public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "hluaw at connect dot ust.hk" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug gdb/30296] New: GDB showing <synthetic pointer> for struct members that are clearly not.
Date: Fri, 31 Mar 2023 16:27:42 +0000	[thread overview]
Message-ID: <bug-30296-4717@http.sourceware.org/bugzilla/> (raw)

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

            Bug ID: 30296
           Summary: GDB showing <synthetic pointer> for struct members
                    that are clearly not.
           Product: gdb
           Version: HEAD
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: hluaw at connect dot ust.hk
  Target Milestone: ---

Code:
#include "stdint.h"
int a, b;
volatile int c;
int16_t func_3();
int16_t func_3() {
  int64_t l_126[4] = {0x5C253C716A15F506LL, 0x5C253C716A15F506LL,
                      0x5C253C716A15F506LL, 0x5C253C716A15F506LL};
  b = l_126[0];
  return c;
}
int main() { func_3(); }


Compile:
$ clang -O1 -g r.c
$ clang -v
  clang version 15.0.7
  Target: x86_64-pc-linux-gnu
  Thread model: posix
  InstalledDir: /usr/lib/llvm/15/bin
  Configuration file: /etc/clang/clang.cfg
  System configuration file directory: /etc/clang
  Selected GCC installation: /usr/lib/gcc/x86_64-pc-linux-gnu/11
  Candidate multilib: .;@m64
  Candidate multilib: 32;@m32
  Selected multilib: .;@m64

GDB Behavior:
(gdb) b func_3
Breakpoint 1 at 0x1130: func_3. (2 locations)
(gdb) r
Starting program: /home/john/documents/debugger-bugs/struct_syn/reduce/a.out
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Breakpoint 1, func_3 () at r.c:8
8         b = l_126[0];
(gdb) p l_126
$1 = {6639779683436459270, <synthetic pointer>, <synthetic pointer>, <synthetic
pointer>}
(gdb) info addr l_126
Symbol "l_126" is a complex DWARF expression:
     0: DW_OP_constu 6639779683436459270
    10: DW_OP_stack_value
    [8-byte piece].

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

             reply	other threads:[~2023-03-31 16:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-31 16:27 hluaw at connect dot ust.hk [this message]
2023-03-31 16:56 ` [Bug gdb/30296] " tromey at sourceware dot org
2023-03-31 17:03 ` tromey at sourceware dot org
2023-04-20 22:23 ` tromey at sourceware dot org
2023-04-21  0:33 ` tromey at sourceware dot org
2023-04-21 12:20 ` tromey at sourceware dot org
2023-04-21 23:28 ` tromey at sourceware dot org
2023-05-11 21:48 ` cvs-commit at gcc dot gnu.org
2023-05-11 21:49 ` tromey at sourceware dot org

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