Commit 4fad06fd authored by Andreas Haas's avatar Andreas Haas Committed by Commit Bot

[wasm] Add DebugBreak to debug Liftoff-generated code

DebugBreak allows you to put break points into generated code. When
executed in gdb, the execution will stop in the generated code at the
break point.

R=clemensb@chromium.org

Change-Id: I5607d7ec45d4910412c7adff5ae9bea2c9498909
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2002536
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65802}
parent 58cb79e5
...@@ -1658,6 +1658,8 @@ void LiftoffAssembler::DeallocateStackSlot(uint32_t size) { ...@@ -1658,6 +1658,8 @@ void LiftoffAssembler::DeallocateStackSlot(uint32_t size) {
add(sp, sp, Operand(size)); add(sp, sp, Operand(size));
} }
void LiftoffAssembler::DebugBreak() { stop(); }
void LiftoffStackSlots::Construct() { void LiftoffStackSlots::Construct() {
for (auto& slot : slots_) { for (auto& slot : slots_) {
const LiftoffAssembler::VarState& src = slot.src_; const LiftoffAssembler::VarState& src = slot.src_;
......
...@@ -1143,6 +1143,8 @@ void LiftoffAssembler::DeallocateStackSlot(uint32_t size) { ...@@ -1143,6 +1143,8 @@ void LiftoffAssembler::DeallocateStackSlot(uint32_t size) {
Drop(size, 1); Drop(size, 1);
} }
void LiftoffAssembler::DebugBreak() { debug("DebugBreak", 0, BREAK); }
void LiftoffStackSlots::Construct() { void LiftoffStackSlots::Construct() {
size_t slot_count = slots_.size(); size_t slot_count = slots_.size();
// The stack pointer is required to be quadword aligned. // The stack pointer is required to be quadword aligned.
......
...@@ -1946,6 +1946,8 @@ void LiftoffAssembler::DeallocateStackSlot(uint32_t size) { ...@@ -1946,6 +1946,8 @@ void LiftoffAssembler::DeallocateStackSlot(uint32_t size) {
add(esp, Immediate(size)); add(esp, Immediate(size));
} }
void LiftoffAssembler::DebugBreak() { int3(); }
void LiftoffStackSlots::Construct() { void LiftoffStackSlots::Construct() {
for (auto& slot : slots_) { for (auto& slot : slots_) {
const LiftoffAssembler::VarState& src = slot.src_; const LiftoffAssembler::VarState& src = slot.src_;
......
...@@ -689,6 +689,7 @@ class LiftoffAssembler : public TurboAssembler { ...@@ -689,6 +689,7 @@ class LiftoffAssembler : public TurboAssembler {
inline void AllocateStackSlot(Register addr, uint32_t size); inline void AllocateStackSlot(Register addr, uint32_t size);
inline void DeallocateStackSlot(uint32_t size); inline void DeallocateStackSlot(uint32_t size);
inline void DebugBreak();
//////////////////////////////////// ////////////////////////////////////
// End of platform-specific part. // // End of platform-specific part. //
//////////////////////////////////// ////////////////////////////////////
......
...@@ -1630,6 +1630,8 @@ void LiftoffAssembler::DeallocateStackSlot(uint32_t size) { ...@@ -1630,6 +1630,8 @@ void LiftoffAssembler::DeallocateStackSlot(uint32_t size) {
addiu(sp, sp, size); addiu(sp, sp, size);
} }
void LiftoffAssembler::DebugBreak() { stop(); }
void LiftoffStackSlots::Construct() { void LiftoffStackSlots::Construct() {
for (auto& slot : slots_) { for (auto& slot : slots_) {
const LiftoffAssembler::VarState& src = slot.src_; const LiftoffAssembler::VarState& src = slot.src_;
......
...@@ -1422,6 +1422,8 @@ void LiftoffAssembler::DeallocateStackSlot(uint32_t size) { ...@@ -1422,6 +1422,8 @@ void LiftoffAssembler::DeallocateStackSlot(uint32_t size) {
daddiu(sp, sp, size); daddiu(sp, sp, size);
} }
void LiftoffAssembler::DebugBreak() { stop(); }
void LiftoffStackSlots::Construct() { void LiftoffStackSlots::Construct() {
for (auto& slot : slots_) { for (auto& slot : slots_) {
const LiftoffAssembler::VarState& src = slot.src_; const LiftoffAssembler::VarState& src = slot.src_;
......
...@@ -541,6 +541,8 @@ void LiftoffAssembler::DeallocateStackSlot(uint32_t size) { ...@@ -541,6 +541,8 @@ void LiftoffAssembler::DeallocateStackSlot(uint32_t size) {
bailout(kUnsupportedArchitecture, "DeallocateStackSlot"); bailout(kUnsupportedArchitecture, "DeallocateStackSlot");
} }
void LiftoffAssembler::DebugBreak() { stop(); }
void LiftoffStackSlots::Construct() { void LiftoffStackSlots::Construct() {
asm_->bailout(kUnsupportedArchitecture, "LiftoffStackSlots::Construct"); asm_->bailout(kUnsupportedArchitecture, "LiftoffStackSlots::Construct");
} }
......
...@@ -545,6 +545,8 @@ void LiftoffAssembler::DeallocateStackSlot(uint32_t size) { ...@@ -545,6 +545,8 @@ void LiftoffAssembler::DeallocateStackSlot(uint32_t size) {
bailout(kUnsupportedArchitecture, "DeallocateStackSlot"); bailout(kUnsupportedArchitecture, "DeallocateStackSlot");
} }
void LiftoffAssembler::DebugBreak() { stop(); }
void LiftoffStackSlots::Construct() { void LiftoffStackSlots::Construct() {
asm_->bailout(kUnsupportedArchitecture, "LiftoffStackSlots::Construct"); asm_->bailout(kUnsupportedArchitecture, "LiftoffStackSlots::Construct");
} }
......
...@@ -1713,6 +1713,8 @@ void LiftoffAssembler::DeallocateStackSlot(uint32_t size) { ...@@ -1713,6 +1713,8 @@ void LiftoffAssembler::DeallocateStackSlot(uint32_t size) {
addq(rsp, Immediate(size)); addq(rsp, Immediate(size));
} }
void LiftoffAssembler::DebugBreak() { int3(); }
void LiftoffStackSlots::Construct() { void LiftoffStackSlots::Construct() {
for (auto& slot : slots_) { for (auto& slot : slots_) {
const LiftoffAssembler::VarState& src = slot.src_; const LiftoffAssembler::VarState& src = slot.src_;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment