diff options
author | Giuliano Procida <gprocida@google.com> | 2023-12-12 17:42:45 +0000 |
---|---|---|
committer | Giuliano Procida <gprocida@google.com> | 2023-12-13 11:25:51 +0000 |
commit | 4d5423fcffc43ed2969742f6d75a4c437ead3578 (patch) | |
tree | 4b1ace63cba3edf8f6528cb7022dda035f9165ec | |
parent | d2a7fe78605e039e97837de6b169b530d2ebee5e (diff) | |
download | stg-4d5423fcffc43ed2969742f6d75a4c437ead3578.tar.gz |
DWARF processor: add DIE context to exceptions
```
$ stg --elf tls.o
dwarf_getlocation returned empty expression
processing DIE 0x23
processing DIE 0xc
```
PiperOrigin-RevId: 590237411
Change-Id: I2d3b1f875ec3bc0d02833ec583e90812294d6f5b
-rw-r--r-- | dwarf_processor.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/dwarf_processor.cc b/dwarf_processor.cc index 7f91653..48d6e26 100644 --- a/dwarf_processor.cc +++ b/dwarf_processor.cc @@ -301,6 +301,17 @@ class Processor { private: void Process(Entry& entry) { + try { + return ProcessInternal(entry); + } catch (Exception& e) { + std::ostringstream os; + os << "processing DIE " << Hex(entry.GetOffset()); + e.Add(os.str()); + throw; + } + } + + void ProcessInternal(Entry& entry) { ++result_.processed_entries; auto tag = entry.GetTag(); switch (tag) { |