From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3771 invoked by alias); 2 Oct 2004 22:48:28 -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 3760 invoked from network); 2 Oct 2004 22:48:27 -0000 Received: from unknown (HELO walton.sibelius.xs4all.nl) (82.92.89.47) by sourceware.org with SMTP; 2 Oct 2004 22:48:27 -0000 Received: from elgar.sibelius.xs4all.nl (elgar.sibelius.xs4all.nl [192.168.0.2]) by walton.sibelius.xs4all.nl (8.13.0/8.13.0) with ESMTP id i92MmNA9000430; Sun, 3 Oct 2004 00:48:23 +0200 (CEST) Received: from elgar.sibelius.xs4all.nl (localhost [127.0.0.1]) by elgar.sibelius.xs4all.nl (8.12.6p3/8.12.6) with ESMTP id i92MmNKV007943; Sun, 3 Oct 2004 00:48:23 +0200 (CEST) (envelope-from kettenis@elgar.sibelius.xs4all.nl) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.12.6p3/8.12.6/Submit) id i92MmMm2007940; Sun, 3 Oct 2004 00:48:22 +0200 (CEST) Date: Sat, 02 Oct 2004 22:48:00 -0000 Message-Id: <200410022248.i92MmMm2007940@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: amitkale@linsyssoft.com CC: gdb-patches@sources.redhat.com In-reply-to: <200410020921.45566.amitkale@linsyssoft.com> Subject: Re: kgdb support for gdb References: <200410011314.33157.amitkale@linsyssoft.com> <200410012200.i91M0x8m001379@elgar.sibelius.xs4all.nl> <200410020921.45566.amitkale@linsyssoft.com> X-SW-Source: 2004-10/txt/msg00032.txt.bz2 From: "Amit S. Kale" Date: Sat, 2 Oct 2004 09:21:45 +0530 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. Before I give some more comments, here's a bit more mrotivation for the request. I think it would be best if the user doesn't have to do anything special to do kernel debugging. Loading a kernel into GDB and connecting to it should be enough. Therefore it seems a bit artificial to seperate the code from the normal Linux code. So here are some more comments: * Could you use a somewhat more descriptive name than OSABI_LK? I'd suggest OSABI_LINUX_KERNEL. Please put it close to the exitsing OSABI_LINUX entry. * Something similar for the lk-tdep.c file. Why not name it linux-tdep.c? The same goes for i386-lk-tdep.c and x86-64-lk-tdep.c. The amount of code is minimal, so just put it in the exitsing i386-linux-tdep.c and amd64-linux.c files. * Please use a linux_-prefix for the function names in lk-tdep.c/linux-tdep.c. It sort of is our conventions, and prevents any (future) name space collisions. > > Oh, and if you want this code to be included in the official GDB > sources, you'll have to assign copyright to the FSF of course. Definitely. Do I have to change the copyright message on the cfiles myself, or the gdb folks do it while including them into the gdb cvs tree? I have already signed a blanket copyright disclaimer for gdb contributions from myself as an individual. I'll have to sign one more for my company, LinSysSoft. Yes, please change the copyright messages yourself. If you (or your boss) want it, you can add something like "Contributed by LinSysSoft" to any new source files. Anyway, even though I don't use Linux anymore, I think this is great stuff to have integrated in GDB. Mark