aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuliano Procida <gprocida@google.com>2023-12-12 17:42:45 +0000
committerGiuliano Procida <gprocida@google.com>2023-12-13 11:25:51 +0000
commit4d5423fcffc43ed2969742f6d75a4c437ead3578 (patch)
tree4b1ace63cba3edf8f6528cb7022dda035f9165ec
parentd2a7fe78605e039e97837de6b169b530d2ebee5e (diff)
downloadstg-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.cc11
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) {