This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC][Python] gdbpy_frame_stop_reason_string bug


On Friday 14 October 2011 15:40:49, Kevin Pouget wrote:

> 2011-10-14  Kevin Pouget  <kevin.pouget@st.com>
> 
> 	* frame.c (frame_stop_reason_string): Rewrite using
> 	unwind_stop_reasons.def.
> 	* frame.h (enum unwind_stop_reason): Likewise.
> 	* python/py-frame.c (gdbpy_initialize_frames): Likewise.
> 	(gdbpy_frame_stop_reason_string): Use new enum unwind_stop_reason
> 	constants for bound-checking.
> 	* unwind_stop_reasons.def: New file.
> 

You're missing this change that was in my patch:

Index: src/gdb/stack.c
===================================================================
--- src.orig/gdb/stack.c        2011-10-11 12:43:20.000000000 +0100
+++ src/gdb/stack.c     2011-10-12 15:38:23.083658404 +0100
@@ -1625,7 +1625,7 @@ backtrace_command_1 (char *count_exp, in
       enum unwind_stop_reason reason;
 
       reason = get_frame_unwind_stop_reason (trailing);
-      if (reason > UNWIND_FIRST_ERROR)
+      if (reason >= UNWIND_FIRST_ERROR)
        printf_filtered (_("Backtrace stopped: %s\n"),
                         frame_stop_reason_string (reason));
     }

because before, UNWIND_FIRST_ERROR was not an alias, now it is.

I notice only these two descriptions are capitalized:

> +SET (UNWIND_NO_REASON, "No reason")

> +SET (UNWIND_UNAVAILABLE, "Not enough registers or memory available to unwind further")

(the latter my fault).  Can you lowercase them too for consistency?

Also, I believe as is, we lose gdb.FRAME_UNWIND_FIRST_ERROR?

-- 
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]