Changes:
- $Id: patcher.c 2931 2005-07-08 11:49:50Z twisti $
+ $Id: patcher.c 2986 2005-07-11 18:56:09Z twisti $
*/
/* if we show disassembly, we have to skip the nop */
- if (showdisassemble)
+ if (opt_showdisassemble)
ra = ra + 4;
/* get the offset from machine instruction */
/* if we show disassembly, we have to skip the nop */
- if (showdisassemble)
+ if (opt_showdisassemble)
ra = ra + 4;
/* patch the field's offset */
/* if we show disassembly, we have to skip the nop */
- if (showdisassemble)
+ if (opt_showdisassemble)
ra = ra + 4;
/* get the offset from machine instruction */
/* if we show disassembly, we have to skip the nop */
- if (showdisassemble)
+ if (opt_showdisassemble)
ra = ra + 4;
/* get the offset from machine instruction */
/* if we show disassembly, we have to skip the nop */
- if (showdisassemble)
+ if (opt_showdisassemble)
ra = ra + 4;
/* get the offset from machine instruction */
Machine code:
- a63bfe60 ldq a1,-416(pv)
<patched call position>
+ a63bfe60 ldq a1,-416(pv)
a77bfe58 ldq pv,-424(pv)
6b5b4000 jsr (pv)
/* calculate and set the new return address */
- ra = ra - 2 * 4;
+ ra = ra - 1 * 4;
*((ptrint *) (sp + 4 * 8)) = (ptrint) ra;
PATCHER_MONITORENTER;
/* patch back original code */
- *((u4 *) (ra + 4)) = mcode;
+ *((u4 *) ra) = mcode;
+
+ /* if we show disassembly, we have to skip the nop */
+
+ if (opt_showdisassemble)
+ ra = ra + 4;
/* get the offset from machine instruction */
*((ptrint *) (pv + offset)) = (ptrint) c->vftbl;
- /* if we show disassembly, we have to skip the nop */
-
- if (showdisassemble)
- ra = ra + 4;
-
/* get the offset from machine instruction */
offset = (s2) (*((u4 *) (ra + 4)) & 0x0000ffff);
/* if we show disassembly, we have to skip the nop */
- if (showdisassemble)
+ if (opt_showdisassemble)
ra = ra + 4;
/* get the offset from machine instruction */
/* if we show disassembly, we have to skip the nop */
- if (showdisassemble)
+ if (opt_showdisassemble)
ra = ra + 4;
/* get the offset from machine instruction */
/* if we show disassembly, we have to skip the nop */
- if (showdisassemble)
+ if (opt_showdisassemble)
ra = ra + 4;
/* patch vftbl index */
/* if we show disassembly, we have to skip the nop */
- if (showdisassemble)
+ if (opt_showdisassemble)
ra = ra + 4;
/* patch interfacetable index */
/* if we show disassembly, we have to skip the nop */
- if (showdisassemble)
+ if (opt_showdisassemble)
ra = ra + 4;
/* get the offset from machine instruction */
/* if we show disassembly, we have to skip the nop */
- if (showdisassemble)
+ if (opt_showdisassemble)
ra = ra + 4;
/* patch super class index */
/* if we show disassembly, we have to skip the nop */
- if (showdisassemble)
+ if (opt_showdisassemble)
ra = ra + 4;
/* get the offset from machine instruction */
/* if we show disassembly, we have to skip the nop */
- if (showdisassemble)
+ if (opt_showdisassemble)
ra = ra + 4;
/* get the offset from machine instruction */