This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [PATCH] Stale breakpoint instructions, spurious SIGTRAPS.
- From: "Blanc, Nicolas" <nicolas dot blanc at intel dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Wed, 16 Apr 2014 17:18:31 +0000
- Subject: RE: [PATCH] Stale breakpoint instructions, spurious SIGTRAPS.
- Authentication-results: sourceware.org; auth=none
- References: <1397585886-29261-1-git-send-email-palves at redhat dot com>
Hi Pedro,
> Then, the reason that disable_breakpoints_in_freed_objfile was clearing the inserted flag isn't clear, but likely to avoid breakpoint removal errors, assuming remove-symbol-file was called after the dynamic object was already unmapped from the inferior.
Indeed that was the intend. The clearing of the flag copied from disable_breakpoints_in_unloaded_shlib.
> Comments?
The suggestion makes sense to me.
Thanks for looking into this.
> if (val)
> @@ -7666,7 +7693,7 @@ disable_breakpoints_in_freed_objfile (struct objfile *objfile)
> ? /* If the file is a shared library not loaded by the user then
> solib_unloaded was notified and disable_breakpoints_in_unloaded_shlib
> was called. In that case there is no need to take action again. */
> - if ((objfile->flags & OBJF_SHARED) && !(objfile->flags & OBJF_USERLOADED))
> + if ((objfile->flags & OBJF_USERLOADED) == 0)
> return;
The comment above should be updated. The condition is now weaker.
ALL_BREAKPOINTS (b)
@@ -7698,7 +7725,11 @@ disable_breakpoints_in_freed_objfile (struct objfile *objfile)
> if (is_addr_in_objfile (loc_addr, objfile))
> {
> loc->shlib_disabled = 1;
> - loc->inserted = 0;
> + /* At this point, we don't know whether the object was
> + unmapped from the inferior or not, so leave the
> + inserted flag alone. We'll handle failure to
> + uninsert quietly, in case the object was indeed
> + unmapped. */
Would it work to simplify disable_breakpoints_in_unloaded_shlib in the same way?
Note that I understand it might be unnecessary risky to fix a function that is not broken.
> + /* Make sure we see the memory breakpoints. */ cleanup =
> + make_show_memory_breakpoints_cleanup (1); val = target_read_memory
> + (addr, old_contents, bplen);
It was not immediately clear to me that old_contents means current content.
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052