This is an archive of the discontinued LLVM Phabricator instance.

Clean up the default stop messages for thread and frame
ClosedPublic

Authored by jingham on Nov 7 2016, 7:15 PM.

Details

Reviewers
clayborg
Summary

The stop information you get when lldb stops is noisy and redundant. Part of this was because we had only one thread stop format, which was getting used in "thread list" where it's quite useful to see where the thread is stopped, and in the normal stop message, where we're going to print the frame info immediately below, so the function information is not relevant.

It's also a little noisy to print the PC in a frame that has debug information. So I added a thread-stop-format which gets used in the stop message. The one used in "thread-list" will stay the same.

The old stop record looks like:

  • thread #1: tid = 0x29428a, 0x0000000100018fe7 Sketch`main(argc=1, argv=0x00007fff5fbff5a0) + 55 at SKTMain.m:19, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1 frame #0: 0x0000000100018fe7 Sketch`main(argc=1, argv=0x00007fff5fbff5a0) + 55 at SKTMain.m:19

With this diff, the default form will be:

  • thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1 frame #0: Sketch`main(argc=1, argv=0x00007fff5fbff618) at SKTMain.m:19

If you stop in a frame with no debug info, you will still see the PC & offset:

  • thread #1, name = 'A_Cool_Thread', stop reason = trace frame #0: 0x000000010004c85e dyld`gdb_image_notifier(dyld_image_mode, unsigned int, dyld_image_info const*) + 1

I haven't gone through the test suite consequences of this change. Should be none, but I wouldn't be surprised if somebody is scraping stop output when they shouldn't be... I'll do that before committing, I just wanted to get this out there in case the form of the new output bugs people.

Diff Detail

Repository
rL LLVM

Event Timeline

jingham updated this revision to Diff 77134.Nov 7 2016, 7:15 PM
jingham retitled this revision from to Clean up the default stop messages for thread and frame.
jingham updated this object.
jingham added a reviewer: clayborg.
jingham set the repository for this revision to rL LLVM.

Pasting the text into the description auto-wrapped, which masks the difference... This looks better:

Old:

* thread #1: tid = 0x29428a, 0x0000000100018fe7 Sketch`main(argc=1, argv=0x00007fff5fbff5a0) + 55 at SKTMain.m:19, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #0: 0x0000000100018fe7 Sketch`main(argc=1, argv=0x00007fff5fbff5a0) + 55 at SKTMain.m:19

New:

* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #0: Sketch`main(argc=1, argv=0x00007fff5fbff618) at SKTMain.m:19
clayborg accepted this revision.Nov 8 2016, 8:44 AM
clayborg edited edge metadata.

Looks fine to me. If we don't agree on the default format that should be used, then we can do that in a separate patch.

This revision is now accepted and ready to land.Nov 8 2016, 8:44 AM
jingham closed this revision.Nov 8 2016, 12:48 PM

Committed as r286288.