[Lldb-commits] [Patch][Please Review] Detect inferior changed

Kopec, Matt matt.kopec at intel.com
Mon Mar 4 16:30:57 PST 2013

This patch resolves an issue on Linux where if you are debugging an inferior, change the inferior in some way (source change then recompile) and do a run/process launch, lldb asserts on Linux. The problem comes down to lldb not checking for a changed module/objectfile. The test TestInferiorChanged.py tests for this exact behaviour.

I noticed the class DynamicLoaderMacOSXDYLD handles the changed inferior correctly for Mac and I have prepared a patch that does something similar in POSIX as part of DidLaunch/DidAttach, which I have attached. I was initially tempted to check this in without feedback from the list, however, I am now hesitant that DynamicLoader is the correct place to do this in general.

With the run/process launch command there are uses of the target executable module (ie. CommandObjectLaunch, Process::Launch) before reaching any DynamicLoader use, which, if the file/module has changed, parts of the executable module would be invalid. The directory/file would be the same but other parts such as the objectfile would be invalid. The earliest location to set the target executable correctly would probably be part of CommandObjectLaunch::DoExecute.

Is this a concern? Is there problems with setting the executable module this way or should it just be done as in the patch?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: inferiorchanged.patch
Type: application/octet-stream
Size: 6053 bytes
Desc: inferiorchanged.patch
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20130305/c9cf1703/attachment.obj>

More information about the lldb-commits mailing list