This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] "$ gdb PROGRAM" vs "(gdb) file PROGRAM" difference; warn on failure to remove breakpoint.


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]