<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">One issue after looking closer at the code is you didn't specify you wanted the target filled in when calling:<div class=""><br class=""></div><div class="">auto sc = frame->GetSymbolContext(eSymbolContextFunction);<br class=""><div><br class=""></div><div><br class=""></div><div>It should be:</div><div><br class=""></div><div>auto sc = frame->GetSymbolContext(<span style="font-size: 11px; background-color: rgb(255, 255, 255);" class="">eSymbolContextTarget | </span><span style="font-size: 11px; background-color: rgb(255, 255, 255);" class="">eSymbolContextModule | </span><span style="font-size: 11px; background-color: rgb(255, 255, 255);" class="">eSymbolContextCompUnit | </span>eSymbolContextFunction);</div><div><br class=""></div><div>I also doubt that "variable->CalculateSymbolContext(&var_sc);" fills in the target correctly. You can manually fill the target and module in if needed.</div><div><br class=""></div><div><br class=""></div><div><br class=""></div><div><br class=""></div><div><blockquote type="cite" class=""><div class="">On May 3, 2018, at 1:19 PM, Adrian Prantl via lldb-commits <<a href="mailto:lldb-commits@lists.llvm.org" class="">lldb-commits@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Author: adrian<br class="">Date: Thu May 3 13:19:39 2018<br class="">New Revision: 331480<br class=""><br class="">URL: <a href="http://llvm.org/viewvc/llvm-project?rev=331480&view=rev" class="">http://llvm.org/viewvc/llvm-project?rev=331480&view=rev</a><br class="">Log:<br class="">Revert "DWARFExpression: Convert file addresses to load addresses early on."<br class=""><br class="">This reverts commit 331462 while investigating bot breakage.<br class=""><br class="">Modified:<br class=""> lldb/trunk/include/lldb/Core/Value.h<br class=""> lldb/trunk/source/Core/Value.cpp<br class=""> lldb/trunk/source/Core/ValueObjectVariable.cpp<br class=""> lldb/trunk/source/Expression/DWARFExpression.cpp<br class=""><br class="">Modified: lldb/trunk/include/lldb/Core/Value.h<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Value.h?rev=331480&r1=331479&r2=331480&view=diff" class="">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Value.h?rev=331480&r1=331479&r2=331480&view=diff</a><br class="">==============================================================================<br class="">--- lldb/trunk/include/lldb/Core/Value.h (original)<br class="">+++ lldb/trunk/include/lldb/Core/Value.h Thu May 3 13:19:39 2018<br class="">@@ -228,9 +228,6 @@ public:<br class=""><br class=""> static const char *GetContextTypeAsCString(ContextType context_type);<br class=""><br class="">- /// Convert this value's file address to a load address, if possible.<br class="">- void ConvertToLoadAddress(SymbolContext sc);<br class="">-<br class=""> bool GetData(DataExtractor &data);<br class=""><br class=""> void Clear();<br class=""><br class="">Modified: lldb/trunk/source/Core/Value.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Value.cpp?rev=331480&r1=331479&r2=331480&view=diff" class="">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Value.cpp?rev=331480&r1=331479&r2=331480&view=diff</a><br class="">==============================================================================<br class="">--- lldb/trunk/source/Core/Value.cpp (original)<br class="">+++ lldb/trunk/source/Core/Value.cpp Thu May 3 13:19:39 2018<br class="">@@ -669,28 +669,6 @@ const char *Value::GetContextTypeAsCStri<br class=""> return "???";<br class=""> }<br class=""><br class="">-void Value::ConvertToLoadAddress(SymbolContext sc) {<br class="">- if (GetValueType() != eValueTypeFileAddress)<br class="">- return;<br class="">-<br class="">- if (!sc.module_sp)<br class="">- return;<br class="">-<br class="">- lldb::addr_t file_addr = GetScalar().ULongLong(LLDB_INVALID_ADDRESS);<br class="">- if (file_addr == LLDB_INVALID_ADDRESS)<br class="">- return;<br class="">-<br class="">- Address so_addr;<br class="">- if (!sc.module_sp->ResolveFileAddress(file_addr, so_addr))<br class="">- return;<br class="">- lldb::addr_t load_addr = so_addr.GetLoadAddress(sc.target_sp.get());<br class="">- if (load_addr == LLDB_INVALID_ADDRESS)<br class="">- return;<br class="">-<br class="">- SetValueType(Value::eValueTypeLoadAddress);<br class="">- GetScalar() = load_addr;<br class="">-}<br class="">-<br class=""> ValueList::ValueList(const ValueList &rhs) { m_values = rhs.m_values; }<br class=""><br class=""> const ValueList &ValueList::operator=(const ValueList &rhs) {<br class=""><br class="">Modified: lldb/trunk/source/Core/ValueObjectVariable.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectVariable.cpp?rev=331480&r1=331479&r2=331480&view=diff" class="">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObjectVariable.cpp?rev=331480&r1=331479&r2=331480&view=diff</a><br class="">==============================================================================<br class="">--- lldb/trunk/source/Core/ValueObjectVariable.cpp (original)<br class="">+++ lldb/trunk/source/Core/ValueObjectVariable.cpp Thu May 3 13:19:39 2018<br class="">@@ -236,9 +236,23 @@ bool ValueObjectVariable::UpdateValue()<br class=""><br class=""> // If we have a file address, convert it to a load address if we can.<br class=""> if (value_type == Value::eValueTypeFileAddress && process_is_alive) {<br class="">- SymbolContext var_sc;<br class="">- variable->CalculateSymbolContext(&var_sc);<br class="">- m_value.ConvertToLoadAddress(var_sc);<br class="">+ lldb::addr_t file_addr =<br class="">+ m_value.GetScalar().ULongLong(LLDB_INVALID_ADDRESS);<br class="">+ if (file_addr != LLDB_INVALID_ADDRESS) {<br class="">+ SymbolContext var_sc;<br class="">+ variable->CalculateSymbolContext(&var_sc);<br class="">+ if (var_sc.module_sp) {<br class="">+ ObjectFile *objfile = var_sc.module_sp->GetObjectFile();<br class="">+ if (objfile) {<br class="">+ Address so_addr(file_addr, objfile->GetSectionList());<br class="">+ lldb::addr_t load_addr = so_addr.GetLoadAddress(target);<br class="">+ if (load_addr != LLDB_INVALID_ADDRESS) {<br class="">+ m_value.SetValueType(Value::eValueTypeLoadAddress);<br class="">+ m_value.GetScalar() = load_addr;<br class="">+ }<br class="">+ }<br class="">+ }<br class="">+ }<br class=""> }<br class=""><br class=""> if (!CanProvideValue()) {<br class=""><br class="">Modified: lldb/trunk/source/Expression/DWARFExpression.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/DWARFExpression.cpp?rev=331480&r1=331479&r2=331480&view=diff" class="">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/DWARFExpression.cpp?rev=331480&r1=331479&r2=331480&view=diff</a><br class="">==============================================================================<br class="">--- lldb/trunk/source/Expression/DWARFExpression.cpp (original)<br class="">+++ lldb/trunk/source/Expression/DWARFExpression.cpp Thu May 3 13:19:39 2018<br class="">@@ -1379,13 +1379,10 @@ bool DWARFExpression::Evaluate(<br class=""> // The DW_OP_addr operation has a single operand that encodes a machine<br class=""> // address and whose size is the size of an address on the target machine.<br class=""> //----------------------------------------------------------------------<br class="">- case DW_OP_addr: {<br class="">+ case DW_OP_addr:<br class=""> stack.push_back(Scalar(opcodes.GetAddress(&offset)));<br class=""> stack.back().SetValueType(Value::eValueTypeFileAddress);<br class="">- auto sc = frame->GetSymbolContext(eSymbolContextFunction);<br class="">- stack.back().ConvertToLoadAddress(sc);<br class=""> break;<br class="">- }<br class=""><br class=""> //----------------------------------------------------------------------<br class=""> // The DW_OP_addr_sect_offset4 is used for any location expressions in<br class=""><br class=""><br class="">_______________________________________________<br class="">lldb-commits mailing list<br class=""><a href="mailto:lldb-commits@lists.llvm.org" class="">lldb-commits@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits<br class=""></div></div></blockquote></div><br class=""></div></body></html>