comparison graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/instrument/SLDefaultVisualizer.java @ 19706:ef30b2318658

Truffle/Instrumentation: the Visualizer for language-specific values now has a "trim" option to limit result size.
author Michael Van De Vanter <michael.van.de.vanter@oracle.com>
date Thu, 05 Mar 2015 16:58:12 -0800
parents 618d92152d3c
children 894f82515e38
comparison
equal deleted inserted replaced
19705:32b4b06b6fac 19706:ef30b2318658
1 /* 1 /*
2 * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
71 } 71 }
72 return callTarget.toString(); 72 return callTarget.toString();
73 } 73 }
74 74
75 @Override 75 @Override
76 public String displayValue(ExecutionContext context, Object value) { 76 public String displayValue(ExecutionContext context, Object value, int trim) {
77 if (value == SLNull.SINGLETON) { 77 if (value == SLNull.SINGLETON) {
78 return "null"; 78 return "null";
79 } 79 }
80 return value.toString(); 80 return trim(value.toString(), trim);
81 } 81 }
82 82
83 @Override 83 @Override
84 public String displayIdentifier(FrameSlot slot) { 84 public String displayIdentifier(FrameSlot slot) {
85 85