From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JmSgD-00031Z-0A for mharc-grub-devel@gnu.org; Thu, 17 Apr 2008 07:53:29 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JmSgB-00030b-Ii for grub-devel@gnu.org; Thu, 17 Apr 2008 07:53:27 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JmSgA-0002zh-1k for grub-devel@gnu.org; Thu, 17 Apr 2008 07:53:27 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JmSg9-0002ze-To for grub-devel@gnu.org; Thu, 17 Apr 2008 07:53:25 -0400 Received: from mx1.redhat.com ([66.187.233.31]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JmSg9-0005hY-Cb for grub-devel@gnu.org; Thu, 17 Apr 2008 07:53:25 -0400 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m3HBrKJH019404 for ; Thu, 17 Apr 2008 07:53:20 -0400 Received: from pobox.stuttgart.redhat.com (pobox.stuttgart.redhat.com [172.16.2.10]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m3HBrJP5010056 for ; Thu, 17 Apr 2008 07:53:20 -0400 Received: from [10.34.1.17] (gopher.brq.redhat.com [10.34.1.17]) by pobox.stuttgart.redhat.com (8.13.1/8.13.1) with ESMTP id m3HBrJdc031864 for ; Thu, 17 Apr 2008 07:53:19 -0400 From: Lubomir Kundrak To: The development of GRUB 2 In-Reply-To: <20080415133805.GG21548@thorin> References: <1208212240.3971.48.camel@localhost.localdomain> <20080415133805.GG21548@thorin> Content-Type: text/plain Organization: Red Hat Inc. Date: Thu, 17 Apr 2008 13:53:21 +0200 Message-Id: <1208433201.770.43.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.12.3 (2.12.3-3.fc8) Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: Re: [PATCH] Make gdb debugging a bit less painful X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2008 11:53:27 -0000 On Tue, 2008-04-15 at 15:38 +0200, Robert Millan wrote: > On Tue, Apr 15, 2008 at 12:30:40AM +0200, Lubomir Kundrak wrote: > > diff -rup grub-1.95.orig/kern/main.c grub-1.95/kern/main.c > > --- grub-1.95.orig/kern/main.c 2007-01-29 15:31:36.000000000 +0100 > > +++ grub-1.95/kern/main.c 2007-01-30 18:29:55.000000000 +0100 > > @@ -106,6 +106,14 @@ grub_load_normal_mode (void) > > grub_errno = GRUB_ERR_NONE; > > } > > > > +#ifndef GRUB_UTIL > > +/* > > + * Let GDB find the stack top > > + */ > > +void > > +main (void) __attribute__ ((alias("grub_main"))); > > +#endif > > grub_main() isn't always the function we want for top of the stack. For > example cmain() in kern/ieee1275/cmain.c does quite a bit of things already. > > I'm not sure what would be an ellegant way to solve this... :-/ Well, then more preprocessor conditionals come into play. Wold there be any problems with that? -- Lubomir Kundrak (Red Hat Security Response Team)