From: Lubomir Kundrak <lkundrak@redhat.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: [PATCH] Make gdb debugging a bit less painful
Date: Tue, 15 Apr 2008 00:30:40 +0200 [thread overview]
Message-ID: <1208212240.3971.48.camel@localhost.localdomain> (raw)
[-- Attachment #1: Type: text/plain, Size: 532 bytes --]
These are pretty self-explainable. I think I tried to sumbit these
changes with the serial debugging patch year and some months ago and I
was told to sign the copyright assignment. I have already done that
now. :)
2008-04-15 Lubomir Kundrak <lkundrak@redhat.com>
* kern/main.c (grub_main) [!GRUB_UTIL]: Alias grub_main to main,
so that gdb is able to find stack top.
* genmk.rb: replace strip with objcopy, so unstripped files are
left untouched for debugging purposes.
--
Lubomir Kundrak (Red Hat Security Response Team)
[-- Attachment #2: grub-1.95-debuginfo.patch --]
[-- Type: text/x-patch, Size: 1687 bytes --]
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
+
/* The main routine. */
void
grub_main (void)
--- grub-1.95.cvs20071119.orig/genmk.rb 2007-11-27 10:58:52.000000000 +0100
+++ grub-1.95.cvs20071119/genmk.rb 2007-11-27 11:17:58.000000000 +0100
@@ -101,10 +101,11 @@
mod_obj = mod_src.suffix('o')
defsym = 'def-' + @name.suffix('lst')
undsym = 'und-' + @name.suffix('lst')
+ exec = @name.suffix('exec')
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,10 +113,13 @@
MOSTLYCLEANFILES += #{deps_str}
UNDSYMFILES += #{undsym}
-#{@name}: #{pre_obj} #{mod_obj}
+#{@name}: #{exec}
+ -rm -f $@
+ $(OBJCOPY) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment -R .note.gnu.build-id $^ $@
+
+#{exec}: #{pre_obj} #{mod_obj}
-rm -f $@
$(TARGET_CC) $(#{prefix}_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^
- $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment -R .note.gnu.build-id $@
#{pre_obj}: $(#{prefix}_DEPENDENCIES) #{objs_str}
-rm -f $@
next reply other threads:[~2008-04-14 22:30 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-14 22:30 Lubomir Kundrak [this message]
2008-04-15 13:21 ` [PATCH] Make gdb debugging a bit less painful Robert Millan
2008-04-15 13:38 ` Robert Millan
2008-04-17 11:53 ` Lubomir Kundrak
2008-04-17 20:11 ` Robert Millan
2008-04-18 2:21 ` Pavel Roskin
2008-04-18 11:32 ` Robert Millan
2008-04-18 12:13 ` Robert Millan
2008-04-18 15:16 ` Pavel Roskin
2008-04-18 15:36 ` Robert Millan
2008-04-18 15:38 ` Bean
2008-04-18 15:45 ` Robert Millan
2008-04-18 13:58 ` Lubomir Kundrak
2008-04-18 15:54 ` Robert Millan
2008-04-15 19:01 ` Pavel Roskin
2008-04-17 11:54 ` Lubomir Kundrak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1208212240.3971.48.camel@localhost.localdomain \
--to=lkundrak@redhat.com \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.