Hi everyone,
I’m planning to include some new commands in lldb. Initially I thought of creating aliases of gdb commands which are not available in lldb (like "break args"
instead of "breakpoint set -flags args"
). But then I realized that lldb follows a noun verb format rather than gdb and it’s not a good idea (to create some sort of gdb clone in lldb).
Now I want to ask the community what kind of features do they think are missing in lldb right now which I can try adding in the code base of lldb so that I can create some new commands.
Also I’m a beginner and still trying to understand the source code. I’ve added few commands related to breakpoints, like "breakpoint setbacktrace args"
, which prints the backtrace whenever a breakpoint is hit. So it will be a great idea if someone can suggest me the new commands in hierarchical order i.e., from integrating easier commands to complex ones.
As for whole commands, no idea. If it were me I’d try porting over some useful gdb scripts and see what went wrong and survey my colleagues if possible.
But perhaps adding a whole command is a bit much to start out with (not that it’s that complicated, but there’s a lot of setup code which is hardly exciting).
I am reminded of Colorize output when searching for symbols in `lldb` · Issue #57372 · llvm/llvm-project · GitHub. Which is quite self contained and even has had one attempt at it. So you’ve got some test cases already. You could ping that person in a comment to see if they are still working on it, but I doubt it given that time that has passed.
It’s something everyone would appreciate and isn’t so big you’ll have to fight to add it.
First off, I think a command like breakpoint setbacktrace args
is too fine-grained for the lldb basic command set, after all, it’s really just the same as:
breakpoint command add -O bt
If we keep adding shims like this to the main command set it’s going to rapidly grow unwieldy. We sometimes add convenience aliases for common operations, though in this case, I don’t think the operation is common enough to warrant this. That’s not said as discouragement, but rather to give some context for thinking about what kind of commands we want to add.
One section of lldb that is lacking is the ability to react to the various events in the course of a debug session. We have an affordance for the user to react to stops in the target (target stop-hook) but not things like “target created”, “process launched”, “process exited” and so forth. The way the stop-hooks callbacks get registered could be pretty easily extended to other classes of “interesting lifecycle events”. That would also be a good excuse to dig into lldb to see how all these lifecycle events get triggered. But this is also moderately big project, and getting a nice general CLI interface will take some thinking. So it’s on the “complex” side.
Jim
On Sep 15, 2023, at 3:25 AM, Taalhaataahir0102 via LLVM Discussion Forums notifications@llvm.discoursemail.com wrote:
taalhaataahir0102
September 15Also I’m a beginner and still trying to understand the source code. I’ve added few commands related to breakpoints, like
"breakpoint setbacktrace args"
, which prints the backtrace whenever a breakpoint is hit. So please suggest me commands in hierarchical order i.e., from integrating easiest commands to complex ones.
Visit Topic or reply to this email to respond.
To unsubscribe from these emails, click here.