All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: The development of GRUB 2 <grub-devel@gnu.org>,
	 Lubomir Rintel <lkundrak@v3.sk>
Subject: gdb script merged
Date: Sun, 13 Nov 2011 23:18:16 +0100	[thread overview]
Message-ID: <4EC04228.6020906@gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1211 bytes --]

Hello, all. Looking though archives I found old script by Lubomir Rintel
for gdb. I integrated it into our build system and committed, now you
just have to run gdb -x gdb_grub from grub-core directory. It's limited
to platforms with predefined load address, so *-efi is excluded but all
others platforms should work, didn't test it with anything else than
i386-pc though.
At first I wanted to install it as well but then I noticed that it has
an important problem:
- It uses insecure temporary files. While fine if you own current
directory (like grub-core), it has to use mktemp if to be installed
globally.
- I don't know how to implement the logic "check if kernel.exec is in .,
if so use it, otherwise use @platformdir@/kernel.exec" in gdb scripts.
Note: @platformdir@ is expanded by automake.
Also I would prefer script to be less chatty and use python but it's not
very important.
I attach a simple patch to install those scripts if needed.
Also there is a serial-gdb patch in same series, while also interesting
it would need more work (and can be integrated with my another work for
backtracing on grub_fatal and exceptions)

-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: gdb-install.diff --]
[-- Type: text/x-diff; name="gdb-install.diff", Size: 2172 bytes --]

=== modified file 'conf/Makefile.common'
--- conf/Makefile.common	2011-05-15 00:23:36 +0000
+++ conf/Makefile.common	2011-11-13 22:10:21 +0000
@@ -152,6 +152,8 @@
 grubconf_SCRIPTS =
 noinst_LIBRARIES =
 dist_noinst_DATA =
+platform_SCRIPTS =
+platform_PROGRAMS =
 
 TESTS =
 EXTRA_DIST =

=== modified file 'gentpl.py'
--- gentpl.py	2011-10-16 09:53:27 +0000
+++ gentpl.py	2011-11-13 22:10:21 +0000
@@ -356,7 +356,7 @@
 def module(platform):
     r = set_canonical_name_suffix(".module")
 
-    r += gvar_add("noinst_PROGRAMS", "[+ name +].module")
+    r += gvar_add("platform_PROGRAMS", "[+ name +].module")
     r += gvar_add("MODULE_FILES", "[+ name +].module$(EXEEXT)")
 
     r += var_set(cname() + "_SOURCES", platform_sources(platform) + " ## platform sources")
@@ -384,7 +384,7 @@
 
 def kernel(platform):
     r = set_canonical_name_suffix(".exec")
-    r += gvar_add("noinst_PROGRAMS", "[+ name +].exec")
+    r += gvar_add("platform_PROGRAMS", "[+ name +].exec")
     r += var_set(cname() + "_SOURCES", platform_startup(platform))
     r += var_add(cname() + "_SOURCES", platform_sources(platform))
     r += var_set("nodist_" + cname() + "_SOURCES", platform_nodist_sources(platform) + " ## platform nodist sources")
@@ -409,7 +409,7 @@
 
 def image(platform):
     r = set_canonical_name_suffix(".image")
-    r += gvar_add("noinst_PROGRAMS", "[+ name +].image")
+    r += gvar_add("platform_PROGRAMS", "[+ name +].image")
     r += var_set(cname() + "_SOURCES", platform_sources(platform))
     r += var_set("nodist_" + cname() + "_SOURCES", platform_nodist_sources(platform) + "## platform nodist sources")
     r += var_set(cname() + "_LDADD", platform_ldadd(platform))

=== modified file 'grub-core/Makefile.core.def'
--- grub-core/Makefile.core.def	2011-11-13 21:59:46 +0000
+++ grub-core/Makefile.core.def	2011-11-13 22:11:07 +0000
@@ -19,13 +19,13 @@
 };
 
 script = {
-  installdir = noinst;
+  installdir = platform;
   name = gmodule.pl;
   common = gmodule.pl.in;
 };
 
 script = {
-  installdir = noinst;
+  installdir = platform;
   name = gdb_grub;
   common = gdb_grub.in;
 };


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]

             reply	other threads:[~2011-11-13 22:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-13 22:18 Vladimir 'φ-coder/phcoder' Serbinenko [this message]
2011-11-14 22:08 ` gdb script merged Vladimir 'φ-coder/phcoder' Serbinenko

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=4EC04228.6020906@gmail.com \
    --to=phcoder@gmail.com \
    --cc=grub-devel@gnu.org \
    --cc=lkundrak@v3.sk \
    /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.