Reapply "[NFC][DebugInfo][DWARF] Create new low-level dwarf library (#…
(#145959)
This reapplies cbf781f0bd, with fixes for
the shared-library build and the unconventional sanitizer-runtime build.
Original Description:
This is the culmination of a series of changes described in [1].
Although somewhat large by line count, it is almost entirely mechanical,
creating a new library in DebugInfo/DWARF/LowLevel. This new library has
very minimal dependencies, allowing it to be used from more places than
the normal DebugInfo/DWARF library--in particular from MC.
1.
https://discourse.llvm.org/t/rfc-debuginfo-dwarf-refactor-into-to-lower-and-higher-level-libraries/86665/2
This commit is contained in:
committed by
GitHub
parent
a4be46e0e5
commit
23f1ba3ee4
@@ -36,7 +36,8 @@
|
||||
#include "lldb/Target/StackID.h"
|
||||
#include "lldb/Target/Target.h"
|
||||
#include "lldb/Target/Thread.h"
|
||||
#include "llvm/DebugInfo/DWARF/DWARFExpression.h"
|
||||
#include "llvm/DebugInfo/DWARF/DWARFExpressionPrinter.h"
|
||||
#include "llvm/DebugInfo/DWARF/LowLevel/DWARFExpression.h"
|
||||
|
||||
using namespace lldb;
|
||||
using namespace lldb_private;
|
||||
@@ -81,7 +82,7 @@ void DWARFExpression::DumpLocation(Stream *s, lldb::DescriptionLevel level,
|
||||
llvm::DIDumpOptions DumpOpts;
|
||||
DumpOpts.GetNameForDWARFReg = GetRegName;
|
||||
llvm::DWARFExpression E(m_data.GetAsLLVM(), m_data.GetAddressByteSize());
|
||||
llvm::DWARFExpressionPrinter::print(&E, s->AsRawOstream(), DumpOpts, nullptr);
|
||||
llvm::printDwarfExpression(&E, s->AsRawOstream(), DumpOpts, nullptr);
|
||||
}
|
||||
|
||||
RegisterKind DWARFExpression::GetRegisterKind() const { return m_reg_kind; }
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
#include "lldb/Utility/Log.h"
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
#include "llvm/DebugInfo/DIContext.h"
|
||||
#include "llvm/DebugInfo/DWARF/DWARFExpression.h"
|
||||
#include "llvm/DebugInfo/DWARF/DWARFExpressionPrinter.h"
|
||||
#include "llvm/DebugInfo/DWARF/LowLevel/DWARFExpression.h"
|
||||
#include <optional>
|
||||
|
||||
using namespace lldb;
|
||||
@@ -89,8 +90,7 @@ static void DumpDWARFExpr(Stream &s, llvm::ArrayRef<uint8_t> expr, Thread *threa
|
||||
order_and_width->second);
|
||||
llvm::DWARFExpression E(data, order_and_width->second,
|
||||
llvm::dwarf::DWARF32);
|
||||
llvm::DWARFExpressionPrinter::print(&E, s.AsRawOstream(),
|
||||
llvm::DIDumpOptions(), nullptr);
|
||||
printDwarfExpression(&E, s.AsRawOstream(), llvm::DIDumpOptions(), nullptr);
|
||||
} else
|
||||
s.PutCString("dwarf-expr");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user