public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "dclarke at blastwave dot org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug gdb/27750] local variables have wrong address and values on sparc64
Date: Sat, 17 Apr 2021 17:53:59 +0000	[thread overview]
Message-ID: <bug-27750-4717-WXtHSXihQJ@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-27750-4717@http.sourceware.org/bugzilla/>

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

--- Comment #2 from Dennis Clarke <dclarke at blastwave dot org> ---

Seems like a good observation and I sort of wondered about the compiler
here. So then with gcc 9.3.0 from the Debian folks : 

mimas$ /usr/bin/sparc64-linux-gnu-gcc-9 --version 
sparc64-linux-gnu-gcc-9 (Debian 9.3.0-21) 9.3.0
Copyright (C) 2019 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$ 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$ /usr/bin/sparc64-linux-gnu-gcc-9 -std=iso9899:1999 \
> -pedantic -pedantic-errors -fno-builtin -g -m64 -O0 \
> -mno-app-regs -mcpu=ultrasparc -mmemory-model=tso \
> -o foo_gcc-9 foo.c 
mimas$ 
mimas$ which gdb
/home/dclarke/local/bin/gdb
mimas$ 
mimas$ TERM=dumb LC_ALL=C /home/dclarke/local/bin/gdb ./foo_gcc-9
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_gcc-9...
(gdb) break foo.c:13
Breakpoint 1 at 0x878: file foo.c, line 13.
(gdb) run
Starting program: /home/dclarke/foo_gcc-9 
a = 1
&a = 0x7fefffff5bc

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 *) 0x7feffa5d49c
(gdb) cont
Continuing.
[Inferior 1 (process 53214) exited normally]
(gdb) quit
mimas$ 

I will attach two binaries : 

    1) foo_sparc64_gcc-10.xz  made with gcc 10.2.1

    2) foo_sparc64_gcc-9.xz   made with gcc 9.3.0

I may go get sources to a previous gdb release and see if I can build
and test.

Thank you so much for your kind attention to this.

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

  parent reply	other threads:[~2021-04-17 17:53 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-17 16:15 [Bug gdb/27750] New: " 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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-27750-4717-WXtHSXihQJ@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).