Skip to content

Commit

Permalink
[DWARF} Use LLVM's debug line parser in LLDB.
Browse files Browse the repository at this point in the history
The line number table header was substantially revised in DWARF 5 and is
not fully supported by LLDB's current debug line implementation.

This patch replaces the LLDB debug line parser with its counterpart in
LLVM. This was possible because of the limited contact surface between
the code to parse the DWARF debug line section and the rest of LLDB.

We pay a small cost in terms of performance and memory usage. This is
something we plan to address in the near future.

Differential revision: https://reviews.llvm.org/D62570

llvm-svn: 368742
  • Loading branch information
JDevlieghere committed Aug 13, 2019
1 parent bddab07 commit 2353393
Show file tree
Hide file tree
Showing 7 changed files with 187 additions and 1,210 deletions.
8 changes: 6 additions & 2 deletions lldb/include/lldb/Core/FileSpecList.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ class Stream;
/// A class that contains a mutable list of FileSpec objects.
class FileSpecList {
public:
typedef std::vector<FileSpec> collection;
typedef collection::const_iterator const_iterator;

/// Default constructor.
///
/// Initialize this object with an empty file list.
Expand Down Expand Up @@ -191,9 +194,10 @@ class FileSpecList {
static size_t GetFilesMatchingPartialPath(const char *path, bool dir_okay,
FileSpecList &matches);

const_iterator begin() const { return m_files.begin(); }
const_iterator end() const { return m_files.end(); }

protected:
typedef std::vector<FileSpec>
collection; ///< The collection type for the file list.
collection m_files; ///< A collection of FileSpec objects.
};

Expand Down
2 changes: 2 additions & 0 deletions lldb/include/lldb/Symbol/CompileUnit.h
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,8 @@ class CompileUnit : public std::enable_shared_from_this<CompileUnit>,
/// A line table object pointer that this object now owns.
void SetLineTable(LineTable *line_table);

void SetSupportFiles(const FileSpecList &support_files);

void SetDebugMacros(const DebugMacrosSP &debug_macros);

/// Set accessor for the variable list.
Expand Down
1 change: 0 additions & 1 deletion lldb/source/Plugins/SymbolFile/DWARF/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ add_lldb_library(lldbPluginSymbolFileDWARF PLUGIN
DWARFDebugArangeSet.cpp
DWARFDebugInfo.cpp
DWARFDebugInfoEntry.cpp
DWARFDebugLine.cpp
DWARFDebugMacro.cpp
DWARFDebugRanges.cpp
DWARFDeclContext.cpp
Expand Down
Loading

0 comments on commit 2353393

Please sign in to comment.