public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Mark Kettenis <kettenis@chello.nl>
To: gdb@sources.redhat.com
Cc: binutils@sources.redhat.com
Subject: [RFC] Setting the architecture from a core file
Date: Fri, 24 Oct 2003 15:28:00 -0000	[thread overview]
Message-ID: <200310241528.h9OFS3Cb001732@elgar.kettenis.dyndns.org> (raw)

My pending changes for core file support based on register sets
require[1] that we will be able to detect the OS/ABI variant from the
core file.  Currently we fail to do this for most, if not all, NetBSD
ELF targets.  It's possible to detect a NetBSD ELF core file by
looking whether certian NetBSD-specific notes are present.  I can do
all the work from gdb/osabi.c:generic_elf_osabi_sniff_tag_sections,
but there is also the possibility to add a pseudosection in
bfd/elf.c:elfcore_grok_netbsd_procinfo().  I'm leaning towards the
latter since it avoids duplicating code and it fits better in the way
how things are done in general in BFD and GDB.  But perhaps people
have a different opinion?

Mark

[1] We might relax this a bit if necessary, i.e. we could fall back on
    the architecture of the selected executable.


Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* elf.c (elfcore_grok_netbsd_procinfo): Make a pseudosection out
	of the note.

Index: elf.c
===================================================================
RCS file: /cvs/src/src/bfd/elf.c,v
retrieving revision 1.203
diff -u -p -r1.203 elf.c
--- elf.c 20 Oct 2003 14:38:39 -0000 1.203
+++ elf.c 24 Oct 2003 15:27:50 -0000
@@ -6833,7 +6833,8 @@ elfcore_grok_netbsd_procinfo (bfd *abfd,
   elf_tdata (abfd)->core_command
     = _bfd_elfcore_strndup (abfd, note->descdata + 0x7c, 31);
 
-  return TRUE;
+  return elfcore_make_note_pseudosection (abfd, ".note.netbsdcore.procinfo",
+					  note);
 }
 
 static bfd_boolean

             reply	other threads:[~2003-10-24 15:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-24 15:28 Mark Kettenis [this message]
2003-10-30 11:09 ` Nick Clifton
2003-10-30 21:20   ` Mark Kettenis

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=200310241528.h9OFS3Cb001732@elgar.kettenis.dyndns.org \
    --to=kettenis@chello.nl \
    --cc=binutils@sources.redhat.com \
    --cc=gdb@sources.redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).