Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Feb 2007 12:40:52 +0200
From:      Kostik Belousov <kostikbel@gmail.com>
To:        John Baldwin <jhb@freebsd.org>
Cc:        freebsd-current@freebsd.org, "Wilkinson, Alex" <alex.wilkinson@dsto.defence.gov.au>
Subject:   Re: kgdb(1) ... is it broken ?
Message-ID:  <20070227104052.GG77131@deviant.kiev.zoral.com.ua>
In-Reply-To: <200702261834.13911.jhb@freebsd.org>
References:  <20070223061822.GA1497@obelix.dsto.defence.gov.au> <20070223113439.GK39168@deviant.kiev.zoral.com.ua> <200702261834.13911.jhb@freebsd.org>

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

--O8XZ+2Hy8Kj8wLPZ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Feb 26, 2007 at 06:34:13PM -0500, John Baldwin wrote:
> > Try this patch, it shall allow to see useful backtrace in kgdb (I really
> > like to receive feedback on this one):
> >=20
> > Index: gnu/usr.bin/gdb/kgdb/trgt_i386.c
> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> > RCS file: /usr/local/arch/ncvs/src/gnu/usr.bin/gdb/kgdb/trgt_i386.c,v
> > retrieving revision 1.5
> > diff -u -r1.5 trgt_i386.c
> > --- gnu/usr.bin/gdb/kgdb/trgt_i386.c	11 Sep 2005 05:36:30 -0000	1.5
> > +++ gnu/usr.bin/gdb/kgdb/trgt_i386.c	23 Feb 2007 11:31:39 -0000
> > @@ -146,7 +146,7 @@
> >  	*realnump =3D -1;
> > =20
> >  	ofs =3D (regnum >=3D I386_EAX_REGNUM && regnum <=3D I386_FS_REGNUM)
> > -	    ? kgdb_trgt_frame_offset[regnum] : -1;
> > +	    ? kgdb_trgt_frame_offset[regnum] + 4 : -1;
> >  	if (ofs =3D=3D -1)
> >  		return;
>=20
> You can make the patch by dependent on the kern.osreldate (__FreeBSD_vers=
ion)
> which is accesible as the global var 'osreldate' in the kernel and use the
> old offset for kernels before Kip's change so it works for both old and n=
ew.

That was my intent (in fact, I would prefer to check instruction at calltrap
label directly).

I noted that kgdb machine-specific code pulls sys/proc.h,
machine/frame.h and machine/pcb.h. As result, kgdb have to be built from
the same tree as the kernel itself. Due to this, I do not see high need
for such check.

Anyway, I think that I implement it later this week.


--O8XZ+2Hy8Kj8wLPZ
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (FreeBSD)

iD8DBQFF5Aq0C3+MBN1Mb4gRArlyAJ9Lscz2nTCBjVwwBl8ICFy1BoqBnACgoH8i
itpJl3fAdkZlnwmswv7Uthc=
=k8lg
-----END PGP SIGNATURE-----

--O8XZ+2Hy8Kj8wLPZ--



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