[Lldb-commits] [PATCH] D146765: [lldb/crashlog] Load inlined symbol into interactive crashlog

Med Ismail Bennani via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Mar 23 15:28:59 PDT 2023


mib added inline comments.


================
Comment at: lldb/examples/python/crashlog.py:552-557
+                self.symbol_data[image_uuid]["symbols"].append({
+                    "name": json_frame['symbol'],
+                    "type": "code",
+                    "size": 0,
+                    "address": pc,
+                })
----------------
Same problem here I guess: IIUC if `pc = image['base'] + frame_offset`, then I believe `frame_offset` is not the address of the beginning of the function, but rather an address in the middle of the function (either at a callsite, or at the crash site).


================
Comment at: lldb/examples/python/crashlog.py:669
+                             r'(0x[0-9a-fA-F]{4,}) +'               # addr (4 chars or more)
+                             r'((.*)(?:(?: +\+ +)([0-9]+))|[^\s]+)' # symbol + offset
                             )
----------------
@kastiglione may be you have a better idea how to handle `symbol + offset` where ` + offset` might be optional.


================
Comment at: lldb/examples/python/crashlog.py:880
+                    "size": 0,
+                    "address": frame_addr,
+                })
----------------
I'm not sure if I should subtract the offset from the `frame_addr` so the symbol is at the right address.

Currently, the symbol name is `symbol + offset`, so I didn't have to do anything subtraction.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146765



More information about the lldb-commits mailing list