[PATCH] D65832: [llvm-readelf] Implement NT_FILE core file parsing

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 7 01:25:30 PDT 2019


grimar added inline comments.


================
Comment at: llvm/test/tools/llvm-readobj/note-core-ntfile.test:62
+# GNU-NEXT:     0x0000000000007000  0x0000000000008000  0x0000000000009000
+# GNU-NEXT:         [stack]
+
----------------
Perhaps worth to check there is no more output here:

```
# GNU-NOT: {{.}}
```


================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:4339
+    return createStringError(object_error::parse_failed,
+                             "Malformed note - too short for header");
+
----------------
Other errors in this file are lowercase, I think the new errors should follow.


================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:5556
+    return;
+  }
+
----------------
This part is common and can be reused for both LLVM and GNU styles:

```
  if (NoteType != ELF::NT_FILE)
    return;

  Expected<CoreNote<ELFT>> Note = readCoreNote<ELFT>(Desc);
  if (!Note) {
    warn(Note.takeError());
    return;
  }
```

I.e. I would try either add a one more helper or try to combine `printCoreNoteLLVMStyle` and `printCoreNote`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65832/new/

https://reviews.llvm.org/D65832





More information about the llvm-commits mailing list