question about gdb.Type

Matthieu VIAL matthieu.vial@orange-ftgroup.com
Tue Aug 4 15:02:00 GMT 2009


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


-------------- next part --------------
#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



More information about the Archer mailing list