[PATCH] D149058: [BPF][DebugInfo] Use .BPF.ext for line info when DWARF is not available

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 10 15:27:24 PDT 2023


MaskRay added a comment.

Sorry for the slow response... Weekly ping is fine if you receive no response. I am reading through this again...

For the summary:

> `$ clang -target bpf -g test.c -o test.o`

Switch to `clang --target=bpf` as `-target ` has been deprecated since Clang 3.4.
Tip: use `arc diff --head=HEAD 'HEAD^' --verbatim` to update the diff as well as rewriting the summary with your local commit message.

> A silly question, who has to check the "Done" box for sub-discussions, author or reviewer?

Tip. The differential author can click "Done" without clicking "Submit". When `arc diff 'HEAD^'` or (to update the summary) `arc diff --head=HEAD 'HEAD^' --verbatim` uploads a new patch, the "Done" states will be sumited.
However, if you make replies to the inline comments, you need to explicitly click "Submit".



================
Comment at: llvm/lib/DebugInfo/BTF/BTFParser.cpp:24
+
+static const char BTFSectionName[] = ".BTF";
+static const char BTFExtSectionName[] = ".BTF.ext";
----------------
const variables in namespace are automatically internal linkage. `static` is not needed.


================
Comment at: llvm/lib/DebugInfo/BTF/BTFParser.cpp:102
+  std::optional<SectionRef> findSection(StringRef Name) {
+    auto It = Sections.find(Name);
+    if (It != Sections.end())
----------------
`return Sections.lookup(Name);`


================
Comment at: llvm/lib/DebugInfo/Symbolize/Symbolize.cpp:623
+  Triple::ArchType Arch = Obj.getArch();
+  if (Arch != Triple::ArchType::bpfel && Arch != Triple::ArchType::bpfeb)
+    return false;
----------------
Use `llvm::Triple::isBPF`


================
Comment at: llvm/test/tools/llvm-objdump/BPF/interleaved-source-test.ll:40
+
+;; Check source code in disassembly:
+
----------------
`;; Check inlined source code in disassembly:`


================
Comment at: llvm/test/tools/llvm-objdump/BPF/interleaved-source-test.ll:44
+; CHECK-EMPTY:
+; CHECK-NEXT: {{[0-9a-f]+}} <foo>:
+; CHECK-NEXT: ;   consume(1);
----------------
We can use `[[#%x,]]`, but the convention is probably to just use `; CHECK-NEXT: <foo>:`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149058



More information about the llvm-commits mailing list