From patchwork Wed Apr 30 10:55:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 754 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx21.g.dreamhost.com (peon2454.g.dreamhost.com [208.113.200.127]) by wilcox.dreamhost.com (Postfix) with ESMTP id B064C360072 for ; Wed, 30 Apr 2014 03:56:00 -0700 (PDT) Received: by homiemail-mx21.g.dreamhost.com (Postfix, from userid 14314964) id 6D93C133C07E; Wed, 30 Apr 2014 03:56:00 -0700 (PDT) X-Original-To: gdb@patchwork.siddhesh.in Delivered-To: x14314964@homiemail-mx21.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx21.g.dreamhost.com (Postfix) with ESMTPS id 490A6133087E for ; Wed, 30 Apr 2014 03:56:00 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type; q=dns; s=default; b=wFltV V9/ksy/uVZgZGHS7sKRbuSp2eqP5GhsaDf8jerenTV8o2lrqLBqWqwAnQ4qVeQ6V Eo9g7wSzGdUV7vrZAtob474FCVKGcaAAiTNUT3l63j0TdZNj97TxhQ8yh9IBrTSw rofxi4MjdVq3D35tP2s2z8TK8xmv1ZOMfCbtz0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type; s=default; bh=njhisXrwEj3 PWPwcfgI0WO7cFWU=; b=O/nXK0jiYPUBBo5zvHHLcCoCNrKM98ckCSfNKX4aIxV wx+UzHjS/s0jDoULeVovquO+2KAV96DjFBswfjigKi9GGTZW3QVOEeFCF+nMkp6I eajoK+PG2vRuCYvVk/6UOu6UfhjBCbaj8mC10Uz263/98iytgbIKXwTP+TPI6eho = Received: (qmail 27903 invoked by alias); 30 Apr 2014 10:55:52 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 27877 invoked by uid 89); 30 Apr 2014 10:55:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mail-gw1-out.broadcom.com Received: from mail-gw1-out.broadcom.com (HELO mail-gw1-out.broadcom.com) (216.31.210.62) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 30 Apr 2014 10:55:51 +0000 Received: from irvexchcas08.broadcom.com (HELO IRVEXCHCAS08.corp.ad.broadcom.com) ([10.9.208.57]) by mail-gw1-out.broadcom.com with ESMTP; 30 Apr 2014 05:06:44 -0700 Received: from IRVEXCHSMTP3.corp.ad.broadcom.com (10.9.207.53) by IRVEXCHCAS08.corp.ad.broadcom.com (10.9.208.57) with Microsoft SMTP Server (TLS) id 14.3.174.1; Wed, 30 Apr 2014 03:55:48 -0700 Received: from mail-irva-13.broadcom.com (10.10.10.20) by IRVEXCHSMTP3.corp.ad.broadcom.com (10.9.207.53) with Microsoft SMTP Server id 14.3.174.1; Wed, 30 Apr 2014 03:55:49 -0700 Received: from xl-cam-21.broadcom.com (xl-cam-21.cam.broadcom.com [10.177.132.81]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id EC68B51E7F; Wed, 30 Apr 2014 03:55:48 -0700 (PDT) Received: by xl-cam-21.broadcom.com (Postfix, from userid 15136) id 45F372CE89A1; Wed, 30 Apr 2014 11:55:48 +0100 (BST) From: Andrew Burgess To: CC: Andrew Burgess Subject: [PATCH v3 3/4] Deprecate frame_stop_reason_string. Date: Wed, 30 Apr 2014 11:55:43 +0100 Message-ID: <1398855344-25278-4-git-send-email-aburgess@broadcom.com> In-Reply-To: <1398855344-25278-1-git-send-email-aburgess@broadcom.com> References: <533EC5B7.6080600@broadcom.com> <1398855344-25278-1-git-send-email-aburgess@broadcom.com> MIME-Version: 1.0 X-IsSubscribed: yes X-DH-Original-To: gdb@patchwork.siddhesh.in Patch #4 adds frame specific stop reason strings. It is better to use that string rather than the existing generic stop reason string. This patch renames frame_stop_reason_string to deprecated_frame_stop_reason_string and updates all the call sites to use the deprecated name. Patch #4 adds the new frame specific stop reason, and some uses of the deprecated funciton will be moved to this new API, however, in the python and guile scripting API we expose a function that converts the stop reason code into a string, without a frame, this will be harder to convert to the new API and so I have currently left using the deprecated_frame_stop_reason_string function. This patch only makes sense if patch #4 is approved, but does this look ok? Thanks, Andrew gdb/ChangeLog: * frame.c (frame_stop_reason_string): Rename to ... (deprecated_frame_stop_reason_string): this. * frame.h (frame_stop_reason_string): Rename to ... (deprecated_frame_stop_reason_string): this. * stack.c (frame_info): Update call to frame_stop_reason_string. (backtrace_command_1): Update call to frame_stop_reason_string. * guile/scm-frame.c (gdbscm_unwind_stop_reason_string): Update call to frame_stop_reason_string. * python/py-frame.c (gdbpy_frame_stop_reason_string): Update call to frame_stop_reason_string. --- gdb/frame.c | 2 +- gdb/frame.h | 5 +++-- gdb/guile/scm-frame.c | 2 +- gdb/python/py-frame.c | 2 +- gdb/stack.c | 4 ++-- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/gdb/frame.c b/gdb/frame.c index 5f05968..5a6e0c7 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -2556,7 +2556,7 @@ get_frame_unwind_stop_reason (struct frame_info *frame) /* Return a string explaining REASON. */ const char * -frame_stop_reason_string (enum unwind_stop_reason reason) +deprecated_frame_stop_reason_string (enum unwind_stop_reason reason) { switch (reason) { diff --git a/gdb/frame.h b/gdb/frame.h index e451a93..7db5382 100644 --- a/gdb/frame.h +++ b/gdb/frame.h @@ -495,9 +495,10 @@ enum unwind_stop_reason enum unwind_stop_reason get_frame_unwind_stop_reason (struct frame_info *); -/* Translate a reason code to an informative string. */ +/* Translate a reason code to an informative string. This is DEPRECATED, + use frame_stop_reason_string instead. */ -const char *frame_stop_reason_string (enum unwind_stop_reason); +const char *deprecated_frame_stop_reason_string (enum unwind_stop_reason); /* Unwind the stack frame so that the value of REGNUM, in the previous (up, older) frame is returned. If VALUEP is NULL, don't diff --git a/gdb/guile/scm-frame.c b/gdb/guile/scm-frame.c index 6031a7f..ddd062c 100644 --- a/gdb/guile/scm-frame.c +++ b/gdb/guile/scm-frame.c @@ -944,7 +944,7 @@ gdbscm_unwind_stop_reason_string (SCM reason_scm) if (reason < UNWIND_FIRST || reason > UNWIND_LAST) scm_out_of_range (FUNC_NAME, reason_scm); - str = frame_stop_reason_string (reason); + str = deprecated_frame_stop_reason_string (reason); return gdbscm_scm_from_c_string (str); } diff --git a/gdb/python/py-frame.c b/gdb/python/py-frame.c index 8c80d39..e7fcfe3 100644 --- a/gdb/python/py-frame.c +++ b/gdb/python/py-frame.c @@ -588,7 +588,7 @@ gdbpy_frame_stop_reason_string (PyObject *self, PyObject *args) return NULL; } - str = frame_stop_reason_string (reason); + str = deprecated_frame_stop_reason_string (reason); return PyUnicode_Decode (str, strlen (str), host_charset (), NULL); } diff --git a/gdb/stack.c b/gdb/stack.c index da7d977..4fa9dd6 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -1528,7 +1528,7 @@ frame_info (char *addr_exp, int from_tty) reason = get_frame_unwind_stop_reason (fi); if (reason != UNWIND_NO_REASON) printf_filtered (_(" Outermost frame: %s\n"), - frame_stop_reason_string (reason)); + deprecated_frame_stop_reason_string (reason)); } else if (get_frame_type (fi) == TAILCALL_FRAME) puts_filtered (" tail call frame"); @@ -1847,7 +1847,7 @@ backtrace_command_1 (char *count_exp, int show_locals, int no_filters, reason = get_frame_unwind_stop_reason (trailing); if (reason >= UNWIND_FIRST_ERROR) printf_filtered (_("Backtrace stopped: %s\n"), - frame_stop_reason_string (reason)); + deprecated_frame_stop_reason_string (reason)); } } }