Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Don't clobber info->mach in gdb_print_insn_mips
@ 2003-06-23 14:14 Fred Fish
  2003-06-23 20:38 ` Andrew Cagney
  0 siblings, 1 reply; 7+ messages in thread
From: Fred Fish @ 2003-06-23 14:14 UTC (permalink / raw)
  To: gdb-patches; +Cc: Fred Fish

I updated to the latest CVS gdb over the weekend and afterwards my
mipsisa32-intrinsity-elf target would no longer disassemble
coprocessor 2 instructions correctly.  I tracked it down to the
info->mach field being clobbered by gdb_print_insn_mips.  The attached
patch fixes it, though I'm not sure if this is the correct solution.

Note that mipsisa32-intrinsity-elf is not yet a supported target
configuration as it is a work in progress and the patches have not
been submitted yet.  But mipsisa32-unknown-elf has a similar problem.

-Fred


2003-06-23  Fred Fish  <fnf@intrinsity.com>

	* mips-tdep.c (gdb_print_insn_mips): Don't clobber a previously
	set value of info->mach.


Index: mips-tdep.c
===================================================================
RCS file: /mips/newtools/fsf/gdb/gdb/mips-tdep.c,v
retrieving revision 1.20
diff -c -r1.20 mips-tdep.c
*** mips-tdep.c	2003/06/23 02:13:09	1.20
--- mips-tdep.c	2003/06/23 13:33:02
***************
*** 5279,5288 ****
       guess that if the address passed in is odd, it's 16-bits.  */
    if (proc_desc)
      info->mach = pc_is_mips16 (PROC_LOW_ADDR (proc_desc)) ?
!       bfd_mach_mips16 : 0;
    else
      info->mach = pc_is_mips16 (memaddr) ?
!       bfd_mach_mips16 : 0;
  
    /* Round down the instruction address to the appropriate boundary.  */
    memaddr &= (info->mach == bfd_mach_mips16 ? ~1 : ~3);
--- 5279,5288 ----
       guess that if the address passed in is odd, it's 16-bits.  */
    if (proc_desc)
      info->mach = pc_is_mips16 (PROC_LOW_ADDR (proc_desc)) ?
!       bfd_mach_mips16 : info->mach;
    else
      info->mach = pc_is_mips16 (memaddr) ?
!       bfd_mach_mips16 : info->mach;
  
    /* Round down the instruction address to the appropriate boundary.  */
    memaddr &= (info->mach == bfd_mach_mips16 ? ~1 : ~3);


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

end of thread, other threads:[~2003-06-26 18:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-23 14:14 [PATCH] Don't clobber info->mach in gdb_print_insn_mips Fred Fish
2003-06-23 20:38 ` Andrew Cagney
2003-06-23 21:39   ` Fred Fish
2003-06-23 21:40     ` Andrew Cagney
2003-06-24  0:51       ` Fred Fish
2003-06-25 21:47         ` Andrew Cagney
2003-06-26 18:00           ` Andrew Cagney

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