[Lldb-commits] [PATCH] D118484: [lldb/test] Fix TestScriptedProcess.py timeout on x86_64

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Jan 28 12:24:43 PST 2022


JDevlieghere accepted this revision.
JDevlieghere added a comment.
This revision is now accepted and ready to land.

LGTM modulo the test comment.



================
Comment at: lldb/examples/python/scripted_process/scripted_process.py:338
+
+ARM64_GPR = [ {'name': 'x0',   'bitsize': 64, 'offset': 0,   'encoding': 'uint', 'format': 'hex', 'set': 0, 'gcc': 0,  'dwarf': 0,  'generic': 'arg0', 'alt-name': 'arg0'},
+              {'name': 'x1',   'bitsize': 64, 'offset': 8,   'encoding': 'uint', 'format': 'hex', 'set': 0, 'gcc': 1,  'dwarf': 1,  'generic': 'arg1', 'alt-name': 'arg1'},
----------------
Generally constants go at the top of the file, but this is rather bulky, so I don't mind it being at the bottom. 


================
Comment at: lldb/test/API/functionalities/scripted_process/stack_core_scripted_process.py:128-137
+            selected_thread_idx = self.scripted_process.get_selected_thread_index()
+            if selected_thread_idx == self.corefile_thread.GetIndexID():
+                if 'arm64' in self.scripted_process.arch:
+                    stop_reason["type"] = lldb.eStopReasonException
                     stop_reason["data"]["desc"] = self.corefile_thread.GetStopDescription(100)
+                elif self.scripted_process.arch == 'x86_64':
+                    stop_reason["type"] = lldb.eStopReasonSignal
----------------
mib wrote:
> JDevlieghere wrote:
> > Can you remind me why we can't read this information from the thread in the core file? 
> Besides on arm, we don't save any breakpoint info in the core file, so all of the core file threads reports a `eStopReasonNone`. So when I try to emulate the core file process from a Scripted Process, the scripted process never stops because none of its threads has a stop reason. That's why we have to fake a SIGTRAP for x86_64.
That sounds like something worth mentioning as a comment in the test. 


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

https://reviews.llvm.org/D118484



More information about the lldb-commits mailing list