[Lldb-commits] [PATCH] D46362: DWARFExpression: Convert file addresses to load addresses early on

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu May 3 02:26:43 PDT 2018

labath added a comment.

One day I'd like us to have a unit testing framework for the dwarf expression evaluator. The evaluator looks like a thing that is both complex enough (so it's worth doing it) and /ought to be/ self-contained enough (so it is doable). Then we could test these, and all other sorts of funny expressions without having to tickle a compiler into producing them.

Comment at: source/Core/Value.cpp:672
+void Value::ConvertToLoadAddress(SymbolContext sc, Target *target) {
+  if (GetValueType() != eValueTypeFileAddress)
You should be able to get the target out of the symbol context.

Comment at: source/Core/Value.cpp:683-685
+  ObjectFile *objfile = sc.module_sp->GetObjectFile();
+  if (!objfile)
+    return;
This is not what the original code was doing, but what do you think about getting the section list directly from the `Module`? The two lists aren't exactly the same, but this distinction should not matter here.
Besides being shorter, this would also make this code work slightly better with object-file-less Modules that Leonard is trying to introduce (D46292 et al.).


More information about the lldb-commits mailing list