|
From: Erik C. <er...@ar...> - 2003-07-25 14:50:33
|
Hi
I'm using a rather recent valgrind from CVS, and having a problem
with code generated by a rather simplistic code generator:
0x837A73C: popl (%esp,,)
12: GETL %ESP, t10
13: LDL (t10), t12
14: GETL %ESP, t14
15: STL t12, (t14)
16: ADDL $0x4, t10
17: PUTL t10, %ESP
18: INCEIPo $3
Oops, it's using the old version ESP for the store, but the
Intel manual says:
If the ESP register is used as a base register for addressing
a destination operand in memory, the POP instruction computes
the effective address of the operand after it increments the
ESP register. For the case of a 16-bit stack where ESP wraps to
0h as a result of the POP instruction, the resulting location
of the memory write is processor-family-specific.
(Page 3-599 in 24547112.pdf,
http://developer.intel.com/design/pentium4/manuals/245471.htm)
I guess this is fairly simple to fix? The following works for
me, though I haven't tested it very thoroughly (by the way, the
CVS server is flaky again - I get cvs [diff aborted]: end of file from server (consult above messages if any) half the time or more):
Index: vg_to_ucode.c
===================================================================
RCS file: /cvsroot/valgrind/valgrind/coregrind/vg_to_ucode.c,v
retrieving revision 1.87
diff -u -r1.87 vg_to_ucode.c
--- vg_to_ucode.c 6 Jul 2003 01:17:33 -0000 1.87
+++ vg_to_ucode.c 25 Jul 2003 14:47:39 -0000
@@ -5215,18 +5215,20 @@
uInstr2(cb, GET, 4, ArchReg, R_ESP, TempReg, t1);
/* load M[ESP] to virtual register t3: t3 = M[t1] */
uInstr2(cb, LOAD, 4, TempReg, t1, TempReg, t3);
+ /* increase ESP */
+ uInstr2(cb, ADD, 4, Literal, 0, TempReg, t1);
+ uLiteral(cb, sz);
+ uInstr2(cb, PUT, 4, TempReg, t1, ArchReg, R_ESP);
+
/* resolve MODR/M */
pair1 = disAMode ( cb, sorb, eip, dis?dis_buf:NULL);
tmpa = LOW24(pair1);
+
/* uInstr2(cb, LOAD, sz, TempReg, tmpa, TempReg, tmpa); */
/* store value from stack in memory, M[m32] = t3 */
uInstr2(cb, STORE, 4, TempReg, t3, TempReg, tmpa);
- /* increase ESP */
- uInstr2(cb, ADD, 4, Literal, 0, TempReg, t1);
- uLiteral(cb, sz);
- uInstr2(cb, PUT, 4, TempReg, t1, ArchReg, R_ESP);
if (dis)
VG_(printf)("popl %s\n", dis_buf);
--
Erik Corry er...@ar...
|
|
From: Nicholas N. <nj...@ca...> - 2003-07-25 15:51:50
|
On Fri, 25 Jul 2003, Erik Corry wrote: > 0x837A73C: popl (%esp,,) > > I guess this is fairly simple to fix? The following works for > me, though I haven't tested it very thoroughly The patch looks good, if it works at all that's a good sign -- when these things are wrong you tend to get big problems (eg. seg faults) extremely quickly :) Thanks for the patch, it makes fixing it a lot easier. > (by the way, the CVS server is flaky again - I get cvs [diff aborted]: > end of file from server (consult above messages if any) half the time or > more): The anonymous CVS server has been causing lots of problems lately (the non-anonymous server has been working fine). The SourceForge CVS browsing pages say "NOTE: ViewCVS is currently running against the backup CVS server; data shown may be up to 24 hours old" and maybe something similar applies to the anonymous server, or maybe they're the same thing. Hopefully it will get better soon, but I really don't know. N |
|
From: Tom H. <th...@cy...> - 2003-07-25 16:02:45
|
In message <Pin...@gr...>
Nicholas Nethercote <nj...@ca...> wrote:
> The anonymous CVS server has been causing lots of problems lately (the
> non-anonymous server has been working fine).
I think it is very overloaded or something. Unfortunately only people
with commit access to a project can use the ssh interface, just having
a sourceforge account isn't enough.
> The SourceForge CVS browsing pages say "NOTE: ViewCVS is currently running
> against the backup CVS server; data shown may be up to 24 hours old" and
> maybe something similar applies to the anonymous server, or maybe they're
> the same thing. Hopefully it will get better soon, but I really don't
> know.
I suspect it's running against the backup because the main server is
so overloaded ;-)
Tom
--
Tom Hughes (th...@cy...)
Software Engineer, Cyberscience Corporation
http://www.cyberscience.com/
|
|
From: Olly B. <ol...@su...> - 2003-07-25 16:05:13
|
On Fri, Jul 25, 2003 at 04:51:46PM +0100, Nicholas Nethercote wrote:
> [SourceForge CVS]
> Hopefully it will get better soon, but I really don't know.
SourceForge sent out a mail recently suggestion that the CVS situation
should be resolved within a month (they're installed 6 new servers
apparently). I live in hope...
Cheers,
Olly
|
|
From: Dan K. <da...@ke...> - 2003-07-26 03:34:03
|
Nicholas Nethercote wrote: >>(by the way, the CVS server is flaky again - I get cvs [diff aborted]: >>end of file from server (consult above messages if any) half the time or >>more): > > > The anonymous CVS server has been causing lots of problems lately (the > non-anonymous server has been working fine). > > The SourceForge CVS browsing pages say "NOTE: ViewCVS is currently running > against the backup CVS server; data shown may be up to 24 hours old" and > maybe something similar applies to the anonymous server, or maybe they're > the same thing. Hopefully it will get better soon, but I really don't > know. IMHO it's time to register valgrind.net and get away from sourceforge, which doesn't seem likely to survive in its present form... - Dan -- Dan Kegel http://www.kegel.com http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045 |