|
Mark Wielaard |
a928b7 |
--- valgrind-3.8.0/coregrind/m_debuginfo/readdwarf.c (revision 12990)
|
|
Mark Wielaard |
a928b7 |
+++ valgrind-3.8.0/coregrind/m_debuginfo/readdwarf.c (working copy)
|
|
Mark Wielaard |
a928b7 |
@@ -2733,6 +2733,7 @@
|
|
Mark Wielaard |
a928b7 |
Word sw;
|
|
Mark Wielaard |
a928b7 |
UWord uw;
|
|
Mark Wielaard |
a928b7 |
CfiOp op;
|
|
Mark Wielaard |
a928b7 |
+ CfiUnop uop;
|
|
Mark Wielaard |
a928b7 |
HChar* opname;
|
|
Mark Wielaard |
a928b7 |
|
|
Mark Wielaard |
a928b7 |
Int sp; /* # of top element: valid is -1 .. N_EXPR_STACK-1 */
|
|
Mark Wielaard |
a928b7 |
@@ -2778,7 +2779,7 @@
|
|
Mark Wielaard |
a928b7 |
break;
|
|
Mark Wielaard |
a928b7 |
}
|
|
Mark Wielaard |
a928b7 |
|
|
Mark Wielaard |
a928b7 |
- op = 0; opname = NULL; /* excessively conservative */
|
|
Mark Wielaard |
a928b7 |
+ op = 0; uop = 0; opname = NULL; /* excessively conservative */
|
|
Mark Wielaard |
a928b7 |
|
|
Mark Wielaard |
a928b7 |
opcode = *expr++;
|
|
Mark Wielaard |
a928b7 |
switch (opcode) {
|
|
Mark Wielaard |
a928b7 |
@@ -2836,6 +2837,15 @@
|
|
Mark Wielaard |
a928b7 |
VG_(printf)("DW_OP_const4s: %ld", sw);
|
|
Mark Wielaard |
a928b7 |
break;
|
|
Mark Wielaard |
a928b7 |
|
|
Mark Wielaard |
a928b7 |
+ case DW_OP_const2s:
|
|
Mark Wielaard |
a928b7 |
+ /* push: 16-bit signed immediate */
|
|
Mark Wielaard |
a928b7 |
+ sw = read_le_s_encoded_literal( expr, 4 );
|
|
Mark Wielaard |
a928b7 |
+ expr += 2;
|
|
Mark Wielaard |
a928b7 |
+ PUSH( ML_(CfiExpr_Const)( dst, (UWord)sw ) );
|
|
Mark Wielaard |
a928b7 |
+ if (ddump_frames)
|
|
Mark Wielaard |
a928b7 |
+ VG_(printf)("DW_OP_const2s: %ld", sw);
|
|
Mark Wielaard |
a928b7 |
+ break;
|
|
Mark Wielaard |
a928b7 |
+
|
|
Mark Wielaard |
a928b7 |
case DW_OP_const1s:
|
|
Mark Wielaard |
a928b7 |
/* push: 8-bit signed immediate */
|
|
Mark Wielaard |
a928b7 |
sw = read_le_s_encoded_literal( expr, 1 );
|
|
Mark Wielaard |
a928b7 |
@@ -2845,6 +2855,46 @@
|
|
Mark Wielaard |
a928b7 |
VG_(printf)("DW_OP_const1s: %ld", sw);
|
|
Mark Wielaard |
a928b7 |
break;
|
|
Mark Wielaard |
a928b7 |
|
|
Mark Wielaard |
a928b7 |
+ case DW_OP_const1u:
|
|
Mark Wielaard |
a928b7 |
+ /* push: 8-bit unsigned immediate */
|
|
Mark Wielaard |
a928b7 |
+ uw = read_le_u_encoded_literal( expr, 1 );
|
|
Mark Wielaard |
a928b7 |
+ expr += 1;
|
|
Mark Wielaard |
a928b7 |
+ PUSH( ML_(CfiExpr_Const)( dst, uw ) );
|
|
Mark Wielaard |
a928b7 |
+ if (ddump_frames)
|
|
Mark Wielaard |
a928b7 |
+ VG_(printf)("DW_OP_const1: %lu", uw);
|
|
Mark Wielaard |
a928b7 |
+ break;
|
|
Mark Wielaard |
a928b7 |
+
|
|
Mark Wielaard |
a928b7 |
+ case DW_OP_const2u:
|
|
Mark Wielaard |
a928b7 |
+ /* push: 16-bit unsigned immediate */
|
|
Mark Wielaard |
a928b7 |
+ uw = read_le_u_encoded_literal( expr, 2 );
|
|
Mark Wielaard |
a928b7 |
+ expr += 2;
|
|
Mark Wielaard |
a928b7 |
+ PUSH( ML_(CfiExpr_Const)( dst, uw ) );
|
|
Mark Wielaard |
a928b7 |
+ if (ddump_frames)
|
|
Mark Wielaard |
a928b7 |
+ VG_(printf)("DW_OP_const2: %lu", uw);
|
|
Mark Wielaard |
a928b7 |
+ break;
|
|
Mark Wielaard |
a928b7 |
+
|
|
Mark Wielaard |
a928b7 |
+ case DW_OP_const4u:
|
|
Mark Wielaard |
a928b7 |
+ /* push: 32-bit unsigned immediate */
|
|
Mark Wielaard |
a928b7 |
+ uw = read_le_u_encoded_literal( expr, 4 );
|
|
Mark Wielaard |
a928b7 |
+ expr += 4;
|
|
Mark Wielaard |
a928b7 |
+ PUSH( ML_(CfiExpr_Const)( dst, uw ) );
|
|
Mark Wielaard |
a928b7 |
+ if (ddump_frames)
|
|
Mark Wielaard |
a928b7 |
+ VG_(printf)("DW_OP_const4: %lu", uw);
|
|
Mark Wielaard |
a928b7 |
+ break;
|
|
Mark Wielaard |
a928b7 |
+
|
|
Mark Wielaard |
a928b7 |
+ case DW_OP_abs:
|
|
Mark Wielaard |
a928b7 |
+ uop = Cunop_Abs; opname = "abs"; goto unop;
|
|
Mark Wielaard |
a928b7 |
+ case DW_OP_neg:
|
|
Mark Wielaard |
a928b7 |
+ uop = Cunop_Neg; opname = "neg"; goto unop;
|
|
Mark Wielaard |
a928b7 |
+ case DW_OP_not:
|
|
Mark Wielaard |
a928b7 |
+ uop = Cunop_Not; opname = "not"; goto unop;
|
|
Mark Wielaard |
a928b7 |
+ unop:
|
|
Mark Wielaard |
a928b7 |
+ POP( ix );
|
|
Mark Wielaard |
a928b7 |
+ PUSH( ML_(CfiExpr_Unop)( dst, uop, ix ) );
|
|
Mark Wielaard |
a928b7 |
+ if (ddump_frames)
|
|
Mark Wielaard |
a928b7 |
+ VG_(printf)("DW_OP_%s", opname);
|
|
Mark Wielaard |
a928b7 |
+ break;
|
|
Mark Wielaard |
a928b7 |
+
|
|
Mark Wielaard |
a928b7 |
case DW_OP_minus:
|
|
Mark Wielaard |
a928b7 |
op = Cop_Sub; opname = "minus"; goto binop;
|
|
Mark Wielaard |
a928b7 |
case DW_OP_plus:
|
|
Mark Wielaard |
a928b7 |
--- valgrind-3.8.0/coregrind/m_debuginfo/debuginfo.c (revision 12990)
|
|
Mark Wielaard |
a928b7 |
+++ valgrind-3.8.0/coregrind/m_debuginfo/debuginfo.c (working copy)
|
|
Mark Wielaard |
a928b7 |
@@ -2051,7 +2051,7 @@
|
|
Mark Wielaard |
a928b7 |
UWord evalCfiExpr ( XArray* exprs, Int ix,
|
|
Mark Wielaard |
a928b7 |
CfiExprEvalContext* eec, Bool* ok )
|
|
Mark Wielaard |
a928b7 |
{
|
|
Mark Wielaard |
a928b7 |
- UWord wL, wR;
|
|
Mark Wielaard |
a928b7 |
+ UWord w, wL, wR;
|
|
Mark Wielaard |
a928b7 |
Addr a;
|
|
Mark Wielaard |
a928b7 |
CfiExpr* e;
|
|
Mark Wielaard |
a928b7 |
vg_assert(sizeof(Addr) == sizeof(UWord));
|
|
Mark Wielaard |
a928b7 |
@@ -2118,6 +2118,16 @@
|
|
Mark Wielaard |
a928b7 |
}
|
|
Mark Wielaard |
a928b7 |
/* let's hope it doesn't trap! */
|
|
Mark Wielaard |
a928b7 |
return ML_(read_UWord)((void *)a);
|
|
Mark Wielaard |
a928b7 |
+ case Cex_Unop:
|
|
Mark Wielaard |
a928b7 |
+ w = evalCfiExpr( exprs, e->Cex.Unop.ix, eec, ok );
|
|
Mark Wielaard |
a928b7 |
+ if (!(*ok)) return 0;
|
|
Mark Wielaard |
a928b7 |
+ switch (e->Cex.Unop.op) {
|
|
Mark Wielaard |
a928b7 |
+ case Cunop_Abs: return (Word) w < 0 ? - w : w;
|
|
Mark Wielaard |
a928b7 |
+ case Cunop_Neg: return - (Word) w;
|
|
Mark Wielaard |
a928b7 |
+ case Cunop_Not: return ~ w;
|
|
Mark Wielaard |
a928b7 |
+ default: goto unhandled;
|
|
Mark Wielaard |
a928b7 |
+ }
|
|
Mark Wielaard |
a928b7 |
+ /*NOTREACHED*/
|
|
Mark Wielaard |
a928b7 |
default:
|
|
Mark Wielaard |
a928b7 |
goto unhandled;
|
|
Mark Wielaard |
a928b7 |
}
|
|
Mark Wielaard |
a928b7 |
--- valgrind-3.8.0/coregrind/m_debuginfo/storage.c (revision 12990)
|
|
Mark Wielaard |
a928b7 |
+++ valgrind-3.8.0/coregrind/m_debuginfo/storage.c (working copy)
|
|
Mark Wielaard |
a928b7 |
@@ -595,6 +595,16 @@
|
|
Mark Wielaard |
a928b7 |
e.Cex.Binop.ixR = ixR;
|
|
Mark Wielaard |
a928b7 |
return (Int)VG_(addToXA)( dst, &e );
|
|
Mark Wielaard |
a928b7 |
}
|
|
Mark Wielaard |
a928b7 |
+Int ML_(CfiExpr_Unop)( XArray* dst, CfiUnop op, Int ix )
|
|
Mark Wielaard |
a928b7 |
+{
|
|
Mark Wielaard |
a928b7 |
+ CfiExpr e;
|
|
Mark Wielaard |
a928b7 |
+ VG_(memset)( &e, 0, sizeof(e) );
|
|
Mark Wielaard |
a928b7 |
+ e.tag = Cex_Unop;
|
|
Mark Wielaard |
a928b7 |
+ e.Cex.Unop.op = op;
|
|
Mark Wielaard |
a928b7 |
+ e.Cex.Unop.ix = ix;
|
|
Mark Wielaard |
a928b7 |
+ return (Int)VG_(addToXA)( dst, &e );
|
|
Mark Wielaard |
a928b7 |
+}
|
|
Mark Wielaard |
a928b7 |
+
|
|
Mark Wielaard |
a928b7 |
Int ML_(CfiExpr_CfiReg)( XArray* dst, CfiReg reg )
|
|
Mark Wielaard |
a928b7 |
{
|
|
Mark Wielaard |
a928b7 |
CfiExpr e;
|
|
Mark Wielaard |
a928b7 |
--- valgrind-3.8.0/coregrind/m_debuginfo/priv_storage.h (revision 12990)
|
|
Mark Wielaard |
a928b7 |
+++ valgrind-3.8.0/coregrind/m_debuginfo/priv_storage.h (working copy)
|
|
Mark Wielaard |
a928b7 |
@@ -296,6 +296,14 @@
|
|
Mark Wielaard |
a928b7 |
|
|
Mark Wielaard |
a928b7 |
typedef
|
|
Mark Wielaard |
a928b7 |
enum {
|
|
Mark Wielaard |
a928b7 |
+ Cunop_Abs=0x231,
|
|
Mark Wielaard |
a928b7 |
+ Cunop_Neg,
|
|
Mark Wielaard |
a928b7 |
+ Cunop_Not
|
|
Mark Wielaard |
a928b7 |
+ }
|
|
Mark Wielaard |
a928b7 |
+ CfiUnop;
|
|
Mark Wielaard |
a928b7 |
+
|
|
Mark Wielaard |
a928b7 |
+typedef
|
|
Mark Wielaard |
a928b7 |
+ enum {
|
|
Mark Wielaard |
a928b7 |
Creg_IA_SP=0x213,
|
|
Mark Wielaard |
a928b7 |
Creg_IA_BP,
|
|
Mark Wielaard |
a928b7 |
Creg_IA_IP,
|
|
Mark Wielaard |
a928b7 |
@@ -315,7 +323,8 @@
|
|
Mark Wielaard |
a928b7 |
Cex_Const,
|
|
Mark Wielaard |
a928b7 |
Cex_Binop,
|
|
Mark Wielaard |
a928b7 |
Cex_CfiReg,
|
|
Mark Wielaard |
a928b7 |
- Cex_DwReg
|
|
Mark Wielaard |
a928b7 |
+ Cex_DwReg,
|
|
Mark Wielaard |
a928b7 |
+ Cex_Unop
|
|
Mark Wielaard |
a928b7 |
}
|
|
Mark Wielaard |
a928b7 |
CfiExprTag;
|
|
Mark Wielaard |
a928b7 |
|
|
Mark Wielaard |
a928b7 |
@@ -342,6 +351,10 @@
|
|
Mark Wielaard |
a928b7 |
struct {
|
|
Mark Wielaard |
a928b7 |
Int reg;
|
|
Mark Wielaard |
a928b7 |
} DwReg;
|
|
Mark Wielaard |
a928b7 |
+ struct {
|
|
Mark Wielaard |
a928b7 |
+ CfiUnop op;
|
|
Mark Wielaard |
a928b7 |
+ Int ix;
|
|
Mark Wielaard |
a928b7 |
+ } Unop;
|
|
Mark Wielaard |
a928b7 |
}
|
|
Mark Wielaard |
a928b7 |
Cex;
|
|
Mark Wielaard |
a928b7 |
}
|
|
Mark Wielaard |
a928b7 |
@@ -353,6 +366,7 @@
|
|
Mark Wielaard |
a928b7 |
extern Int ML_(CfiExpr_Binop) ( XArray* dst, CfiOp op, Int ixL, Int ixR );
|
|
Mark Wielaard |
a928b7 |
extern Int ML_(CfiExpr_CfiReg)( XArray* dst, CfiReg reg );
|
|
Mark Wielaard |
a928b7 |
extern Int ML_(CfiExpr_DwReg) ( XArray* dst, Int reg );
|
|
Mark Wielaard |
a928b7 |
+extern Int ML_(CfiExpr_Unop) ( XArray* dst, CfiUnop op, Int ix );
|
|
Mark Wielaard |
a928b7 |
|
|
Mark Wielaard |
a928b7 |
extern void ML_(ppCfiExpr)( XArray* src, Int ix );
|
|
Mark Wielaard |
a928b7 |
|