From owner-freebsd-stable@freebsd.org Tue Apr 19 16:35:58 2016 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 999C0B14EDA; Tue, 19 Apr 2016 16:35:58 +0000 (UTC) (envelope-from aijazbaig1@gmail.com) Received: from mail-wm0-x22c.google.com (mail-wm0-x22c.google.com [IPv6:2a00:1450:400c:c09::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E87F1CE1; Tue, 19 Apr 2016 16:35:58 +0000 (UTC) (envelope-from aijazbaig1@gmail.com) Received: by mail-wm0-x22c.google.com with SMTP id n3so39565751wmn.0; Tue, 19 Apr 2016 09:35:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=xzajR6WxyLvNbF3AbZYgAQ3tAL4xF7A3YcB3Wc43oqg=; b=UkSZZgVJDpDdoz0vSqqOyVWPUbjbaMw706V+dE1uIWfAtxTX4m9jost6liwTvGuWCX +YJDhtqe2VuEdwQrgrECCjwEVrKzMbPl+FPV0fhvFs4MZpVU6YYDxq3XcTDPGkn1lDCh QMiApTcIy5vu28SKAfaqCVzSktNPVOdQF8zlMXlTZYYv946rsLfPIxaLjXP2eZgqo5f1 LzunQjrS4t1oy9mFSjJwDy8JQJmZ3OrNTy7XkgfvPQ8JJpvCVAPv4yIUMByAMo1okF7B TSxSC6+Q8oxfn+JKJZuhqOCFFA/XEs6mlH/8aRruvGlA0erKwTpBB95romsOnl43keif Yy+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=xzajR6WxyLvNbF3AbZYgAQ3tAL4xF7A3YcB3Wc43oqg=; b=kjqhKylfZ6UCcXZjXRTToJU9M68zIaycsMNc5MkYV6bMlfr6Jvp8MAyyqTRPx+mAqp rINn4kVbiRNLchjBRQyvr6TINW+P8CI2NVIVX905IliES7whDm9mc1vH/a9uz6Sua2TB EBQjSVIsRFRHuxWNHIpnWpWlkBLkjOZitlbbi5njZCFOXw4ZixMJGP/MFFWSiB4VQOTk QTSe61aj8tvZPd8Rpux5NHav5XZR0VCFpxzeRy6zbMdI497JijEa24WGq8VwIEMs/7P3 D/J6SH5AttUCnBgFdr/Ls0LkGRek5pnAq7Cl3YdS0qrRpN5LsO+v66HCRb4kbOMgwCwL TYfg== X-Gm-Message-State: AOPr4FWZYGMdkuJf8KcluGkh/DDyRy2tvPuPDzZMynat7IWJtiKUj61fFfLgs/jpiiCtbdlFnFkS4Mm0AZb2bw== MIME-Version: 1.0 X-Received: by 10.194.184.38 with SMTP id er6mr3924030wjc.93.1461083755747; Tue, 19 Apr 2016 09:35:55 -0700 (PDT) Received: by 10.194.21.162 with HTTP; Tue, 19 Apr 2016 09:35:55 -0700 (PDT) In-Reply-To: References: Date: Tue, 19 Apr 2016 22:05:55 +0530 Message-ID: Subject: Re: Toggling between remote KGDB and local DDB within a debugging session From: Aijaz Baig To: cem@freebsd.org Cc: FreeBSD Hackers , freebsd-stable@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2016 16:35:58 -0000 On Tue, Apr 19, 2016 at 9:08 PM, Conrad Meyer wrote: > On Tue, Apr 19, 2016 at 5:49 AM, Aijaz Baig wrote: >> 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?? > > Ctrl-c on the serial console. For me I merely see 'Quit' being spat out when I do a ctrl-c > >> 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 > > Are you sure ddb just doesn't run on the serial port? For the very first time, a manual panic does indeed bring up the ddb prompt. However it is only AFTER I've attached kgdb to it, does this start happening, namely not going back ever to ddb (with 'Quit' being displayed instead and with the control still with KGDB) > >> 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. > > Yes. I regularly do this with ctrl-c (gdb->ddb) / "gdb" (ddb->gdb). If it'd help, I'm using VMs. So my serial console is actually the VM console. Now just to be on the safe side I tried putting "comconsole" into '/boot/loader.conf'. However now, with the aforementioned sysctl, it doesn't drop to ddb even for the very first time unlike previous trials where. dropping into DDB was smooth as long as KGDB was not attached to it ever. > > Best, > Conrad Keen to hear from you -- Best Regards, Aijaz Baig