[Lldb-commits] [PATCH] D141972: Delay loading of qProcessInfo-informed binaries until later in the Process setup

Jason Molenda via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jan 17 15:22:53 PST 2023


jasonmolenda created this revision.
jasonmolenda added a reviewer: jingham.
jasonmolenda added a project: LLDB.
Herald added a subscriber: JDevlieghere.
Herald added a project: All.
jasonmolenda requested review of this revision.
Herald added a subscriber: lldb-commits.

I handle two types of binary specification in qProcessInfo -- the `main-binary-{uuid,address,slide}` and `binary-addresses` -- so the remote stub can tell lldb to discover/load binaries when we connect.

I did this loading in `ProcessGDBRemote::DoConnectRemote()` which is very early in process setup, e.g. we don't have threads yet.  This caused problems for one group that has a python script in the dSYM and need a more fully set up process.

This patch moves this binary loading from `DoConnectRemote()` to `DidLaunchOrAttach()` where we're nearly done setting up the Process.  There's a method, `MaybeLoadExecutableModule` which reads the load address of the main binary from the remote stub (maybge on linux or something) and sets the load address in the Target; I added my new `LoadStubBinaries()` method next to that one in `DidLaunchOrAttach()`. I originally thought to simply add the code to `MaybeLoadExecutableModule` but then the method was doing two completely unrelated things and it would only serve to confuse people in the future I think.

I don't know of a particularly good reviewer on this one, but I'll add Jim without thinking of a better choice offhand.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D141972

Files:
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141972.489956.patch
Type: text/x-patch
Size: 5749 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230117/5fa31b88/attachment.bin>


More information about the lldb-commits mailing list