From 20c28562dd84eccaa1f69e13846cc90978be81a3 Mon Sep 17 00:00:00 2001 From: Andy Till Date: Mon, 18 May 2015 21:24:04 +0100 Subject: [PATCH] 0.6.1 Fixes a display bug in the term view where brackets were in the wrong order. --- README.md | 26 +++++++++++++---------- pom.xml | 2 +- src/main/java/erlyberly/DbgView.java | 2 +- src/main/java/erlyberly/TermTreeView.java | 24 +++++++++++++-------- 4 files changed, 32 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index fb4e2a4..09fef73 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,9 @@ [![Join the chat at https://gitter.im/andytill/erlyberly](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/andytill/erlyberly?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -erlyberly is a debugger for erlang, and [elixir](https://twitter.com/andy_till/status/539566833515626497). Instead of setting break points in code, a trace is set on a function and calls to it are logged without blocking your processes. +erlyberly is a debugger for erlang, and [elixir](https://twitter.com/andy_till/status/539566833515626497). Traces are applied to functions and calls to it are logged without blocking your processes. -If you are using `io:format/2` or lager for debugging then erlyberly can save you time. There is no recompliation and no log statements need to be removed (or not!) afterwards. +If you are using `io:format/2` or lager for debugging then erlyberly can save you time. There are no code changes and no recompliation required to see function calls. ### Features and How To @@ -15,6 +15,8 @@ All the modules loaded by the VM appear in the module tree. Expand one of modul ![you cannot see the beautiful screen shot](doc/erlyberly.png) +Right click on a module and then click **Module Trace** to put a trace on all functions displayed under the module. If some functions are not displayed because of a filter, the trace will not be applied. + ##### See calls to functions and their results Double click on a trace to see a breakdown of the arguments and results of the function call. @@ -85,10 +87,6 @@ Open up the process table, next to the memory usage columns there is a pie chart ![you cannot see the beautiful screen shot](doc/heap-pie.png) -##### See the state of a process - -Right click on a process in the process table and click on *"Get process state"*. This is possible only if the process handles system messages, OTP behaviours do. - ##### Cross platform Tested on Ubuntu and Windows 7/8. Also seen on [OS X](http://t.co/kzXppo5GEt). @@ -138,9 +136,15 @@ You'll also need the [floaty-field](https://github.com/andytill/floaty-field) li Some things that are important. -1. Bug fixing and stability for current features is number one priority right now. Help by contributing issue reports. -2. seq_trace visualisation with graphs. -3. More statistics on the running system, such as memory and CPU. -4. Beat CAP. +1. Bug fixing and stability for current features is number one priority right now. Help by contributing issue reports. +2. seq_trace support. +3. Beat CAP. + +erlyberly is meant to be a complementary to observer so there will be no attempt to implement features such as the supervisor hierarchy graph. + +### Special Thanks + +The following people have contributed code to erlyberly: -erlyberly is meant to be a complementary to observer so there will be no attempt to implement features such as the supervisor hierarchy graph. \ No newline at end of file ++ [@aboroska](https://github.com/aboroska) ++ [@ruanpienaar](https://github.com/ruanpienaar) diff --git a/pom.xml b/pom.xml index 5b90691..e79b25c 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ andytill erlyberly - 0.5.5 + 0.6.1 jar erlyberly diff --git a/src/main/java/erlyberly/DbgView.java b/src/main/java/erlyberly/DbgView.java index eba3011..39bc054 100644 --- a/src/main/java/erlyberly/DbgView.java +++ b/src/main/java/erlyberly/DbgView.java @@ -416,7 +416,7 @@ private void toggleTraceModFunc(ModFunc function) { } private void toggleTraceMod(ObservableList> functions){ - for (TreeItem func : functions) { + for (TreeItem func : functions) { if(!func.getValue().toString().equals("module_info/0") && !func.getValue().toString().equals("module_info/1")){ ModFunc function = (ModFunc) func.getValue(); diff --git a/src/main/java/erlyberly/TermTreeView.java b/src/main/java/erlyberly/TermTreeView.java index 759fed4..80f53a1 100644 --- a/src/main/java/erlyberly/TermTreeView.java +++ b/src/main/java/erlyberly/TermTreeView.java @@ -64,7 +64,7 @@ else if(isRecordField(obj)) { OtpErlangObject value = OtpUtil.tupleElement(2, obj); if(OtpUtil.isLittleTerm(value)) - tupleItem.setValue(value); + tupleItem.setValue(otpObjectToString(value)); else addToTreeItem(tupleItem, value); @@ -74,17 +74,18 @@ else if(isRecordField(obj)) { tupleItem.setExpanded(true); if(OtpUtil.isLittleTerm(obj)) { - tupleItem.setValue(obj); + tupleItem.setValue(otpObjectToString(obj)); + parent.getChildren().add(tupleItem); } else { tupleItem.setValue("{"); for (OtpErlangObject e : elements) { addToTreeItem(tupleItem, e); } + parent.getChildren().add(tupleItem); parent.getChildren().add(new TreeItem("}")); } - parent.getChildren().add(tupleItem); } } } @@ -102,26 +103,31 @@ else if(obj instanceof OtpErlangList) { if(OtpUtil.isLittleTerm(obj)) { - listItem.setValue(obj); + listItem.setValue(otpObjectToString(obj)); + parent.getChildren().add(listItem); } else { listItem.setValue("["); for (OtpErlangObject e : elements) { addToTreeItem(listItem, e); } + parent.getChildren().add(listItem); parent.getChildren().add(new TreeItem("]")); } - - parent.getChildren().add(listItem); } } else { - StringBuilder stringBuilder = new StringBuilder(); - OtpUtil.otpObjectToString(obj, stringBuilder); - parent.getChildren().add(new TreeItem(stringBuilder.toString())); + parent.getChildren().add(new TreeItem(otpObjectToString(obj))); } } + private String otpObjectToString(OtpErlangObject obj) { + StringBuilder stringBuilder = new StringBuilder(); + OtpUtil.otpObjectToString(obj, stringBuilder); + String string = stringBuilder.toString(); + return string; + } + private Label recordLabel(String recordNameText) { Label label; label = new Label(recordNameText);