🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #8793

68030up mmu instruction decoding in gdb4.7

#8793
From: Robert R. Henry
Date: Thu, 10 Dec 1992 01:06
105 lines
3005 bytes
gdb4.7 target== m68030 or m68040 does not correctly disassemble
memory management unit instructions, such as those in this program:
  main()
  {
    asm("pflusha");
    asm("pmove tc,a0@");
    asm("pmove srp,a0@");
    asm("pmove crp,a0@");
    asm("pmove mmusr,a0@");
    asm("pmove tt0,a0@");
    asm("pmove tt1,a0@");
    asm("pmove a0@,tc");
    asm("pmove a0@,srp");
    asm("pmove a0@,crp");
    asm("pmove a0@,mmusr");
    asm("pmove a0@,tt0");
    asm("pmove a0@,tt1");
  }

This is because the routine print_insn_arg in gdb4.7 can not handle
the register-codes (*d)
	P
	W
	X
	Y
	Z
	V
	f
	3
	|

Here's my fix to m68k-pinsn.c.  I'm only about 60% sure that this
is the right way to do it....

607a608,677
>     case 'P':
>       {
> 	static char *P_mmu_reg_name[] = {
> 	  "tc", "drp", "srp", "crp",
> 	  "cal", "val", "scc", "ac"};
> 	int val = fetch_arg (buffer, place, 3);
>         fprintf_filtered (stream, P_mmu_reg_name[val]);
> 	p += 2;
>       }
>       break;
> 
>     case '3':
>       {
> 	static char *Three_mmu_reg_name[] = {
> 	  "?3-code-val0?", "?3-code-val1?", "tt0", "tt1",
> 	  "?3-code-val4?", "?3-code-val5?", "?3-code-val6?", "?3-code-val7?"};
> 	int val = fetch_arg (buffer, place, 3);
>         fprintf_filtered (stream, Three_mmu_reg_name[val]);
> 	p += 2;
>       }
>       break;
> 
>     case 'W':
>       {
> 	static char *W_mmu_reg_name[] = {"?W-code-val0?", "drp", "srp", "crp"};
> 	int val = fetch_arg (buffer, place, 2);
>         fprintf_filtered (stream, W_mmu_reg_name[val]);
> 	p += 2;	/* maybe */
>       }
>       break;
> 
>     case 'X':
>       {
> 	/* not sure about this */
> 	int val = fetch_arg (buffer, place, 4);
> 	if (val <= 7) {
> 	  fprintf_filtered (stream, "bad%d", val);
> 	} else {
> 	  fprintf_filtered (stream, "bac%d", val);
> 	}
> 	p += 2;	/* maybe */
>       }
>       break;
> 
>     case 'Y':
>       {
>         fprintf_filtered (stream, "psr");
> 	p += 2;	/* maybe */
>       }
>       break;
> 
>     case 'Z':
>       {
>         fprintf_filtered (stream, "pcsr");
> 	p += 2;	/* maybe */
>       }
>       break;
> 
>     case 'f':
>       {
> 	int val = fetch_arg (buffer, place, 1);
> 	if (val == 0) {
> 	  fprintf_filtered (stream, "sfc");
> 	} else {
> 	  fprintf_filtered (stream, "dfc");
> 	}
> 	p += 2;	/* maybe */
>       }
>       break;
> 
Technical Details
Message-ID: <9212100106.AA00371@tera.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!tera.com!rrh

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f5053,db6d5775f84aedd7,start
X-Google-Attributes: gidf5053,public
X-Google-ArrivalTime: 1992-12-09 18:38:22 PST
Newsgroups: gnu.gdb.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!tera.com!rrh
From: rrh@tera.com (Robert R. Henry)
Subject: 68030up mmu instruction decoding in gdb4.7
Message-ID: <9212100106.AA00371@tera.com>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Thu, 10 Dec 1992 01:06:03 GMT
Approved: bug-gdb@prep.ai.mit.edu
Lines: 106