Commit 8cf73e85 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[wasm] Make the "jco" gdb macro also print WasmCode

Using the "jco" gdb macro on a WasmCode address would currently crash.
With this change, you can also use it to print code objects off the gc
heap.

R=titzer@chromium.org
CC=wasm-team@google.com

Bug: v8:7140, v8:6876
Change-Id: I21daf58b6b4734e3d052b66284b95938b4f57d40
Reviewed-on: https://chromium-review.googlesource.com/796416Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49753}
parent 6b29f1cf
......@@ -16,6 +16,7 @@
#include "src/ostreams.h"
#include "src/regexp/jsregexp.h"
#include "src/transitions-inl.h"
#include "src/wasm/wasm-heap.h"
#include "src/wasm/wasm-objects-inl.h"
namespace v8 {
......@@ -1889,6 +1890,12 @@ extern void _v8_internal_Print_Object(void* object) {
extern void _v8_internal_Print_Code(void* object) {
i::Isolate* isolate = i::Isolate::Current();
i::wasm::WasmCode* wasm_code = isolate->wasm_code_manager()->LookupCode(
reinterpret_cast<i::Address>(object));
if (wasm_code) {
wasm_code->Print(isolate);
return;
}
isolate->FindCodeObject(reinterpret_cast<i::Address>(object))->Print();
}
......
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