================
@@ -4051,6 +4144,14 @@ void CodeGenFunction::EmitTrapCheck(llvm::Value *Checked,
llvm::BasicBlock *&TrapBB = TrapBBs[CheckHandlerID];
+ llvm::DILocation *TrapLocation = Builder.getCurrentDebugLocation();
+ llvm::StringRef Category = GetTrapMessageForHandler(CheckHandlerID);
+
+ if (getDebugInfo() && !Category.empty()) {
+ TrapLocation = getDebugInfo()->CreateTrapFailureMessageFor(
+ TrapLocation, Category, TrapMessage);
----------------
Michael137 wrote:
Correct me if I'm wrong, but shouldn't `TrapMessage` be what
`GetTrapMessageForHandler` provides, and `Category` be something like `UBSan
Trap`?
The way the fake inline frame name gets constructed is:
```
__clang_trap_msg$<category>$<trap message>
```
Currently you are omitting the "<trap message>" and putting the failure reason
into the category. It would still technically work out with LLDB (it will
display the category even if no message was provided), but it wouldn't be
consistent with how `__verbose_trap` is handled
https://github.com/llvm/llvm-project/pull/143758
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits