This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[patch 02/15] PIE: disable_breakpoints_in_shlibs also bp_shlib_event
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Mon, 9 Nov 2009 21:57:39 +0100
- Subject: [patch 02/15] PIE: disable_breakpoints_in_shlibs also bp_shlib_event
Hi,
Fix error on inserting stale breakpoint of type bp_shlib_event.
Thanks,
Jan
With the patchset applied:
x86_64 host i386 target:
cd gdb/testsuite; ../gdb -nx -i=mi <transcript.1
-gdb-set non-stop 1
105-file-exec-and-symbols gdb.mi/mi-non-stop-exit
220-exec-run
200-break-insert -t main
220-exec-run
=thread-exited,id="3",group-id="16651"
=thread-exited,id="2",group-id="16651"
=thread-exited,id="1",group-id="16651"
=thread-group-exited,id="16651"
=library-unloaded,id="/lib/ld-linux.so.2",target-name="/lib/ld-linux.so.2",host-name="/lib/ld-linux.so.2"
=library-unloaded,id="/lib/libpthread.so.0",target-name="/lib/libpthread.so.0",host-name="/lib/libpthread.so.0"
=library-unloaded,id="/lib/libm.so.6",target-name="/lib/libm.so.6",host-name="/lib/libm.so.6"
=library-unloaded,id="/lib/libc.so.6",target-name="/lib/libc.so.6",host-name="/lib/libc.so.6"
=thread-group-created,id="16656"
=thread-created,id="1",group-id="16656"
220^running
*running,thread-id="all"
(gdb)
&"Error in re-setting breakpoint 1: Warning:\n"
&"Cannot insert breakpoint -1.\n"
&"Error accessing memory address 0x5ab0b0: Input/output error.\n"
&"\n"
220^error,msg="Warning:\nCannot insert breakpoint -1.\nError accessing memory address 0x5ab0b0: Input/output error.\n"
=thread-selected,id="1"
(gdb)
=thread-exited,id="1",group-id="16656"
=thread-group-exited,id="16656"
* breakpoint.c (disable_breakpoints_in_shlibs): Apply also to
bp_shlib_event. Simplify parentheses.
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -4994,9 +4994,10 @@ disable_breakpoints_in_shlibs (void)
becomes enabled, or the duplicate is removed, gdb will try to insert
all breakpoints. If we don't set shlib_disabled here, we'll try
to insert those breakpoints and fail. */
- if (((b->type == bp_breakpoint)
- || (b->type == bp_hardware_breakpoint)
- || (b->type == bp_tracepoint))
+ if ((b->type == bp_breakpoint
+ || b->type == bp_hardware_breakpoint
+ || b->type == bp_tracepoint
+ || b->type == bp_shlib_event)
&& loc->pspace == current_program_space
&& !loc->shlib_disabled
#ifdef PC_SOLIB