public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* gdb for hppa
@ 2003-08-18  2:51 Randolph Chung
  2003-08-18  3:15 ` MIPS64 problem with symbols Peter Reilley
  2003-08-23 14:48 ` gdb for hppa Joel Brobecker
  0 siblings, 2 replies; 4+ messages in thread
From: Randolph Chung @ 2003-08-18  2:51 UTC (permalink / raw)
  To: gdb

so, i heard gdb/hppa is looking for some help? :-)

my primary interest is in getting gdb working on hppa-linux, but from
talking to drow, looking at the code and what needs to be done, i 
think it'll be worthwhile to merge the palinux code (which is not in 
cvs yet) with the hpux stuff in cvs instead of having a separate target.
what is the current status of hppa support? (i'm going to through the 
mail archive, but haven't seen very much) is anyone else working on 
this? is there a list of "todo" items that i can help with? what do we
need to do to get hppa out of the "obsolete candidate" list? 

thanks
randolph
-- 
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/

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

* MIPS64 problem with symbols
  2003-08-18  2:51 gdb for hppa Randolph Chung
@ 2003-08-18  3:15 ` Peter Reilley
       [not found]   ` <mailpost.1061176541.26825@news-sj1-1>
  2003-08-23 14:48 ` gdb for hppa Joel Brobecker
  1 sibling, 1 reply; 4+ messages in thread
From: Peter Reilley @ 2003-08-18  3:15 UTC (permalink / raw)
  To: gdb

I have built a GDB cross tool for the MIPS 64 bit processor hosted
on Intel Linux.   GDB works OK in controlling the target but symbols
fail to load.   In particular, the start address is truncated to 32 bits.
My base address is 0xffffffffa0080000.   When I load symbols
I get an error message;

(Internal error: pc 0xa0080000 in read in psymtab, but not in symtab.)

The symbols in the elf file look OK so I think that the problem is
in GDB.   Is cross GDB known to work on 64 bit targets when hosted
on a 32 bit Intel host?

Thanks,
Pete.

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

* Re: MIPS64 problem with symbols
       [not found]   ` <mailpost.1061176541.26825@news-sj1-1>
@ 2003-08-18  4:59     ` cgd
  0 siblings, 0 replies; 4+ messages in thread
From: cgd @ 2003-08-18  4:59 UTC (permalink / raw)
  To: micrio; +Cc: gdb, binutils

At Mon, 18 Aug 2003 03:15:41 +0000 (UTC), "Peter Reilley" wrote:
> I have built a GDB cross tool for the MIPS 64 bit processor hosted
> on Intel Linux.   GDB works OK in controlling the target but symbols
> fail to load.   In particular, the start address is truncated to 32 bits.
> My base address is 0xffffffffa0080000.   When I load symbols
> I get an error message;
> 
> (Internal error: pc 0xa0080000 in read in psymtab, but not in symtab.)
> 
> The symbols in the elf file look OK so I think that the problem is
> in GDB.   Is cross GDB known to work on 64 bit targets when hosted
> on a 32 bit Intel host?

what kind of symbols?

I ran across something the other week w/ STABS-in-ELF, which i solved
like the following patches, but i've not tested them well for MIPS,
let alone for other targets.

i'm a bit uncomfortable with them because not all of the the stabs
values are VMAs, but it would have been harder to fix it better (and
i'm not really worried about 2G offsets into peoples' .o files /
executables).  (If you've got an executable or .o file that big, use a
better bloody debugging format.  8-)

they did do well enough for my few initial tests, though, which were
addr2line and objdump --stabs on KSEG0/KSEG1 programs (kernels,
firmware).


Consider these contributed.  If somebody wants to test them well
enough to be included, great, but i've got other fish to fry right
now.  8-)


chris
--
[ bfd/ChangeLog ]

	* syms.c (_bfd_stab_section_find_nearest_line): Handle sign
	extension of VMAs used in stabs.

[ gas/ChangeLog ]

	* rddbg.c (read_section_stabs_debugging_info): Handle sign
	extension of VMAs used in stabs.

Index: bfd/syms.c
===================================================================
RCS file: /projects/bbp/cvsroot/systemsw/tools/src/binutils/bfd/syms.c,v
retrieving revision 1.1.1.9
retrieving revision 1.10
diff -u -p -r1.1.1.9 -r1.10
--- syms.c	2003/07/26 05:39:17	1.1.1.9
+++ syms.c	2003/08/07 22:46:07	1.10
@@ -899,12 +899,17 @@ _bfd_stab_section_find_nearest_line (bfd
   char *directory_name;
   int saw_fun;
   bfd_boolean saw_line, saw_func;
+  int sext_vma;
 
   *pfound = FALSE;
   *pfilename = bfd_get_filename (abfd);
   *pfnname = NULL;
   *pline = 0;
 
+  sext_vma = bfd_get_sign_extend_vma (abfd);
+  if (sext_vma == -1)
+    sext_vma = 0;
+
   /* Stabs entries use a 12 byte format:
        4 byte string table index
        1 byte stab type
@@ -1111,7 +1116,10 @@ _bfd_stab_section_find_nearest_line (bfd
 	         and directory.  */
 	      if (saw_fun == 0)
 		{
-		  info->indextable[i].val = bfd_get_32 (abfd, last_stab + VALOFF);
+		  if (sext_vma) 
+		    info->indextable[i].val = bfd_get_signed_32 (abfd, last_stab + VALOFF);
+		  else 
+		    info->indextable[i].val = bfd_get_32 (abfd, last_stab + VALOFF);
 		  info->indextable[i].stab = last_stab;
 		  info->indextable[i].str = str;
 		  info->indextable[i].directory_name = directory_name;
@@ -1166,7 +1174,10 @@ _bfd_stab_section_find_nearest_line (bfd
 	      if (name == NULL)
 		continue;
 
-	      info->indextable[i].val = bfd_get_32 (abfd, stab + VALOFF);
+	      if (sext_vma) 
+		info->indextable[i].val = bfd_get_signed_32 (abfd, stab + VALOFF);
+              else 
+		info->indextable[i].val = bfd_get_32 (abfd, stab + VALOFF);
 	      info->indextable[i].stab = stab;
 	      info->indextable[i].str = str;
 	      info->indextable[i].directory_name = directory_name;
@@ -1179,7 +1190,11 @@ _bfd_stab_section_find_nearest_line (bfd
 
       if (saw_fun == 0)
 	{
-	  info->indextable[i].val = bfd_get_32 (abfd, last_stab + VALOFF);
+	  if (sext_vma)
+	    info->indextable[i].val = bfd_get_signed_32 (abfd, last_stab + VALOFF);
+	  else
+	    info->indextable[i].val = bfd_get_32 (abfd, last_stab + VALOFF);
+
 	  info->indextable[i].stab = last_stab;
 	  info->indextable[i].str = str;
 	  info->indextable[i].directory_name = directory_name;
@@ -1267,7 +1282,10 @@ _bfd_stab_section_find_nearest_line (bfd
 	{
 	case N_SOL:
 	  /* The name of an include file.  */
-	  val = bfd_get_32 (abfd, stab + VALOFF);
+	  if (sext_vma)
+	    val = bfd_get_signed_32 (abfd, stab + VALOFF);
+	  else
+	    val = bfd_get_32 (abfd, stab + VALOFF);
 	  if (val <= offset)
 	    {
 	      file_name = (char *) str + bfd_get_32 (abfd, stab + STRDXOFF);
@@ -1281,8 +1299,11 @@ _bfd_stab_section_find_nearest_line (bfd
 	  /* A line number.  If the function was specified, then the value
 	     is relative to the start of the function.  Otherwise, the
 	     value is an absolute address.  */
-	  val = ((indexentry->function_name ? indexentry->val : 0)
-		 + bfd_get_32 (abfd, stab + VALOFF));
+	  if (sext_vma)
+	    val = bfd_get_signed_32 (abfd, stab + VALOFF);
+	  else
+	    val = bfd_get_32 (abfd, stab + VALOFF);
+	  val += indexentry->function_name ? indexentry->val : 0;
 	  /* If this line starts before our desired offset, or if it's
 	     the first line we've been able to find, use it.  The
 	     !saw_line check works around a bug in GCC 2.95.3, which emits
Index: binutils/rddbg.c
===================================================================
RCS file: /projects/bbp/cvsroot/systemsw/tools/src/binutils/binutils/rddbg.c,v
retrieving revision 1.1.1.5
retrieving revision 1.7
diff -u -p -r1.1.1.5 -r1.7
--- rddbg.c	2003/04/28 18:29:43	1.1.1.5
+++ rddbg.c	2003/08/07 22:46:09	1.7
@@ -114,10 +114,15 @@ read_section_stabs_debugging_info (abfd,
 		  { "LC_SYMTAB.stabs", "LC_SYMTAB.stabstr" } };
   unsigned int i;
   PTR shandle;
+  int sext_vma;
 
   *pfound = FALSE;
   shandle = NULL;
 
+  sext_vma = bfd_get_sign_extend_vma (abfd);
+  if (sext_vma == -1)
+    sext_vma = 0;
+
   for (i = 0; i < sizeof names / sizeof names[0]; i++)
     {
       asection *sec, *strsec;
@@ -176,7 +181,10 @@ read_section_stabs_debugging_info (abfd,
 	      type = bfd_get_8 (abfd, stab + 4);
 	      other = bfd_get_8 (abfd, stab + 5);
 	      desc = bfd_get_16 (abfd, stab + 6);
-	      value = bfd_get_32 (abfd, stab + 8);
+	      if (sext_vma)
+		value = bfd_get_signed_32 (abfd, stab + 8);
+	      else
+		value = bfd_get_32 (abfd, stab + 8);
 
 	      if (type == 0)
 		{

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

* Re: gdb for hppa
  2003-08-18  2:51 gdb for hppa Randolph Chung
  2003-08-18  3:15 ` MIPS64 problem with symbols Peter Reilley
@ 2003-08-23 14:48 ` Joel Brobecker
  1 sibling, 0 replies; 4+ messages in thread
From: Joel Brobecker @ 2003-08-23 14:48 UTC (permalink / raw)
  To: Randolph Chung; +Cc: gdb

Hello Randolph,

> so, i heard gdb/hppa is looking for some help? :-)

Yes :)

> my primary interest is in getting gdb working on hppa-linux, but from
> talking to drow, looking at the code and what needs to be done, i 
> think it'll be worthwhile to merge the palinux code (which is not in 
> cvs yet) with the hpux stuff in cvs instead of having a separate target.

I agree.

> what is the current status of hppa support?

Right now, only hppa*-*-hpux* is supported. All the other targets have
been obsoleted. The HPPA port has recently been partially multiarched
(both 32 and 64 bit), and I am working on improving the port so that it
is fully multiarched.

-- 
Joel

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

end of thread, other threads:[~2003-08-23 14:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-18  2:51 gdb for hppa Randolph Chung
2003-08-18  3:15 ` MIPS64 problem with symbols Peter Reilley
     [not found]   ` <mailpost.1061176541.26825@news-sj1-1>
2003-08-18  4:59     ` cgd
2003-08-23 14:48 ` gdb for hppa Joel Brobecker

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