InfernusDoleo
InfernusDoleo

Reputation: 139

lldb: Python scripting, accessing command history?

I'm currently debugging some software using lldb, and its been a weeks long project. I've been adding aliases for commonly used commands, and even tweaked an example python script to help with speeding up my work.

The issue I am having - sometimes I type a command, and then later on I need to reference that (a memory address I need is there, for example). In bash I'd simply do:

history | grep <command>
!<history number>

That obviously does not work in lldb. I'd like to add a script where I add a python command 'history' but nowhere that I look can I find a way to access the lldb command history. Is that possible?

Upvotes: 1

Views: 972

Answers (1)

Jim Ingham
Jim Ingham

Reputation: 27148

Are you talking about python commands or lldb commands? lldb does support command history (the command is command history) and !<HISTORY_NUMBER> also works. ^R will start an incremental search back through the history buffer. The lldb command line doesn't have command pipelines (or a grep) so you can't search that way, but you can still get around pretty well this way.

Upvotes: 2

Related Questions