[Lldb-commits] [lldb] Read and store gnu build id from loaded core file (PR #92492)

via lldb-commits lldb-commits at lists.llvm.org
Wed May 22 08:43:18 PDT 2024


================
@@ -271,6 +282,17 @@ Status ProcessElfCore::DoLoadCore() {
   return error;
 }
 
+void ProcessElfCore::UpdateBuildIdForNTFileEntries() {
+  if (!m_nt_file_entries.empty()) {
----------------
GeorgeHuyubo wrote:

@labath 
There are two reasons,
1. We need to do this after we load PT_LOAD segment, so that we have address map which is essential to ReadMemory. PT_LOAD is usually after PT_NOTE afaik.
2. We need to do this after the core architecture is set, so GetAddressByteSize() will return non zero value.

@kevinfrei 
During the pass, it's parsing the elf header of the core file, during which we don't have the gnu build id in there yet. We need to let the pass finish so that we have the core file loaded into memory, and then we will need to read from certain memory region which represent a loaded module and parse the elf header there to get the gnu build id. 

https://github.com/llvm/llvm-project/pull/92492


More information about the lldb-commits mailing list