This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] "$ gdb PROGRAM" vs "(gdb) file PROGRAM" difference; warn on failure to remove breakpoint.
- From: Tom Tromey <tromey at redhat dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 11 Jun 2014 13:01:15 -0600
- Subject: Re: [PATCH] "$ gdb PROGRAM" vs "(gdb) file PROGRAM" difference; warn on failure to remove breakpoint.
- Authentication-results: sourceware.org; auth=none
- References: <1402323778-27849-1-git-send-email-palves at redhat dot com>
>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
Pedro> Turns out there's a difference between loading the program with "gdb
Pedro> PROGRAM", vs loading it with "(gdb) file PROGRAM". The latter results
Pedro> in the objfile ending up with OBJF_USERLOADED set, while not with the
Pedro> former. (That difference seems bogus, but still that's not the point
Pedro> of this patch. We can revisit that afterwards.)
[...]
Pedro> 2014-06-09 Pedro Alves <palves@redhat.com>
Pedro> * breakpoint.c (insert_bp_location, remove_breakpoint_1): Adjust.
Pedro> (disable_breakpoints_in_freed_objfile): Skip objfiles that don't
Pedro> have OBJF_SHARED set.
Pedro> * objfiles.c (userloaded_objfile_contains_address_p): Rename to...
Pedro> (shared_objfile_contains_address_p): ... this. Check OBJF_SHARED
Pedro> instead of OBJF_USERLOADED.
Pedro> * objfiles.h (OBJF_SHARED): Update comment.
Pedro> (userloaded_objfile_contains_address_p): Rename to ...
Pedro> (shared_objfile_contains_address_p): ... this, and update
Pedro> comments.
Pedro> * symfile.c (add_symbol_file_command): Also set OBJF_SHARED in the
Pedro> new objfile.
Pedro> (remove_symbol_file_command): Skip objfiles that don't have
Pedro> OBJF_SHARED set.
FWIW I read through this and it looks reasonable to me.
Tom