Mercurial > hg > truffle
changeset 22119:64dcb0a9fabf
Truffle/Debug REPL: more robust when execution halts at an unlocatable source
author | Michael Van De Vanter <michael.van.de.vanter@oracle.com> |
---|---|
date | Mon, 31 Aug 2015 18:13:55 -0700 |
parents | eaab173a0f44 |
children | fe5df1f36fec |
files | truffle/com.oracle.truffle.tools.debug.shell/src/com/oracle/truffle/tools/debug/shell/client/SimpleREPLClient.java |
diffstat | 1 files changed, 5 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/truffle/com.oracle.truffle.tools.debug.shell/src/com/oracle/truffle/tools/debug/shell/client/SimpleREPLClient.java Fri Aug 28 14:39:46 2015 -0700 +++ b/truffle/com.oracle.truffle.tools.debug.shell/src/com/oracle/truffle/tools/debug/shell/client/SimpleREPLClient.java Mon Aug 31 18:13:55 2015 -0700 @@ -233,9 +233,11 @@ // Information about where the execution is halted /** The source where execution, if any, is halted; null if none. */ - private Source haltedSource = null; + private Source haltedSource; /** The line number where execution, if any, is halted; 0 if none. */ private int haltedLineNumber = 0; + /** The name of a source that we can't locate. */ + private String unknownSourceName = "<unavailable>"; /** The stack where execution, if any, is halted; null if none. Evaluated lazily. */ private List<REPLFrame> frames = null; @@ -263,6 +265,7 @@ } catch (IOException e1) { this.haltedSource = null; this.haltedLineNumber = 0; + this.unknownSourceName = message.get(REPLMessage.SOURCE_NAME); } } updatePrompt(); @@ -400,7 +403,7 @@ whereLineNumber = frame.locationLineNumber(); } if (whereSource == null) { - displayFailReply("Frame " + selectedFrameNumber + ": source unavailable"); + displayFailReply("Unavalable source=\"" + this.unknownSourceName + "\""); return; } final int listSize = listSizeOption.getInt();