This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[review v2] jit: remove bp locations when unregistering jit code
- From: "Mihails Strasuns (Code Review)" <gerrit at gnutoolchain-gerrit dot osci dot io>
- To: gdb-patches at sourceware dot org
- Cc: Simon Marchi <simon dot marchi at polymtl dot ca>
- Date: Tue, 26 Nov 2019 12:07:46 -0500
- Subject: [review v2] jit: remove bp locations when unregistering jit code
- Auto-submitted: auto-generated
- References: <gerrit.1574686491000.Id9133540d67fa0c4619ac88324b0349b89e4b2b1@gnutoolchain-gerrit.osci.io>
- Reply-to: gnutoolchain-gerrit at osci dot io
Mihails Strasuns has posted comments on this change.
Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/704
......................................................................
Patch Set 2:
> So to unregister a jit region and register a new one (that would happen to have the exact same code at the exact same address as the previous one), the process would need to call __jit_debug_register_code twice, executing between the two events.
Correct.
> After unregistration, when the execution resumes, shouldn't there be something that deletes the breakpoint locations related to that objfile that was removed? And then when __jit_debug_register_code for registering the new object, we would re-create brand new breakpoint locations?
To be honest I hoped someone here will be able to explain this to me :)
But no, this is not how gdb works right now - removal of object files does not cause existing breakpoint locations to be removed, it only clears matching symtab reference (see `breakpoint_free_objfile`). Normally it doesn't cause any problems because next time the same object file appears again, a new breakpoint location gets created/inserted with the new address.
The only possible explanation I could think of is that it is somehow possible for objfile instance to be deleted with the matching instruction memory still being accessible - and that such breakpoint location is still expected to hit. But some sort of historical quirk is always possible of course.
--
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: Id9133540d67fa0c4619ac88324b0349b89e4b2b1
Gerrit-Change-Number: 704
Gerrit-PatchSet: 2
Gerrit-Owner: Mihails Strasuns <mihails.strasuns@intel.com>
Gerrit-Reviewer: Mihails Strasuns <mihails.strasuns@intel.com>
Gerrit-CC: Simon Marchi <simon.marchi@polymtl.ca>
Gerrit-Comment-Date: Tue, 26 Nov 2019 17:07:46 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment