public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "jwakely.gcc at gmail dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug python/27510] Document gdb.Type string representations
Date: Thu, 04 Mar 2021 14:28:00 +0000	[thread overview]
Message-ID: <bug-27510-4717-vl5Jw3l0Fs@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-27510-4717@http.sourceware.org/bugzilla/>

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

--- Comment #2 from Jonathan Wakely <jwakely.gcc at gmail dot com> ---
But to make things more complicated ...

echo 'struct S { } s;' > test.C
g++ -g -c test.C -o test1.o
echo 'int main() { }' >> test.C
g++ -g -c test.C -o test2.o

gdb -q -ex 'py print(gdb.lookup_type("S"))' -ex q test1.o
Reading symbols from test1.o...
struct S

gdb -q -ex 'py print(gdb.lookup_type("S"))' -ex q test2.o
Reading symbols from test2.o...
S

WAT?

Whether str(gdb.Type) includes the "struct" class-head depends on whether
main() is defined in the same translation unit? How does that make sense?

It is at least consistent with 'whatis':

gdb -q -ex 'whatis s' -ex q test1.o
Reading symbols from test1.o...
type = struct S

gdb -q -ex 'whatis s' -ex q test2.o
Reading symbols from test2.o...
type = S

But ... why?

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

  parent reply	other threads:[~2021-03-04 14:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-04 13:00 [Bug python/27510] New: " jwakely.gcc at gmail dot com
2021-03-04 13:04 ` [Bug python/27510] " jwakely.gcc at gmail dot com
2021-03-04 13:06 ` hi-angel at yandex dot ru
2021-03-04 14:28 ` jwakely.gcc at gmail dot com [this message]
2021-03-05 13:50 ` ssbssa 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-27510-4717-vl5Jw3l0Fs@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).