[Lldb-commits] [PATCH] D80680: save_crashlog should not be using the load_addr property of an SBAddress

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed May 27 18:02:20 PDT 2020


jingham created this revision.
jingham added a reviewer: clayborg.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.
friss accepted this revision.
friss added a comment.
This revision is now accepted and ready to land.

Thanks for adding a test! this LGTM


The load_addr property relies on there being a variable called "target" in the current module.  It is explicitly marked only to be used in the interactive interpreter, and not in commands.

We used to be sloppy about leaving lldb.target sitting around in the script interpreter between uses of the interactive interpreter, so this mostly worked (unless the current target the last time you used the script interpreter wasn't the current target when you ran the command...)

But Jonas cleaned that up a little while ago.  That uncovered the bug in save_crashlog.

I added a quick test.  You could definitely do more rigorous testing of the output here, but this is better than the previous nothing, and what I have time for.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80680

Files:
  lldb/examples/python/crashlog.py
  lldb/test/API/macosx/save_crashlog/Makefile
  lldb/test/API/macosx/save_crashlog/TestSaveCrashlog.py
  lldb/test/API/macosx/save_crashlog/main.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80680.266709.patch
Type: text/x-patch
Size: 4382 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200528/e3687275/attachment.bin>


More information about the lldb-commits mailing list