[Lldb-commits] [lldb] [lldb] Implement basic support for reverse-continue (PR #112079)

Robert O'Callahan via lldb-commits lldb-commits at lists.llvm.org
Tue Nov 12 09:59:25 PST 2024


rocallahan wrote:

> I worry that in a situation like this where there's a pending task people will go the wrong way and lose important state because they forgot that "continue" doesn't mean "continue what I was doing" - which is what it currently means in lldb

I don't know of any other debugger that supports the equivalent of a thread plan stack, and even though I've been neck-deep in debuggers for a long time I didn't know about this LLDB feature until I started working on this PR, so TBH I think most users will assume "continue" works like any other debugger and just resumes execution forwards, and are surprised (hopefully in a good way) if/when they discover it's more complicated than that. And therefore will be surprised in a bad way if/when they discover that "continue" runs backwards in some situations.

> I think ultimately I'm arguing against requiring: "we either have all forward or all backwards plans on any given thread plan stack" because I don't think that is flexible enough to support all the use cases we want to support.

I agree and as I said above, I've already removed that requirement in my experimental branch. I haven't added a notion of "no-direction-opinion" plans yet, but most of what you said above makes sense even if we don't have that.

Let's consider a really simple case where the user does a reverse-continue, hits an unconditional breakpoint, and then wants to execute forwards. One question is, what command should they use to execute forwards? I've been assuming that they would just use `process continue`, but if you really want `process continue` to resume the reverse-continue and we should have a separate command or flag to switch to forwards, we can do that. We should probably settle this now because it's quite fundamental.

The other question is, what should the thread plan stacks look like during this scenario?

https://github.com/llvm/llvm-project/pull/112079


More information about the lldb-commits mailing list