Repository navigation
Add lldb versions of the ptbt and ptbtall gdb macros - #32
Merged
Merged
Conversation
lldbinit.py is a Python command script with the same output as gdbinit. Load it with "command script import lldbinit.py" (or from ~/.lldbinit). Unlike the gdb macros, the argument can be a struct or a pointer, so "ptbtall pt" works as well as "ptbtall &pt". If the name isn't visible in the current frame, outer frames are tried, so it also works when stopped inside a library function. Each frame line shows the address of the pt_func_t. Checked against gdbinit on pttpcc (1040 threads, same backtraces). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
debugger_test.sh builds protothread_test with -g, stops it twice, and runs ptbtall in both debuggers. The first stop is in test_pc(), with the consumer running and the producer waiting. The second is where the last thread arrives at a barrier in test_barrier(), which has running, ready and waiting threads, some waiting inside a pt_call(). The two debuggers have to print the same threads and frames, and each frame's line has to be a pt_wait(), pt_yield() or pt_call(). The thread functions and states are checked too, but not line numbers, so the test doesn't break whenever protothread_test.c changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
lldbinit.pyis an lldb port of theptbtandptbtallmacros ingdbinit. Load it withcommand script import lldbinit.py, or add that line to~/.lldbinit.The output matches gdbinit. One difference is that the argument can be a struct or a pointer, so
ptbtall ptworks as well asptbtall &pt. If the name isn't visible in the current frame, outer frames are tried. So it still works when you're stopped inside a library function likept_timer_next().It was checked against gdbinit on pttpcc (1040 threads, same backtraces) and in VS Code with CodeLLDB. The README now mentions both.
🤖 Generated with Claude Code