This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit] Allow multiple _ovly_debug_event instances
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: gdb-patches at sourceware dot org
- Date: Fri, 22 Aug 2008 17:51:48 +0200 (CEST)
- Subject: [commit] Allow multiple _ovly_debug_event instances
Hello,
when debugging a Cell/B.E. executable, it may happen that multiple separate
instances of the overlay manager are present in the target. This works just
fine, except that GDB will install the _ovly_debug_event breakpoint only for
a single instance. This patch fixes this by simply looping over all objfiles
and allowing each of them to provide its own version of _ovly_debug_event.
Tested on spu-elf. Committed to mainline.
Bye,
Ulrich
ChangeLog:
* breakpoint.c (create_overlay_event_breakpoint): Rename to ...
(create_overlay_event_breakpoint_1): ... this. Add OBJFILE parameter.
(create_overlay_event_breakpoint): Loop over all objfiles to install
multiple instances of the overlay event breakpoint if present.
diff -urNp src-orig/gdb/breakpoint.c src/gdb/breakpoint.c
--- src-orig/gdb/breakpoint.c 2008-08-17 16:36:36.289446957 +0200
+++ src/gdb/breakpoint.c 2008-08-17 17:01:05.329938176 +0200
@@ -4535,12 +4535,12 @@ delete_longjmp_breakpoint (int thread)
}
static void
-create_overlay_event_breakpoint (char *func_name)
+create_overlay_event_breakpoint_1 (char *func_name, struct objfile *objfile)
{
struct breakpoint *b;
struct minimal_symbol *m;
- if ((m = lookup_minimal_symbol_text (func_name, NULL)) == NULL)
+ if ((m = lookup_minimal_symbol_text (func_name, objfile)) == NULL)
return;
b = create_internal_breakpoint (SYMBOL_VALUE_ADDRESS (m),
@@ -4560,6 +4560,14 @@ create_overlay_event_breakpoint (char *f
update_global_location_list (1);
}
+static void
+create_overlay_event_breakpoint (char *func_name)
+{
+ struct objfile *objfile;
+ ALL_OBJFILES (objfile)
+ create_overlay_event_breakpoint_1 (func_name, objfile);
+}
+
void
enable_overlay_breakpoints (void)
{
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com