Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Apr 2016 18:19:48 +0530
From:      Aijaz Baig <aijazbaig1@gmail.com>
To:        freebsd-hackers@freebsd.org, freebsd-stable@freebsd.org
Subject:   Toggling between remote KGDB and local DDB within a debugging session
Message-ID:  <CAHB2L%2Bde=Bxn4G2uEDdN%2BSPY=SREN9REGShV=gnRombjqStYzw@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hello

I think the title says it all!! :)

I would like to know if there is indeed a way to toggle between gdb
and ddb while debugging a remote kernel. I am already at the gdb (or
rather kgdb) prompt. From here how do I switch to local ddb on the
debugged machine??

My kernel configuration file already contains 'options
BREAK_TO_DEBUGGER' and I have BOTH GDB and DDB configured aka:
options GDB
options DDB

I tried adding 'options KDB_UNATTENDED' but that does not make any difference.

As per the developer's handbook, "Every time you type gdb, the mode
will be toggled between remote GDB and local DDB. In order to force a
next trap immediately, simply type s (step). Your hosting GDB will now
gain control over the target kernel:" Now when you type 'gdb' at the
DDB prompt, KGDB takes over remotely. On continuing at the KGDB
prompt, you arrive back at the debugged machine but it is not longer
under the control of DDB.

My question is, how do I drop to DDB from within a running machine
whose serial ports (albeit virtual ones) are remotely attached to
another machine? When remote remote KGDB is listening and I force a
panic using 'sysctl debug.kdb.enter=1', it drops into remote KGDB.
However, when it is NOT listening on the serial port, the local system
just freezes

What I want, is to enter ddb on the local machine. Do some debugging
using it; drop to remote KGDB for things that are best done using
KGDB, then switch back to local DDB when I'm done.

Is there a way to do that? If yes please do let me know

-- 

Best Regards,
Aijaz Baig



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAHB2L%2Bde=Bxn4G2uEDdN%2BSPY=SREN9REGShV=gnRombjqStYzw>