Issue 136410
Summary [LLDB] An inconsistency between step-by-step debugging and breakpoint debugging at O2
Labels new issue
Assignees
Reporter Apochens
    Clang version:

```
Ubuntu clang version 21.0.0 (++20250415033808+d0e4af8a88dc-1~exp1~20250415153924.2354)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm-21/bin
```

LLDB version: `lldb version 21.0.0`

Inconsistency-triggering program `test.c`:
```c
int printf(const char *, ...);
int a[2][9] = {
  {0, 1, 2, 3, 4, 5, 6, 7, 8},
  {0, 1, 2, 3, 4, 5, 6, 7, 8}
};
int main(int argc, char* argv[]) {
  int b, c, d = 0;
  if (argc == 0)
    d = 1;
  for (b = 0; b < 2; b++) {
    for (c = 0; c < 9; c++) {
      printf("%d\n", a[b][c]);   // set breakpoint at this line
      if (d)
        printf("index\n");
    }
 }
}
```
Compilation command: `clang -g -O2 test.c -o test`

When debugging the program step-by-step (i.e., `s`), the debugger could stop at the specified line, while the debugger cannot stop at the line when directly setting the breakpoint (i.e., `b 12`).

@jimingham Apologies for bothering you again. Would the root cause of this inconsistency be identical to #136089 ?
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to