From: Andrew Burgess <aburgess@broadcom.com>
To: <gdb-patches@sourceware.org>
Cc: Andrew Burgess <aburgess@broadcom.com>
Subject: [PATCH v3 3/4] Deprecate frame_stop_reason_string.
Date: Wed, 30 Apr 2014 10:55:00 -0000 [thread overview]
Message-ID: <1398855344-25278-4-git-send-email-aburgess@broadcom.com> (raw)
In-Reply-To: <1398855344-25278-1-git-send-email-aburgess@broadcom.com>
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);
}
\f
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));
}
}
}
--
1.8.1.3
next prev parent reply other threads:[~2014-04-30 10:55 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-04 14:46 [RFC 0/4] Catch errors in get_prev_frame Andrew Burgess
2014-04-04 14:47 ` [RFC 1/4] New tests for backtracing with a corrupted stack Andrew Burgess
2014-04-04 14:48 ` [RFC 2/4] Remove previous frame if we error during compute_frame_id Andrew Burgess
2014-04-04 14:53 ` Andrew Burgess
2014-04-15 19:02 ` Pedro Alves
2014-04-04 14:49 ` [RFC 3/4] Deprecate frame_stop_reason_string Andrew Burgess
2014-04-04 14:55 ` Andrew Burgess
2014-04-04 14:50 ` [RFC 4/4] Add TRY_CATCH to get_prev_frame and frame specific strop strings Andrew Burgess
2014-04-15 9:11 ` [RFC 0/4] Catch errors in get_prev_frame Andrew Burgess
2014-04-17 10:15 ` [PATCH v2 1/4] New test for backtrace when the stack pointer is invalid (inaccessible) Andrew Burgess
2014-04-17 10:15 ` [PATCH v2 3/4] Deprecate frame_stop_reason_string Andrew Burgess
2014-04-29 19:56 ` Pedro Alves
2014-04-30 10:46 ` Andrew Burgess
2014-04-17 10:15 ` [PATCH v2 0/4] Catch errors in get_prev_frame Andrew Burgess
2014-04-17 10:15 ` [PATCH v2 4/4] Add a TRY_CATCH to get_prev_frame to better handle errors during unwind Andrew Burgess
2014-04-17 10:15 ` [PATCH v2 2/4] Remove previous frame if an error occurs when computing frame id " Andrew Burgess
2014-04-30 10:55 ` [PATCH v3 0/4] Catch errors in get_prev_frame Andrew Burgess
2014-04-30 10:55 ` [PATCH v3 4/4] Add a TRY_CATCH to get_prev_frame to better handle errors during unwind Andrew Burgess
2014-05-28 18:31 ` Pedro Alves
2014-05-28 23:35 ` Andrew Burgess
2014-05-29 9:41 ` Pedro Alves
2014-05-29 23:02 ` Andrew Burgess
2014-05-30 11:46 ` Pedro Alves
2014-04-30 10:55 ` [PATCH v3 1/4] New test for backtrace when the stack pointer is invalid (inaccessible) Andrew Burgess
2014-05-28 18:42 ` Pedro Alves
2014-04-30 10:55 ` [PATCH v3 2/4] Remove previous frame if an error occurs when computing frame id during unwind Andrew Burgess
2014-05-16 15:37 ` Pedro Alves
2014-05-28 23:16 ` Andrew Burgess
2014-04-30 10:55 ` Andrew Burgess [this message]
2014-05-28 17:26 ` [PATCH v3 3/4] Deprecate frame_stop_reason_string Pedro Alves
2014-05-28 23:26 ` Andrew Burgess
2014-05-29 9:00 ` Pedro Alves
2014-05-29 9:53 ` Andrew Burgess
2014-05-29 9:56 ` Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1398855344-25278-4-git-send-email-aburgess@broadcom.com \
--to=aburgess@broadcom.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox