diff --git a/.gitignore b/.gitignore index 355bce4..d5f6f77 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ /libstdc++-v3-python-r155978.tar.bz2 -/gdb-7.2.50.20110218.tar.bz2 +/gdb-7.2.50.20110222.tar.bz2 diff --git a/gdb-archer-pie-addons-keep-disabled.patch b/gdb-archer-pie-addons-keep-disabled.patch index 110f0bd..81661ca 100644 --- a/gdb-archer-pie-addons-keep-disabled.patch +++ b/gdb-archer-pie-addons-keep-disabled.patch @@ -1,8 +1,8 @@ -Index: gdb-7.2.50.20110206/gdb/breakpoint.c +Index: gdb-7.2.50.20110222/gdb/breakpoint.c =================================================================== ---- gdb-7.2.50.20110206.orig/gdb/breakpoint.c 2011-02-06 20:39:24.000000000 +0100 -+++ gdb-7.2.50.20110206/gdb/breakpoint.c 2011-02-06 20:39:44.000000000 +0100 -@@ -10587,6 +10587,50 @@ update_breakpoint_locations (struct brea +--- gdb-7.2.50.20110222.orig/gdb/breakpoint.c 2011-02-23 00:12:59.000000000 +0100 ++++ gdb-7.2.50.20110222/gdb/breakpoint.c 2011-02-23 00:13:04.000000000 +0100 +@@ -10547,6 +10547,50 @@ update_breakpoint_locations (struct brea update_global_location_list (1); } @@ -53,22 +53,22 @@ Index: gdb-7.2.50.20110206/gdb/breakpoint.c /* Reset a breakpoint given it's struct breakpoint * BINT. The value we return ends up being the return value from catch_errors. Unused in this case. */ -Index: gdb-7.2.50.20110206/gdb/breakpoint.h +Index: gdb-7.2.50.20110222/gdb/breakpoint.h =================================================================== ---- gdb-7.2.50.20110206.orig/gdb/breakpoint.h 2011-02-06 20:39:24.000000000 +0100 -+++ gdb-7.2.50.20110206/gdb/breakpoint.h 2011-02-06 20:40:00.000000000 +0100 -@@ -1194,4 +1194,7 @@ extern struct breakpoint *iterate_over_b +--- gdb-7.2.50.20110222.orig/gdb/breakpoint.h 2011-02-23 00:12:59.000000000 +0100 ++++ gdb-7.2.50.20110222/gdb/breakpoint.h 2011-02-23 00:13:16.000000000 +0100 +@@ -1192,4 +1192,7 @@ extern int user_breakpoint_p (struct bre - extern int user_breakpoint_p (struct breakpoint *); + extern int get_number_or_range (char **pp); +extern void breakpoints_relocate (struct objfile *objfile, + struct section_offsets *delta); + #endif /* !defined (BREAKPOINT_H) */ -Index: gdb-7.2.50.20110206/gdb/objfiles.c +Index: gdb-7.2.50.20110222/gdb/objfiles.c =================================================================== ---- gdb-7.2.50.20110206.orig/gdb/objfiles.c 2011-01-10 21:38:49.000000000 +0100 -+++ gdb-7.2.50.20110206/gdb/objfiles.c 2011-02-06 20:39:44.000000000 +0100 +--- gdb-7.2.50.20110222.orig/gdb/objfiles.c 2011-01-10 21:38:49.000000000 +0100 ++++ gdb-7.2.50.20110222/gdb/objfiles.c 2011-02-23 00:13:04.000000000 +0100 @@ -846,6 +846,11 @@ objfile_relocate1 (struct objfile *objfi obj_section_addr (s)); } diff --git a/gdb-archer.patch b/gdb-archer.patch index 2b4460f..6bd1ec3 100644 --- a/gdb-archer.patch +++ b/gdb-archer.patch @@ -2,7 +2,7 @@ http://sourceware.org/gdb/wiki/ProjectArcher http://sourceware.org/gdb/wiki/ArcherBranchManagement GIT snapshot: -commit 271b14253f10eea8c60a327c63dbe732a2af511a +commit 691a5a1b3015e2199040ead20cc85bc277af14e3 branch `archer' - the merge of branches: archer-jankratochvil-vla @@ -14,20 +14,20 @@ archer-tromey-python diff --git a/gdb/Makefile.in b/gdb/Makefile.in -index c6049fa..4a17976 100644 +index 6363773..7bd1020 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in -@@ -813,7 +813,8 @@ annotate.h sim-regno.h dictionary.h dfp.h main.h frame-unwind.h \ +@@ -808,7 +808,8 @@ annotate.h sim-regno.h dictionary.h dfp.h main.h frame-unwind.h \ remote-fileio.h i386-linux-tdep.h vax-tdep.h objc-lang.h \ sentinel-frame.h bcache.h symfile.h windows-tdep.h linux-tdep.h \ - gdb_usleep.h jit.h xml-syscall.h ada-operator.inc microblaze-tdep.h \ --psymtab.h psympriv.h progspace.h bfin-tdep.h ia64-hpux-tdep.h -+psymtab.h psympriv.h progspace.h bfin-tdep.h ia64-hpux-tdep.h \ + gdb_usleep.h jit.h xml-syscall.h microblaze-tdep.h \ +-psymtab.h psympriv.h progspace.h bfin-tdep.h ia64-hpux-tdep.h printcmd.h ++psymtab.h psympriv.h progspace.h bfin-tdep.h ia64-hpux-tdep.h printcmd.h \ +python/python.h python/python-internal.h # Header files that already have srcdir in them, or which are in objdir. -@@ -1345,6 +1346,12 @@ stamp-h: $(srcdir)/config.in config.status +@@ -1340,6 +1341,12 @@ stamp-h: $(srcdir)/config.in config.status CONFIG_LINKS= \ $(SHELL) config.status @@ -392,18 +392,18 @@ index b9aaf54..e1f3242 100644 /* Return the innermost stack frame executing inside of BLOCK, or NULL diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c -index ca56c43..6f269b9 100644 +index 623effa..4bcd681 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c -@@ -62,6 +62,7 @@ - #include "jit.h" +@@ -63,6 +63,7 @@ #include "xml-syscall.h" #include "parser-defs.h" + #include "cli/cli-utils.h" +#include "regcache.h" /* readline include files */ #include "readline/readline.h" -@@ -104,6 +105,9 @@ static void break_command_1 (char *, int, int); +@@ -105,6 +106,9 @@ static void break_command_1 (char *, int, int); static void mention (struct breakpoint *); @@ -413,7 +413,7 @@ index ca56c43..6f269b9 100644 /* This function is used in gdbtk sources and thus can not be made static. */ struct breakpoint *set_raw_breakpoint (struct gdbarch *gdbarch, -@@ -220,6 +224,10 @@ static void disable_trace_command (char *, int); +@@ -217,6 +221,10 @@ static void disable_trace_command (char *, int); static void trace_pass_command (char *, int); @@ -424,7 +424,7 @@ index ca56c43..6f269b9 100644 /* Assuming we're creating a static tracepoint, does S look like a static tracepoint marker spec ("-m MARKER_ID")? */ #define is_marker_spec(s) \ -@@ -1309,6 +1317,22 @@ watchpoint_in_thread_scope (struct breakpoint *b) +@@ -1148,6 +1156,22 @@ watchpoint_in_thread_scope (struct breakpoint *b) && !is_executing (inferior_ptid))); } @@ -447,7 +447,7 @@ index ca56c43..6f269b9 100644 /* Assuming that B is a watchpoint: - Reparse watchpoint expression, if REPARSE is non-zero - Evaluate expression and store the result in B->val -@@ -1368,12 +1392,17 @@ update_watchpoint (struct breakpoint *b, int reparse) +@@ -1207,12 +1231,17 @@ update_watchpoint (struct breakpoint *b, int reparse) struct frame_id saved_frame_id; int frame_saved; @@ -462,10 +462,10 @@ index ca56c43..6f269b9 100644 + if (b->pspace != current_program_space) + return; + - /* We don't free locations. They are stored in the bp_location array - and update_global_location_list will eventually delete them and - remove breakpoints if needed. */ -@@ -1595,13 +1624,7 @@ update_watchpoint (struct breakpoint *b, int reparse) + if (b->disposition == disp_del_at_next_stop) + return; + +@@ -1442,13 +1471,7 @@ update_watchpoint (struct breakpoint *b, int reparse) Watchpoint %d deleted because the program has left the block\n\ in which its expression is valid.\n"), b->number); @@ -480,7 +480,7 @@ index ca56c43..6f269b9 100644 } /* Restore the selected frame. */ -@@ -1992,6 +2015,7 @@ insert_breakpoint_locations (void) +@@ -1839,6 +1862,7 @@ insert_breakpoint_locations (void) int val = 0; int disabled_breaks = 0; int hw_breakpoint_error = 0; @@ -488,7 +488,7 @@ index ca56c43..6f269b9 100644 struct ui_file *tmp_error_stream = mem_fileopen (); struct cleanup *cleanups = make_cleanup_ui_file_delete (tmp_error_stream); -@@ -2019,9 +2043,13 @@ insert_breakpoint_locations (void) +@@ -1866,9 +1890,13 @@ insert_breakpoint_locations (void) /* For targets that support global breakpoints, there's no need to select an inferior to insert breakpoint to. In fact, even if we aren't attached to any process yet, we should still @@ -504,7 +504,7 @@ index ca56c43..6f269b9 100644 continue; val = insert_bp_location (bl, tmp_error_stream, &disabled_breaks, -@@ -2045,13 +2073,19 @@ insert_breakpoint_locations (void) +@@ -1892,13 +1920,19 @@ insert_breakpoint_locations (void) if (bpt->disposition == disp_del_at_next_stop) continue; @@ -530,7 +530,7 @@ index ca56c43..6f269b9 100644 if (some_failed) { for (loc = bpt->loc; loc; loc = loc->next) -@@ -3635,6 +3669,8 @@ print_it_typical (bpstat bs) +@@ -3482,6 +3516,8 @@ print_it_typical (bpstat bs) case bp_tracepoint: case bp_fast_tracepoint: case bp_jit_event: @@ -539,7 +539,7 @@ index ca56c43..6f269b9 100644 default: result = PRINT_UNKNOWN; break; -@@ -3856,6 +3892,8 @@ watchpoint_check (void *p) +@@ -3703,6 +3739,8 @@ watchpoint_check (void *p) gdb_assert (bs->breakpoint_at != NULL); b = bs->breakpoint_at; @@ -548,7 +548,7 @@ index ca56c43..6f269b9 100644 /* If this is a local watchpoint, we only want to check if the watchpoint frame is in scope if the current thread is the thread that was used to create the watchpoint. */ -@@ -3965,13 +4003,7 @@ watchpoint_check (void *p) +@@ -3812,13 +3850,7 @@ watchpoint_check (void *p) " deleted because the program has left the block in\n\ which its expression is valid.\n"); @@ -563,7 +563,7 @@ index ca56c43..6f269b9 100644 return WP_DELETED; } -@@ -4176,9 +4208,7 @@ bpstat_check_watchpoint (bpstat bs) +@@ -4023,9 +4055,7 @@ bpstat_check_watchpoint (bpstat bs) case 0: /* Error from catch_errors. */ printf_filtered (_("Watchpoint %d deleted.\n"), b->number); @@ -574,7 +574,7 @@ index ca56c43..6f269b9 100644 /* We've already printed what needs to be printed. */ bs->print_it = print_it_done; break; -@@ -4384,7 +4414,7 @@ bpstat_stop_status (struct address_space *aspace, +@@ -4231,7 +4261,7 @@ bpstat_stop_status (struct address_space *aspace, watchpoint as triggered so that we will handle the out-of-scope event. We'll get to the watchpoint next iteration. */ @@ -583,7 +583,7 @@ index ca56c43..6f269b9 100644 b->related_breakpoint->watchpoint_triggered = watch_triggered_yes; } } -@@ -4506,7 +4536,7 @@ handle_jit_event (void) +@@ -4353,7 +4383,7 @@ handle_jit_event (void) /* Decide what infrun needs to do with this bpstat. */ struct bpstat_what @@ -592,7 +592,7 @@ index ca56c43..6f269b9 100644 { struct bpstat_what retval; /* We need to defer calling `solib_add', as adding new symbols -@@ -4514,12 +4544,13 @@ bpstat_what (bpstat bs) +@@ -4361,12 +4391,13 @@ bpstat_what (bpstat bs) and hence may clear unprocessed entries in the BS chain. */ int shlib_event = 0; int jit_event = 0; @@ -607,7 +607,7 @@ index ca56c43..6f269b9 100644 { /* Extract this BS's action. After processing each BS, we check if its action overrides all we've seem so far. */ -@@ -4649,6 +4680,20 @@ bpstat_what (bpstat bs) +@@ -4496,6 +4527,20 @@ bpstat_what (bpstat bs) out already. */ internal_error (__FILE__, __LINE__, _("bpstat_what: tracepoint encountered")); @@ -628,7 +628,7 @@ index ca56c43..6f269b9 100644 default: internal_error (__FILE__, __LINE__, _("bpstat_what: unhandled bptype %d"), (int) bptype); -@@ -4686,6 +4731,21 @@ bpstat_what (bpstat bs) +@@ -4533,6 +4578,21 @@ bpstat_what (bpstat bs) handle_jit_event (); } @@ -650,7 +650,7 @@ index ca56c43..6f269b9 100644 return retval; } -@@ -4807,6 +4867,8 @@ bptype_string (enum bptype type) +@@ -4654,6 +4714,8 @@ bptype_string (enum bptype type) {bp_fast_tracepoint, "fast tracepoint"}, {bp_static_tracepoint, "static tracepoint"}, {bp_jit_event, "jit events"}, @@ -659,7 +659,7 @@ index ca56c43..6f269b9 100644 }; if (((int) type >= (sizeof (bptypes) / sizeof (bptypes[0]))) -@@ -4954,6 +5016,8 @@ print_one_breakpoint_location (struct breakpoint *b, +@@ -4801,6 +4863,8 @@ print_one_breakpoint_location (struct breakpoint *b, case bp_fast_tracepoint: case bp_static_tracepoint: case bp_jit_event: @@ -668,7 +668,7 @@ index ca56c43..6f269b9 100644 if (opts.addressprint) { annotate_field (4); -@@ -5235,7 +5299,8 @@ user_settable_breakpoint (const struct breakpoint *b) +@@ -5082,7 +5146,8 @@ user_settable_breakpoint (const struct breakpoint *b) || b->type == bp_catchpoint || b->type == bp_hardware_breakpoint || is_tracepoint (b) @@ -678,7 +678,7 @@ index ca56c43..6f269b9 100644 } /* Return true if this breakpoint was set by the user, false if it is -@@ -5724,6 +5789,8 @@ allocate_bp_location (struct breakpoint *bpt) +@@ -5571,6 +5636,8 @@ allocate_bp_location (struct breakpoint *bpt) case bp_longjmp_master: case bp_std_terminate_master: case bp_exception_master: @@ -687,7 +687,7 @@ index ca56c43..6f269b9 100644 loc->loc_type = bp_loc_software_breakpoint; break; case bp_hardware_breakpoint: -@@ -5813,6 +5880,7 @@ set_raw_breakpoint_without_location (struct gdbarch *gdbarch, +@@ -5660,6 +5727,7 @@ set_raw_breakpoint_without_location (struct gdbarch *gdbarch, b->ops = NULL; b->condition_not_parsed = 0; b->py_bp_object = NULL; @@ -695,7 +695,7 @@ index ca56c43..6f269b9 100644 /* Add this breakpoint to the end of the chain so that a list of breakpoints will come out in order of increasing numbers. */ -@@ -5831,7 +5899,7 @@ set_raw_breakpoint_without_location (struct gdbarch *gdbarch, +@@ -5678,7 +5746,7 @@ set_raw_breakpoint_without_location (struct gdbarch *gdbarch, /* Initialize loc->function_name. */ static void @@ -704,7 +704,7 @@ index ca56c43..6f269b9 100644 { gdb_assert (loc->owner != NULL); -@@ -5839,8 +5907,29 @@ set_breakpoint_location_function (struct bp_location *loc) +@@ -5686,8 +5754,29 @@ set_breakpoint_location_function (struct bp_location *loc) || loc->owner->type == bp_hardware_breakpoint || is_tracepoint (loc->owner)) { @@ -736,7 +736,7 @@ index ca56c43..6f269b9 100644 if (loc->function_name) loc->function_name = xstrdup (loc->function_name); } -@@ -5915,7 +6004,8 @@ set_raw_breakpoint (struct gdbarch *gdbarch, +@@ -5762,7 +5851,8 @@ set_raw_breakpoint (struct gdbarch *gdbarch, b->loc->section = sal.section; b->line_number = sal.line; @@ -746,7 +746,7 @@ index ca56c43..6f269b9 100644 breakpoints_changed (); -@@ -7032,7 +7122,7 @@ clone_momentary_breakpoint (struct breakpoint *orig) +@@ -6879,7 +6969,7 @@ clone_momentary_breakpoint (struct breakpoint *orig) copy = set_raw_breakpoint_without_location (orig->gdbarch, orig->type); copy->loc = allocate_bp_location (copy); @@ -755,7 +755,7 @@ index ca56c43..6f269b9 100644 copy->loc->gdbarch = orig->loc->gdbarch; copy->loc->requested_address = orig->loc->requested_address; -@@ -7132,6 +7222,7 @@ mention (struct breakpoint *b) +@@ -6979,6 +7069,7 @@ mention (struct breakpoint *b) do_cleanups (ui_out_chain); break; case bp_breakpoint: @@ -763,7 +763,7 @@ index ca56c43..6f269b9 100644 if (ui_out_is_mi_like_p (uiout)) { say_where = 0; -@@ -7142,6 +7233,8 @@ mention (struct breakpoint *b) +@@ -6989,6 +7080,8 @@ mention (struct breakpoint *b) else printf_filtered (_("Breakpoint")); printf_filtered (_(" %d"), b->number); @@ -772,7 +772,7 @@ index ca56c43..6f269b9 100644 say_where = 1; break; case bp_hardware_breakpoint: -@@ -7201,6 +7294,7 @@ mention (struct breakpoint *b) +@@ -7048,6 +7141,7 @@ mention (struct breakpoint *b) case bp_longjmp_master: case bp_std_terminate_master: case bp_exception_master: @@ -780,7 +780,7 @@ index ca56c43..6f269b9 100644 break; } -@@ -7261,7 +7355,8 @@ add_location_to_breakpoint (struct breakpoint *b, +@@ -7108,7 +7202,8 @@ add_location_to_breakpoint (struct breakpoint *b, gdb_assert (loc->pspace != NULL); loc->section = sal->section; @@ -790,7 +790,7 @@ index ca56c43..6f269b9 100644 return loc; } -@@ -8710,6 +8805,7 @@ watch_command_1 (char *arg, int accessflag, int from_tty, +@@ -8542,6 +8637,7 @@ watch_command_1 (char *arg, int accessflag, int from_tty, b = set_raw_breakpoint_without_location (NULL, bp_type); set_breakpoint_number (internal, b); b->thread = thread; @@ -798,7 +798,7 @@ index ca56c43..6f269b9 100644 b->disposition = disp_donttouch; b->exp = exp; b->exp_valid_block = exp_valid_block; -@@ -9881,6 +9977,9 @@ update_global_location_list (int should_insert) +@@ -9704,6 +9800,9 @@ update_global_location_list (int should_insert) int keep_in_target = 0; int removed = 0; @@ -808,7 +808,7 @@ index ca56c43..6f269b9 100644 /* Skip LOCP entries which will definitely never be needed. Stop either at or being the one matching OLD_LOC. */ while (locp < bp_location + bp_location_count -@@ -10197,12 +10296,20 @@ delete_breakpoint (struct breakpoint *bpt) +@@ -10020,12 +10119,20 @@ delete_breakpoint (struct breakpoint *bpt) /* At least avoid this stale reference until the reference counting of breakpoints gets resolved. */ @@ -834,7 +834,7 @@ index ca56c43..6f269b9 100644 } observer_notify_breakpoint_deleted (bpt->number); -@@ -10533,6 +10640,9 @@ update_breakpoint_locations (struct breakpoint *b, +@@ -10356,6 +10463,9 @@ update_breakpoint_locations (struct breakpoint *b, return; b->loc = NULL; @@ -844,7 +844,7 @@ index ca56c43..6f269b9 100644 for (i = 0; i < sals.nelts; ++i) { -@@ -10560,11 +10670,7 @@ update_breakpoint_locations (struct breakpoint *b, +@@ -10383,11 +10493,7 @@ update_breakpoint_locations (struct breakpoint *b, } } @@ -857,7 +857,7 @@ index ca56c43..6f269b9 100644 b->source_file = xstrdup (sals.sals[i].symtab->filename); if (b->line_number == 0) -@@ -10647,6 +10753,7 @@ breakpoint_re_set_one (void *bint) +@@ -10470,6 +10576,7 @@ breakpoint_re_set_one (void *bint) case bp_tracepoint: case bp_fast_tracepoint: case bp_static_tracepoint: @@ -865,7 +865,7 @@ index ca56c43..6f269b9 100644 /* Do not attempt to re-set breakpoints disabled during startup. */ if (b->enable_state == bp_startup_disabled) return 0; -@@ -10817,6 +10924,7 @@ breakpoint_re_set_one (void *bint) +@@ -10640,6 +10747,7 @@ breakpoint_re_set_one (void *bint) case bp_exception: case bp_exception_resume: case bp_jit_event: @@ -873,7 +873,7 @@ index ca56c43..6f269b9 100644 break; } -@@ -10981,11 +11089,25 @@ map_breakpoint_numbers (char *args, void (*function) (struct breakpoint *, +@@ -10804,11 +10912,25 @@ map_breakpoint_numbers (char *args, void (*function) (struct breakpoint *, ALL_BREAKPOINTS_SAFE (b, tmp) if (b->number == num) { @@ -903,7 +903,7 @@ index ca56c43..6f269b9 100644 break; } if (match == 0) -@@ -12100,6 +12222,22 @@ all_tracepoints () +@@ -11923,6 +12045,22 @@ all_tracepoints () return tp_vec; } @@ -926,7 +926,7 @@ index ca56c43..6f269b9 100644 /* This help string is used for the break, hbreak, tbreak and thbreak commands. It is defined as a macro to prevent duplication. -@@ -12185,6 +12323,107 @@ iterate_over_breakpoints (int (*callback) (struct breakpoint *, void *), +@@ -12008,6 +12146,107 @@ iterate_over_breakpoints (int (*callback) (struct breakpoint *, void *), return NULL; } @@ -1034,14 +1034,14 @@ index ca56c43..6f269b9 100644 void _initialize_breakpoint (void) { -@@ -12721,4 +12960,5 @@ inferior in all-stop mode, gdb behaves as if always-inserted mode is off."), +@@ -12544,4 +12783,5 @@ inferior in all-stop mode, gdb behaves as if always-inserted mode is off."), automatic_hardware_breakpoints = 1; observer_attach_about_to_proceed (breakpoint_about_to_proceed); + observer_attach_mark_used (breakpoint_types_mark_used); } diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h -index 86fae66..ffef340 100644 +index a0fea21..4b24701 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -148,6 +148,9 @@ enum bptype @@ -1121,7 +1121,7 @@ index 9409dde..f0fa4c7 100644 extern char *xfullpath (const char *); diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo -index e16065b..cdb44e3 100644 +index f8b7e2d..72c47e6 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -1177,6 +1177,16 @@ for remote debugging. @@ -1141,7 +1141,7 @@ index e16065b..cdb44e3 100644 @c resolve the situation of these eventually @item -tui @cindex @code{--tui} -@@ -20677,8 +20687,6 @@ containing @code{end}. For example: +@@ -20683,8 +20693,6 @@ containing @code{end}. For example: @smallexample (@value{GDBP}) python @@ -1150,7 +1150,7 @@ index e16065b..cdb44e3 100644 >print 23 >end 23 -@@ -20691,6 +20699,14 @@ in a Python script. This can be controlled using @code{maint set +@@ -20697,6 +20705,14 @@ in a Python script. This can be controlled using @code{maint set python print-stack}: if @code{on}, the default, then Python stack printing is enabled; if @code{off}, then Python stack printing is disabled. @@ -1165,7 +1165,7 @@ index e16065b..cdb44e3 100644 @end table It is also possible to execute a Python script from the @value{GDBN} -@@ -20712,6 +20728,14 @@ and thus is always available. +@@ -20718,6 +20734,14 @@ and thus is always available. @cindex python api @cindex programming in python @@ -1365,7 +1365,7 @@ index 620269f..c6fc64f 100644 /* The current depth of dwarf expression recursion, via DW_OP_call*, DW_OP_fbreg, DW_OP_push_object_address, etc., and the maximum diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c -index 4d31afa..fd0c185 100644 +index a439f72..9abcd56 100644 --- a/gdb/dwarf2loc.c +++ b/gdb/dwarf2loc.c @@ -134,6 +134,9 @@ struct dwarf_expr_baton @@ -1636,7 +1636,7 @@ index 4d31afa..fd0c185 100644 retval = allocate_value_lazy (type); VALUE_LVAL (retval) = lval_memory; if (in_stack_memory) -@@ -2831,11 +2989,51 @@ loclist_tracepoint_var_ref (struct symbol *symbol, struct gdbarch *gdbarch, +@@ -2811,11 +2969,51 @@ loclist_tracepoint_var_ref (struct symbol *symbol, struct gdbarch *gdbarch, dlbaton->per_cu); } @@ -5791,7 +5791,7 @@ index 8497991..4635853 100644 SYMBOL_LINKAGE_NAME (tsymbol)) == 0) return SYMBOL_VALUE_ADDRESS (msymbol); diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c -index fc50e2a..499df7c 100644 +index ee76542..aaf8be6 100644 --- a/gdb/p-valprint.c +++ b/gdb/p-valprint.c @@ -39,6 +39,7 @@ @@ -6197,10 +6197,10 @@ index 0c5563e..e4f0b25 100644 return ret; diff --git a/gdb/printcmd.c b/gdb/printcmd.c -index 29ffbf5..42b7821 100644 +index ebca5a3..4159985 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c -@@ -964,6 +964,11 @@ print_command_1 (char *exp, int inspect, int voidprint) +@@ -971,6 +971,11 @@ print_command_1 (char *exp, int inspect, int voidprint) else val = access_value_history (0); @@ -6212,7 +6212,7 @@ index 29ffbf5..42b7821 100644 if (voidprint || (val && value_type (val) && TYPE_CODE (value_type (val)) != TYPE_CODE_VOID)) { -@@ -1465,6 +1470,22 @@ x_command (char *exp, int from_tty) +@@ -1472,6 +1477,22 @@ x_command (char *exp, int from_tty) set_internalvar (lookup_internalvar ("__"), last_examine_value); } } @@ -6235,7 +6235,7 @@ index 29ffbf5..42b7821 100644 /* Add an expression to the auto-display chain. -@@ -2865,4 +2886,6 @@ Show printing of source filename and line number with ."), NULL, +@@ -2884,4 +2905,6 @@ Show printing of source filename and line number with ."), NULL, add_com ("eval", no_class, eval_command, _("\ Convert \"printf format string\", arg1, arg2, arg3, ..., argn to\n\ a command line, and call it.")); @@ -11816,7 +11816,7 @@ index 0000000..31f7656 +extern void marker (void); +extern void forkoff (int nr); diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp -index d523d8e..b543ad0 100644 +index 44d449a..d8c50f2 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -140,6 +140,11 @@ proc gdb_unload {} { @@ -11977,7 +11977,7 @@ index 82e3adb..a5b9146 100644 static void diff --git a/gdb/valarith.c b/gdb/valarith.c -index 787fc69..a90f416 100644 +index 68f649f..aaa4487 100644 --- a/gdb/valarith.c +++ b/gdb/valarith.c @@ -198,7 +198,10 @@ value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound) diff --git a/gdb-prelink-rela.patch b/gdb-prelink-rela.patch new file mode 100644 index 0000000..fb63f0c --- /dev/null +++ b/gdb-prelink-rela.patch @@ -0,0 +1,141 @@ +http://sourceware.org/ml/gdb-patches/2011-02/msg00630.html +Subject: [patch] [i386] Fix {,un}prelinked libraries for attach/core-load + +Hi, + +please see comments in the patch. The adjusted testcase FAILs on i386. + +"Prelink", March 4, 2004 - by Jakub Jelinek: + http://people.redhat.com/jakub/prelink.pdf + primarily section 7 - REL to RELA conversion + +An example of unprelinked -> prelinked library change: + Program Headers: + Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align +- LOAD 0x000000 0x00000000 0x00000000 0x00538 0x00538 R E 0x1000 +- LOAD 0x000538 0x00001538 0x00001538 0x00100 0x00110 RW 0x1000 +- DYNAMIC 0x000550 0x00001550 0x00001550 0x000c8 0x000c8 RW 0x4 +- NOTE 0x0000f4 0x000000f4 0x000000f4 0x00024 0x00024 R 0x4 +- GNU_EH_FRAME 0x0004e8 0x000004e8 0x000004e8 0x00014 0x00014 R 0x4 ++ LOAD 0x000000 0x411b3000 0x411b3000 0x00558 0x00558 R E 0x1000 ++ LOAD 0x000558 0x411b4558 0x411b4558 0x00100 0x00110 RW 0x1000 ++ DYNAMIC 0x000570 0x411b4570 0x411b4570 0x000c8 0x000c8 RW 0x4 ++ NOTE 0x0000f4 0x411b30f4 0x411b30f4 0x00024 0x00024 R 0x4 ++ GNU_EH_FRAME 0x000508 0x411b3508 0x411b3508 0x00014 0x00014 R 0x4 + GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x4 + +So far GDB expected all such displacements will be always PAGE_SIZE aligned. +This applies for example for re-prelinking of an already prelinked file. +But it does not apply for prelinking of an unprelinked file or unprelinking of +a prelinked file, there can be arbitrary displacement. + +It affects i386 (=i686, prelink doc reports also ARM and MIPS) which uses REL. +x86_64 always uses RELA, therefore I have not noticed it so far. i386 still +has to be supported. + +This affects both attachment to a PID and core file loads. + +This applies in real world if you transfer a core file between hosts and try to +backtrace them, libraries of both hosts may differ whether they are / are not +prelinked. + +I could implement some (displacement-forgiving and prelink-modifications +forgiving) comparison of both DYNAMIC segments found. But I do not think it is +useful, if the DYNAMIC address from linkmap vs. bfd do not match it is still a +better chance to try a displacement to make them match. Keeping the file +relocation cannot work anyway when the DYNAMIC address is verified as wrong. + +No regressions on {x86_64,x86_64-m32,i686}-fedora15-linux-gnu. + +Mostly do you agree the DYNAMIC content does not have to be verifed? +Do you have any comments on the in-code long comments? + + +Thanks, +Jan + + +gdb/ +2011-02-22 Jan Kratochvil + + Fix libraries displacement if they change whether they were prelinked. + * solib-svr4.c (LM_ADDR_CHECK): Set L_ADDR even if the DYNAMIC pointer + does not match. Comment why. + +gdb/testsuite/ +2011-02-22 Jan Kratochvil + + * gdb.base/break-interp-lib.c (v, vptr): New variables. + * gdb.base/break-interp.exp (test_attach): New comment. + +--- a/gdb/solib-svr4.c ++++ b/gdb/solib-svr4.c +@@ -237,11 +237,11 @@ LM_ADDR_CHECK (struct so_list *so, bfd *abfd) + + Even on PPC it must be zero-aligned at least for MINPAGESIZE. */ + ++ l_addr = l_dynaddr - dynaddr; ++ + if ((l_addr & (minpagesize - 1)) == 0 + && (l_addr & align) == ((l_dynaddr - dynaddr) & align)) + { +- l_addr = l_dynaddr - dynaddr; +- + if (info_verbose) + printf_unfiltered (_("Using PIC (Position Independent Code) " + "prelink displacement %s for \"%s\".\n"), +@@ -249,9 +249,20 @@ LM_ADDR_CHECK (struct so_list *so, bfd *abfd) + so->so_name); + } + else +- warning (_(".dynamic section for \"%s\" " +- "is not at the expected address " +- "(wrong library or version mismatch?)"), so->so_name); ++ { ++ /* There is no way to verify the library file matches. prelink ++ can during prelinking of an unprelinked file (or unprelinking ++ of a prelinked file) shift the DYNAMIC segment by arbitrary ++ offset without any page size alignment. There is no way to ++ find out the ELF header and/or Program Headers for a limited ++ verification if it they match. One could do a verification ++ of the DYNAMIC segment. Still the found address is the best ++ one GDB could find. */ ++ ++ warning (_(".dynamic section for \"%s\" " ++ "is not at the expected address " ++ "(wrong library or version mismatch?)"), so->so_name); ++ } + } + + set_addr: +--- a/gdb/testsuite/gdb.base/break-interp-lib.c ++++ b/gdb/testsuite/gdb.base/break-interp-lib.c +@@ -20,6 +20,10 @@ + #include + #include + ++/* Force REL->RELA conversion on i386, see "Prelink", March 4, 2004. */ ++volatile int v[2]; ++volatile int *vptr = &v[1]; ++ + void + libfunc (const char *action) + { +--- a/gdb/testsuite/gdb.base/break-interp.exp ++++ b/gdb/testsuite/gdb.base/break-interp.exp +@@ -352,6 +352,14 @@ proc test_attach {file displacement {relink_args ""}} { + # test simplicity, we merged this test and the test above by not + # restoring $INTERP after $EXEC prelink. $INTERP gets restored + # later below. ++ # ++ # `(wrong library or version mismatch?)' messages are printed for ++ # $binfile_lib on platforms converting REL->RELA relocations by ++ # prelink (such as on i386). There is no reliable way to verify ++ # the library file matches the running library in such case but ++ # GDB at least attempts to set the right displacement. We test ++ # `libfunc' is present in the backtrace and therefore the ++ # displacement has been guessed right. + + if [prelink$relink $relink_args [file tail $exec]] { + # /proc/PID/exe cannot be loaded as it is "EXECNAME (deleted)". + diff --git a/gdb.spec b/gdb.spec index a0fb1f6..97be79d 100644 --- a/gdb.spec +++ b/gdb.spec @@ -23,11 +23,11 @@ Name: gdb%{?_with_debug:-debug} # Set version to contents of gdb/version.in. # NOTE: the FSF gdb versions are numbered N.M for official releases, like 6.3 # and, since January 2005, X.Y.Z.date for daily snapshots, like 6.3.50.20050112 # (daily snapshot from mailine), or 6.3.0.20040112 (head of the release branch). -Version: 7.2.50.20110218 +Version: 7.2.50.20110222 # The release always contains a leading reserved number, start it at 1. # `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing. -Release: 25%{?_with_upstream:.upstream}%{?dist} +Release: 26%{?_with_upstream:.upstream}%{?dist} License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and BSD and Public Domain Group: Development/Debuggers @@ -558,6 +558,9 @@ Patch565: gdb-physname-pr11734-1of2.patch Patch566: gdb-physname-pr11734-2of2.patch Patch567: gdb-physname-pr12273.patch +# Fix attach/core-load of {,un}prelinked i386 libs (bugreport by Michal Toman). +Patch571: gdb-prelink-rela.patch + BuildRequires: ncurses-devel%{?_isa} texinfo gettext flex bison expat-devel%{?_isa} Requires: readline%{?_isa} BuildRequires: readline-devel%{?_isa} @@ -827,6 +830,7 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c %patch565 -p1 %patch566 -p1 %patch567 -p1 +%patch571 -p1 %patch390 -p1 %patch393 -p1 @@ -1251,6 +1255,10 @@ fi %{_infodir}/gdb.info* %changelog +* Wed Feb 23 2011 Jan Kratochvil - 7.2.50.20110222-26.fc15 +- Rebase to FSF GDB 7.2.50.20110222 (which is a 7.3 pre-release). +- Fix attach/core-load of {,un}prelinked i386 libs (bugreport by Michal Toman). + * Mon Feb 21 2011 Jan Kratochvil - 7.2.50.20110218-25.fc15 - Drop %%{_datadir}/gdb/syscalls/* for unsupported arches. diff --git a/sources b/sources index 4219109..63f3744 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ 04e5c4b1b9e633422cc48990fe61958d libstdc++-v3-python-r155978.tar.bz2 -91f8283c9b38ce8f746a308bc4165d81 gdb-7.2.50.20110218.tar.bz2 +2e26a654bcd0c9c46cfc104e4068a95c gdb-7.2.50.20110222.tar.bz2