[llvm] [llvm-gsymutil] Option --symtab-file to specify a separate binary (PR #79898)

Greg Clayton via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 29 22:24:15 PST 2024


================
@@ -358,7 +363,38 @@ static llvm::Error handleObjectFile(ObjectFile &Obj,
     return Err;
 
   // Get the UUID and convert symbol table to GSYM.
-  if (auto Err = ObjectFileTransformer::convert(Obj, LogOS, Gsym))
+  // Use a separate file for symbol table if specified
+  std::string SymtabFile = SymbolTableFilename;
+  ErrorOr<std::unique_ptr<MemoryBuffer>> SymtabBuffOrErr = nullptr;
+  std::unique_ptr<MemoryBuffer> SymtabBuffer = nullptr;
+  if (!SymtabFile.empty()) {
+    outs() << "Using symbol table file: " << SymbolTableFilename << "\n";
+    SymtabBuffOrErr = MemoryBuffer::getFileOrSTDIN(SymtabFile);
----------------
clayborg wrote:

Use the optional:
```
s/SymtabFile/*SymbolTableFilename/
```

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


More information about the llvm-commits mailing list