My own view was a little simpler: Delete the target_set_execdir method,
I'm guessing you meant "get" here?
Ooops! yes, that' right.
and replace all the calls with a reference to the infrun global. I would
keep the target_set_execdir more or less as is; otherwise, you'll need
some kind of observer to notice when the execdir changes. The
"to_can_go_backwards" is an interesting idea, but in my opinion only
makes sense if the target_set_execdir method is removed. Otherwise,
we can treat target_set_execdir == NULL as cannot-go-backwards.
OK, so you're saying that "target_set_execdir" will set the
global infrun variable, not a target-defined variable?
Not quite, actually. Roughly, when the user changes the exec direction,
we call target_set_execdir and, if the call succeeded, then update the
direction known in infrun. Or perhaps you or others have better ideas?