Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lldb/test/Shell/Recognizer/Inputs/ubsan_add_overflow.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include <limits.h>

int main() { return INT_MAX + 1; }
8 changes: 0 additions & 8 deletions lldb/test/Shell/Recognizer/Inputs/ubsan_add_overflow.cpp

This file was deleted.

12 changes: 6 additions & 6 deletions lldb/test/Shell/Recognizer/ubsan_add_overflow.test
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# REQUIRES: clang

# RUN: %clang_host -g -O0 %S/Inputs/ubsan_add_overflow.cpp -o %t.out \
# RUN: -fsanitize=signed-integer-overflow -fsanitize-trap=signed-integer-overflow
# RUN: %clang_host -g -O0 %S/Inputs/ubsan_add_overflow.c -o %t.out \
# RUN: -fsanitize=signed-integer-overflow -fsanitize-trap=signed-integer-overflow

# RUN: %lldb -b -s %s %t.out | FileCheck %s

run
# CHECK: thread #{{.*}} stop reason = Undefined Behavior Sanitizer: Integer addition overflowed
# CHECK-NEXT: frame #1: {{.*}}`main at ubsan_add_overflow.c

frame info
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anthonyhatran You should keep the frame info command and checking the output because this checks that the selected frame is in main and not the fake frame.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be clear. What you added (bt and checking the output) is good but we should also make sure that frame 1 is the selected frame.

Copy link
Contributor Author

@anthonyhatran anthonyhatran Jul 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clarification; I thought it would be potentially redundant so I removed it. I also didn't see Michael's comment before the initial revision commit. Re-added.

# CHECK: frame #{{.*}}`main at ubsan_add_overflow.cpp
bt
# CHECK: frame #0: {{.*}}`__clang_trap_msg$Undefined Behavior Sanitizer$Integer addition overflowed{{.*}}
# CHECK: frame #1: {{.*}}`main at ubsan_add_overflow.c

frame recognizer info 0
# CHECK: frame 0 is recognized by Verbose Trap StackFrame Recognizer
Expand Down
Loading