This is an archive of the discontinued LLVM Phabricator instance.

Added utility function to get correct signal number from remote platform.
ClosedPublic

Authored by chaoren on Jun 1 2015, 2:55 PM.

Details

Summary

This change adds a utility that uses the kill -l command to get the
correct signal number. Falls back to using SBUnixSignals, and finally
signal.SIG<signal> if all else fails.

Diff Detail

Repository
rL LLVM

Event Timeline

chaoren updated this revision to Diff 26932.Jun 1 2015, 2:55 PM
chaoren retitled this revision from to Added utility function to get correct signal number from remote platform..
chaoren updated this object.
chaoren edited the test plan for this revision. (Show Details)
chaoren added reviewers: ovyalov, clayborg, tberghammer.
chaoren added a subscriber: Unknown Object (MLST).
clayborg accepted this revision.Jun 1 2015, 3:34 PM
clayborg edited edge metadata.

Looks good.

This revision is now accepted and ready to land.Jun 1 2015, 3:34 PM
ovyalov added inline comments.Jun 1 2015, 3:51 PM
test/lldbutil.py
934 ↗(On Diff #26932)

Nit: to avoid nesting - if not lldb.remote_platform return getattr(signal, signal_name)

937 ↗(On Diff #26932)

Could you check for return error value?

chaoren added inline comments.Jun 1 2015, 3:56 PM
test/lldbutil.py
934 ↗(On Diff #26932)

I want to use getattr(signal, signal_name) as a fallback if kill -l can't find anything. Actually, it'd be better if we can check for a valid remote process first and try getting a signal value from that before falling back to getattr.

ovyalov added inline comments.Jun 1 2015, 4:02 PM
test/lldbutil.py
934 ↗(On Diff #26932)

Yep - fallback to process instance if presented is a good option - e.g., in this case remote test invocation Linux->OSX should pass well.

chaoren updated this revision to Diff 26944.Jun 1 2015, 5:38 PM
chaoren edited edge metadata.
  • Address review comments.
ovyalov added inline comments.Jun 1 2015, 6:27 PM
test/lldbutil.py
956 ↗(On Diff #26944)

target.GetProcess() ?

ovyalov accepted this revision.Jun 1 2015, 6:42 PM
ovyalov edited edge metadata.

LGTM

chaoren updated this object.Jun 2 2015, 9:49 AM
chaoren edited edge metadata.
chaoren updated this object.
chaoren updated this object.
This revision was automatically updated to reflect the committed changes.