[Lldb-commits] [PATCH] D58405: Make educated guess when constructing module from memory

Alex Langford via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Feb 19 14:10:28 PST 2019

xiaobai marked an inline comment as done.
xiaobai added inline comments.

Comment at: source/Target/Process.cpp:2638-2639
-  ModuleSP module_sp(new Module(file_spec, ArchSpec()));
+  ModuleSP module_sp(new Module(
+      file_spec, GetTarget().GetExecutableModule()->GetArchitecture()));
   if (module_sp) {
clayborg wrote:
> Is the MergeFrom in the first part not enough? I am worried about the case where we don't have even an executable, no one has set the architecture on the target, or worse yet, they have set the wrong architecture on the target. We want to correct the architecture on the target if we didn't specify it or the target was wrong. I am worried if we do this here we might hose up things in those cases.
MergeFrom is not enough. When debugging an android-aarch64 binary, the triple was just set to `aarch64---` for modules constructed from in-memory object files, which is not enough info to do anything meaningful. 

However, thinking about this further, MergeFrom might not even be what we want here. Specifically, this is *just* a guess and the information from the in-memory object file is likely more reliable. It would probably better not to merge but to overwrite when information is available.



More information about the lldb-commits mailing list