llvm-project/lldb/source/Commands
Dawn Perchik 954b40bf63 Add support for "source info" and use it to fix MI's -symbol-list-lines.
This patch adds support the command 'source info' as follows:
    (lldb) help source info
         Display source line information (as specified) based on the current executable's
         debug info.
    
    Syntax: source info <cmd-options>
    
    Command Options Usage:
      source info [-c <count>] [-s <shlib-name>] [-f <filename>] [-l <linenum>] [-e <linenum>]
      source info [-c <count>] [-s <shlib-name>] [-n <symbol>]
      source info [-c <count>] [-a <address-expression>]
    
           -a <address-expression> ( --address <address-expression> )
                Lookup the address and display the source information for the corresponding
                file and line.
    
           -c <count> ( --count <count> )
                The number of line entries to display.
    
           -e <linenum> ( --end-line <linenum> )
                The line number at which to stop displaying lines.
    
           -f <filename> ( --file <filename> )
                The file from which to display source.
    
           -l <linenum> ( --line <linenum> )
                The line number at which to start the displaying lines.
    
           -n <symbol> ( --name <symbol> )
                The name of a function whose source to display.
    
           -s <shlib-name> ( --shlib <shlib-name> )
                Look up the source in the given module or shared library (can be specified
                more than once).
For example:
    (lldb) source info --file x.h
    Lines for file x.h in compilation unit x.cpp in `x
    [0x0000000100000d00-0x0000000100000d10): /Users/dawn/tmp/./x.h:10
    [0x0000000100000d10-0x0000000100000d1b): /Users/dawn/tmp/./x.h:10

The new options are used to fix the MI command:
    -symbol-list-lines <file>
which didn't work for header files because it called:
    target modules dump line-table <file>
which only dumps line tables for a compilation unit.

The patch also fixes a bug in the error reporting when no files were supplied to the command. Previously you'd get:
    (lldb) target modules dump line-table
    error:
    Syntax:
    error: no source filenames matched any command arguments
Now you get:
    error: file option must be specified.

Reviewed by: clayborg, jingham, ki.stfu
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D15593

llvm-svn: 256863
2016-01-05 19:51:51 +00:00
..
CMakeLists.txt [cmake] Remove LLVM_NO_RTTI. 2015-09-03 08:46:55 +00:00
CommandCompletions.cpp Don't #include "lldb-python.h" from anywhere. 2015-05-29 17:41:47 +00:00
CommandObjectApropos.cpp Don't #include "lldb-python.h" from anywhere. 2015-05-29 17:41:47 +00:00
CommandObjectApropos.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectArgs.cpp TypeSystem is now a plugin interface and removed any "ClangASTContext &Class::GetClangASTContext()" functions. 2015-09-17 22:23:34 +00:00
CommandObjectArgs.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectBreakpoint.cpp Add the ability (through the SB API & command line) to specify an address 2015-11-17 03:39:13 +00:00
CommandObjectBreakpoint.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectBreakpointCommand.cpp commands: Use override instead of virtual. 2015-10-07 16:56:17 +00:00
CommandObjectBreakpointCommand.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectBugreport.cpp commands: Use override instead of virtual. 2015-10-07 16:56:17 +00:00
CommandObjectBugreport.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectCommands.cpp commands: Use override instead of virtual. 2015-10-07 16:56:17 +00:00
CommandObjectCommands.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectDisassemble.cpp Change the (internal to this file only) enum names from gcc_ to 2015-09-04 03:40:29 +00:00
CommandObjectDisassemble.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectExpression.cpp Added support to the expression command for dropping into the REPL at will. 2015-10-20 00:55:21 +00:00
CommandObjectExpression.h Added support to the expression command for dropping into the REPL at will. 2015-10-20 00:55:21 +00:00
CommandObjectFrame.cpp Improve error handling for `frame select` command when there are too many arguments. 2015-12-22 16:50:28 +00:00
CommandObjectFrame.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectGUI.cpp Don't #include "lldb-python.h" from anywhere. 2015-05-29 17:41:47 +00:00
CommandObjectGUI.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectHelp.cpp Don't #include "lldb-python.h" from anywhere. 2015-05-29 17:41:47 +00:00
CommandObjectHelp.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectLanguage.cpp Remove the list of all languages in the help for "help language" since 2015-09-03 01:13:26 +00:00
CommandObjectLanguage.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectLog.cpp commands: Use override instead of virtual. 2015-10-07 16:56:17 +00:00
CommandObjectLog.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectMemory.cpp Fix TestMemoryRead after r252035 2015-11-04 19:32:01 +00:00
CommandObjectMemory.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectMultiword.cpp CommandObjectProxy needs to proxy GenerateHelpText as well as 2015-11-05 01:18:07 +00:00
CommandObjectPlatform.cpp Modify "platform connect" to connect to processes as well 2015-12-08 14:08:19 +00:00
CommandObjectPlatform.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectPlugin.cpp commands: Use override instead of virtual. 2015-10-07 16:56:17 +00:00
CommandObjectPlugin.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectProcess.cpp Modify "platform connect" to connect to processes as well 2015-12-08 14:08:19 +00:00
CommandObjectProcess.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectQuit.cpp Don't #include "lldb-python.h" from anywhere. 2015-05-29 17:41:47 +00:00
CommandObjectQuit.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectRegister.cpp commands: Use override instead of virtual. 2015-10-07 16:56:17 +00:00
CommandObjectRegister.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectSettings.cpp commands: Use override instead of virtual. 2015-10-07 16:56:17 +00:00
CommandObjectSettings.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectSource.cpp Add support for "source info" and use it to fix MI's -symbol-list-lines. 2016-01-05 19:51:51 +00:00
CommandObjectSource.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectSyntax.cpp Don't #include "lldb-python.h" from anywhere. 2015-05-29 17:41:47 +00:00
CommandObjectSyntax.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectTarget.cpp Add support for "source info" and use it to fix MI's -symbol-list-lines. 2016-01-05 19:51:51 +00:00
CommandObjectTarget.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectThread.cpp When constructing an address range to "step" or "next" through, 2015-12-15 00:40:30 +00:00
CommandObjectThread.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectType.cpp [Commands] Get rid of unused typedefs. 2016-01-04 19:12:25 +00:00
CommandObjectType.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectVersion.cpp Don't #include "lldb-python.h" from anywhere. 2015-05-29 17:41:47 +00:00
CommandObjectVersion.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectWatchpoint.cpp commands: Use override instead of virtual. 2015-10-07 16:56:17 +00:00
CommandObjectWatchpoint.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
CommandObjectWatchpointCommand.cpp commands: Use override instead of virtual. 2015-10-07 16:56:17 +00:00
CommandObjectWatchpointCommand.h Fix Clang-tidy misc-use-override warnings in source/Commands headers, unify closing inclusion guards 2015-09-02 09:33:09 +00:00
Makefile Fix a few more clang (3.2) warnings on Linux: 2012-12-07 22:21:08 +00:00