Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Oct 2015 07:39:01 -0700
From:      Navdeep Parhar <np@FreeBSD.org>
To:        Andriy Gapon <avg@FreeBSD.org>
Cc:        John Baldwin <jhb@FreeBSD.org>, freebsd-current@FreeBSD.org
Subject:   Re: kgdb ported to devel/gdb
Message-ID:  <20151002143901.GA16147@ox>
In-Reply-To: <560E21E1.6010002@FreeBSD.org>
References:  <2662739.EWKL7pkiRb@ralph.baldwin.cx> <560E21E1.6010002@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Oct 02, 2015 at 09:19:13AM +0300, Andriy Gapon wrote:
> On 01/09/2015 00:32, John Baldwin wrote:
> > Over the past several months I have ported kgdb to the version of gdb in ports.
> > I have a pending patch to the gdb port to add fork following, but once that is
> > done (and possibly after updating to 7.10) I will try to add my existing work
> > as a KGDB option on the port.  Until such time, you can try the newer kgdb by
> > checking out my branch from git.
> > 
> > Here's my cheat sheet on how to build the newer kgdb.  Note that if you build
> > a world with my cross-libkvm patches you should get a kgdb that can debug
> > i386 cores on amd64 and vice versa.
> > 
> > All of the targets that the native devel/gdb support have their backends
> > ported (so x86, sparc64, powerpc and powerpc64).  I have not yet ported
> > arm or mips since those don't work for userland yet in upstream gdb.  I
> > have only compiled non-x86 backends.  Testing of the new kgdb on sparc64
> > and powerpc would be appreciated.
> > 
> > Steps:
> > 
> > % git clone https://github.com/bsdjhb/gdb.git
> > % git checkout freebsd-7.9.1-kgdb
> > % fetch http://www.freebsd.org/~jhb/gdb/build
> > % pkg install devel/gdb
> > 
> > # Having gdb installed will mean you get the python bindings in the right
> > # place.
> > 
> > % pkg install gmake
> > 
> > # I think this is the only build tool you need?
> > 
> > % ./build
> > % cd obj
> > 
> > # Replace 'obj' with 'obj.<arch>' for all but amd64
> > 
> > % gmake
> > 
> > # ... wait
> > 
> > You will now have a binary at 'obj/gdb/kgdb'.  I just run it from my obj
> > tree currently when testing.  Once it becomes part of the port it will get
> > installed as /usr/local/bin/kgdb791 or some such.
> 
> John,
> 
> first of all, thank you very much for this!
> 
> I followed your instructions substituting freebsd-7.10-kgdb for
> freebsd-7.9.1-kgdb branch (devel/gdb is also at version 7.10) and the build
> process worked just fine.
> However, when I try to use the new kgdb it works, but I get some annoying
> diagnostics:
> 
> ...

Andriy,

The patch is also available in D3727.  I downloaded the raw diff from there,
applied it to $PORTS/devel/gdb, and built it as a port (with the KGDB support
option enabled of course).  Everything works.  Can you try that?

https://reviews.freebsd.org/D3727

Regards,
Navdeep



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20151002143901.GA16147>