gdb/gdb-archer-pie-addons-keep-disabled.patch
Richard Biener e1333f9f57 - Use patchlist.pl to merge with gdb-7.8-16.fc22, a rebase to FSF GDB 4.8.
The GDB 4.8 features are:
  * Guile scripting support.
  * Python scripting enhancements.
  * New commands:
      ** guile
      ** guile-repl
      ** info auto-load guile-scripts [REGEXP]
  * New options:
      ** maint ada set ignore-descriptive-types (on|off)
      ** maint set target-async (on|off)
      ** set|show auto-load guile-scripts (on|off)
      ** set|show auto-connect-native-target
      ** set|show guile print-stack (none|message|full)
      ** set|show mi-async (on|off)
      ** set|show print symbol-loading (off|brief|full)
      ** set|show record btrace replay-memory-access (read-only|read-write)
  * Remote Protocol:
      ** The qXfer:btrace:read packet supports a new annex 'delta'.
  * GDB/MI:
      ** A new option "-gdb-set mi-async" replaces "-gdb-set target-async".
  * New target configurations:
      ** PowerPC64 GNU/Linux little-endian
  * btrace enhancements:
      ** The btrace record target now supports the 'record goto' command.
      ** The btrace record target supports limited reverse execution and
         replay.
  * ISO C99 variable length automatic arrays support.
  * It is no longer required to "set target-async on" in order to use
     background execution commands (e.g., "c&", "s&", etc.).

OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=102
2014-08-11 14:08:48 +00:00

84 lines
2.7 KiB
Diff

Index: gdb-7.7.50.20140609/gdb/breakpoint.c
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/breakpoint.c 2014-06-13 20:24:34.564667225 +0200
+++ gdb-7.7.50.20140609/gdb/breakpoint.c 2014-06-13 20:24:35.650668351 +0200
@@ -16364,6 +16364,50 @@ initialize_breakpoint_ops (void)
static struct cmd_list_element *enablebreaklist = NULL;
void
+breakpoints_relocate (struct objfile *objfile, struct section_offsets *delta)
+{
+ struct bp_location *bl, **blp_tmp;
+ int changed = 0;
+
+ gdb_assert (objfile->separate_debug_objfile_backlink == NULL);
+
+ ALL_BP_LOCATIONS (bl, blp_tmp)
+ {
+ struct obj_section *osect;
+
+ /* BL->SECTION can be correctly NULL for breakpoints with multiple
+ locations expanded through symtab. */
+
+ ALL_OBJFILE_OSECTIONS (objfile, osect)
+ {
+ CORE_ADDR relocated_address;
+ CORE_ADDR delta_offset;
+
+ delta_offset = ANOFFSET (delta, osect->the_bfd_section->index);
+ if (delta_offset == 0)
+ continue;
+ relocated_address = bl->address + delta_offset;
+
+ if (obj_section_addr (osect) <= relocated_address
+ && relocated_address < obj_section_endaddr (osect))
+ {
+ if (bl->inserted)
+ remove_breakpoint (bl, mark_uninserted);
+
+ bl->address += delta_offset;
+ bl->requested_address += delta_offset;
+
+ changed = 1;
+ }
+ }
+ }
+
+ if (changed)
+ qsort (bp_location, bp_location_count, sizeof (*bp_location),
+ bp_location_compare);
+}
+
+void
_initialize_breakpoint (void)
{
struct cmd_list_element *c;
Index: gdb-7.7.50.20140609/gdb/breakpoint.h
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/breakpoint.h 2014-06-13 20:24:34.566667227 +0200
+++ gdb-7.7.50.20140609/gdb/breakpoint.h 2014-06-13 20:24:35.651668352 +0200
@@ -1553,4 +1553,7 @@ extern void breakpoint_free_objfile (str
extern char *ep_parse_optional_if_clause (char **arg);
+extern void breakpoints_relocate (struct objfile *objfile,
+ struct section_offsets *delta);
+
#endif /* !defined (BREAKPOINT_H) */
Index: gdb-7.7.50.20140609/gdb/objfiles.c
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/objfiles.c 2014-06-13 20:24:35.652668353 +0200
+++ gdb-7.7.50.20140609/gdb/objfiles.c 2014-06-13 20:25:10.867704891 +0200
@@ -820,6 +820,11 @@ objfile_relocate1 (struct objfile *objfi
obj_section_addr (s));
}
+ /* Final call of breakpoint_re_set can keep breakpoint locations disabled if
+ their addresses match. */
+ if (objfile->separate_debug_objfile_backlink == NULL)
+ breakpoints_relocate (objfile, delta);
+
/* Data changed. */
return 1;
}