public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/101905] New: Missed debug information for global register variable
@ 2021-08-14  2:19 yuri.karlsbrun at broadcom dot com
  2021-08-16  9:03 ` [Bug debug/101905] " rguenth at gcc dot gnu.org
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: yuri.karlsbrun at broadcom dot com @ 2021-08-14  2:19 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101905

            Bug ID: 101905
           Summary: Missed debug information for global register variable
           Product: gcc
           Version: 9.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: yuri.karlsbrun at broadcom dot com
  Target Milestone: ---

file evi.c:
register void* regVar asm ("r15");
int
main()
{
  char *str = "Hello";
  regVar = str;
  return 0;
}

% gcc -v
Using built-in specs.
COLLECT_GCC=/tools/oss/packages/x86_64-centos7/gcc/9.3.0/bin/gcc
COLLECT_LTO_WRAPPER=/tools/oss/packages/x86_64-rhel7/gcc/9.3.0/bin/../libexec/gcc/x86_64-pc-linux-gnu/9.3.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../../gcc-9.3.0/configure
--prefix=/tools/oss/packages/x86_64-centos7/gcc/9.3.0 --with-gnu-as
--with-as=/tools/bin/as --with-gnu-ld --with-ld=/tools/bin/ld
--with-mpc=/tools/oss/packages/x86_64-centos7/mpc/1.0.3
--with-mpfr=/tools/oss/packages/x86_64-centos7/mpfr/3.1.2
--enable-languages=c,c++,objc --enable-symvers=gnu
Thread model: posix
gcc version 9.3.0 (GCC) 
% gcc -g3 evi.c -o evi
% gdb evi
(gdb) list
1 register void* regVar asm ("r15");
2 int
3 main()
4 {
5  char *str = "Hello";
6  regVar = str;
7  return 0;
8 }
(gdb) b 7
Breakpoint 1 at 0x400502: file evi.c, line 7.
(gdb) r
Starting program: evi
Breakpoint 1, main () at evi.c:7
7  return 0;
(gdb) p regVar
Missing ELF symbol "regVar".
(gdb) p str
$1 = 0x400594 "Hello"
(gdb) p/x $r15
$2 = 0x400594
(gdb) p (char *)$r15
$3 = 0x400594 "Hello"

I tried it for ARM architecture as well with the same result. 
Thanks,
    Yuri

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2022-05-11  6:36 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-14  2:19 [Bug debug/101905] New: Missed debug information for global register variable yuri.karlsbrun at broadcom dot com
2021-08-16  9:03 ` [Bug debug/101905] " rguenth at gcc dot gnu.org
2021-08-16 10:33 ` jakub at gcc dot gnu.org
2021-08-18 20:42 ` yuri.karlsbrun at broadcom dot com
2021-08-18 21:04 ` [Bug debug/101905] [9/10/11/12 Regression] " jakub at gcc dot gnu.org
2021-08-18 21:10 ` jakub at gcc dot gnu.org
2021-08-18 21:34 ` jakub at gcc dot gnu.org
2021-08-19  8:47 ` rguenth at gcc dot gnu.org
2021-08-20 11:33 ` jakub at gcc dot gnu.org
2021-08-20 12:49 ` rguenther at suse dot de
2021-08-23  9:51 ` cvs-commit at gcc dot gnu.org
2021-08-23  9:55 ` cvs-commit at gcc dot gnu.org
2021-08-23 10:05 ` [Bug debug/101905] [9/10 " jakub at gcc dot gnu.org
2022-05-10  8:20 ` cvs-commit at gcc dot gnu.org
2022-05-11  6:22 ` cvs-commit at gcc dot gnu.org
2022-05-11  6:36 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).