diff options
author | Jim Ingham <jingham@apple.com> | 2010-08-30 19:44:40 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2010-08-30 19:44:40 +0000 |
commit | e40e42181fcc0c9742d6fcb654b0e1dee07a2513 (patch) | |
tree | 978294983a64a9dd49370beea737aadf3932f94b /lldb/source/Commands/CommandObjectThread.cpp | |
parent | 9026d4b4887e88cbca40cc1de43ad91005b9c769 (diff) | |
download | bcm5719-llvm-e40e42181fcc0c9742d6fcb654b0e1dee07a2513.tar.gz bcm5719-llvm-e40e42181fcc0c9742d6fcb654b0e1dee07a2513.zip |
Added a way to open the current source file & line in an external editor, and you can turn this on with:
lldb -e
llvm-svn: 112502
Diffstat (limited to 'lldb/source/Commands/CommandObjectThread.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectThread.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp index 1ed9794663f..8d1737b6af7 100644 --- a/lldb/source/Commands/CommandObjectThread.cpp +++ b/lldb/source/Commands/CommandObjectThread.cpp @@ -60,13 +60,21 @@ lldb_private::DisplayThreadInfo // Show one frame with only the first showing source if (show_source) { + bool already_shown = false; + StackFrameSP frame_sp = thread->GetStackFrameAtIndex(0); + SymbolContext frame_sc(frame_sp->GetSymbolContext (eSymbolContextLineEntry)); + if (interpreter.GetDebugger().UseExternalEditor() && frame_sc.line_entry.file && frame_sc.line_entry.line != 0) + { + already_shown = Host::OpenFileInExternalEditor (frame_sc.line_entry.file, frame_sc.line_entry.line); + } + DisplayFramesForExecutionContext (thread, interpreter, strm, 0, // Start at first frame 1, // Number of frames to show false,// Don't show the frame info since we already displayed most of it above... - 1, // Show source for the first frame + !already_shown, // Show source for the first frame 3, // lines of source context before 3); // lines of source context after } |