[Lldb-commits] [PATCH] D15593: Enhance "target modules dump line <file>" and use it to fix MI's -symbol-list-lines.

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Thu Dec 17 11:30:05 PST 2015


clayborg added a comment.

Ok, so I talked with Jim on this and this is what we came up with. I would like to see no changes made to the "target modules dump line-table" command. It is dumping complete line tables. This command is not for "find any line entries that match this file anywhere including inline references". We should make this new command into "source info". Its syntax will be:

source info --file <file> [--line <line>] [--module <module]

line is optional. This job of this command is to find all line entries that match the file and optional line and optionally look only in the modules that might have been specified (might be more than one). --file and --line can only be specified once, --module can be specified multiple times.

The functionality that you reproduced in DumpFileLines() should be replaced. This is the code that looks through all compile units and finds the line entries that is contained in:

  else if (compile_unit_only == false && explicit_matches_only == true && show_raw==false)

should be replaced with a call to:

  uint32_t
  CompileUnit::ResolveSymbolContext
  (
      const FileSpec& file_spec,
      uint32_t line,
      bool check_inlines,
      bool exact,
      uint32_t resolve_scope,
      SymbolContextList &sc_list
  )

As this already does exactly what you are doing. We will need to modify CompileUnit::ResolveSymbolContext() to accept the "line" argument being zero. It will return an "sc_list" of all matches, inside each symbol context will be the LineEntry that you need.


Repository:
  rL LLVM

http://reviews.llvm.org/D15593





More information about the lldb-commits mailing list