This is an archive of the discontinued LLVM Phabricator instance.

runCmd should print the command before running it in case of crashes
ClosedPublic

Authored by jingham on Jul 7 2023, 3:36 PM.

Details

Summary

runCmd (and expect which uses runCmd) run the command, and when that completes, prints the command that was run and the result. That's problematic when the command crashes, since then you don't see what command was run. It's better to print the command to run, then run it, then print the results.

This shouldn't change how the logs look normally, since runCmd captures the command result in an SBCommandResultObject and then prints it back out. So there shouldn't be any output from lldb while the command is running. The only time you should be able to see the difference is if the command crashes, and in that case the difference is you WILL see the command run.

Diff Detail

Event Timeline

jingham created this revision.Jul 7 2023, 3:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 7 2023, 3:36 PM
jingham requested review of this revision.Jul 7 2023, 3:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 7 2023, 3:36 PM
JDevlieghere accepted this revision.Jul 7 2023, 3:40 PM

Makes sense. LGTM.

This revision is now accepted and ready to land.Jul 7 2023, 3:40 PM
mib accepted this revision.Jul 7 2023, 3:52 PM

Yep, LGTM!

bulbazord accepted this revision.Jul 7 2023, 5:41 PM

Oh I really like this. Thanks!