This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Fix failure in TestStackCoreScriptedProcess on x86_64
ClosedPublic

Authored by mib on Jun 13 2023, 11:41 AM.

Details

Summary

This patch should address the failure of TestStackCoreScriptedProcess
that is happening specifically on x86_64.

It turns out that in 1370a1cb5b97, 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.

Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>

Diff Detail

Event Timeline

mib created this revision.Jun 13 2023, 11:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 13 2023, 11:41 AM
Herald added a subscriber: pengfei. · View Herald Transcript
mib requested review of this revision.Jun 13 2023, 11:41 AM
mib updated this revision to Diff 531017.Jun 13 2023, 11:43 AM

Re-enable test

bulbazord accepted this revision.Jun 13 2023, 12:51 PM

Makes sense.

lldb/source/Plugins/Process/scripted/ScriptedThread.cpp
253

Is there a more specific type we can use other than unsigned int? Maybe uint32_t?

This revision is now accepted and ready to land.Jun 13 2023, 12:51 PM
This revision was automatically updated to reflect the committed changes.