I\'m wanting to set a breakpoint on a function parameter if it is greater than a certain value. Dummy code below:
int main(void)
{
uint64_t num = 123456;
Assuming x86-64 calling conventions on GNU/Linux platform you could examine %rdi
(64-bit) register directly to check function's first parameter:
b calc if $rdi == 852479
This allows you to break on function calc
even if you don't have debugging symbols loaded (thus no code listing, i.e. by list calc
).
Note that this method would fail if function is inlined by optimizing compiler.