public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [patch] (OB?) Fix for QNX Neutrino core file floating point handler
@ 2004-12-21 22:34 Kris Warkentin
  2004-12-22  4:34 ` Alan Modra
  0 siblings, 1 reply; 3+ messages in thread
From: Kris Warkentin @ 2004-12-21 22:34 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 495 bytes --]

We weren't generating the floating point register core file sections 
properly.  Instead of .reg2/tid we were getting .reg2/pid which was 
confusing gdb.  This patch fixes that.  Okay to commit?

cheers,

Kris


ChangeLog:

2004-12-21  Kris Warkentin  <kewarken@qnx.com>
	* elf.c (elfcore_grok_nto_gregs): Change name to ..._nto_regs.
	Add 'base' argument for constructing register sections.
	Reformat.
	(elfcore_grok_nto_note): Call elfcore_grok_nto_regs for both
	gp and fp regs.  Reformat.



[-- Attachment #2: bfd.diff --]
[-- Type: text/plain, Size: 1832 bytes --]

Index: elf.c
===================================================================
RCS file: /cvs/src/src/bfd/elf.c,v
retrieving revision 1.258
diff -u -r1.258 elf.c
--- elf.c	10 Dec 2004 14:04:55 -0000	1.258
+++ elf.c	21 Dec 2004 22:22:46 -0000
@@ -7382,14 +7382,17 @@
 }
 
 static bfd_boolean
-elfcore_grok_nto_gregs (bfd *abfd, Elf_Internal_Note *note, pid_t tid)
+elfcore_grok_nto_regs (bfd *abfd,
+		       Elf_Internal_Note *note,
+		       pid_t tid,
+		       char *base)
 {
   char buf[100];
   char *name;
   asection *sect;
 
-  /* Make a ".reg/%d" section.  */
-  sprintf (buf, ".reg/%d", tid);
+  /* Make a "(base)/%d" section.  */
+  sprintf (buf, "%s/%d", base, tid);
 
   name = bfd_alloc (abfd, strlen (buf) + 1);
   if (name == NULL)
@@ -7407,7 +7410,7 @@
 
   /* This is the current thread.  */
   if (elf_tdata (abfd)->core_lwpid == tid)
-    return elfcore_maybe_make_sect (abfd, ".reg", sect);
+    return elfcore_maybe_make_sect (abfd, base, sect);
 
   return TRUE;
 }
@@ -7427,11 +7430,16 @@
 
   switch (note->type)
     {
-    case BFD_QNT_CORE_INFO:   return elfcore_make_note_pseudosection (abfd, ".qnx_core_info", note);
-    case BFD_QNT_CORE_STATUS: return elfcore_grok_nto_status (abfd, note, &tid);
-    case BFD_QNT_CORE_GREG:   return elfcore_grok_nto_gregs (abfd, note, tid);
-    case BFD_QNT_CORE_FPREG:  return elfcore_grok_prfpreg (abfd, note);
-    default:                  return TRUE;
+    case BFD_QNT_CORE_INFO:
+	 return elfcore_make_note_pseudosection (abfd, ".qnx_core_info", note);
+    case BFD_QNT_CORE_STATUS:
+	return elfcore_grok_nto_status (abfd, note, &tid);
+    case BFD_QNT_CORE_GREG:
+	return elfcore_grok_nto_regs (abfd, note, tid, ".reg");
+    case BFD_QNT_CORE_FPREG:
+	return elfcore_grok_nto_regs (abfd, note, tid, ".reg2");
+    default:
+	return TRUE;
     }
 }
 

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

* Re: [patch] (OB?) Fix for QNX Neutrino core file floating point handler
  2004-12-21 22:34 [patch] (OB?) Fix for QNX Neutrino core file floating point handler Kris Warkentin
@ 2004-12-22  4:34 ` Alan Modra
  2004-12-22 14:45   ` Commited:[patch] (OB?) Fix for QNX Neutrino core file floating point h andler Kris Warkentin
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Modra @ 2004-12-22  4:34 UTC (permalink / raw)
  To: Kris Warkentin; +Cc: binutils

On Tue, Dec 21, 2004 at 05:34:10PM -0500, Kris Warkentin wrote:
> 	* elf.c (elfcore_grok_nto_gregs): Change name to ..._nto_regs.

Minor nit.  Please specify the complete new function name here, so that
you can search for it in the ChangeLog.  (It's minor because a search
would hit the instance below.)

> 	Add 'base' argument for constructing register sections.
> 	Reformat.
> 	(elfcore_grok_nto_note): Call elfcore_grok_nto_regs for both
> 	gp and fp regs.  Reformat.

OK with the above change, and the indentation below fixed.

> +    case BFD_QNT_CORE_INFO:
> +	 return elfcore_make_note_pseudosection (abfd, ".qnx_core_info", note);
> +    case BFD_QNT_CORE_STATUS:
> +	return elfcore_grok_nto_status (abfd, note, &tid);

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

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

* Commited:[patch] (OB?) Fix for QNX Neutrino core file floating point h andler
  2004-12-22  4:34 ` Alan Modra
@ 2004-12-22 14:45   ` Kris Warkentin
  0 siblings, 0 replies; 3+ messages in thread
From: Kris Warkentin @ 2004-12-22 14:45 UTC (permalink / raw)
  To: Alan Modra; +Cc: binutils

Thanks Alan.

Kris

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

end of thread, other threads:[~2004-12-22 14:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-21 22:34 [patch] (OB?) Fix for QNX Neutrino core file floating point handler Kris Warkentin
2004-12-22  4:34 ` Alan Modra
2004-12-22 14:45   ` Commited:[patch] (OB?) Fix for QNX Neutrino core file floating point h andler Kris Warkentin

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