public inbox for gdb-prs@sourceware.org help / color / mirror / Atom feed
From: "jacob at jacob dot remcomp.fr" <sourceware-bugzilla@sourceware.org> To: gdb-prs@sourceware.org Subject: [Bug c++/28465] New: Problems wit long double data in gdb ARM 64 aarch64 Date: Sun, 17 Oct 2021 18:37:16 +0000 [thread overview] Message-ID: <bug-28465-4717@http.sourceware.org/bugzilla/> (raw) https://sourceware.org/bugzilla/show_bug.cgi?id=28465 Bug ID: 28465 Summary: Problems wit long double data in gdb ARM 64 aarch64 Product: gdb Version: 9.2 Status: UNCONFIRMED Severity: critical Priority: P2 Component: c++ Assignee: unassigned at sourceware dot org Reporter: jacob at jacob dot remcomp.fr Target Milestone: --- Dear friends: Consider the following program jacob@rock64:~/lcc/book/test$ cat tgh.c #include <stdio.h> int main(void) { long double d1=19.76; printf("%Lg\n",d1); } I compile it: jacob@rock64:~/lcc/book/test$ gcc -g tgh.c Then, I run it: jacob@rock64:~/lcc/book/test$ ./a.out 19.76 I start gdb jacob@rock64:~/lcc/book/test$ gdb a.out GNU gdb (Debian 7.12-6) 7.12.0.20161007-git Copyright (C) 2016 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 "aarch64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://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 a.out...done. (gdb) run Starting program: /home/jacob/lcc/book/test/a.out 19.76 [Inferior 1 (process 4233) exited normally] Now, I set a breakpoint: Breakpoint 1 at 0x5555555848: file tgh.c, line 4. (gdb) run Starting program: /home/jacob/lcc/book/test/a.out Breakpoint 1, main () at tgh.c:4 4 long double d1=19.76; (gdb) c Continuing. -3.7745e+4414 [Inferior 1 (process 4236) exited normally] The output is completely wrong!!!!!!!! The problem becomes even more strange if I follow the program with instruction single step: (gdb) run Starting program: /home/jacob/lcc/book/test/a.out Breakpoint 1, main () at tgh.c:4 4 long double d1=19.76; (gdb) display/3i $pc-4 1: x/3i $pc-4 0x5555555844 <main+4>: mov x29, sp => 0x5555555848 <main+8>: ldr q0, 0x5555555870 0x555555584c <main+12>: str q0, [x29,#16] (gdb) print *(long double *)0x5555555870 $4 = 19.760000000000001563194018672220409 The correct data is at the specified address!!!!!!!!!!!!! (gdb) nexti 0x000000555555584c 4 long double d1=19.76; 1: x/3i $pc-4 0x5555555848 <main+8>: ldr q0, 0x5555555870 => 0x555555584c <main+12>: str q0, [x29,#16] 0x5555555850 <main+16>: adrp x0, 0x5555555000 (gdb) print $q0 $5 = {u = 0xf947e0009000008097ffffeb97ffffe4, s = 0xf947e0009000008097ffffeb97ffffe4} (gdb) print (long double)$q0 $6 = -inf Apparently the "ldd" instructions does NOT load the data at the specified address!!!!! What is going on??????? jacob@rock64:~/lcc/book/test$ uname -a Linux rock64 4.4.152-rockchip64 #1 SMP Sun Aug 26 14:40:54 CEST 2018 aarch64 GNU/Linux This is the "rock64" small machine (ARM CPU) available at https://www.pine64.org/devices/single-board-computers/rock64/ -- You are receiving this mail because: You are on the CC list for the bug.
next reply other threads:[~2021-10-17 18:37 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-10-17 18:37 jacob at jacob dot remcomp.fr [this message] 2021-10-22 15:15 ` [Bug c++/28465] " tromey at sourceware dot org 2021-10-28 12:01 ` jacob at jacob dot remcomp.fr 2021-10-28 18:56 ` simon.marchi at polymtl dot ca 2022-09-01 16:22 ` luis.machado at arm dot com 2022-09-09 8:56 ` luis.machado at arm dot com 2022-09-09 8:56 ` luis.machado at arm dot com
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-28465-4717@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: linkBe 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).