This is an archive of the discontinued LLVM Phabricator instance.

save_crashlog should not be using the load_addr property of an SBAddress
ClosedPublic

Authored by jingham on May 27 2020, 5:33 PM.

Details

Summary

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.

Diff Detail

Event Timeline

jingham created this revision.May 27 2020, 5:33 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 27 2020, 5:33 PM
friss accepted this revision.May 27 2020, 5:50 PM
friss added a subscriber: friss.

Thanks for adding a test! this LGTM

This revision is now accepted and ready to land.May 27 2020, 5:50 PM
This revision was automatically updated to reflect the committed changes.