[all-commits] [llvm/llvm-project] 1a50fa: [lldb/crashlog] Fix inlined frames in crashlog scr...

Med Ismail Bennani via All-commits all-commits at lists.llvm.org
Mon Apr 13 16:29:39 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1a50fab6e6a4a5eff2697c5141813979e4a337f7
      https://github.com/llvm/llvm-project/commit/1a50fab6e6a4a5eff2697c5141813979e4a337f7
  Author: Med Ismail Bennani <ismail at bennani.ma>
  Date:   2026-04-13 (Mon, 13 Apr 2026)

  Changed paths:
    M lldb/examples/python/crashlog.py
    M lldb/examples/python/crashlog_scripted_process.py
    M lldb/include/lldb/Target/StackFrameList.h
    M lldb/source/Plugins/Process/scripted/ScriptedThread.cpp
    M lldb/source/Target/StackFrameList.cpp
    A lldb/test/Shell/ScriptInterpreter/Python/Crashlog/Inputs/a.out.inline.crash
    A lldb/test/Shell/ScriptInterpreter/Python/Crashlog/Inputs/a.out.inline.ips
    A lldb/test/Shell/ScriptInterpreter/Python/Crashlog/Inputs/inline_test.c
    A lldb/test/Shell/ScriptInterpreter/Python/Crashlog/inline_crashlog.test
    A lldb/test/Shell/ScriptInterpreter/Python/Crashlog/inline_crashlog_json.test

  Log Message:
  -----------
  [lldb/crashlog] Fix inlined frames in crashlog scripted process (#191132)

When loading a crashlog using scripted process, inlined frames get lost.

This happens because `ScriptedThread::LoadArtificialStackFrames` creates
all frames as concrete frames via `SetFrameAtIndex`, completely
bypassing the inline frame synthesis that
`StackFrameList::FetchFramesUpTo` normally performs using
`GetParentOfInlinedScope`. Since two crashlog frames share the same PC
when one is inlined into the other, `CalculateSymbolContext` resolves
both to the innermost inlined scope, which causes the containing
function to be dropped from the backtrace.

This patch fixes the issue in two parts:
- On the Python side, `resolve_stackframes` now skips frames whose PC
matches the next frame's PC. These are inlined frames that LLDB will
synthesize from debug info when it processes the concrete frames we
provide. Indices are renumbered accordingly, and `len(frames) == 0` is
used for first-frame detection.
- On the C++ side, `LoadArtificialStackFrames` now replicates the inline
synthesis loop from `FetchFramesUpTo`: after creating each concrete
frame, it calls `GetParentOfInlinedScope` in a loop and creates a
`StackFrame` for each inlined parent scope.

rdar://154981041

Signed-off-by: Med Ismail Bennani <ismail at bennani.ma>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list