This is an archive of the discontinued LLVM Phabricator instance.

[lldb/Plugins] Fix method dispatch bug when using multiple scripted processes
ClosedPublic

Authored by mib on Feb 3 2023, 5:41 PM.

Details

Summary

This patch should address a bug when a user have multiple scripted
processes in the same debugging session.

In order for the scripted process plugin to be able to call into the
scripted object instance methods to fetch the necessary data to
reconstruct its state, the scripted process plugin calls into a
scripted process interface, that has a reference to the created script
object instance.

However, prior to this patch, we only had a single instance of the
scripted process interface, living the script interpreter. So every time
a new scripted process plugin was created, it would overwrite the script
object instance that was held by the single scripted process interface
in the script interpreter.

That would cause all the method calls made to the scripted process
interface to be dispatched by the last instanciated script object
instance, which is wrong.

In order to prevent that, this patch moves the scripted process
interface reference to be help by the scripted process plugin itself.

rdar://104882562

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>

Diff Detail

Event Timeline

mib created this revision.Feb 3 2023, 5:41 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 3 2023, 5:41 PM
mib requested review of this revision.Feb 3 2023, 5:41 PM
mib updated this revision to Diff 494779.Feb 3 2023, 5:52 PM

Fix test failure

JDevlieghere accepted this revision.Feb 6 2023, 10:56 AM

Makes sense. LGTM.

This revision is now accepted and ready to land.Feb 6 2023, 10:56 AM
bulbazord accepted this revision.Feb 6 2023, 11:24 AM
This revision was landed with ongoing or failed builds.Feb 6 2023, 4:03 PM
This revision was automatically updated to reflect the committed changes.