This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
z8k simulator broken
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: Alan Modra <amodra at bigpond dot net dot au>
- Cc: gdb at sources dot redhat dot com
- Date: Tue, 14 Jan 2003 23:28:18 -0500
- Subject: z8k simulator broken
Did you ever get a chance to look at the z8k sim problem? It seems that the
problem is that it uses the idx to generate the names of functions, but your
changes to "Generate idx as gas needs it" broke that.
Here's what I'm using; it builds, but I haven't really tested the simulator
yet. Someone tell me again why I'm doing this?
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
Index: writecode.c
===================================================================
RCS file: /cvs/src/src/sim/z8k/writecode.c,v
retrieving revision 1.3
diff -u -p -r1.3 writecode.c
--- writecode.c 6 Jun 2002 15:50:50 -0000 1.3
+++ writecode.c 15 Jan 2003 04:27:10 -0000
@@ -187,7 +187,7 @@ lookup_inst (what)
}
if (nibl_matched)
{
- z8k_inv_list[what] = ptr->idx;
+ z8k_inv_list[what] = ptr - z8k_table;
break; /* while */
}
ptr++;
@@ -1550,7 +1550,7 @@ mangle (p, shortcut, value)
}
else
{
- emit ("int <fop>_%d(context,pc,iwords0)\n", p->idx);
+ emit ("int <fop>_%d(context,pc,iwords0)\n", p - z8k_table);
emit ("int iwords0;\n");
}
emit ("sim_state_type *context;\n");
@@ -1668,7 +1668,7 @@ build_list (i)
if (!p)
return;
- add_to_list (&list[p->idx], i);
+ add_to_list (&list[p - z8k_table], i);
}
int
@@ -1807,7 +1807,7 @@ main (ac, av)
#endif
if (p != NULL)
{
- printf ("%d", p->idx);
+ printf ("%d", p - z8k_table);
}
else
printf ("400");