[Lldb-commits] [lldb] r311000 - Remove the DWARFExpression -> Clang ExpressionParser dependency
Tamas Berghammer via lldb-commits
lldb-commits at lists.llvm.org
Wed Aug 16 04:45:10 PDT 2017
Author: tberghammer
Date: Wed Aug 16 04:45:10 2017
New Revision: 311000
URL: http://llvm.org/viewvc/llvm-project?rev=311000&view=rev
Log:
Remove the DWARFExpression -> Clang ExpressionParser dependency
It was completly unused and broke the part of the encapsulation that
common code shouldn't depend on specific plugins or language specific
features.
Modified:
lldb/trunk/include/lldb/Expression/DWARFExpression.h
lldb/trunk/source/Core/ValueObjectVariable.cpp
lldb/trunk/source/Expression/DWARFExpression.cpp
lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserGo.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/trunk/source/Symbol/JavaASTContext.cpp
lldb/trunk/source/Target/RegisterContext.cpp
lldb/trunk/source/Target/StackFrame.cpp
Modified: lldb/trunk/include/lldb/Expression/DWARFExpression.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/DWARFExpression.h?rev=311000&r1=310999&r2=311000&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Expression/DWARFExpression.h (original)
+++ lldb/trunk/include/lldb/Expression/DWARFExpression.h Wed Aug 16 04:45:10 2017
@@ -22,10 +22,6 @@ class DWARFCompileUnit;
namespace lldb_private {
-class ClangExpressionDeclMap;
-class ClangExpressionVariable;
-class ClangExpressionVariableList;
-
//----------------------------------------------------------------------
/// @class DWARFExpression DWARFExpression.h "lldb/Expression/DWARFExpression.h"
/// @brief Encapsulates a DWARF location expression and interprets it.
@@ -262,8 +258,6 @@ public:
/// member variables to populate many operands
//------------------------------------------------------------------
bool Evaluate(ExecutionContextScope *exe_scope,
- ClangExpressionVariableList *expr_locals,
- ClangExpressionDeclMap *decl_map,
lldb::addr_t loclist_base_load_addr,
const Value *initial_value_ptr, const Value *object_address_ptr,
Value &result, Status *error_ptr) const;
@@ -272,9 +266,7 @@ public:
/// Wrapper for the static evaluate function that uses member
/// variables to populate many operands
//------------------------------------------------------------------
- bool Evaluate(ExecutionContext *exe_ctx,
- ClangExpressionVariableList *expr_locals,
- ClangExpressionDeclMap *decl_map, RegisterContext *reg_ctx,
+ bool Evaluate(ExecutionContext *exe_ctx, RegisterContext *reg_ctx,
lldb::addr_t loclist_base_load_addr,
const Value *initial_value_ptr, const Value *object_address_ptr,
Value &result, Status *error_ptr) const;
@@ -338,32 +330,14 @@ public:
/// True on success; false otherwise. If error_ptr is non-NULL,
/// details of the failure are provided through it.
//------------------------------------------------------------------
- static bool
- Evaluate(ExecutionContext *exe_ctx, ClangExpressionVariableList *expr_locals,
- ClangExpressionDeclMap *decl_map, RegisterContext *reg_ctx,
- lldb::ModuleSP opcode_ctx, const DataExtractor &opcodes,
- DWARFCompileUnit *dwarf_cu, const lldb::offset_t offset,
- const lldb::offset_t length, const lldb::RegisterKind reg_set,
- const Value *initial_value_ptr, const Value *object_address_ptr,
- Value &result, Status *error_ptr);
-
- //------------------------------------------------------------------
- /// Loads a ClangExpressionVariableList into the object
- ///
- /// @param[in] locals
- /// If non-NULL, the list of locals used by this expression.
- /// See Evaluate().
- //------------------------------------------------------------------
- void SetExpressionLocalVariableList(ClangExpressionVariableList *locals);
-
- //------------------------------------------------------------------
- /// Loads a ClangExpressionDeclMap into the object
- ///
- /// @param[in] locals
- /// If non-NULL, the list of external variables used by this
- /// expression. See Evaluate().
- //------------------------------------------------------------------
- void SetExpressionDeclMap(ClangExpressionDeclMap *decl_map);
+ static bool Evaluate(ExecutionContext *exe_ctx, RegisterContext *reg_ctx,
+ lldb::ModuleSP opcode_ctx, const DataExtractor &opcodes,
+ DWARFCompileUnit *dwarf_cu, const lldb::offset_t offset,
+ const lldb::offset_t length,
+ const lldb::RegisterKind reg_set,
+ const Value *initial_value_ptr,
+ const Value *object_address_ptr, Value &result,
+ Status *error_ptr);
bool GetExpressionData(DataExtractor &data) const {
data = m_data;
Modified: lldb/trunk/source/Core/ValueObjectVariable.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectVariable.cpp?rev=311000&r1=310999&r2=311000&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObjectVariable.cpp (original)
+++ lldb/trunk/source/Core/ValueObjectVariable.cpp Wed Aug 16 04:45:10 2017
@@ -156,9 +156,8 @@ bool ValueObjectVariable::UpdateValue()
target);
}
Value old_value(m_value);
- if (expr.Evaluate(&exe_ctx, nullptr, nullptr, nullptr,
- loclist_base_load_addr, nullptr, nullptr, m_value,
- &m_error)) {
+ if (expr.Evaluate(&exe_ctx, nullptr, loclist_base_load_addr, nullptr,
+ nullptr, m_value, &m_error)) {
m_resolved_value = m_value;
m_value.SetContext(Value::eContextTypeVariable, variable);
Modified: lldb/trunk/source/Expression/DWARFExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/DWARFExpression.cpp?rev=311000&r1=310999&r2=311000&view=diff
==============================================================================
--- lldb/trunk/source/Expression/DWARFExpression.cpp (original)
+++ lldb/trunk/source/Expression/DWARFExpression.cpp Wed Aug 16 04:45:10 2017
@@ -24,9 +24,6 @@
#include "lldb/Utility/StreamString.h"
#include "lldb/Utility/VMRange.h"
-#include "Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h"
-#include "Plugins/ExpressionParser/Clang/ClangExpressionVariable.h"
-
#include "lldb/Host/Host.h"
#include "lldb/Utility/Endian.h"
@@ -1245,23 +1242,21 @@ bool DWARFExpression::DumpLocationForAdd
}
bool DWARFExpression::Evaluate(ExecutionContextScope *exe_scope,
- ClangExpressionVariableList *expr_locals,
- ClangExpressionDeclMap *decl_map,
lldb::addr_t loclist_base_load_addr,
const Value *initial_value_ptr,
const Value *object_address_ptr, Value &result,
Status *error_ptr) const {
ExecutionContext exe_ctx(exe_scope);
- return Evaluate(&exe_ctx, expr_locals, decl_map, nullptr,
- loclist_base_load_addr, initial_value_ptr, object_address_ptr,
- result, error_ptr);
+ return Evaluate(&exe_ctx, nullptr, loclist_base_load_addr, initial_value_ptr,
+ object_address_ptr, result, error_ptr);
}
-bool DWARFExpression::Evaluate(
- ExecutionContext *exe_ctx, ClangExpressionVariableList *expr_locals,
- ClangExpressionDeclMap *decl_map, RegisterContext *reg_ctx,
- lldb::addr_t loclist_base_load_addr, const Value *initial_value_ptr,
- const Value *object_address_ptr, Value &result, Status *error_ptr) const {
+bool DWARFExpression::Evaluate(ExecutionContext *exe_ctx,
+ RegisterContext *reg_ctx,
+ lldb::addr_t loclist_base_load_addr,
+ const Value *initial_value_ptr,
+ const Value *object_address_ptr, Value &result,
+ Status *error_ptr) const {
ModuleSP module_sp = m_module_wp.lock();
if (IsLocationList()) {
@@ -1307,9 +1302,9 @@ bool DWARFExpression::Evaluate(
if (length > 0 && lo_pc <= pc && pc < hi_pc) {
return DWARFExpression::Evaluate(
- exe_ctx, expr_locals, decl_map, reg_ctx, module_sp, m_data,
- m_dwarf_cu, offset, length, m_reg_kind, initial_value_ptr,
- object_address_ptr, result, error_ptr);
+ exe_ctx, reg_ctx, module_sp, m_data, m_dwarf_cu, offset, length,
+ m_reg_kind, initial_value_ptr, object_address_ptr, result,
+ error_ptr);
}
offset += length;
}
@@ -1321,14 +1316,12 @@ bool DWARFExpression::Evaluate(
// Not a location list, just a single expression.
return DWARFExpression::Evaluate(
- exe_ctx, expr_locals, decl_map, reg_ctx, module_sp, m_data, m_dwarf_cu, 0,
- m_data.GetByteSize(), m_reg_kind, initial_value_ptr, object_address_ptr,
- result, error_ptr);
+ exe_ctx, reg_ctx, module_sp, m_data, m_dwarf_cu, 0, m_data.GetByteSize(),
+ m_reg_kind, initial_value_ptr, object_address_ptr, result, error_ptr);
}
bool DWARFExpression::Evaluate(
- ExecutionContext *exe_ctx, ClangExpressionVariableList *expr_locals,
- ClangExpressionDeclMap *decl_map, RegisterContext *reg_ctx,
+ ExecutionContext *exe_ctx, RegisterContext *reg_ctx,
lldb::ModuleSP module_sp, const DataExtractor &opcodes,
DWARFCompileUnit *dwarf_cu, const lldb::offset_t opcodes_offset,
const lldb::offset_t opcodes_length, const lldb::RegisterKind reg_kind,
Modified: lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp?rev=311000&r1=310999&r2=311000&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp Wed Aug 16 04:45:10 2017
@@ -1517,8 +1517,8 @@ RegisterContextLLDB::SavedLocationForReg
dwarfexpr.SetRegisterKind(unwindplan_registerkind);
Value result;
Status error;
- if (dwarfexpr.Evaluate(&exe_ctx, nullptr, nullptr, this, 0, nullptr,
- nullptr, result, &error)) {
+ if (dwarfexpr.Evaluate(&exe_ctx, this, 0, nullptr, nullptr, result,
+ &error)) {
addr_t val;
val = result.GetScalar().ULongLong();
if (unwindplan_regloc.IsDWARFExpression()) {
@@ -1827,8 +1827,8 @@ bool RegisterContextLLDB::ReadCFAValueFo
dwarfexpr.SetRegisterKind(row_register_kind);
Value result;
Status error;
- if (dwarfexpr.Evaluate(&exe_ctx, nullptr, nullptr, this, 0, nullptr,
- nullptr, result, &error)) {
+ if (dwarfexpr.Evaluate(&exe_ctx, this, 0, nullptr, nullptr, result,
+ &error)) {
cfa_value = result.GetScalar().ULongLong();
UnwindLogMsg("CFA value set by DWARF expression is 0x%" PRIx64,
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp?rev=311000&r1=310999&r2=311000&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp Wed Aug 16 04:45:10 2017
@@ -2741,8 +2741,6 @@ bool DWARFASTParserClang::ParseChildMemb
form_value.BlockData() - debug_info_data.GetDataStart();
if (DWARFExpression::Evaluate(
nullptr, // ExecutionContext *
- nullptr, // ClangExpressionVariableList *
- nullptr, // ClangExpressionDeclMap *
nullptr, // RegisterContext *
module_sp, debug_info_data, die.GetCU(), block_offset,
block_length, eRegisterKindDWARF, &initialValue,
@@ -3214,11 +3212,11 @@ bool DWARFASTParserClang::ParseChildMemb
uint32_t block_length = form_value.Unsigned();
uint32_t block_offset =
form_value.BlockData() - debug_info_data.GetDataStart();
- if (DWARFExpression::Evaluate(
- nullptr, nullptr, nullptr, nullptr, module_sp,
- debug_info_data, die.GetCU(), block_offset,
- block_length, eRegisterKindDWARF, &initialValue,
- nullptr, memberOffset, nullptr)) {
+ if (DWARFExpression::Evaluate(nullptr, nullptr, module_sp,
+ debug_info_data, die.GetCU(),
+ block_offset, block_length,
+ eRegisterKindDWARF, &initialValue,
+ nullptr, memberOffset, nullptr)) {
member_byte_offset = memberOffset.ResolveValue(NULL).UInt();
}
} else {
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserGo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserGo.cpp?rev=311000&r1=310999&r2=311000&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserGo.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserGo.cpp Wed Aug 16 04:45:10 2017
@@ -662,8 +662,6 @@ size_t DWARFASTParserGo::ParseChildMembe
form_value.BlockData() - debug_info_data.GetDataStart();
if (DWARFExpression::Evaluate(
NULL, // ExecutionContext *
- NULL, // ClangExpressionVariableList *
- NULL, // ClangExpressionDeclMap *
NULL, // RegisterContext *
module_sp, debug_info_data, die.GetCU(), block_offset,
block_length, eRegisterKindDWARF, &initialValue, NULL,
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=311000&r1=310999&r2=311000&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Wed Aug 16 04:45:10 2017
@@ -1669,9 +1669,8 @@ SymbolFileDWARF::GlobalVariableMap &Symb
const DWARFExpression &location = var_sp->LocationExpression();
Value location_result;
Status error;
- if (location.Evaluate(nullptr, nullptr, nullptr,
- LLDB_INVALID_ADDRESS, nullptr, nullptr,
- location_result, &error)) {
+ if (location.Evaluate(nullptr, LLDB_INVALID_ADDRESS, nullptr,
+ nullptr, location_result, &error)) {
if (location_result.GetValueType() ==
Value::eValueTypeFileAddress) {
lldb::addr_t file_addr =
Modified: lldb/trunk/source/Symbol/JavaASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/JavaASTContext.cpp?rev=311000&r1=310999&r2=311000&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/JavaASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/JavaASTContext.cpp Wed Aug 16 04:45:10 2017
@@ -134,9 +134,9 @@ public:
obj_load_address.SetValueType(Value::eValueTypeLoadAddress);
Value result;
- if (m_dynamic_type_id.Evaluate(exe_ctx->GetBestExecutionContextScope(),
- nullptr, nullptr, 0, &obj_load_address,
- nullptr, result, nullptr)) {
+ if (m_dynamic_type_id.Evaluate(exe_ctx->GetBestExecutionContextScope(), 0,
+ &obj_load_address, nullptr, result,
+ nullptr)) {
Status error;
lldb::addr_t type_id_addr = result.GetScalar().UInt();
@@ -315,9 +315,8 @@ public:
ExecutionContextScope *exec_ctx_scope = value_obj->GetExecutionContextRef()
.Lock(true)
.GetBestExecutionContextScope();
- if (m_length_expression.Evaluate(exec_ctx_scope, nullptr, nullptr, 0,
- nullptr, &obj_load_address, result,
- nullptr))
+ if (m_length_expression.Evaluate(exec_ctx_scope, 0, nullptr,
+ &obj_load_address, result, nullptr))
return result.GetScalar().UInt();
return UINT32_MAX;
Modified: lldb/trunk/source/Target/RegisterContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/RegisterContext.cpp?rev=311000&r1=310999&r2=311000&view=diff
==============================================================================
--- lldb/trunk/source/Target/RegisterContext.cpp (original)
+++ lldb/trunk/source/Target/RegisterContext.cpp Wed Aug 16 04:45:10 2017
@@ -93,10 +93,9 @@ RegisterContext::UpdateDynamicRegisterSi
Value result;
Status error;
const lldb::offset_t offset = 0;
- if (dwarf_expr.Evaluate(&exe_ctx, nullptr, nullptr, this, opcode_ctx,
- dwarf_data, nullptr, offset, dwarf_opcode_len,
- eRegisterKindDWARF, nullptr, nullptr, result,
- &error)) {
+ if (dwarf_expr.Evaluate(&exe_ctx, this, opcode_ctx, dwarf_data, nullptr,
+ offset, dwarf_opcode_len, eRegisterKindDWARF, nullptr,
+ nullptr, result, &error)) {
expr_result = result.GetScalar().SInt(-1);
switch (expr_result) {
case 0:
Modified: lldb/trunk/source/Target/StackFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/StackFrame.cpp?rev=311000&r1=310999&r2=311000&view=diff
==============================================================================
--- lldb/trunk/source/Target/StackFrame.cpp (original)
+++ lldb/trunk/source/Target/StackFrame.cpp Wed Aug 16 04:45:10 2017
@@ -1089,8 +1089,8 @@ bool StackFrame::GetFrameBaseValue(Scala
exe_ctx.GetTargetPtr());
if (m_sc.function->GetFrameBaseExpression().Evaluate(
- &exe_ctx, nullptr, nullptr, nullptr, loclist_base_addr, nullptr,
- nullptr, expr_value, &m_frame_base_error) == false) {
+ &exe_ctx, nullptr, loclist_base_addr, nullptr, nullptr,
+ expr_value, &m_frame_base_error) == false) {
// We should really have an error if evaluate returns, but in case
// we don't, lets set the error to something at least.
if (m_frame_base_error.Success())
More information about the lldb-commits
mailing list