From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: eliz@gnu.org, brobecker@adacore.com, gdb-patches@sourceware.org
Subject: Re: New warning in GDB 7.5
Date: Mon, 20 Aug 2012 14:24:00 -0000 [thread overview]
Message-ID: <20120820142417.GA1149@host2.jankratochvil.net> (raw)
In-Reply-To: <201208191910.q7JJAnQ0023236@glazunov.sibelius.xs4all.nl>
On Sun, 19 Aug 2012 21:10:49 +0200, Mark Kettenis wrote:
> set $tem = (struct Lisp_Symbol *) $ptr
>
> probably won't trigger a full symbol read since "struct Lisp_Symbol"
> is a type and not a function or variable.
It will, because GDB generates symbols for each type. See for example:
process_structure_scope -> new_symbol_full <DW_TAG_structure_type> ->
-> add_symbol_to_list
It should work without any stub 'set' commands, if it does not one should have
a reproducer (one can download Emacs but a minimal reproducer would be
better).
Regards,
Jan
struct s { int i; } v;
gdb -ex r --args ./gdb ./63.o
Reading symbols from /home/jkratoch/redhat/gdb-clean/gdb/63.o...done.
(gdb) maintenance info psymtabs
{ objfile /home/jkratoch/redhat/gdb-clean/gdb/63.o ((struct objfile *) 0x2224c80)
{ psymtab 63.c ((struct partial_symtab *) 0x2218dc0)
readin no
fullname (null)
text addresses 0x0 -- 0x0
psymtabs_addrmap_supported yes
globals (* (struct partial_symbol **) 0x221a780 @ 1)
statics (* (struct partial_symbol **) 0x222fe50 @ 2)
dependencies (none)
}
}
(gdb) maintenance info symtabs
(gdb)
Program received signal SIGINT, Interrupt.
0x00007ffff638dd30 in __poll_nocancel () at ../sysdeps/unix/syscall-template.S:81
81 T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS)
# global symbol
(gdb) p *(* (struct partial_symbol **) 0x221a780 @ 1)[0]
$3 = {ginfo = {name = 0x2218d5a "v", value = {ivalue = 0, block = 0x0, bytes = 0x0, address = 0, chain = 0x0}, language_specific = {mangled_lang = {
demangled_name = 0x0}, cplus_specific = 0x0}, language = language_c, section = 0, obj_section = 0x0}, domain = VAR_DOMAIN, aclass = LOC_STATIC}
# static symbol
(gdb) p *(* (struct partial_symbol **) 0x222fe50 @ 2)[0]
$5 = {ginfo = {name = 0x2218d55 "int", value = {ivalue = 0, block = 0x0, bytes = 0x0, address = 0, chain = 0x0}, language_specific = {mangled_lang = {
demangled_name = 0x0}, cplus_specific = 0x0}, language = language_c, section = 0, obj_section = 0x0}, domain = VAR_DOMAIN, aclass = LOC_TYPEDEF}
# static symbol
(gdb) p *(* (struct partial_symbol **) 0x222fe50 @ 2)[1]
$6 = {ginfo = {name = 0x2218d3e "s", value = {ivalue = 0, block = 0x0, bytes = 0x0, address = 0, chain = 0x0}, language_specific = {mangled_lang = {
demangled_name = 0x0}, cplus_specific = 0x0}, language = language_c, section = 0, obj_section = 0x0}, domain = STRUCT_DOMAIN, aclass = LOC_TYPEDEF}
(gdb) c
Continuing.
(gdb) p (struct s *) 0
$1 = (struct s *) 0x0
(gdb) maintenance info symtabs
{ objfile /home/jkratoch/redhat/gdb-clean/gdb/63.o ((struct objfile *) 0x2224c80)
{ symtab 63.c ((struct symtab *) 0x2219790)
dirname /home/jkratoch/redhat/gdb-clean/gdb
fullname (null)
blockvector ((struct blockvector *) 0x2219770) (primary)
linetable ((struct linetable *) 0x0)
debugformat DWARF 2
}
}
next prev parent reply other threads:[~2012-08-20 14:24 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-18 20:03 Eli Zaretskii
2012-08-18 20:56 ` Joel Brobecker
2012-08-18 21:01 ` Eli Zaretskii
2012-08-18 21:49 ` Mark Kettenis
2012-08-19 2:46 ` Eli Zaretskii
2012-08-19 4:37 ` Joel Brobecker
2012-08-19 16:53 ` Eli Zaretskii
2012-08-19 18:07 ` Joel Brobecker
2012-08-19 18:27 ` Eli Zaretskii
2012-08-19 18:33 ` Joel Brobecker
2012-08-19 18:33 ` Mark Kettenis
2012-08-19 18:59 ` Eli Zaretskii
2012-08-19 19:11 ` Mark Kettenis
2012-08-19 19:44 ` Eli Zaretskii
2012-08-20 14:24 ` Jan Kratochvil [this message]
2012-08-20 16:33 ` Eli Zaretskii
2012-08-20 17:07 ` Jan Kratochvil
2012-08-20 17:35 ` Eli Zaretskii
2012-08-20 15:01 ` Tom Tromey
2012-08-20 16:34 ` Eli Zaretskii
2012-08-20 17:28 ` Tom Tromey
2012-08-20 18:03 ` Tom Tromey
2012-08-20 18:56 ` Eli Zaretskii
2012-08-20 19:22 ` Tom Tromey
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=20120820142417.GA1149@host2.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=brobecker@adacore.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=mark.kettenis@xs4all.nl \
/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