From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 04FB13894C2B; Sat, 17 Apr 2021 16:15:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 04FB13894C2B From: "dclarke at blastwave dot org" To: gdb-prs@sourceware.org Subject: [Bug gdb/27750] New: local variables have wrong address and values on sparc64 Date: Sat, 17 Apr 2021 16:15:42 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: 10.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dclarke at blastwave dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Apr 2021 16:15:43 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27750 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 :=20 mimas$=20 mimas$ uname -a=20 Linux mimas 5.10.0-6-sparc64 #1 Debian 5.10.28-1 (2021-04-09) sparc64 GNU/L= inux mimas$=20 mimas$=20 mimas$ /usr/bin/gcc --version=20 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$=20 mimas$=20 mimas$ cat -n foo.c=20 1 2 #include 3 #include 4 5 int main(int argc, char **argv) 6 { 7 int a =3D 1; 8 9 printf("a =3D %i\n", a); 10 11 printf("&a =3D %p\n", &a); 12 13 return EXIT_SUCCESS; 14 15 } 16 mimas$=20 mimas$=20 mimas$ /usr/bin/gcc -std=3Diso9899:1999 -pedantic -pedantic-errors -fno-bui= ltin -g -m64 -O0 -mno-app-regs -mcpu=3Dultrasparc -mmemory-model=3Dtso -o foo fo= o.c=20 mimas$=20 mimas$=20 mimas$ TERM=3Ddumb LC_ALL=3DC /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 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: . Find the GDB manual and other documentation resources online at: . 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=20 a =3D 1 &a =3D 0x7fefffff5dc Breakpoint 1, main (argc=3D0, argv=3D0x0) at foo.c:13 13 return EXIT_SUCCESS; (gdb) print a $1 =3D 0 (gdb) print &a $2 =3D (int *) 0x7feffc5325b (gdb) cont Continuing. [Inferior 1 (process 52994) exited normally] (gdb) quit mimas$=20 With a fresh local build of gdb 10.1 I see the same behavior :=20 mimas$=20 mimas$ which gdb /home/dclarke/local/bin/gdb mimas$=20 mimas$ gdb --version=20 GNU gdb (GDB) 10.1 Copyright (C) 2020 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. mimas$=20 mimas$ TERM=3Ddumb LC_ALL=3DC /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 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: . Find the GDB manual and other documentation resources online at: . 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=20 a =3D 1 &a =3D 0x7fefffff5cc Breakpoint 1, main (argc=3D0, argv=3D0x0) at foo.c:13 13 return EXIT_SUCCESS; (gdb) print a $1 =3D 0 (gdb) print &a $2 =3D (int *) 0x7feffcf94ac (gdb) cont Continuing. [Inferior 1 (process 52988) exited normally] (gdb) quit mimas$=20 --=20 Dennis Clarke RISC-V/SPARC/PPC/ARM/CISC UNIX and Linux spoken GreyBeard and suspenders optional --=20 You are receiving this mail because: You are on the CC list for the bug.=