mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-23 22:00:10 +00:00
[lldb] Fix failure in TestStackCoreScriptedProcess on x86_64
This patch should address the failure of TestStackCoreScriptedProcess
that is happening specifically on x86_64.
It turns out that in 1370a1cb5b
, I changed the way we extract integers
from a `StructuredData::Dictionary` and in order to get a stop info from
the scripted process, we call a method that returns a `SBStructuredData`
containing the stop reason data.
TestStackCoreScriptedProcess` was failing specifically on x86_64 because
the stop info dictionary contains the signal number, that the `Scripted
Thread` was trying to extract as a signed integer where it was actually
parsed as an unsigned integer. That caused `GetValueForKeyAsInteger` to
return the default value parameter, `LLDB_INVALID_SIGNAL_NUMBER`.
This patch address the issue by extracting the signal number with the
appropriate type and re-enables the test.
Differential Revision: https://reviews.llvm.org/D152848
Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
This commit is contained in:
parent
63538a0879
commit
0c5b632071
@ -484,6 +484,7 @@ public:
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
template <class IntType>
|
||||
bool GetValueForKeyAsInteger(llvm::StringRef key, IntType &result) const {
|
||||
ObjectSP value_sp = GetValueForKey(key);
|
||||
|
@ -250,10 +250,12 @@ bool ScriptedThread::CalculateStopInfo() {
|
||||
StopInfo::CreateStopReasonWithBreakpointSiteID(*this, break_id);
|
||||
} break;
|
||||
case lldb::eStopReasonSignal: {
|
||||
int signal;
|
||||
uint32_t signal;
|
||||
llvm::StringRef description;
|
||||
data_dict->GetValueForKeyAsInteger("signal", signal,
|
||||
LLDB_INVALID_SIGNAL_NUMBER);
|
||||
if (!data_dict->GetValueForKeyAsInteger("signal", signal)) {
|
||||
signal = LLDB_INVALID_SIGNAL_NUMBER;
|
||||
return false;
|
||||
}
|
||||
data_dict->GetValueForKeyAsString("desc", description);
|
||||
stop_info_sp =
|
||||
StopInfo::CreateStopReasonWithSignal(*this, signal, description.data());
|
||||
|
@ -35,7 +35,6 @@ class StackCoreScriptedProcesTestCase(TestBase):
|
||||
@skipIfOutOfTreeDebugserver
|
||||
@skipIfRemote
|
||||
@skipIfAsan # On ASAN builds, this test times-out (rdar://98678134)
|
||||
@skipIfDarwin
|
||||
def test_launch_scripted_process_stack_frames(self):
|
||||
"""Test that we can launch an lldb scripted process from the command
|
||||
line, check its process ID and read string from memory."""
|
||||
|
Loading…
Reference in New Issue
Block a user