public inbox for archer@sourceware.org
 help / color / mirror / Atom feed
* question about gdb.Type
@ 2009-08-04 15:02 Matthieu VIAL
  2009-08-10 21:15 ` Tom Tromey
  0 siblings, 1 reply; 2+ messages in thread
From: Matthieu VIAL @ 2009-08-04 15:02 UTC (permalink / raw)
  To: archer

[-- Attachment #1: Type: text/plain, Size: 677 bytes --]

Hello,

I'am using the fields attribute of gdb.Type to find base classes of
type. But the gdb.Type object returned by field.type seems incomplete.
Indeed the fields attribute is always empty. I need to use
gd.lookup_type to get the fields. Is it normal or is it a bug ?

I also get a SIGSEGV in archer if I use the file command to reload the
debuggee after using my python script which uses a lot gdb.Type.

Looking at the backtrace, the SIGSEGV seems to have something to do with
the fields too. gdb is trying to copy the field name.

See the attached file to look at the backtrace.

I'am using archer-refs_heads_archer-tromey-python from 2009-07-30

Regards,
Matthieu VIAL



[-- Attachment #2: backtrace.txt --]
[-- Type: text/plain, Size: 2709 bytes --]

#0  0xb7c8438b in ?? ()
#1  0x082b41a7 in xstrdup (s=0xb743b607 <Address 0xb743b607 out of bounds>) at .././libiberty/xstrdup.c:33
#2  0x0818367e in copy_type_recursive_1 (objfile=<value optimized out>, type=0xa395ba0, copied_types=0xabe3064, representative=0xbf96c9d4) at gdbtypes.c:2932
#3  0x08183821 in copy_type_recursive (objfile=0xa1b6270, type=0xa395ba0, copied_types=0xabe3064) at gdbtypes.c:2999
#4  0x08106ac1 in clean_up_objfile_types (objfile=0xa1b6270, datum=0xb7a69d40) at .././gdb/python/python-type.c:569
#5  0x0809180c in clear_objfile_data (objfile=0xa1b6270) at objfiles.c:876
#6  0x08091f60 in free_objfile (objfile=0xa1b6270) at objfiles.c:859
#7  0x0814fe4d in syms_from_objfile (objfile=0xa1a3c80, addrs=0xa767858, offsets=0x0, num_offsets=0, add_flags=6) at symfile.c:795
#8  0x08151724 in symbol_file_add_with_addrs_or_offsets (abfd=0xa752d48, add_flags=<value optimized out>, addrs=0x0, offsets=0x0, num_offsets=0, flags=8) at symfile.c:1000
#9  0x081523f9 in symbol_file_add_main_1 (args=0xb743b607 <Address 0xb743b607 out of bounds>, from_tty=<value optimized out>, flags=3) at symfile.c:1139
#10 0x0815262f in symbol_file_command (args=0xa0df9a5 "sctest", from_tty=1) at symfile.c:1501
#11 0x0809141a in file_command (arg=0xa0df9a5 "sctest", from_tty=1) at exec.c:367
#12 0x080972a8 in execute_command (p=0xa0df9aa "t", from_tty=1) at top.c:442
#13 0x08174538 in command_handler (command=0xa0df9a0 "") at event-top.c:511
#14 0x08175262 in command_line_handler (rl=0xa18a0b0 "file sctest ") at event-top.c:735
#15 0x08233a4d in rl_callback_read_char () at callback.c:205
#16 0x0817468b in rl_callback_read_char_wrapper (client_data=0x0) at event-top.c:178
#17 0x08174164 in handle_file_event (data={ptr = 0x0, integer = 0}) at event-loop.c:812
#18 0x0817331b in process_event () at event-loop.c:394
#19 0x081740b4 in gdb_do_one_event (data=0x0) at event-loop.c:459
#20 0x0816e4ab in catch_errors (func=0x8173e60 <gdb_do_one_event>, func_args=0x0, errstring=0x82d2901 "", mask=6) at exceptions.c:510
#21 0x080f5b2a in tui_command_loop (data=0x0) at .././gdb/tui/tui-interp.c:153
#22 0x0816eb24 in current_interp_command_loop () at interps.c:291
#23 0x0808ffbb in captured_command_loop (data=0x0) at .././gdb/main.c:227
#24 0x0816e4ab in catch_errors (func=0x808ffb0 <captured_command_loop>, func_args=0x0, errstring=0x82d2901 "", mask=6) at exceptions.c:510
#25 0x0808f7cc in captured_main (data=0xbf96ceb4) at .././gdb/main.c:948
#26 0x0816e4ab in catch_errors (func=0x808ed20 <captured_main>, func_args=0xbf96ceb4, errstring=0x82d2901 "", mask=6) at exceptions.c:510
#27 0x0808eb21 in gdb_main (args=0xbf96ceb4) at .././gdb/main.c:958
#28 0x0808eae5 in main (argc=) at gdb.c:33


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: question about gdb.Type
  2009-08-04 15:02 question about gdb.Type Matthieu VIAL
@ 2009-08-10 21:15 ` Tom Tromey
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2009-08-10 21:15 UTC (permalink / raw)
  To: Matthieu VIAL; +Cc: archer

>>>>> "Matthieu" == Matthieu VIAL <matthieu.vial@orange-ftgroup.com> writes:

Matthieu> I'am using the fields attribute of gdb.Type to find base classes of
Matthieu> type. But the gdb.Type object returned by field.type seems incomplete.
Matthieu> Indeed the fields attribute is always empty. I need to use
Matthieu> gd.lookup_type to get the fields. Is it normal or is it a bug ?

Yeah.  Maybe we need a way to call the equivalent of check_typedef on a
Type.

Matthieu> I also get a SIGSEGV in archer if I use the file command to
Matthieu> reload the debuggee after using my python script which uses a
Matthieu> lot gdb.Type.

Matthieu> Looking at the backtrace, the SIGSEGV seems to have something
Matthieu> to do with the fields too. gdb is trying to copy the field
Matthieu> name.

Matthieu> See the attached file to look at the backtrace.

Thanks, I will try to look into this.
If you have a simple recipe to recreate it, that would help.

Tom

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-08-10 21:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-04 15:02 question about gdb.Type Matthieu VIAL
2009-08-10 21:15 ` Tom Tromey

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