From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22678 invoked by alias); 19 Oct 2004 12:45:02 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 22649 invoked from network); 19 Oct 2004 12:45:00 -0000 Received: from unknown (HELO svr68.ehostpros.com) (67.15.48.48) by sourceware.org with SMTP; 19 Oct 2004 12:45:00 -0000 Received: from [61.11.18.135] (helo=pythagoras) by svr68.ehostpros.com with esmtpsa (TLSv1:RC4-MD5:128) (Exim 4.43) id 1CJtMF-0004Sn-Iv; Tue, 19 Oct 2004 05:44:56 -0700 From: "Amit S. Kale" Organization: LinSysSoft Technologies Pvt Ltd To: Mark Kettenis Subject: Re: kgdb support for gdb Date: Tue, 19 Oct 2004 12:45:00 -0000 User-Agent: KMail/1.5 Cc: gdb-patches@sources.redhat.com References: <200410011314.33157.amitkale@linsyssoft.com> <200410012200.i91M0x8m001379@elgar.sibelius.xs4all.nl> <200410020921.45566.amitkale@linsyssoft.com> In-Reply-To: <200410020921.45566.amitkale@linsyssoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200410191813.38468.amitkale@linsyssoft.com> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - svr68.ehostpros.com X-AntiAbuse: Original Domain - sources.redhat.com X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - linsyssoft.com X-Source: X-Source-Args: X-Source-Dir: X-SW-Source: 2004-10/txt/msg00313.txt.bz2 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" > > 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