gdb/gdb-btrobust.patch
Richard Biener 355c8053f0 - Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
  * Python Scripting
   - You can now access frame registers from Python scripts.
   - New attribute 'producer' for gdb.Symtab objects.
  * New Python-based convenience functions:
   - $_caller_is(name [, number_of_frames])
   - $_caller_matches(regexp [, number_of_frames])
   - $_any_caller_is(name [, number_of_frames])
   - $_any_caller_matches(regexp [, number_of_frames])
  * New commands
   - queue-signal signal-name-or-number
     Queue a signal to be delivered to the thread when it is resumed.
  * On resume, GDB now always passes the signal the program had stopped
    for to the thread the signal was sent to, even if the user changed
    threads before resuming.  Previously GDB would often (but not
    always) deliver the signal to the thread that happens to be current
    at resume time.
  * Conversely, the "signal" command now consistently delivers the
    requested signal to the current thread.  GDB now asks for
    confirmation if the program had stopped for a signal and the user
    switched threads meanwhile.
  * "breakpoint always-inserted" modes "off" and "auto" merged.
    Now, when 'breakpoint always-inserted mode' is set to "off", GDB
    won't remove breakpoints from the target until all threads stop,
    even in non-stop mode.  The "auto" mode has been removed, and "off"
    is now the default mode.
  * MI changes
   - The -list-thread-groups command outputs an exit-code field for
     inferiors that have exited.

OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00

86 lines
3.2 KiB
Diff

This should fix the error with glib. An error message will still be
printed, but a default backtrace will occur in this case.
--
Index: gdb-7.8.90.20150214/gdb/python/py-framefilter.c
===================================================================
--- gdb-7.8.90.20150214.orig/gdb/python/py-framefilter.c 2015-02-14 17:35:12.277653200 +0100
+++ gdb-7.8.90.20150214/gdb/python/py-framefilter.c 2015-02-14 17:36:15.737953789 +0100
@@ -1506,6 +1506,7 @@ gdbpy_apply_frame_filter (const struct e
volatile struct gdb_exception except;
PyObject *item;
htab_t levels_printed;
+ int count_printed = 0;
if (!gdb_python_initialized)
return EXT_LANG_BT_NO_FILTERS;
@@ -1525,24 +1526,7 @@ gdbpy_apply_frame_filter (const struct e
iterable = bootstrap_python_frame_filters (frame, frame_low, frame_high);
if (iterable == NULL)
- {
- /* Normally if there is an error GDB prints the exception,
- abandons the backtrace and exits. The user can then call "bt
- no-filters", and get a default backtrace (it would be
- confusing to automatically start a standard backtrace halfway
- through a Python filtered backtrace). However in the case
- where GDB cannot initialize the frame filters (most likely
- due to incorrect auto-load paths), GDB has printed nothing.
- In this case it is OK to print the default backtrace after
- printing the error message. GDB returns EXT_LANG_BT_NO_FILTERS
- here to signify there are no filters after printing the
- initialization error. This return code will trigger a
- default backtrace. */
-
- gdbpy_print_stack ();
- do_cleanups (cleanups);
- return EXT_LANG_BT_NO_FILTERS;
- }
+ goto error_nothing_printed;
/* If iterable is None, then there are no frame filters registered.
If this is the case, defer to default GDB printing routines in MI
@@ -1573,15 +1557,40 @@ gdbpy_apply_frame_filter (const struct e
error and continue with other frames. */
if (success == EXT_LANG_BT_ERROR)
gdbpy_print_stack ();
+
+ count_printed++;
}
if (item == NULL && PyErr_Occurred ())
- goto error;
+ {
+ if (count_printed > 0)
+ goto error;
+ else
+ goto error_nothing_printed;
+ }
done:
do_cleanups (cleanups);
return success;
+ /* Normally if there is an error GDB prints the exception,
+ abandons the backtrace and exits. The user can then call "bt
+ no-filters", and get a default backtrace (it would be
+ confusing to automatically start a standard backtrace halfway
+ through a Python filtered backtrace). However in the case
+ where GDB cannot initialize the frame filters (most likely
+ due to incorrect auto-load paths), GDB has printed nothing.
+ In this case it is OK to print the default backtrace after
+ printing the error message. GDB returns EXT_LANG_BT_NO_FILTERS
+ here to signify there are no filters after printing the
+ initialization error. This return code will trigger a
+ default backtrace. */
+
+ error_nothing_printed:
+ gdbpy_print_stack ();
+ do_cleanups (cleanups);
+ return EXT_LANG_BT_NO_FILTERS;
+
/* Exit and abandon backtrace on error, printing the exception that
is set. */
error: