Is there a way to execute function in process core context in GDB?
The incentive is to run a function that will go through a large tree to find a specific node. I can walk the tree manually but I would like to build a function that will help me analyze the core.
Hence either a function or "GDB script" to run over the data tree.
Is there a way to execute function in process core context in GDB?
No: you need a "live" inferior process for that.
I can walk the tree manually but I would like to build a function that will help me analyze the core.
You can do that using Python scripting built into recent GDB versions.
gdb can call C functions. If you type p myfunction(...parameters...)
, gdb will evaluate the expression and print the returned value. Of course, the program you're debugging must be stopped.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With