This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: kgdb support for gdb


On Saturday 02 Oct 2004 9:21 am, Amit S. Kale wrote:
> On Saturday 02 Oct 2004 3:30 am, Mark Kettenis wrote:
> >    From: "Amit S. Kale" <amitkale@linsyssoft.com>
> >    Date: Fri, 1 Oct 2004 13:14:33 +0530
> >
> >    Hi,
> >
> >    Attached patches add kgdb support to gdb. They define two new
> >    targets i386-lk and x86_64-lk. Because of the definition of these
> >    targets, one can build a gdb with does not contain the linux
> >    operating environment specific things which are inappropriate for
> >    the kernel, like signal trampoline frame parsing.
> >
> > I don't think you/we should add a new target triple for this stuff.
> > Instead you should add a special OS ABI variant for the kernel, and
> > use that to define your own kernel architecture vector.  I suppose
> > there is a way to detect that a binary is a Linux kernel instead of a
> > normal ELF executable?
>
> Yes. There is a way to detect that. I'll look into this and get back with a
> different patch.

There isn't an easy way to detect that we have a kernel binary. Kernel binary 
vmlinux is an i386 linux elf executable. For now I have defined an osabi 
"Linux-kernel". Since there is no way to automatically detect that users have 
to tell gdb to use it explicitly.

I'll send out a patch when I am done with the rest of the things suggested by 
you and Andrew C.

Please let me know whether following user interface is ok.
Thanks
-Amit

[amitkale@pythagoras gdb-build]$ gdb/gdb  ~/build/2.6.9-rc2-i386/vmlinux
GNU gdb 6.2.50_2004-10-15-cvs
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db 
library "/lib/tls/libthread_db.so.1".

(gdb) set osabi Linux-kernel
(gdb) tar re /dev/ttyS0
Remote debugging using /dev/ttyS0
breakpoint () at /home/amitkale/work/linux-2.6.9-rc2/kernel/kgdb.c:1285
1285            atomic_set(&kgdb_setting_breakpoint, 0);
warning: no shared library support for this OS / ABI
(gdb) bt
#0  breakpoint () at /home/amitkale/work/linux-2.6.9-rc2/kernel/kgdb.c:1285



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]