[Lldb-commits] [PATCH] D139250: [lldb] Add ScriptedPlatform python implementation

Med Ismail Bennani via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Dec 12 04:54:52 PST 2022


mib added inline comments.


================
Comment at: lldb/examples/python/scripted_process/scripted_platform.py:31
+    def list_processes(self):
+        """ Get a list of processes that can be ran on the platform.
+
----------------
labath wrote:
> I am surprised that you want to go down the "run" path for this functionality. I think most of the launch functionality does not make sense for this use case (e.g., you can't provide arguments to these processes, when you "run" them, can you?), and it is not consistent with what the "process listing" functionality does for regular platforms.
> 
> OTOH, the "attach" flow makes perfect sense here -- you take the pid of an existing process, attach to it, and stop it at a random point in its execution. You can't customize anything about how that process is run (because it's already running) -- all you can do is choose how you want to select the target process.
For now, there is no support for attaching to a scripted process, because we didn't have any use for it quite yet: cripted processes were mostly used for doing post-mortem debugging, so we "ran" them artificially in lldb by providing some launch options (the name of the class managing the process and an optional user-provided dictionary) through the command line or using an `SBLaunchInfo` object.

I guess I'll need to extend the `platform process launch/attach` commands and `SBAttachInfo` object to also support these options since they're required for the scripted process instantiation.

Note that we aren't really attaching to the real running process, we're creating a scripted process that knows how to read memory to mock the real process.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139250/new/

https://reviews.llvm.org/D139250



More information about the lldb-commits mailing list