# HG changeset patch # User Gilles Duboscq # Date 1342013308 -7200 # Node ID 74eb5feba8dc4512860a0ecfb147b15716d14ca5 # Parent b3d3a2fcba3d471a7ebe6cc49440f861ae3721dd Make sure the right port is used for dumping diff -r b3d3a2fcba3d -r 74eb5feba8dc graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotDebugConfig.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotDebugConfig.java Wed Jul 11 14:41:22 2012 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotDebugConfig.java Wed Jul 11 15:28:28 2012 +0200 @@ -64,11 +64,7 @@ if (logFilter != null || meterFilter != null || timerFilter != null || dumpFilter != null || methodFilter != null) { TTY.println(Thread.currentThread().getName() + ": " + toString()); } - if (GraalOptions.PrintIdealGraphFile) { - dumpHandlers.add(new GraphPrinterDumpHandler()); - } else { - dumpHandlers.add(new GraphPrinterDumpHandler(GraalOptions.PrintIdealGraphAddress, GraalOptions.PrintBinaryGraphPort)); - } + dumpHandlers.add(new GraphPrinterDumpHandler()); if (GraalOptions.PrintCFG) { dumpHandlers.add(new CFGPrinterObserver()); } diff -r b3d3a2fcba3d -r 74eb5feba8dc graal/com.oracle.graal.printer/src/com/oracle/graal/printer/GraphPrinterDumpHandler.java --- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/GraphPrinterDumpHandler.java Wed Jul 11 14:41:22 2012 +0200 +++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/GraphPrinterDumpHandler.java Wed Jul 11 15:28:28 2012 +0200 @@ -42,23 +42,14 @@ private static final SimpleDateFormat sdf = new SimpleDateFormat("YYYY-MM-dd-HHmm"); private GraphPrinter printer; - private List previousInlineContext = new ArrayList<>(); - private String host; - private int port; + private List previousInlineContext; private int failuresCount; /** - * Creates a new {@link GraphPrinterDumpHandler} that writes output to a file. + * Creates a new {@link GraphPrinterDumpHandler}. */ public GraphPrinterDumpHandler() { - } - - /** - * Creates a new {@link GraphPrinterDumpHandler} that sends output to a remote IdealGraphVisualizer instance. - */ - public GraphPrinterDumpHandler(String host, int port) { - this.host = host; - this.port = port; + previousInlineContext = new ArrayList<>(); } private void ensureInitialized() { @@ -67,7 +58,7 @@ return; } previousInlineContext.clear(); - if (host == null) { + if (GraalOptions.PrintIdealGraphAddress == null) { initializeFilePrinter(); } else { initializeNetworkPrinter(); @@ -97,8 +88,9 @@ } private void initializeNetworkPrinter() { + String host = GraalOptions.PrintIdealGraphAddress; + int port = GraalOptions.PrintBinaryGraphs ? GraalOptions.PrintBinaryGraphPort : GraalOptions.PrintIdealGraphPort; try { - if (GraalOptions.PrintBinaryGraphs) { printer = new BinaryGraphPrinter(SocketChannel.open(new InetSocketAddress(host, port))); } else {