Skip to content

🍒/bastille/crashlog #2113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Nov 6, 2020
Merged

🍒/bastille/crashlog #2113

merged 8 commits into from
Nov 6, 2020

Conversation

JDevlieghere
Copy link

No description provided.

Don't try to guess the location of LLDB.framework but use xcrun to ask
the command line driver for the location of the lldb module.

(cherry picked from commit fb6d1c0)
Python doesn't support enums before PEP 435, but using a class with
constants is how it's commonly emulated. It can be converted into a real
Enum (in Python 3.4 and later) by extending the Enum class:

  class CrashLogParseMode(Enum):
      NORMAL = 0
      THREAD = 1
      IMAGES = 2
      THREGS = 3
      SYSTEM = 4
      INSTRS = 5

(cherry picked from commit 6c9f3fe)
Remove commented out code and print statements.

(cherry picked from commit 66009a1)
Move crash log parsing out of the CrashLog class and into its own class
and add more tests.

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

(cherry picked from commit 4b84682)
Instead of parsing the crashlog in one big loop, use methods that
correspond to the different parsing modes.

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

(cherry picked from commit 16dd693)
Before:

  error: python exception <class 'AttributeError'>

After:

  error: python exception: 'DarwinImage' object has no attribute 'debugger'

(cherry picked from commit f0fd434)
The lldb.debugger et al convenience variables are only available from
the interactive script interpreter. In all other scenarios, they are
None (since fc1fd6b) before that they
were default initialized.

The crashlog script was hacking around that by setting the lldb.debugger
to a newly created debugger instance when running outside of the script
interpreter, which works fine until lldb creates a script interpreter
instance under the hood and clears the variables. This was resulting in
an AttributeError when invoking the script directly (from outside of
lldb):

  AttributeError: 'NoneType' object has no attribute 'GetSourceManager'

This patch fixes that by passing around the debugger instance.

rdar://64775776

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

(cherry picked from commit c29c24b)
This test requires running under the Python we built against (which is
easy) and setting up the PYTHONPATH (which is not worth it for this
simple test).

(cherry picked from commit 99a99c2)
@fredriss fredriss merged commit 626140e into swiftlang:apple/stable/20200714 Nov 6, 2020
@JDevlieghere JDevlieghere deleted the 🍒/bastille/crashlog branch December 14, 2020 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants