From owner-freebsd-questions@FreeBSD.ORG Tue Oct 7 17:53:23 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D3E01065686 for ; Tue, 7 Oct 2008 17:53:23 +0000 (UTC) (envelope-from alancyang@gmail.com) Received: from mail-gx0-f21.google.com (mail-gx0-f21.google.com [209.85.217.21]) by mx1.freebsd.org (Postfix) with ESMTP id 42F718FC18 for ; Tue, 7 Oct 2008 17:53:23 +0000 (UTC) (envelope-from alancyang@gmail.com) Received: by gxk14 with SMTP id 14so6804472gxk.19 for ; Tue, 07 Oct 2008 10:53:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=4rmWkFnBya4m3daNDhDWv+9oyr2PdvF1tfR4LwJAjsA=; b=gRzOgW34us9NNTYzk2pqxRp6x+JP58lzEI8onr11MtUcNKAM75b4Hvsf1JTuJ7OTKf 704SinjDXz+PSIYNkfjerexYpJAxB/TX299faHI8PDTC3+aWicAo58nN8Bhe/RkI9Rq2 RIYCOCv8AQrwsCE7hsDYwFrkGvE5igx01zZKI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=l1P8F20BZFTuDnHGUruar1eGn/7ht5GoicXZ6aZDPH3GfgA+K7qYfcWJfAko/Hvylo AeX+3AmkZHIU1VhYNGmx/8GfifRBAyx6Odv2vA/roisUlD29RiRW4Zvn1NlskTcn7y2+ 5PVdNhnTD8+fD8d5abF58DgRraXRaSizQHAuw= Received: by 10.90.104.20 with SMTP id b20mr7795248agc.69.1223402002354; Tue, 07 Oct 2008 10:53:22 -0700 (PDT) Received: by 10.90.94.14 with HTTP; Tue, 7 Oct 2008 10:53:22 -0700 (PDT) Message-ID: <290865fd0810071053k6da13d96j391ade1a30599fa1@mail.gmail.com> Date: Tue, 7 Oct 2008 10:53:22 -0700 From: "alan yang" To: freebsd-questions@freebsd.org, freebsd-hackers@freebsd.org In-Reply-To: <290865fd0810061712sfdf5a0p4d3954773ee27a3d@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <290865fd0810061544ubbe92fdsf75501bb729da3f0@mail.gmail.com> <48EA9E95.80105@FreeBSD.org> <290865fd0810061712sfdf5a0p4d3954773ee27a3d@mail.gmail.com> Cc: Subject: Re: kgdb debugging X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Oct 2008 17:53:23 -0000 Could people shed some light how to get remote debugging going, must be something that i overlooked, really appreciate. Two FreeBSD7 systems, target and development, connected with null modem cable on each's COM1. step 1) - rebuild kernel with following options: options DDB options KDB options GDB makeoptions DEBUG=-g step 2) - from development system cd to /usr/src/sys/i386/comiple/MYKERNEL kgdb -r /dev/cuad0 kernel.debug it displays the following: Switching to remote protocol Ignoring packet error, continuing ......... Couldn't establish connection to remote target Malformed response to offset query, timeout step 3) - from targetsystem: 1. Ctrl + Alt + Esc to go into db 2. from db> type gdb 3. it displays: "The remote GDB backend could not be selected" On Mon, Oct 6, 2008 at 5:12 PM, alan yang wrote: > the problem is, when entering gdb from db as described in the following: > -- > Enter ing gdb from ddb > In FreeBSD you can build a kernel with support for both ddb and gdb. > You can then > change backwards and forwards between them. For example, if you're in > ddb, you can > go to gdb like this: > db> gdb > Next trap will enter GDB remote protocol mode > db> si step a single instruction to reenter ddb > -- > after typing gdb command, it says: "The remote GDB backend could not > be selected" > that i am not sure what this indicates; looking at subr_kdb.c, wonder > maybe kdb_dbbe_set is not set? seems kdb_dbbe_set is not referenced > anywhere, not sure how to get it right. > > thanks for shed some light ... > > On Mon, Oct 6, 2008 at 4:26 PM, Pietro Cerutti wrote: >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA512 >> >> alan yang wrote: >> | hi, there, >> | >> | wonder people can shed some lights on remote debugging. i have >> | freebsd7 configured with option DDB / KDB / GDB but after entering the >> | db on the target system the command gdb gives "the remote GDB backend >> | could not be selected". >> | >> | i browsed through the mailing list, and do find 1 similar post but >> | without answer. >> | >> | thanks in advance & apology if i overlooked things ... >> >> I suggest the following tutorial: >> http://www.lemis.com/grog/Papers/Debug-tutorial/tutorial.pdf >> >> Have fun :) >> >> | >> | cheers, >> | alan >> | _______________________________________________ >> | freebsd-hackers@freebsd.org mailing list >> | http://lists.freebsd.org/mailman/listinfo/freebsd-hackers >> | To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" >> >> >> - -- >> Pietro Cerutti >> gahr@FreeBSD.org >> >> PGP Public Key: >> http://gahr.ch/pgp >> >> -----BEGIN PGP SIGNATURE----- >> Version: GnuPG v2.0.9 (FreeBSD) >> >> iEYEAREKAAYFAkjqnpQACgkQwMJqmJVx945RSwCgoDb0JTr8LSFDB1vpAbGUjb76 >> ZH0An19HpFVJJTUB5/XnyZc0pIDzgxc3 >> =6Pdm >> -----END PGP SIGNATURE----- >> >