Skip to content

Commit

Permalink
Add debugtrap opcode to vasm
Browse files Browse the repository at this point in the history
Summary: This is useful for debugging. It's int3 on x64 and brk(0) on ARM.

Reviewed By: @edwinsmith

Differential Revision: D1621091
  • Loading branch information
oyamauchi authored and hhvm-bot committed Oct 17, 2014
1 parent c5c7b86 commit 2adfbb1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions hphp/runtime/vm/jit/vasm-arm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ struct Vgen {
void emit(bindjmp& i);
void emit(copy& i);
void emit(copy2& i);
void emit(debugtrap& i) { a->Brk(0); }
void emit(fallbackcc i);
void emit(hcsync& i);
void emit(hcnocatch& i);
Expand Down
1 change: 1 addition & 0 deletions hphp/runtime/vm/jit/vasm-x64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ struct Vgen {
void emit(copy i);
void emit(copy2& i);
void emit(copyargs& i) { always_assert(false); }
void emit(debugtrap& i) { a->int3(); }
void emit(end& i) {}
void emit(ldimm& i);
void emit(fallback& i);
Expand Down
2 changes: 2 additions & 0 deletions hphp/runtime/vm/jit/vasm-x64.h
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ inline Vptr Vr<Reg,Kind,Bits>::operator+(size_t d) const {
O(copy, Inone, UH(s,d), DH(d,s))\
O(copy2, Inone, UH(s0,d0) UH(s1,d1), DH(d0,s0) DH(d1,s1))\
O(copyargs, Inone, UH(s,d), DH(d,s))\
O(debugtrap, Inone, Un, Dn)\
O(end, Inone, Un, Dn)\
O(ldimm, I(s) I(saveflags), Un, D(d))\
O(fallback, I(dest), Un, Dn)\
Expand Down Expand Up @@ -550,6 +551,7 @@ struct contenter { Vreg64 fp, target; };
struct copy { Vreg s, d; };
struct copy2 { Vreg64 s0, s1, d0, d1; };
struct copyargs { Vtuple s, d; };
struct debugtrap {};
struct end {};
struct ldimm { Immed64 s; Vreg d; bool saveflags; };
struct fallback { SrcKey dest; TransFlags trflags; };
Expand Down

0 comments on commit 2adfbb1

Please sign in to comment.