Page MenuHomePhabricator

[ScriptInterpreter] Pass the debugger instead of the command interpreter
ClosedPublic

Authored by JDevlieghere on Apr 25 2019, 9:31 PM.

Details

Summary

As discussed in D61090, there's no good reason for the script interpreter to depend on the command interpreter. When looking at the code, it becomes clear that we mostly use the command interpreter as a way to access the debugger. Hence, it makes more sense to just pass that to the script interpreter directly.

This is part 1 out of 2. I have another patch in the pipeline that changes the ownership of the script interpreter to the debugger as well, but I didn't get around to finish that today.

Diff Detail

Repository
rLLDB LLDB

Event Timeline

JDevlieghere created this revision.Apr 25 2019, 9:31 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 25 2019, 9:31 PM

Seems like a good change to me, but Jim should have a look as he requested that.

Looks good to me too. The fact that you were mostly eliminating redirections from CommandInterpreter -> Debugger is good evidence this was wrongly structured initially.

I'm a little curious that we do:

m_debugger.GetCommandInterpreter().GetPythonCommandsFromIOHandler

to read "break command add -s python" command text. Seems like the script interpreter IO handler should do this otherwise the Command Interpreter has to know the right way to do input for every script interpreter. But I think that's a change for another patch.

This one seems pure goodness.

jingham accepted this revision.Apr 26 2019, 10:54 AM

Oops, forgot to do the action part of this...

This revision is now accepted and ready to land.Apr 26 2019, 10:54 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptApr 26 2019, 10:59 AM