Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] mips, eabi64, addr_bit == 32
@ 2006-05-31 23:32 Michael Snyder
  2006-05-31 23:39 ` Daniel Jacobowitz
  2006-06-17 23:15 ` Mark Kettenis
  0 siblings, 2 replies; 8+ messages in thread
From: Michael Snyder @ 2006-05-31 23:32 UTC (permalink / raw)
  To: brobecker, GDB Patches, fnf

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

Disagreement between gcc and gdb about the size of an addr
causes numerous dwarf2-related complaints of the form:

(gdb) advance foo^M
foo (a=dwarf2_read_address: Corrupted DWARF expression.^M
) at 
/opt/redhat/gnupro-06r1-1/sources/tools/cross/gdb/testsuite/gdb.base/advan\ce.c:6^M
6         int b = a + 10;^M
(gdb) FAIL: gdb.base/advance.exp: advance function called as param


[-- Attachment #2: d2 --]
[-- Type: text/plain, Size: 1265 bytes --]

2006-05-31  Michael Snyder  <msnyder@redhat.com>

	* mips-tdep.c (mips_gdbarch_init): EABI64, addr_bit is 32.
	(mips_write_pc): Difference between addr_bit and ptr_bit
	requires sign_extension when setting $pc.
	
Index: mips-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.c,v
retrieving revision 1.393
diff -p -r1.393 mips-tdep.c
*** mips-tdep.c	31 May 2006 23:15:50 -0000	1.393
--- mips-tdep.c	31 May 2006 23:18:47 -0000
*************** mips_unwind_dummy_id (struct gdbarch *gd
*** 838,843 ****
--- 838,847 ----
  static void
  mips_write_pc (CORE_ADDR pc, ptid_t ptid)
  {
+   /* If addr_bit is 32, force sign extension.  */
+   if (gdbarch_addr_bit (current_gdbarch) == 32)
+     if ((pc & 0xffffffff80000000LL) == 0x80000000)
+       pc |= 0xffffffff00000000LL;
    write_register_pid (mips_regnum (current_gdbarch)->pc, pc, ptid);
  }
  
*************** mips_gdbarch_init (struct gdbarch_info i
*** 4976,4981 ****
--- 4980,4986 ----
        tdep->default_mask_address_p = 0;
        set_gdbarch_long_bit (gdbarch, 64);
        set_gdbarch_ptr_bit (gdbarch, 64);
+       set_gdbarch_addr_bit (gdbarch, 32);
        set_gdbarch_long_long_bit (gdbarch, 64);
        break;
      case MIPS_ABI_N32:

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

* Re: [RFA] mips, eabi64, addr_bit == 32
  2006-05-31 23:32 [RFA] mips, eabi64, addr_bit == 32 Michael Snyder
@ 2006-05-31 23:39 ` Daniel Jacobowitz
  2006-05-31 23:47   ` Michael Snyder
  2006-06-17 23:15 ` Mark Kettenis
  1 sibling, 1 reply; 8+ messages in thread
From: Daniel Jacobowitz @ 2006-05-31 23:39 UTC (permalink / raw)
  To: Michael Snyder; +Cc: brobecker, GDB Patches, fnf

On Wed, May 31, 2006 at 04:25:36PM -0700, Michael Snyder wrote:
> Disagreement between gcc and gdb about the size of an addr
> causes numerous dwarf2-related complaints of the form:
> 
> (gdb) advance foo^M
> foo (a=dwarf2_read_address: Corrupted DWARF expression.^M
> ) at 
> /opt/redhat/gnupro-06r1-1/sources/tools/cross/gdb/testsuite/gdb.base/advan\ce.c:6^M
> 6         int b = a + 10;^M
> (gdb) FAIL: gdb.base/advance.exp: advance function called as param
> 

> 2006-05-31  Michael Snyder  <msnyder@redhat.com>
> 
> 	* mips-tdep.c (mips_gdbarch_init): EABI64, addr_bit is 32.

Wasn't Fred just looking at this?  Jim posted a better solution,
that needed to be updated to current sources.

Setting addr_bit to 32 is incorrect, addresses have 64 bits on this
target.  It's the use of TARGET_ADDR_BIT in the dwarf reader that's
wrong.


-- 
Daniel Jacobowitz
CodeSourcery


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

* Re: [RFA] mips, eabi64, addr_bit == 32
  2006-05-31 23:39 ` Daniel Jacobowitz
@ 2006-05-31 23:47   ` Michael Snyder
  2006-06-01  1:55     ` Daniel Jacobowitz
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Snyder @ 2006-05-31 23:47 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: brobecker, GDB Patches, fnf

Daniel Jacobowitz wrote:
> On Wed, May 31, 2006 at 04:25:36PM -0700, Michael Snyder wrote:
> 
>>Disagreement between gcc and gdb about the size of an addr
>>causes numerous dwarf2-related complaints of the form:
>>
>>(gdb) advance foo^M
>>foo (a=dwarf2_read_address: Corrupted DWARF expression.^M
>>) at 
>>/opt/redhat/gnupro-06r1-1/sources/tools/cross/gdb/testsuite/gdb.base/advan\ce.c:6^M
>>6         int b = a + 10;^M
>>(gdb) FAIL: gdb.base/advance.exp: advance function called as param
>>
> 
> 
>>2006-05-31  Michael Snyder  <msnyder@redhat.com>
>>
>>	* mips-tdep.c (mips_gdbarch_init): EABI64, addr_bit is 32.
> 
> 
> Wasn't Fred just looking at this?  Jim posted a better solution,
> that needed to be updated to current sources.
> 
> Setting addr_bit to 32 is incorrect, addresses have 64 bits on this
> target.  It's the use of TARGET_ADDR_BIT in the dwarf reader that's
> wrong.

'K, I'll look for Jim's post.  About when was it posted?


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

* Re: [RFA] mips, eabi64, addr_bit == 32
  2006-05-31 23:47   ` Michael Snyder
@ 2006-06-01  1:55     ` Daniel Jacobowitz
  2006-06-08 19:21       ` Michael Snyder
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel Jacobowitz @ 2006-06-01  1:55 UTC (permalink / raw)
  To: Michael Snyder; +Cc: brobecker, GDB Patches, fnf

On Wed, May 31, 2006 at 04:41:23PM -0700, Michael Snyder wrote:
> >Wasn't Fred just looking at this?  Jim posted a better solution,
> >that needed to be updated to current sources.
> >
> >Setting addr_bit to 32 is incorrect, addresses have 64 bits on this
> >target.  It's the use of TARGET_ADDR_BIT in the dwarf reader that's
> >wrong.
> 
> 'K, I'll look for Jim's post.  About when was it posted?

Earlier this month:

  http://sourceware.org/ml/gdb-patches/2006-05/msg00226.html

-- 
Daniel Jacobowitz
CodeSourcery


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

* Re: [RFA] mips, eabi64, addr_bit == 32
  2006-06-01  1:55     ` Daniel Jacobowitz
@ 2006-06-08 19:21       ` Michael Snyder
  2006-06-08 19:39         ` Fred Fish
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Snyder @ 2006-06-08 19:21 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: brobecker, GDB Patches, fnf, Jim Blandy

Daniel Jacobowitz wrote:
> On Wed, May 31, 2006 at 04:41:23PM -0700, Michael Snyder wrote:
> 
>>>Wasn't Fred just looking at this?  Jim posted a better solution,
>>>that needed to be updated to current sources.
>>>
>>>Setting addr_bit to 32 is incorrect, addresses have 64 bits on this
>>>target.  It's the use of TARGET_ADDR_BIT in the dwarf reader that's
>>>wrong.
>>
>>'K, I'll look for Jim's post.  About when was it posted?
> 
> 
> Earlier this month:
> 
>   http://sourceware.org/ml/gdb-patches/2006-05/msg00226.html
> 

Doesn't appear that any resolution ever came out of this.


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

* Re: [RFA] mips, eabi64, addr_bit == 32
  2006-06-08 19:21       ` Michael Snyder
@ 2006-06-08 19:39         ` Fred Fish
  0 siblings, 0 replies; 8+ messages in thread
From: Fred Fish @ 2006-06-08 19:39 UTC (permalink / raw)
  To: Michael Snyder; +Cc: Daniel Jacobowitz, brobecker, GDB Patches, Jim Blandy, fnf

On Thursday 08 June 2006 15:20, Michael Snyder wrote:
> Doesn't appear that any resolution ever came out of this.

Correct.  I've wanted to find time to go back and try merging Jim's
changes again into a current mainline tree but so far I've been too
busy with other stuff.

Quite a few of the patches merge easily but some are dependent on code
that has since been removed, so will need some work (as I recall).

-Fred



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

* Re: [RFA] mips, eabi64, addr_bit == 32
  2006-05-31 23:32 [RFA] mips, eabi64, addr_bit == 32 Michael Snyder
  2006-05-31 23:39 ` Daniel Jacobowitz
@ 2006-06-17 23:15 ` Mark Kettenis
  2006-06-20 20:29   ` Daniel Jacobowitz
  1 sibling, 1 reply; 8+ messages in thread
From: Mark Kettenis @ 2006-06-17 23:15 UTC (permalink / raw)
  To: msnyder; +Cc: brobecker, gdb-patches, fnf

> Date: Wed, 31 May 2006 16:25:36 -0700
> From: Michael Snyder <msnyder@redhat.com>
> 
> Disagreement between gcc and gdb about the size of an addr
> causes numerous dwarf2-related complaints of the form:
> 
> (gdb) advance foo^M
> foo (a=dwarf2_read_address: Corrupted DWARF expression.^M
> ) at 
> /opt/redhat/gnupro-06r1-1/sources/tools/cross/gdb/testsuite/gdb.base/advan\ce.c:6^M
> 6         int b = a + 10;^M
> (gdb) FAIL: gdb.base/advance.exp: advance function called as param

Is this patch still on the table?  It looks highly suspicious to me.
I mean, you have 64-bit pointers, but 32-bit addresses?

Shouldn't we just fix GCC to emit the correct debug info?

> 2006-05-31  Michael Snyder  <msnyder@redhat.com>
> 
> 	* mips-tdep.c (mips_gdbarch_init): EABI64, addr_bit is 32.
> 	(mips_write_pc): Difference between addr_bit and ptr_bit
> 	requires sign_extension when setting $pc.
> 	
> Index: mips-tdep.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/mips-tdep.c,v
> retrieving revision 1.393
> diff -p -r1.393 mips-tdep.c
> *** mips-tdep.c	31 May 2006 23:15:50 -0000	1.393
> --- mips-tdep.c	31 May 2006 23:18:47 -0000
> *************** mips_unwind_dummy_id (struct gdbarch *gd
> *** 838,843 ****
> --- 838,847 ----
>   static void
>   mips_write_pc (CORE_ADDR pc, ptid_t ptid)
>   {
> +   /* If addr_bit is 32, force sign extension.  */
> +   if (gdbarch_addr_bit (current_gdbarch) == 32)
> +     if ((pc & 0xffffffff80000000LL) == 0x80000000)
> +       pc |= 0xffffffff00000000LL;
>     write_register_pid (mips_regnum (current_gdbarch)->pc, pc, ptid);
>   }
>   
> *************** mips_gdbarch_init (struct gdbarch_info i
> *** 4976,4981 ****
> --- 4980,4986 ----
>         tdep->default_mask_address_p = 0;
>         set_gdbarch_long_bit (gdbarch, 64);
>         set_gdbarch_ptr_bit (gdbarch, 64);
> +       set_gdbarch_addr_bit (gdbarch, 32);
>         set_gdbarch_long_long_bit (gdbarch, 64);
>         break;
>       case MIPS_ABI_N32:


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

* Re: [RFA] mips, eabi64, addr_bit == 32
  2006-06-17 23:15 ` Mark Kettenis
@ 2006-06-20 20:29   ` Daniel Jacobowitz
  0 siblings, 0 replies; 8+ messages in thread
From: Daniel Jacobowitz @ 2006-06-20 20:29 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: msnyder, brobecker, gdb-patches, fnf

On Sun, Jun 18, 2006 at 01:14:40AM +0200, Mark Kettenis wrote:
> Is this patch still on the table?  It looks highly suspicious to me.
> I mean, you have 64-bit pointers, but 32-bit addresses?
> 
> Shouldn't we just fix GCC to emit the correct debug info?

I think the debug information is reasonable.  But in any case, I agree
that this isn't the right fix - I pointed out Jim's old patch for the
same issue; I'd rather someone updated that.

-- 
Daniel Jacobowitz
CodeSourcery


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

end of thread, other threads:[~2006-06-20 20:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-31 23:32 [RFA] mips, eabi64, addr_bit == 32 Michael Snyder
2006-05-31 23:39 ` Daniel Jacobowitz
2006-05-31 23:47   ` Michael Snyder
2006-06-01  1:55     ` Daniel Jacobowitz
2006-06-08 19:21       ` Michael Snyder
2006-06-08 19:39         ` Fred Fish
2006-06-17 23:15 ` Mark Kettenis
2006-06-20 20:29   ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox