[all-commits] [llvm/llvm-project] 3be864: [lldb/crashlog] Add support for 32bit frame addresses

Med Ismail Bennani via All-commits all-commits at lists.llvm.org
Thu Nov 3 14:45:23 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3be864333a8843534465bcbf3d355fcd12b42369
      https://github.com/llvm/llvm-project/commit/3be864333a8843534465bcbf3d355fcd12b42369
  Author: Med Ismail Bennani <medismail.bennani at gmail.com>
  Date:   2022-11-03 (Thu, 03 Nov 2022)

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

  Log Message:
  -----------
  [lldb/crashlog] Add support for 32bit frame addresses

This patch adds support for 32bit stack frame addresses in the `crashlog`
command.

For crash reports that are generated from a arm64_32 process, `PAGEZERO`
is loaded at 0x00004000 so no code address will be less than 0x4000.

This patch changes the crashlog frame address regex group to match
addresses as small as 4 hex characters.

rdar://100805026

Differential Revision: https://reviews.llvm.org/D135310

Signed-off-by: Med Ismail Bennani <medismail.bennani at gmail.com>


  Commit: 42df155ae628b4ae756a858bd09b105ee10b86eb
      https://github.com/llvm/llvm-project/commit/42df155ae628b4ae756a858bd09b105ee10b86eb
  Author: Med Ismail Bennani <medismail.bennani at gmail.com>
  Date:   2022-11-03 (Thu, 03 Nov 2022)

  Changed paths:
    M lldb/examples/python/crashlog.py
    M lldb/test/Shell/ScriptInterpreter/Python/Crashlog/Inputs/a.out.crash

  Log Message:
  -----------
  [lldb/crashlog] Fix the image_regex_uuid to skip null UUID images

This patch updates the image_regex_uuid matcher to match null-UUID
images in the plain text crashlog parser.

It updates the regex to match one or more '?' characters or the image
full path.

rdar://100904019

Differential Revision: https://reviews.llvm.org/D135482

Signed-off-by: Med Ismail Bennani <medismail.bennani at gmail.com>


  Commit: cc05487a834e55659072918393f5c7490af67ed2
      https://github.com/llvm/llvm-project/commit/cc05487a834e55659072918393f5c7490af67ed2
  Author: Med Ismail Bennani <medismail.bennani at gmail.com>
  Date:   2022-11-03 (Thu, 03 Nov 2022)

  Changed paths:
    M lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
    M lldb/source/Plugins/Process/scripted/ScriptedThread.cpp

  Log Message:
  -----------
  [lldb/Plugins] Cleanup error handling in Scripted{Process,Thread} (NFC)

Signed-off-by: Med Ismail Bennani <medismail.bennani at gmail.com>


  Commit: 268628cb79b0f8bb0edec86d9d500c16eadd516a
      https://github.com/llvm/llvm-project/commit/268628cb79b0f8bb0edec86d9d500c16eadd516a
  Author: Med Ismail Bennani <medismail.bennani at gmail.com>
  Date:   2022-11-03 (Thu, 03 Nov 2022)

  Changed paths:
    M lldb/source/Commands/CommandObjectThread.cpp

  Log Message:
  -----------
  [lldb/Commands] Add newline for extended backtrace thread (NFCI)

This adds a new line between the real thread and the extended backtrace
thread when it's available. This should improve readability for the user.

Signed-off-by: Med Ismail Bennani <medismail.bennani at gmail.com>


  Commit: 90608963d40b4765fc95e039d5100940ad822535
      https://github.com/llvm/llvm-project/commit/90608963d40b4765fc95e039d5100940ad822535
  Author: Med Ismail Bennani <medismail.bennani at gmail.com>
  Date:   2022-11-03 (Thu, 03 Nov 2022)

  Changed paths:
    M lldb/source/Utility/StructuredData.cpp

  Log Message:
  -----------
  [lldb/Utility] Fix StructuredData::ParseJSONValue for null items

This patch fixes the JSON parser for StructuredData to handle JSON null
entries.

Differential Revision: https://reviews.llvm.org/D135616

Signed-off-by: Med Ismail Bennani <medismail.bennani at gmail.com>


  Commit: e861d053dd43f2e5a63f150ee2f9d1d643ea29c1
      https://github.com/llvm/llvm-project/commit/e861d053dd43f2e5a63f150ee2f9d1d643ea29c1
  Author: Med Ismail Bennani <medismail.bennani at gmail.com>
  Date:   2022-11-03 (Thu, 03 Nov 2022)

  Changed paths:
    M lldb/include/lldb/Core/StructuredDataImpl.h
    M lldb/include/lldb/Utility/StructuredData.h
    M lldb/source/Commands/CommandObjectProcess.cpp
    M lldb/source/Utility/StructuredData.cpp
    M lldb/test/API/functionalities/process_crash_info/TestProcessCrashInfo.py
    M lldb/unittests/Utility/CMakeLists.txt
    A lldb/unittests/Utility/Inputs/StructuredData-full.json
    A lldb/unittests/Utility/Inputs/StructuredData-nested.json
    M lldb/unittests/Utility/StructuredDataTest.cpp

  Log Message:
  -----------
  [lldb/Utility] Add GetDescription(Stream&) to StructureData::*

This patch improves the StructuredData classes to provide a
GetDescription(lldb_private::Stream&) affordance.

This is very convenient compared to the Dump method because this try to
pretty print the structure instead of just serializing it into a JSON.

This patch also updates some parts of lldb (i.e. extended crash info) to
use this new affordance instead of StructuredData::Dump.

Differential Revision: https://reviews.llvm.org/D135547

Signed-off-by: Med Ismail Bennani <medismail.bennani at gmail.com>


  Commit: 78d6e1d1d4b3b5c6bdd779256c915a8ac7148174
      https://github.com/llvm/llvm-project/commit/78d6e1d1d4b3b5c6bdd779256c915a8ac7148174
  Author: Med Ismail Bennani <medismail.bennani at gmail.com>
  Date:   2022-11-03 (Thu, 03 Nov 2022)

  Changed paths:
    M lldb/examples/python/crashlog.py
    M lldb/examples/python/scripted_process/crashlog_scripted_process.py
    M lldb/examples/python/scripted_process/scripted_process.py
    M lldb/include/lldb/Interpreter/ScriptedProcessInterface.h
    M lldb/include/lldb/Target/Process.h
    M lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
    M lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h
    M lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
    M lldb/source/Plugins/Process/scripted/ScriptedProcess.h
    M lldb/source/Plugins/Process/scripted/ScriptedThread.cpp
    M lldb/source/Plugins/Process/scripted/ScriptedThread.h
    M lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.cpp
    M lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.h
    M lldb/source/Plugins/ScriptInterpreter/Python/ScriptedThreadPythonInterface.cpp
    M lldb/source/Plugins/ScriptInterpreter/Python/ScriptedThreadPythonInterface.h
    M lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
    M lldb/test/API/functionalities/process_crash_info/TestProcessCrashInfo.py
    A lldb/test/Shell/ScriptInterpreter/Python/Crashlog/Inputs/application_specific_info/asi.ips
    A lldb/test/Shell/ScriptInterpreter/Python/Crashlog/Inputs/application_specific_info/asi.yaml
    A lldb/test/Shell/ScriptInterpreter/Python/Crashlog/Inputs/application_specific_info/main.m
    A lldb/test/Shell/ScriptInterpreter/Python/Crashlog/app_specific_backtrace_crashlog.test

  Log Message:
  -----------
  [lldb/crashlog] Add support for Application Specific Backtraces & Information

For an exception crashlog, the thread backtraces aren't usually very helpful
and instead, developpers look at the "Application Specific Backtrace" that
was generated by `objc_exception_throw`.

LLDB could already parse and symbolicate these Application Specific Backtraces
for regular textual-based crashlog, so this patch adds support to parse them
in JSON crashlogs, and materialize them a HistoryThread extending the
crashed ScriptedThread.

This patch also includes the Application Specific Information messages
as part of the process extended crash information log. To do so, the
ScriptedProcess Python interface has a new GetMetadata method that
returns an arbitrary dictionary with data related to the process.

rdar://93207586

Differential Revision: https://reviews.llvm.org/D126260

Signed-off-by: Med Ismail Bennani <medismail.bennani at gmail.com>


  Commit: 3350d5574864442d7c4120af25404762a840da00
      https://github.com/llvm/llvm-project/commit/3350d5574864442d7c4120af25404762a840da00
  Author: Med Ismail Bennani <medismail.bennani at gmail.com>
  Date:   2022-11-03 (Thu, 03 Nov 2022)

  Changed paths:
    M lldb/include/lldb/Interpreter/ScriptedProcessInterface.h

  Log Message:
  -----------
  [lldb/Plugins] Use default initializers for StructuredData::*SP (NFC)

This patch replaces the ScriptedProcessInterface getters to return
default initializers for StructureData shared pointers instead of
returning a null pointer.

Differential Revision: https://reviews.llvm.org/D137359

Signed-off-by: Med Ismail Bennani <medismail.bennani at gmail.com>


Compare: https://github.com/llvm/llvm-project/compare/76c0ee5cb740...3350d5574864


More information about the All-commits mailing list