This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [PATCH 1/3] Added command remove-symbol-file.
- 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: Tue, 30 Apr 2013 11:06:13 +0000
- Subject: RE: [PATCH 1/3] Added command remove-symbol-file.
- References: <1366098721-18302-1-git-send-email-nicolas dot blanc at intel dot com> <1366098721-18302-2-git-send-email-nicolas dot blanc at intel dot com> <517ABA6A dot 5070400 at redhat dot com> <388084C8C1E6A64FA36AD1D656E4856619DF0224 at IRSMSX102 dot ger dot corp dot intel dot com> <517EC93F dot 2020409 at redhat dot com>
Hi Pedro,
I tested adding a file manually in gdb before the debuggee, as you suggested, and indeed
the user-added file appeared in so_list_head. There was a glitch in my function because
"objfile->flags & OBJF_SHARED" was not set by GDB. So the dangling reference was not removed
from the list. I fixed that and now the new code for remove_user_added_file is:
/* SO_LIST_HEAD may contain user-loaded object files that can be removed
out-of-band by the user. So upon notification of free_objfile remove
any reference to any user-loaded file that is about to be freed. */
static void
remove_user_added_objfile (struct objfile *objfile)
{
struct so_list *so;
if (!objfile)
return;
if (objfile->flags & OBJF_USERLOADED)
{
for (so = so_list_head; so != NULL; so = so->next)
if (so->objfile == objfile)
so->objfile = NULL;
}
}
If this is function is ok for you then I'll send a new version of the patch.
Thanks again for your feedback,
Nicolas
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