rr-debugger / rr

Record and Replay Framework
http://rr-project.org/
Other
9.2k stars 585 forks source link

"Cannot call functions in reverse mode." #1638

Open Keno opened 8 years ago

Keno commented 8 years ago

Maybe this is wishful thinking, but I was hoping to be able to set a conditional breakpoint during reverse-continue. Unfortunately gdb complains that it "Cannot call functions in reverse mode.". I don't particularly care that it be fast, but it would be nice if there was some way that this could be made work.

rocallahan commented 8 years ago

Unfortunately that is a gdb limitation. I don't know why they impose that limitation --- rr could support this (though it would be slow).

I suggest filing a gdb bug about this at https://sourceware.org/bugzilla.

rocallahan commented 8 years ago

To be clear, there's no actual rr work required here. gdb could evaluate breakpoint conditions which are function calls during reverse execution just the same way it does during forward execution with rr.

rocallahan commented 8 years ago

FWIW, you can probably simulate a conditional breakpoint by using the gdb commands command and some macrology to automatically continue if your breakpoint condition doesn't hold.

khuey commented 8 years ago

@tromey is this something that could happen?

tromey commented 8 years ago

Offhand I don't know why the restriction is there. It's easy to test though: open gdb/infcall.c and search for the error message, then remove the call to error. One other possible hack might be to temporarily change the execution direction at this spot, though I don't know what other effects that might have.

I also suggest filing an upstream bug.

khuey commented 8 years ago

I tried just removing the error out in gdb/infcall.c but that didn't make things work.

sceptical-coder commented 3 years ago

OTOH this (with a help of make_scope_exit() from gdb_support/scope_exit.h)

One other possible hack might be to temporarily change the execution direction at this spot

seems to be working here.