public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* [RFC] Setting the architecture from a core file
@ 2003-10-24 15:28 Mark Kettenis
  2003-10-30 11:09 ` Nick Clifton
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Kettenis @ 2003-10-24 15:28 UTC (permalink / raw)
  To: gdb; +Cc: binutils

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFC] Setting the architecture from a core file
  2003-10-24 15:28 [RFC] Setting the architecture from a core file Mark Kettenis
@ 2003-10-30 11:09 ` Nick Clifton
  2003-10-30 21:20   ` Mark Kettenis
  0 siblings, 1 reply; 3+ messages in thread
From: Nick Clifton @ 2003-10-30 11:09 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: gdb, binutils

Hi Mark,

> 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?

No, I think that the latter method would be best.

Cheers
        Nick

PS.  Are you officially submitting the patch you attached to your
email ?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFC] Setting the architecture from a core file
  2003-10-30 11:09 ` Nick Clifton
@ 2003-10-30 21:20   ` Mark Kettenis
  0 siblings, 0 replies; 3+ messages in thread
From: Mark Kettenis @ 2003-10-30 21:20 UTC (permalink / raw)
  To: nickc; +Cc: gdb, binutils

   From: Nick Clifton <nickc@redhat.com>
   Date: Thu, 30 Oct 2003 11:00:23 +0000

   PS.  Are you officially submitting the patch you attached to your
   email ?

Not yet.  I've mailed back my copyright assignment for binutils to the
FSF.  The assignment is probably not necessary for this one-liner, but
I'll formally submit the patch after the paperwork is all done.

Mark

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-10-30 21:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-24 15:28 [RFC] Setting the architecture from a core file Mark Kettenis
2003-10-30 11:09 ` Nick Clifton
2003-10-30 21:20   ` Mark Kettenis

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).