This is an archive of the discontinued LLVM Phabricator instance.

[LLDB] Add "frame select" as equivalent of GDB's "frame" command
ClosedPublic

Authored by DavidSpickett on Sep 29 2022, 6:07 AM.

Details

Summary

This is useful for answering the question "where am I?" and is surprisingly
difficult to figure out without just doing another step command.

Diff Detail

Event Timeline

DavidSpickett created this revision.Sep 29 2022, 6:07 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 29 2022, 6:07 AM
DavidSpickett requested review of this revision.Sep 29 2022, 6:07 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 29 2022, 6:07 AM
awarzynski accepted this revision.Sep 29 2022, 6:54 AM

LGTM, thanks!

This revision is now accepted and ready to land.Sep 29 2022, 6:54 AM

f with no input does this job:

(lldb) f
frame #1: 0x0000000100003f70 callem`nothing at callem.c:3
   1   	int nothing(int input) {
   2   	  if (input < 10) {
-> 3   	    return nothing(++input);
    	           ^
   4   	  }
   5   	  return input;
   6   	}
   7   	
(lldb) up
frame #2: 0x0000000100003f70 callem`nothing at callem.c:3
   1   	int nothing(int input) {
   2   	  if (input < 10) {
-> 3   	    return nothing(++input);
    	           ^
   4   	  }
   5   	  return input;
   6   	}
   7   	
(lldb) f
frame #2: 0x0000000100003f70 callem`nothing at callem.c:3
   1   	int nothing(int input) {
   2   	  if (input < 10) {
-> 3   	    return nothing(++input);
    	           ^
   4   	  }
   5   	  return input;
   6   	}
   7   	
(lldb)

etc...

  • Add "frame select" and short "f" version on the lldb side.
DavidSpickett retitled this revision from [LLDB] Add "process status" as equivalent of GDB's "frame" command to [LLDB] Add "frame select" as equivalent of GDB's "frame" command.Sep 30 2022, 3:56 AM

Thanks for the suggestion @jingham , does this look good to you?