is there eval function? I've read "help" and I didnt find
I want to make eval("gdb command")
because I want to create my own function for grepping using this method
I want to make eval($arg1)
is there eval function? I've read "help" and I didnt find
I want to make eval("gdb command")
because I want to create my own function for grepping using this method
I want to make eval($arg1)
There is an
eval
command, but it doesn't really do what you want. It provides a limited form of substitution of values into commands.For a command along the lines of grep, I would suggest writing it in Python. This would be relatively easy to do. The idea would be to use
gdb.execute
to capture the output of a command into a string, and then use Python to search the string however you like. If done from Python you have complete control of how to parse the command-line, something that's not true if you use the gdbdefine
command.Oddly enough, I wrote a grep python gdb function earlier today for another question. These couple of files make a new command that checks if the call stack contains _malloc. This should be a pretty good start for other string searching and evaluation functions.
Here is a script for gdb
Here is the python file: