[Lldb-commits] [PATCH] Update ObjectFileELF to detect ELF triple based on ELF notes and the ELF header.

Ed Maste emaste at freebsd.org
Wed Jun 25 18:35:37 PDT 2014


================
Comment at: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp:1075
@@ -983,1 +1074,3 @@
+        // Process FreeBSD ELF notes.
+        if (note.n_namesz == LLDB_NT_OWNER_FREEBSD_LENGTH && note.n_name == LLDB_NT_OWNER_FREEBSD)
         {
----------------
n_name is a std::string and the length (namesz) should be handled in the note parser so you should be able to just do note.n_name == LLDB_NT_OWNER_FREEBSD, no?

Also for the purpose of this parsing we'll generally have just one case in each of the switch statements - maybe it'd be more concise to just check note.n_type == LLDB_NT_FREEBSD_ABI_TAG in the if() as well?

http://reviews.llvm.org/D4302






More information about the lldb-commits mailing list