This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
bug fix for gdb 16039
- From: "Dave.Tian" <xhengdf at gmail dot com>
- To: gdb-patches at sourceware dot org
- Date: Sat, 12 Oct 2013 18:17:23 +0800
- Subject: bug fix for gdb 16039
- Authentication-results: sourceware.org; auth=none
1, description : I create a defect for gdb Bug 16039
gdb "next " cmd stop working when a dynamic library(libc++
static linked in) unloaded
there is a dynamic library with libc++ static linked.
when call dlclose on this library, gdb "next" cmd stop to work.
since gdb has internal breakpoints on
std::terminate/longjmp/..., which set when dlopen on the library.
after dlclose, the address of mem-break is not valid, so
remove_breakpoints/insert_breakpoints failed with EIO error. then gdb
"next" failed with "cannot insert breapoint -XXX".
2, ChangeLog :
2013-10-12 Tian Ye <xhengdf@gmail.com>
* breakpoint.c : Bug 16039 fix
3, Patch diff:
--- breakpoint.c.old 2013-10-12 01:15:09.044081000 -0700
+++ breakpoint.c.new 2013-10-12 03:04:16.992359000 -0700
@@ -7147,8 +7147,8 @@ set_longjmp_breakpoint (struct thread_in
clones of those and enable them for the requested thread. */
ALL_BREAKPOINTS_SAFE (b, b_tmp)
if (b->pspace == current_program_space
- && (b->type == bp_longjmp_master
- || b->type == bp_exception_master))
+ && ((b->type == bp_longjmp_master
+ || b->type == bp_exception_master) && !b->loc->shlib_disabled))
{
enum bptype type = b->type == bp_longjmp_master ? bp_longjmp : bp_exception;
struct breakpoint *clone;
@@ -7463,7 +7463,11 @@ disable_breakpoints_in_unloaded_shlib (s
|| b->type == bp_hardware_breakpoint)
&& (loc->loc_type == bp_loc_hardware_breakpoint
|| loc->loc_type == bp_loc_software_breakpoint))
- || is_tracepoint (b))
+ || is_tracepoint (b)
+ || (b->type == bp_longjmp_master
+ || b->type == bp_std_terminate_master
+ || b->type == bp_exception_master
+ || b->type == bp_exception))
&& solib_contains_address_p (solib, loc->address))
{
loc->shlib_disabled = 1;
thank you,
-YT