tmaric
tmaric

Reputation: 5477

gdb search regex up

I'm debugging my program with gdb and I have found a weird value for a variable x0.

the search x0 = will only show me the line in the current frame where the "x0 = " regex is written from the last listed line in the frame, on. Is there a possibility to find the regex in an upward direction? Like, if x0 has a weird value, I would like the gdb to search for the "x0 = " regex from the current line, up. This is much easier than just listing above, and above, and above...

Thanks

Upvotes: 1

Views: 1496

Answers (1)

osgx
osgx

Reputation: 94345

http://sourceware.org/gdb/current/onlinedocs/gdb/Search.html#index-search-450

reverse-search regexp

The command `reverse-search regexp' checks each line, starting with the one before the last line listed and going backward, for a match for regexp. It lists the line that is found. You can abbreviate this command as rev.

And the search command is just an alias of forward-search command.

Upvotes: 3

Related Questions