Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

gdb warning for -g -O0: warning: Unmapped DWARF Register #61 encountered. #1432

Open Quuxplusone opened 15 years ago

Quuxplusone commented 15 years ago
Bugzilla Link PR4475
Status NEW
Importance P normal
Reported by Török Edwin (edwin+bugs@etorok.eu)
Reported on 2009-06-29 05:58:37 -0700
Last modified on 2009-06-30 10:51:42 -0700
Version unspecified
Hardware PC Linux
CC baldrick@free.fr, daniel@zuster.org, devang.patel@gmail.com, llvm-bugs@lists.llvm.org
Fixed by commit(s)
Attachments
Blocks
Blocked by
See also
When compiling code with -g -O0, and breakpointing in gdb I get warnings
every time the breakpoint is hit / every time I step in the code.
I can still print variables though, so this may be a benign warning for the -O0
case.

However if I compile with -O1 -g, I cannot print variables (see below), so this
may be a problem for the -O1 case (I assume the variable is assigned to a
register, but the DWARF information is missing this info?)

Here is what happens with -O0:
$ clang -g -O0 x.c -o a.out
$ gdb /a.out
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu"...

(gdb) b readString
Breakpoint 1 at 0x400582: file x.c, line 9.
(gdb) r
Starting program: /home/edwin/clam/git/builds/clang/a.out
Breakpoint 1, readString (p=warning: Unmapped DWARF Register #48 encountered.
warning: Unmapped DWARF Register #49 encountered.
warning: Unmapped DWARF Register #50 encountered.
warning: Unmapped DWARF Register #51 encountered.
warning: Unmapped DWARF Register #52 encountered.
warning: Unmapped DWARF Register #53 encountered.
warning: Unmapped DWARF Register #54 encountered.
warning: Unmapped DWARF Register #55 encountered.
0x7ffff16b9512 "k��\177", off=0x7ffff16b950c, len=10, ok=0x7ffff16b950b "\001")
at x.c:9
9           unsigned stringlen;
Current language:  auto; currently minimal
(gdb) n
warning: Unmapped DWARF Register #48 encountered.
warning: Unmapped DWARF Register #49 encountered.
warning: Unmapped DWARF Register #50 encountered.
warning: Unmapped DWARF Register #51 encountered.
warning: Unmapped DWARF Register #52 encountered.
warning: Unmapped DWARF Register #53 encountered.
warning: Unmapped DWARF Register #54 encountered.
warning: Unmapped DWARF Register #55 encountered.
10          char *str = (char*)readData(p, off, len, ok, &stringlen);
(gdb) n
warning: Unmapped DWARF Register #48 encountered.
warning: Unmapped DWARF Register #49 encountered.
warning: Unmapped DWARF Register #50 encountered.
warning: Unmapped DWARF Register #51 encountered.
warning: Unmapped DWARF Register #52 encountered.
warning: Unmapped DWARF Register #53 encountered.
warning: Unmapped DWARF Register #54 encountered.
warning: Unmapped DWARF Register #55 encountered.
warning: Unmapped DWARF Register #48 encountered.
warning: Unmapped DWARF Register #49 encountered.
warning: Unmapped DWARF Register #50 encountered.
warning: Unmapped DWARF Register #51 encountered.
warning: Unmapped DWARF Register #52 encountered.
warning: Unmapped DWARF Register #53 encountered.
warning: Unmapped DWARF Register #54 encountered.
warning: Unmapped DWARF Register #55 encountered.
warning: Unmapped DWARF Register #48 encountered.
warning: Unmapped DWARF Register #49 encountered.
warning: Unmapped DWARF Register #50 encountered.
warning: Unmapped DWARF Register #51 encountered.
warning: Unmapped DWARF Register #52 encountered.
warning: Unmapped DWARF Register #53 encountered.
warning: Unmapped DWARF Register #54 encountered.
warning: Unmapped DWARF Register #55 encountered.
11          if (*ok && stringlen && str[stringlen-1] != '\0') {
(gdb) p str
$1 = 0x2095010 ""

With -O1 -g:

$ gdb ./a.out
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu"...
(gdb) b readString
Breakpoint 1 at 0x400543: file x.c, line 10.
(gdb) r
Starting program: /home/edwin/clam/git/builds/clang/a.out

Breakpoint 1, readString () at x.c:10
10          char *str = (char*)readData(p, off, len, ok, &stringlen);
Current language:  auto; currently minimal
(gdb) n

warning: Unmapped DWARF Register #48 encountered.
warning: Unmapped DWARF Register #49 encountered.
warning: Unmapped DWARF Register #50 encountered.
warning: Unmapped DWARF Register #51 encountered.
warning: Unmapped DWARF Register #52 encountered.
warning: Unmapped DWARF Register #53 encountered.
warning: Unmapped DWARF Register #54 encountered.
warning: Unmapped DWARF Register #55 encountered.
warning: Unmapped DWARF Register #48 encountered.
warning: Unmapped DWARF Register #49 encountered.
warning: Unmapped DWARF Register #50 encountered.
warning: Unmapped DWARF Register #51 encountered.
warning: Unmapped DWARF Register #52 encountered.
warning: Unmapped DWARF Register #53 encountered.
warning: Unmapped DWARF Register #54 encountered.
warning: Unmapped DWARF Register #55 encountered.
warning: Unmapped DWARF Register #48 encountered.
warning: Unmapped DWARF Register #49 encountered.
warning: Unmapped DWARF Register #50 encountered.
warning: Unmapped DWARF Register #51 encountered.
warning: Unmapped DWARF Register #52 encountered.
warning: Unmapped DWARF Register #53 encountered.
warning: Unmapped DWARF Register #54 encountered.
warning: Unmapped DWARF Register #55 encountered.
11          if (*ok && stringlen && str[stringlen-1] != '\0') {
(gdb) p str
No symbol "str" in current context.
Quuxplusone commented 15 years ago
I am seeing this with "make check" on x86-64 for llvm and llvm-gcc built today:

FAIL: llvm/test/FrontendC++/2006-11-06-StackTrace.cpp
Failed with unknown error (or has stderr output) at line 5
while running: gdb -q -batch -n -x 2006-11-06-StackTrace.cpp.tmp.in 2006-11-06-
StackTrace.cpp.tmp.exe | tee 2006-11-06-StackTrace.cpp.tmp.out |  /bin/grep {#0
DeepStack::deepest.*(this=.*,.*x=33)}
#0  DeepStack::deepest (this=0x7fffbc517380, x=33) at 2006-11-06-
StackTrace.cpp:28
warning: Unmapped DWARF Register #61 encountered.
warning: Unmapped DWARF Register #61 encountered.
warning: Unmapped DWARF Register #48 encountered.
warning: Unmapped DWARF Register #49 encountered.
warning: Unmapped DWARF Register #50 encountered.
warning: Unmapped DWARF Register #51 encountered.
warning: Unmapped DWARF Register #52 encountered.
warning: Unmapped DWARF Register #53 encountered.
warning: Unmapped DWARF Register #54 encountered.
warning: Unmapped DWARF Register #55 encountered.
warning: Unmapped DWARF Register #59 encountered.
warning: Unmapped DWARF Register #60 encountered.
warning: Unmapped DWARF Register #61 encountered.
warning: Unmapped DWARF Register #48 encountered.
warning: Unmapped DWARF Register #49 encountered.
warning: Unmapped DWARF Register #50 encountered.
warning: Unmapped DWARF Register #51 encountered.
warning: Unmapped DWARF Register #52 encountered.
warning: Unmapped DWARF Register #53 encountered.
warning: Unmapped DWARF Register #54 encountered.
warning: Unmapped DWARF Register #55 encountered.
warning: Unmapped DWARF Register #48 encountered.
warning: Unmapped DWARF Register #49 encountered.
warning: Unmapped DWARF Register #50 encountered.
warning: Unmapped DWARF Register #51 encountered.
warning: Unmapped DWARF Register #52 encountered.
warning: Unmapped DWARF Register #53 encountered.
warning: Unmapped DWARF Register #54 encountered.
warning: Unmapped DWARF Register #55 encountered.
warning: Unmapped DWARF Register #48 encountered.
warning: Unmapped DWARF Register #49 encountered.
warning: Unmapped DWARF Register #50 encountered.
warning: Unmapped DWARF Register #51 encountered.
warning: Unmapped DWARF Register #52 encountered.
warning: Unmapped DWARF Register #53 encountered.
warning: Unmapped DWARF Register #54 encountered.
warning: Unmapped DWARF Register #55 encountered.
warning: Unmapped DWARF Register #48 encountered.
warning: Unmapped DWARF Register #49 encountered.
warning: Unmapped DWARF Register #50 encountered.
warning: Unmapped DWARF Register #51 encountered.
warning: Unmapped DWARF Register #52 encountered.
warning: Unmapped DWARF Register #53 encountered.
warning: Unmapped DWARF Register #54 encountered.
warning: Unmapped DWARF Register #55 encountered.
warning: Unmapped DWARF Register #48 encountered.
warning: Unmapped DWARF Register #49 encountered.
warning: Unmapped DWARF Register #50 encountered.
warning: Unmapped DWARF Register #51 encountered.
warning: Unmapped DWARF Register #52 encountered.
warning: Unmapped DWARF Register #53 encountered.
warning: Unmapped DWARF Register #54 encountered.
warning: Unmapped DWARF Register #55 encountered.
warning: Unmapped DWARF Register #48 encountered.
warning: Unmapped DWARF Register #49 encountered.
warning: Unmapped DWARF Register #50 encountered.
warning: Unmapped DWARF Register #51 encountered.
warning: Unmapped DWARF Register #52 encountered.
warning: Unmapped DWARF Register #53 encountered.
warning: Unmapped DWARF Register #54 encountered.
warning: Unmapped DWARF Register #55 encountered.
warning: Unmapped DWARF Register #48 encountered.
warning: Unmapped DWARF Register #49 encountered.
warning: Unmapped DWARF Register #50 encountered.
warning: Unmapped DWARF Register #51 encountered.
warning: Unmapped DWARF Register #52 encountered.
warning: Unmapped DWARF Register #53 encountered.
warning: Unmapped DWARF Register #54 encountered.
warning: Unmapped DWARF Register #55 encountered.

FAIL: llvm/test/FrontendC++/2006-11-30-Pubnames.cpp
Failed with unknown error (or has stderr output) at line 6
while running: gdb -q -batch -n -x 2006-11-30-Pubnames.cpp.tmp.in 2006-11-30-
Pubnames.cpp.tmp.exe | tee 2006-11-30-Pubnames.cpp.tmp.out | /bin/grep {$1 = 10}
$1 = 10
warning: Unmapped DWARF Register #61 encountered.
warning: Unmapped DWARF Register #61 encountered.
warning: Unmapped DWARF Register #48 encountered.
warning: Unmapped DWARF Register #49 encountered.
warning: Unmapped DWARF Register #50 encountered.
warning: Unmapped DWARF Register #51 encountered.
warning: Unmapped DWARF Register #52 encountered.
warning: Unmapped DWARF Register #53 encountered.
warning: Unmapped DWARF Register #54 encountered.
warning: Unmapped DWARF Register #55 encountered.
warning: Unmapped DWARF Register #59 encountered.
warning: Unmapped DWARF Register #60 encountered.
warning: Unmapped DWARF Register #61 encountered.
Quuxplusone commented 15 years ago
(In reply to comment #1)
> I am seeing this with "make check" on x86-64 for llvm and llvm-gcc built
today:
>

Its not clang specific then, I removed clang from the bug title.
Quuxplusone commented 15 years ago

Note that not being able to print variables at -O1 is expected, LLVM currently only preserves line numbers when optimizing.

Quuxplusone commented 15 years ago
(In reply to comment #3)
> Note that not being able to print variables at -O1 is expected, LLVM currently
> only preserves line numbers when optimizing.
>

Shouldn't gdb say <value optimized out>? IIRC that is what it does for gcc
compiled code.