[all-commits] [llvm/llvm-project] 447c92: [lldb] Remove unused imports from crashlog.py

Jonas Devlieghere via All-commits all-commits at lists.llvm.org
Sat May 14 08:59:12 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 447c920a8adfc07f46f61b2a5099ea5b50628645
      https://github.com/llvm/llvm-project/commit/447c920a8adfc07f46f61b2a5099ea5b50628645
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2022-05-14 (Sat, 14 May 2022)

  Changed paths:
    M lldb/examples/python/crashlog.py

  Log Message:
  -----------
  [lldb] Remove unused imports from crashlog.py


  Commit: ae016e4f7c856983420544794c48c4a2feb6c79a
      https://github.com/llvm/llvm-project/commit/ae016e4f7c856983420544794c48c4a2feb6c79a
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2022-05-14 (Sat, 14 May 2022)

  Changed paths:
    M lldb/examples/python/crashlog.py

  Log Message:
  -----------
  [lldb] Don't swallow crashlog exceptions

crashlog.py catches every exception in order to format them. This
results in both the exception name as well as the backtrace getting
swallowed.

Here's an example of the current output:

  error: python exception: in method 'SBTarget_ResolveLoadAddress', argument 2 of type 'lldb::addr_t'

Compare this to the output without the custom exception handling:

  Traceback (most recent call last):
    File "[...]/site-packages/lldb/macosx/crashlog.py", line 929, in __call__
      SymbolicateCrashLogs(debugger, shlex.split(command))
    File "[...]/site-packages/lldb/macosx/crashlog.py", line 1239, in SymbolicateCrashLogs
      SymbolicateCrashLog(crash_log, options)
    File "[...]/site-packages/lldb/macosx/crashlog.py", line 1006, in SymbolicateCrashLog
      thread.dump_symbolicated(crash_log, options)
    File "[...]/site-packages/lldb/macosx/crashlog.py", line 124, in dump_symbolicated
      symbolicated_frame_addresses = crash_log.symbolicate(
    File "[...]/site-packages/lldb/utils/symbolication.py", line 540, in symbolicate
      if symbolicated_address.symbolicate(verbose):
    File "[...]/site-packages/lldb/utils/symbolication.py", line 98, in symbolicate
      sym_ctx = self.get_symbol_context()
    File "[...]/site-packages/lldb/utils/symbolication.py", line 77, in get_symbol_context
      sb_addr = self.resolve_addr()
    File "[...]/site-packages/lldb/utils/symbolication.py", line 69, in resolve_addr
      self.so_addr = self.target.ResolveLoadAddress(self.load_addr)
    File "[...]/site-packages/lldb/__init__.py", line 10675, in ResolveLoadAddress
      return _lldb.SBTarget_ResolveLoadAddress(self, vm_addr)
  OverflowError: in method 'SBTarget_ResolveLoadAddress', argument 2 of type 'lldb::addr_t'

This patch removes the custom exception handling and lets LLDB or the
default exception handler deal with it instead.

Differential revision: https://reviews.llvm.org/D125589


Compare: https://github.com/llvm/llvm-project/compare/9cf17ac04a76...ae016e4f7c85


More information about the All-commits mailing list