Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KNR1P-0007GF-8n for mharc-grub-devel@gnu.org; Mon, 28 Jul 2008 07:36:11 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KNR1N-0007Fq-8t for grub-devel@gnu.org; Mon, 28 Jul 2008 07:36:09 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KNR1L-0007FZ-Uo for grub-devel@gnu.org; Mon, 28 Jul 2008 07:36:08 -0400 Received: from [199.232.76.173] (port=40446 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KNR1L-0007FV-PA for grub-devel@gnu.org; Mon, 28 Jul 2008 07:36:07 -0400 Received: from moutng.kundenserver.de ([212.227.126.171]:65411) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KNR1L-0004pp-IQ for grub-devel@gnu.org; Mon, 28 Jul 2008 07:36:07 -0400 Received: from [85.180.47.73] (e180047073.adsl.alicedsl.de [85.180.47.73]) by mrelayeu.kundenserver.de (node=mrelayeu6) with ESMTP (Nemesis) id 0ML29c-1KNR133Ydk-00014j; Mon, 28 Jul 2008 13:35:50 +0200 From: Felix Zielcke To: grub-devel@gnu.org, lkundrak@skosi.org Content-Type: multipart/mixed; boundary="=-u2ItcIb4XXMotDl4Zdki" Date: Mon, 28 Jul 2008 13:35:51 +0200 Message-Id: <1217244951.4016.25.camel@fz-deb.local> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 X-Provags-ID: V01U2FsdGVkX1/WUtjhYr/+0yvjLpIHeq8GTvA8IfQps8s5uK+ hsTJ6t3YwgDxRAtduSCTCVVddS+pScgsl08Wp91MrqWBwhd6f/ H5m2l9CeqpvG6Zha1yt+faZqydNOQlc X-detected-kernel: by monty-python.gnu.org: Linux 2.6? (barebone, rare!) Cc: Subject: Wiki DebuggingWithGDB 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: Mon, 28 Jul 2008 11:36:09 -0000 --=-u2ItcIb4XXMotDl4Zdki Content-Type: text/plain Content-Transfer-Encoding: 7bit (Probable Lubomir is subscribed but just in case sending the mail to him, he made originally the Wiki page and is hosting the patch.) I just tried that GRUB in qemu debugging with GDB stuff. The Stuff on that Wiki page is a bit outdated. I'm not that familiar with such things but maybe I can try to fix this myself. Attached is the grub2-gdb.diff updated to current SVN version. I don't have any webspace to host it. I have compiled grub2 with CFLAGS="-g3 -O0" gdb shows: GNU gdb 6.8-debian [copyright stuff] This GDB was configured as "x86_64-linux-gnu". 0x00008c1e in grub_console_getkey () Function "grub_dl_add" not defined. /home/fz/grub/grub2.svn/.gdbinit:78: Error in sourced command file: No breakpoint number 0. (gdb) bt #0 0x00008c1e in grub_console_getkey () #1 0x81400006 in ?? () #2 0x02060000 in ?? () #3 0xff0080ff in ?? () #4 0x00000000 in ?? () --=-u2ItcIb4XXMotDl4Zdki Content-Disposition: attachment; filename=grub2-gdb.diff Content-Type: text/x-patch; name=grub2-gdb.diff; charset=UTF-8 Content-Transfer-Encoding: 7bit Index: kern/main.c =================================================================== --- kern/main.c (Revision 1742) +++ kern/main.c (Arbeitskopie) @@ -106,6 +106,9 @@ grub_print_error (); } +void +main (void) __attribute__ ((alias("grub_main"))); + /* The main routine. */ void grub_main (void) Index: genmk.rb =================================================================== --- genmk.rb (Revision 1742) +++ genmk.rb (Arbeitskopie) @@ -101,10 +101,11 @@ mod_obj = mod_src.suffix('o') defsym = 'def-' + @name.suffix('lst') undsym = 'und-' + @name.suffix('lst') + exec = @name.suffix('elf') mod_name = File.basename(@name, '.mod') symbolic_name = mod_name.sub(/\.[^\.]*$/, '') - "CLEANFILES += #{@name} #{mod_obj} #{mod_src} #{pre_obj} #{objs_str} #{undsym} + "CLEANFILES += #{@name} #{mod_obj} #{mod_src} #{pre_obj} #{objs_str} #{undsym} #{exec} ifneq ($(#{prefix}_EXPORTS),no) CLEANFILES += #{defsym} DEFSYMFILES += #{defsym} @@ -112,11 +113,14 @@ MOSTLYCLEANFILES += #{deps_str} UNDSYMFILES += #{undsym} -#{@name}: #{pre_obj} #{mod_obj} $(TARGET_OBJ2ELF) +#{@name}: #{exec} -rm -f $@ + $(OBJCOPY) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $^ $@ + +#{exec}: #{pre_obj} #{mod_obj} $(TARGET_OBJ2ELF) + -rm -f $@ $(TARGET_CC) $(#{prefix}_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ #{pre_obj} #{mod_obj} if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ #{pre_obj}: $(#{prefix}_DEPENDENCIES) #{objs_str} -rm -f $@ --=-u2ItcIb4XXMotDl4Zdki--