public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/27750] New: local variables have wrong address and values on sparc64
@ 2021-04-17 16:15 dclarke at blastwave dot org
  2021-04-17 16:51 ` [Bug gdb/27750] " tromey at sourceware dot org
                   ` (25 more replies)
  0 siblings, 26 replies; 27+ messages in thread
From: dclarke at blastwave dot org @ 2021-04-17 16:15 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=27750

            Bug ID: 27750
           Summary: local variables have wrong address and values on
                    sparc64
           Product: gdb
           Version: 10.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: dclarke at blastwave dot org
  Target Milestone: ---

Possibly similar to 23220 however on 64-bit recent Debian sid with
trivial code I see : 

mimas$ 
mimas$ uname -a 
Linux mimas 5.10.0-6-sparc64 #1 Debian 5.10.28-1 (2021-04-09) sparc64 GNU/Linux
mimas$ 

mimas$ 
mimas$ /usr/bin/gcc --version 
gcc (Debian 10.2.1-6) 10.2.1 20210110
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

mimas$ 

mimas$ 
mimas$ cat -n foo.c 
     1
     2  #include <stdio.h>
     3  #include <stdlib.h>
     4
     5  int main(int argc, char **argv)
     6  {
     7      int a = 1;
     8
     9      printf("a = %i\n", a);
    10
    11      printf("&a = %p\n", &a);
    12
    13      return EXIT_SUCCESS;
    14
    15  }
    16
mimas$ 

mimas$ 
mimas$ /usr/bin/gcc -std=iso9899:1999 -pedantic -pedantic-errors -fno-builtin
-g -m64 -O0 -mno-app-regs -mcpu=ultrasparc -mmemory-model=tso -o foo foo.c 
mimas$ 

mimas$ 
mimas$ TERM=dumb LC_ALL=C /usr/bin/gdb ./foo
GNU gdb (Debian 10.1-2) 10.1.90.20210103-git
Copyright (C) 2021 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 "sparc64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./foo...
(gdb) break 13
Breakpoint 1 at 0x858: file foo.c, line 13.
(gdb) run
Starting program: /home/dclarke/foo 
a = 1
&a = 0x7fefffff5dc

Breakpoint 1, main (argc=0, argv=0x0) at foo.c:13
13          return EXIT_SUCCESS;
(gdb) print a
$1 = 0
(gdb) print &a
$2 = (int *) 0x7feffc5325b
(gdb) cont
Continuing.
[Inferior 1 (process 52994) exited normally]
(gdb) quit
mimas$ 

With a fresh local build of gdb 10.1 I see the same behavior : 

mimas$ 
mimas$ which gdb
/home/dclarke/local/bin/gdb
mimas$ 
mimas$ gdb --version 
GNU gdb (GDB) 10.1
Copyright (C) 2020 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.
mimas$ 

mimas$ TERM=dumb LC_ALL=C /home/dclarke/local/bin/gdb ./foo
GNU gdb (GDB) 10.1
Copyright (C) 2020 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 "sparc64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./foo...
(gdb) break 13
Breakpoint 1 at 0x858: file foo.c, line 13.
(gdb) run
Starting program: /home/dclarke/foo 
a = 1
&a = 0x7fefffff5cc

Breakpoint 1, main (argc=0, argv=0x0) at foo.c:13
13          return EXIT_SUCCESS;
(gdb) print a
$1 = 0
(gdb) print &a
$2 = (int *) 0x7feffcf94ac
(gdb) cont
Continuing.
[Inferior 1 (process 52988) exited normally]
(gdb) quit
mimas$ 


-- 
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken
GreyBeard and suspenders optional

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

end of thread, other threads:[~2021-10-24 10:01 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-17 16:15 [Bug gdb/27750] New: local variables have wrong address and values on sparc64 dclarke at blastwave dot org
2021-04-17 16:51 ` [Bug gdb/27750] " tromey at sourceware dot org
2021-04-17 17:53 ` dclarke at blastwave dot org
2021-04-17 17:55 ` dclarke at blastwave dot org
2021-04-17 17:56 ` dclarke at blastwave dot org
2021-04-17 20:32 ` tromey at sourceware dot org
2021-04-17 22:55 ` dclarke at blastwave dot org
2021-04-18  1:21 ` simark at simark dot ca
2021-04-18  1:57 ` tromey at sourceware dot org
2021-04-19  0:51 ` simark at simark dot ca
2021-04-19 10:44 ` dclarke at blastwave dot org
2021-04-19 12:31 ` glaubitz at physik dot fu-berlin.de
2021-04-19 13:29 ` tromey at sourceware dot org
2021-06-27 17:54 ` ahmedsayeed1982 at yahoo dot com
2021-08-10 12:45 ` ucelsanicin at yahoo dot com
2021-08-23  6:05 ` marlenesanchez231+gaby at gmail dot com
2021-08-23  6:54 ` mark at klomp dot org
2021-09-02 11:06 ` donipah907 at mtlcz dot com
2021-09-06  9:09 ` focixujo at livinginsurance dot co.uk
2021-09-10 19:39 ` mehmetgelisin at aol dot com
2021-09-14 12:54 ` jarilittlenen at yahoo dot com
2021-09-22 10:19 ` diheto5497 at secbuf dot com
2021-09-28  1:38 ` marlenesanchez231+jaime at gmail dot com
2021-10-09 11:00 ` gulsenenginar at aol dot com
2021-10-10 16:11 ` oficaj3 at gmail dot com
2021-10-19  7:13 ` progonsaytu at gmail dot com
2021-10-24 10:01 ` glassmtech at ukr dot net

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).