This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [RFA]: Java baseclass offset patch (Was Re: question about gdb)


Dan> I can tell you how to reproduce it, if you tell me if it's the
Dan> same one you are seeing (ie you are doing the same type of
Dan> thing).

Dan> class hwbase
Dan> {
Dan>         public String q;
Dan> }
Dan> public class hw extends hwbase
Dan> {
Dan>         public String s;
Dan>         public hw (String str)
Dan>         {
Dan>                 super();
Dan>                 s=str;
Dan>         }
Dan>         public static void main(String [] arg)
Dan>         {
Dan>                 hw o = new hw("hello\n");
Dan>                 System.out.println(o.s);
Dan>         }
Dan> }

Dan> break hw::main
Dan> run
Dan> next
Dan> p *o.s

Incidentally, if I follow this recipe in gdb, and then at the end do
another "run", gdb will crash.  Stack trace appended -- it looks like
the same crash I've seen many times.

Tom

#0  strcmp (p1=0x0, p2=0x8d9504c "/x1/egcs/install/lib/libgcj.so.1")
    at ../sysdeps/generic/strcmp.c:38
#1  0x80ba4e3 in symbol_add_stub (arg=0x8d94c18) at ../../src/gdb/solib.c:1183
#2  0x80e755c in catch_errors (func=0x80ba4a0 <symbol_add_stub>, 
    args=0x8d94c18, 
    errstring=0x827d0e0 "Error while reading shared library symbols:\n", 
    mask=6) at ../../src/gdb/top.c:607
#3  0x80ba8e9 in solib_add (pattern=0x0, from_tty=0, target=0x0)
    at ../../src/gdb/solib.c:1452
#4  0x80a4d77 in handle_inferior_event (ecs=0xbffff15c)
    at ../../src/gdb/infrun.c:2447
#5  0x80a3efa in wait_for_inferior () at ../../src/gdb/infrun.c:1291
#6  0x80a3d74 in proceed (addr=4294967295, siggnal=TARGET_SIGNAL_0, step=0)
    at ../../src/gdb/infrun.c:1085
#7  0x80bd89e in linuxthreads_create_inferior (
    exec_file=0x834e620 "/tmp/./hw", allargs=0x83419e0 "", env=0x8341a00)
    at ../../src/gdb/linux-thread.c:1569
#8  0x80ce807 in find_default_create_inferior (
    exec_file=0x834e620 "/tmp/./hw", allargs=0x83419e0 "", env=0x8341a00)
    at ../../src/gdb/target.c:1134
#9  0x80a144c in run_command (args=0x0, from_tty=1)
    at ../../src/gdb/infcmd.c:335
#10 0x80e8356 in execute_command (p=0x8339939 "", from_tty=1)
    at ../../src/gdb/top.c:1519
#11 0x80aeafd in command_handler (command=0x8339938 "")
    at ../../src/gdb/event-top.c:515
#12 0x80af174 in command_line_handler (rl=0x8dcbcd0 "à¼Ü\b")
    at ../../src/gdb/event-top.c:811
#13 0x817eef4 in rl_callback_read_char () at ../../src/readline/callback.c:114
#14 0x80ae9cf in stdin_event_handler (error=0, client_data=0x0)
    at ../../src/gdb/event-top.c:422
#15 0x8101b0a in handle_file_event (event_file_desc=0)
    at ../../src/gdb/event-loop.c:748
#16 0x8101589 in process_event () at ../../src/gdb/event-loop.c:383
#17 0x81015d9 in gdb_do_one_event (data=0x0) at ../../src/gdb/event-loop.c:420
#18 0x80e755c in catch_errors (func=0x81015b0 <gdb_do_one_event>, args=0x0, 
    errstring=0x8292ca0 "", mask=6) at ../../src/gdb/top.c:607
#19 0x8101624 in start_event_loop () at ../../src/gdb/event-loop.c:456
#20 0x80815e8 in captured_command_loop (data=0x0) at ../../src/gdb/main.c:104
#21 0x80e755c in catch_errors (func=0x80815d0 <captured_command_loop>, 
    args=0x0, errstring=0x8264b82 "", mask=6) at ../../src/gdb/top.c:607
#22 0x8082013 in captured_main (data=0xbffff7e0) at ../../src/gdb/main.c:749
#23 0x80e755c in catch_errors (func=0x8081620 <captured_main>, 
    args=0xbffff7e0, errstring=0x8264b82 "", mask=6) at ../../src/gdb/top.c:607
#24 0x8082047 in main (argc=3, argv=0xbffff834) at ../../src/gdb/main.c:761
#25 0x4013c9cb in __libc_start_main (main=0x8082020 <main>, argc=3, 
    argv=0xbffff834, init=0x807fdfc <_init>, fini=0x8264a2c <_fini>, 
    rtld_fini=0x4000ae60 <_dl_fini>, stack_end=0xbffff82c)
    at ../sysdeps/generic/libc-start.c:92

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]