Commit Graph

9 Commits

Author SHA1 Message Date
Greg Clayton 7260f6206f Centralized a lot of the status information for processes,
threads, and stack frame down in the lldb_private::Process,
lldb_private::Thread, lldb_private::StackFrameList and the 
lldb_private::StackFrame classes. We had some command line
commands that had duplicate versions of the process status
output ("thread list" and "process status" for example). 

Removed the "file" command and placed it where it should
have been: "target create". Made an alias for "file" to
"target create" so we stay compatible with GDB commands.

We can now have multple usable targets in lldb at the
same time. This is nice for comparing two runs of a program
or debugging more than one binary at the same time. The
new command is "target select <target-idx>" and also to see
a list of the current targets you can use the new "target list"
command. The flow in a debug session can be:

(lldb) target create /path/to/exe/a.out
(lldb) breakpoint set --name main
(lldb) run
... hit breakpoint
(lldb) target create /bin/ls
(lldb) run /tmp
Process 36001 exited with status = 0 (0x00000000) 
(lldb) target list
Current targets:
  target #0: /tmp/args/a.out ( arch=x86_64-apple-darwin, platform=localhost, pid=35999, state=stopped )
* target #1: /bin/ls ( arch=x86_64-apple-darwin, platform=localhost, pid=36001, state=exited )
(lldb) target select 0
Current targets:
* target #0: /tmp/args/a.out ( arch=x86_64-apple-darwin, platform=localhost, pid=35999, state=stopped )
  target #1: /bin/ls ( arch=x86_64-apple-darwin, platform=localhost, pid=36001, state=exited )
(lldb) bt
* thread #1: tid = 0x2d03, 0x0000000100000b9a a.out`main + 42 at main.c:16, stop reason = breakpoint 1.1
  frame #0: 0x0000000100000b9a a.out`main + 42 at main.c:16
  frame #1: 0x0000000100000b64 a.out`start + 52

Above we created a target for "a.out" and ran and hit a
breakpoint at "main". Then we created a new target for /bin/ls
and ran it. Then we listed the targest and selected our original
"a.out" program, so we showed two concurent debug sessions
going on at the same time.

llvm-svn: 129695
2011-04-18 08:33:37 +00:00
Caroline Tice 79042b3e93 Change "breakpoint list" command to default to brief output rather than full output.
Modify test cases in test suite to either expect brief output or to pass -f for full
output as appropriate.

llvm-svn: 124905
2011-02-04 22:59:41 +00:00
Johnny Chen d732156bed 'thread backtrace', not 'thread backtrac'.
llvm-svn: 121151
2010-12-07 17:10:46 +00:00
Johnny Chen cdab9f1933 Make clang happy.
llvm-svn: 118839
2010-11-11 21:22:12 +00:00
Johnny Chen 0c724effb8 The StateType representation has been changed. Modify the test cases to accommodate.
llvm-svn: 116705
2010-10-18 15:44:42 +00:00
Johnny Chen aadcef54de Make calling the super class's setUp() method less fragile.
llvm-svn: 116490
2010-10-14 17:31:24 +00:00
Johnny Chen b7fd763369 Add more comments and wait a little bit after resuming the inferior process before
sending it a signal.

llvm-svn: 116481
2010-10-14 15:58:53 +00:00
Johnny Chen c066ab4385 Add an initial version of test that exercise the lldb commands: 'process signal'
and 'process handle'.  The test suite would like to control the asynch/sync
execution of the interpreter during the middle of the test method, so the
CommandInterpreter::SetSynchronous(bool value) is modified to allow the mode to
be changed more than once.

In practice, it would be advisable to control the process and to set the
async/sync mode from a single thread, too.

llvm-svn: 116467
2010-10-14 01:22:03 +00:00
Greg Clayton 864174e100 Added a new test case to test signals with.
Added frame relative frame selection to "frame select". You can now select
frames relative to the current frame (which defaults to zero if the current
frame hasn't yet been set for a thread):

The gdb "up" command can be done as:
(lldb) frame select -r 1
The gdb "down" command can be done as:
(lldb) frame select -r -1

Place the following in your ~/.lldbinit file for "up" and "down":

command alias up frame select -r 1
command alias down frame select -r -1

llvm-svn: 116176
2010-10-10 22:28:11 +00:00