Bug 29588 - Cannot find bounds of current function in Clang
Summary: Cannot find bounds of current function in Clang
Status: UNCONFIRMED
Alias: None
Product: gdb
Classification: Unclassified
Component: gdb (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-20 15:29 UTC by Martin Sebor
Modified: 2022-09-20 15:29 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Sebor 2022-09-20 15:29:30 UTC
The latest GDB () as well as GNU gdb (GDB) Fedora 11.1-5.fc35 fails with the following error when debugging the top of tree Clang.  LLDB 13.0.0 works fine.

$ ~/bin/gdb-13.0.50.20220919/bin/gdb -nx -q -ex 'break clang::Sema::VerifyIntegerConstantExpression' -ex 'r -S t.C' -ex n -ex n /build/llvm-clang/bin/clang
Reading symbols from /build/llvm-clang/bin/clang...
Function "clang::Sema::VerifyIntegerConstantExpression" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (clang::Sema::VerifyIntegerConstantExpression) pending.
Starting program: /ssd/build/llvm-clang/bin/clang -S t.C

This GDB supports auto-downloading debuginfo from the following URLs:
  <https://debuginfod.fedoraproject.org/>
Enable debuginfod for this session? (y or [n]) y
Debuginfod has been enabled.
To make this setting permanent, add 'set debuginfod enabled on' to .gdbinit.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Breakpoint 1, 0x00007fffe32ee180 in clang::Sema::VerifyIntegerConstantExpression(clang::Expr*, llvm::APSInt*, clang::Sema::AllowFoldKind)@plt ()
   from /ssd/build/llvm-clang/bin/../lib/../lib/libclangSema.so.16git
Single stepping until exit from function _ZN5clang4Sema31VerifyIntegerConstantExpressionEPNS_4ExprEPN4llvm6APSIntENS0_13AllowFoldKindE@plt,
which has no line number information.
0x00007fffe32e5840 in ?? ()
   from /ssd/build/llvm-clang/bin/../lib/../lib/libclangSema.so.16git
Cannot find bounds of current function

To reproduce git clone the latest Clang, build it with GCC (I used gcc version 11.2.1 20220127 (Red Hat 11.2.1-9) (GCC)), and run it as shown above with the following in t.C:

enum { e = "" != 0 };