hanchenye-llvm-project/lldb
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
..
cmake Patch cmake to allow detection of python 2.7.9+ 2015-12-17 14:13:39 +00:00
docs Include -c, -core in the lldb(1) man page 2015-12-16 15:37:21 +00:00
examples Python 3 - modernize exception catching syntax. 2015-11-03 19:49:05 +00:00
include [ptr-traits] Add an #include to provide the complete type for Section 2015-12-30 03:48:24 +00:00
lib Add more autotools/gmake NetBSD glue 2015-11-15 02:00:09 +00:00
lit Create a check-lldb-unit target to run unit tests. 2015-03-13 20:55:07 +00:00
lldb.xcodeproj Xcode: remove --test-subdir test reduction from previous check-in 2015-12-18 23:22:15 +00:00
lldb.xcworkspace Working on getting the OSX build green 2015-05-12 02:20:27 +00:00
packages/Python/lldbsuite Add support for "source info" and use it to fix MI's -symbol-list-lines. 2016-01-05 19:51:51 +00:00
resources Only export public symbols with the cmake build. 2015-09-04 00:00:41 +00:00
scripts __ne__ is the actual Python operator; __neq__ is a typo 2015-12-18 22:46:58 +00:00
source Add support for "source info" and use it to fix MI's -symbol-list-lines. 2016-01-05 19:51:51 +00:00
test Add a symbolic link from the test directory to the actual - elsewhere located - path that contains the test cases - and teach the test suite driver to resolve paths that contain symbolic links to test cases 2015-12-16 01:15:49 +00:00
third_party/Python/module Put progress.py back, apparently this can't be deleted. 2015-12-09 21:32:28 +00:00
tools Add support for "source info" and use it to fix MI's -symbol-list-lines. 2016-01-05 19:51:51 +00:00
unittests Fix a bug in PythonExceptionState and add unittest coverage. 2015-11-13 01:50:19 +00:00
utils Python 3: Modernize exception raising syntax. 2015-11-03 21:01:45 +00:00
www Document NetBSD platform support on the webpage 2015-12-05 19:41:37 +00:00
.arcconfig
.clang-format Update .clang-format file to support break after return type. 2015-12-28 22:09:29 +00:00
.gitignore remove xcshareddata exclusion from .gitignore; add desktop and lldb-python-testsuite shared schemes used by Xcode buildbot 2015-12-18 22:08:24 +00:00
CMakeLists.txt Fix CMake dependency on lldb.py 2015-11-18 21:09:55 +00:00
CODE_OWNERS.txt Added myself to the CODE_OWNERS.txt list for a few subsystems. 2015-11-09 01:24:36 +00:00
INSTALL.txt Revert the patch to Test Commit Access 2015-07-06 11:26:51 +00:00
LICENSE.TXT
Makefile Allow to override python-config executable name from command line 2015-11-15 01:56:21 +00:00
use_lldb_suite_root.py Preparation for turning lldbsuite into a Python package. 2015-10-27 22:33:47 +00:00