Skip to content
Snippets Groups Projects
Commit dd5604f2 authored by Tomas Stupka's avatar Tomas Stupka
Browse files

print external pointers

parent 830e9224
No related branches found
No related tags found
No related merge requests found
/*
* Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -38,6 +38,11 @@ final class ExternalPtrPrinter extends AbstractValuePrinter<RExternalPtr> {
@Override
@TruffleBoundary
protected void printValue(RExternalPtr value, PrintContext printCtx) throws IOException {
printCtx.output().print("");
// like in RDeparse
if (value.getAddr().isLong()) {
printCtx.output().print(String.format("<pointer: %s>", Double.toHexString(value.getAddr().asAddress())));
} else {
printCtx.output().print(String.format("<pointer: external ptr 0x %s>", Long.toHexString(System.identityHashCode(value.getAddr().asTruffleObject()))));
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment