Skip to content

clang-repl %undo message is misleading when there is nothing left to undo #143668

Open
@DavidSpickett

Description

@DavidSpickett

This is the smallest problem but it might be a good first time contributor issue so I'm reporting it anyway.

Start clang-repl and immediately %undo:

C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build>.\bin\clang-repl
clang-repl> %undo
error: Operation failed. Too many undos

Would be nice if this could tell it had reached the top (or bottom?) of the undo stack and customise the error to say that instead.

error: Operation failed. No input left to undo.

Here's a longer example that shows building a set of lines and undo-ing back to the beginning:

C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build>.\bin\clang-repl
clang-repl> int i = 1;
clang-repl> int j = i + 1;
clang-repl> %undo
clang-repl> int k = j + 1;
In file included from <<< inputs >>>:1:
input_line_3:1:9: error: use of undeclared identifier 'j'
    1 | int k = j + 1;
      |         ^
error: Parsing failed.
clang-repl> %undo
clang-repl> int l = i + 1;
input_line_4:1:9: error: use of undeclared identifier 'i'
    1 | int l = i + 1;
      |         ^
error: Parsing failed.
clang-repl> %undo
error: Operation failed. Too many undos
clang-repl>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions