* z8k simulator broken
@ 2003-01-15 4:28 Daniel Jacobowitz
2003-01-15 4:46 ` Alan Modra
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Jacobowitz @ 2003-01-15 4:28 UTC (permalink / raw)
To: Alan Modra; +Cc: gdb
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");
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: z8k simulator broken
2003-01-15 4:28 z8k simulator broken Daniel Jacobowitz
@ 2003-01-15 4:46 ` Alan Modra
2003-01-15 14:55 ` Daniel Jacobowitz
0 siblings, 1 reply; 4+ messages in thread
From: Alan Modra @ 2003-01-15 4:46 UTC (permalink / raw)
To: gdb
On Tue, Jan 14, 2003 at 11:28:18PM -0500, Daniel Jacobowitz wrote:
> Did you ever get a chance to look at the z8k sim problem?
No, I didn't. Andrew told me that it wasn't that important, and for me
to go and fix something else. Haven't done the "something else",
either. :) Knowing what I changed, your patch looks good to me.
--
Alan Modra
IBM OzLabs - Linux Technology Centre
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: z8k simulator broken
2003-01-15 4:46 ` Alan Modra
@ 2003-01-15 14:55 ` Daniel Jacobowitz
2003-01-15 16:09 ` Andrew Cagney
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Jacobowitz @ 2003-01-15 14:55 UTC (permalink / raw)
To: gdb
On Wed, Jan 15, 2003 at 03:15:45PM +1030, Alan Modra wrote:
> On Tue, Jan 14, 2003 at 11:28:18PM -0500, Daniel Jacobowitz wrote:
> > Did you ever get a chance to look at the z8k sim problem?
>
> No, I didn't. Andrew told me that it wasn't that important, and for me
> to go and fix something else. Haven't done the "something else",
> either. :) Knowing what I changed, your patch looks good to me.
For the curious (why would you be curious? I don't know. I don't even
know why I started doing this!) I don't know if this simulator was ever
able to run GDB tests or simple newlib binaries but my guess is not
recently.
A z8002 binary (gdb.base/break) has a .text section of size 0xeb24 or
so. The heap is 0x5000, the stack is 0x1000, and AFAICT a z8002 has
only 0x10000 memory.
A z8001 has much more memory available but only in 64k segments, and
.text is:
0 .text 00019a94 00000000 00000000 00000120 2**1
CONTENTS, ALLOC, LOAD, CODE
i.e. much more than the one segment it can use.
I was trying to multi-arch the z8k on a lark, but it's not enough of a
lark to try to get around _that_. Let it die.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: z8k simulator broken
2003-01-15 14:55 ` Daniel Jacobowitz
@ 2003-01-15 16:09 ` Andrew Cagney
0 siblings, 0 replies; 4+ messages in thread
From: Andrew Cagney @ 2003-01-15 16:09 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb
> For the curious (why would you be curious? I don't know. I don't even
> know why I started doing this!) I don't know if this simulator was ever
> able to run GDB tests or simple newlib binaries but my guess is not
> recently.
>
> A z8002 binary (gdb.base/break) has a .text section of size 0xeb24 or
> so. The heap is 0x5000, the stack is 0x1000, and AFAICT a z8002 has
> only 0x10000 memory.
>
> A z8001 has much more memory available but only in 64k segments, and
> .text is:
> 0 .text 00019a94 00000000 00000000 00000120 2**1
> CONTENTS, ALLOC, LOAD, CODE
>
> i.e. much more than the one segment it can use.
>
>
> I was trying to multi-arch the z8k on a lark, but it's not enough of a
> lark to try to get around _that_. Let it die.
Hmm, I'll file this one away :-)
More evidence supporting the hard-nosed requirement that someone doing a
multi-arch must ensure that the before/after code actually works. GDB
isn't in the business of trying to preserve dead code.
Andrew
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-01-15 16:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-15 4:28 z8k simulator broken Daniel Jacobowitz
2003-01-15 4:46 ` Alan Modra
2003-01-15 14:55 ` Daniel Jacobowitz
2003-01-15 16:09 ` Andrew Cagney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox