Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kgdb broken?

How should one use ddb's kgdb command?



TARGET working NetBSD-current/amd64 box
- kernel with (added DDB back since yesterday)
    makeoptions   COPTS="-O2 -fno-omit-frame-pointer"
    options       DDB             # in-kernel debugger
    #options      DDB_COMMANDONENTER="bt" # execute command when ddb is entered
    options       DDB_ONPANIC=1   # see also sysctl(8): `ddb.onpanic'
    options       DDB_HISTORY_SIZE=512    # enable history editing in DDB
    options       KGDB            # remote debugger
    options       KGDB_DEVNAME="\"com\"",KGDB_DEVADDR=0x3f8,KGDB_DEVRATE=115200
    makeoptions   DEBUG="-g"      # compile full symbol table
- dmesg:
    com0 at acpi0 (UAR1, PNP0501-1): io 0x3f8-0x3ff irq 4
    com0: ns16550a, working fifo
    com0: console
    com0: kgdb
- /etc/ttys: (shouldn't matter, right?)
    console "/usr/libexec/getty Pc"         vt100   on secure
    constty "/usr/libexec/getty Pc"         vt100   off secure
    tty00   "/usr/libexec/getty std.115200" vt100 off secure
- bootblocks:
    Boot options:    timeout 5, flags 0, speed 115200, ioaddr 0, console com0

REMOTE working NetBSD-current/amd64 laptop
- dmesg:
    uplcom0 at uhub3 port 2
    uplcom0: Prolific Technology PL2303 Serial adapter (ATEN/IOGEAR UC232A), 
rev 1.10/2.02, addr 3
    ucom3 at uplcom0
- /etc/ttys:
    console "/usr/libexec/getty Pc"         vt100   off secure
    constty "/usr/libexec/getty Pc"         vt100   off
    ttyU3   "/usr/libexec/getty std.115200" unknown off local
- .gdbinit:
    file netbsd.gdb
    set remote interrupt-sequence Ctrl-C
    set remotebaud 115200
    set debug remote 1
    target remote /dev/ttyU3
- /etc/remote

Procedure - XXX is this right?:
- boot box, while running tip on remote

> boot -d
10701248+570840+690728 [751032+506075]=0xd9c628
kernel text is mapped with 6 large pages and 53 normal pages
Loaded initial symtab at 0xffffffff80d69790, strtab at 0xffffffff80e20d48, # 
entries 31271
fatal breakpoint trap in supervisor mode
trap type 1 code 0 rip ffffffff80217bdd cs 8 rflags 202 cr2 0 ilevel 8 rsp 
curlwp 0xffffffff80ca6b00 pid 0.1 lowest kstack 0xffffffff80e9a280
Stopped in pid 0.1 (system) at  netbsd:breakpoint+0x5:  leave
db{0}> kgdb
db{0}> ~

- exit from tip, then run gdb
# gdb
GNU gdb (GDB) 7.3.1
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64--netbsd".
For bug reporting instructions, please see:
Sending packet: $qSupported:qRelocInsn+#9a...Ack
Packet received: qSupported:qRelocInsn+
Packet qSupported (supported-packets) is supported
Sending packet: $Hg0#df...Ack
Packet received: Hg0
Sending packet: $?#3f...Ack
Packet received: ?
Sending packet: $Hc-1#09...Ack
Packet received: Hc-1
Sending packet: $qC#b4...Ack
Packet received: qC
Sending packet: $qAttached#8f...Ack
Packet received: qAttached
Packet qAttached (query-attached) is supported
Sending packet: $qOffsets#4b...Ack
Packet received: qOffsets
.gdbinit:5: Error in sourced command file:
Malformed response to offset query, qOffsets

Home | Main Index | Thread Index | Old Index