[lldb/qemu] Stub out process info functions

These functions return the information about the host process (so they
show the executable as "qemu" and have the "wrong" architecture), which
isn't useful and can confuse lldb.

We could theoretically try to identify which host processes are running
an emulator, and translate the process information, but that would be
tricky to implement, and the usefulness of it would be fairly limited as
qemu does not support attaching to a running process.
This commit is contained in:
Pavel Labath
2022-10-28 09:04:14 +02:00
parent 8d7f88416a
commit 1dc39378c4
2 changed files with 16 additions and 0 deletions

View File

@@ -42,6 +42,16 @@ public:
return nullptr;
}
uint32_t FindProcesses(const ProcessInstanceInfoMatch &match_info,
ProcessInstanceInfoList &proc_infos) override {
return 0;
}
bool GetProcessInfo(lldb::pid_t pid,
ProcessInstanceInfo &proc_info) override {
return false;
}
bool IsConnected() const override { return true; }
void CalculateTrapHandlerSymbolNames() override {}

View File

@@ -23,3 +23,9 @@ class TestQemuAPI(TestBase):
self.assertSuccess(qemu.MakeDirectory(
self.getBuildArtifact("target_dir")))
self.assertTrue(os.path.isdir(self.getBuildArtifact("target_dir")))
def test_process_api(self):
self.dbg.SetCurrentPlatform("qemu-user")
self.expect("platform process list",
substrs=['no processes were found on the "qemu-user" platform'],
error=True)