Skip to content

Commit 20c2856

Browse files
author
Andy Till
committed
0.6.1 Fixes a display bug in the term view where brackets were in the
wrong order.
1 parent beed433 commit 20c2856

File tree

4 files changed

+32
-22
lines changed

4 files changed

+32
-22
lines changed

README.md

+15-11
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
[![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)
55

6-
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.
6+
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.
77

8-
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.
8+
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.
99

1010
### Features and How To
1111

@@ -15,6 +15,8 @@ All the modules loaded by the VM appear in the module tree. Expand one of modul
1515

1616
![you cannot see the beautiful screen shot](doc/erlyberly.png)
1717

18+
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.
19+
1820
##### See calls to functions and their results
1921

2022
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
8587

8688
![you cannot see the beautiful screen shot](doc/heap-pie.png)
8789

88-
##### See the state of a process
89-
90-
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.
91-
9290
##### Cross platform
9391

9492
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
138136

139137
Some things that are important.
140138

141-
1. Bug fixing and stability for current features is number one priority right now. Help by contributing issue reports.
142-
2. seq_trace visualisation with graphs.
143-
3. More statistics on the running system, such as memory and CPU.
144-
4. Beat CAP.
139+
1. Bug fixing and stability for current features is number one priority right now. Help by contributing issue reports.
140+
2. seq_trace support.
141+
3. Beat CAP.
142+
143+
erlyberly is meant to be a complementary to observer so there will be no attempt to implement features such as the supervisor hierarchy graph.
144+
145+
### Special Thanks
146+
147+
The following people have contributed code to erlyberly:
145148

146-
erlyberly is meant to be a complementary to observer so there will be no attempt to implement features such as the supervisor hierarchy graph.
149+
+ [@aboroska](https://github.com/aboroska)
150+
+ [@ruanpienaar](https://github.com/ruanpienaar)

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>andytill</groupId>
66
<artifactId>erlyberly</artifactId>
7-
<version>0.5.5</version>
7+
<version>0.6.1</version>
88
<packaging>jar</packaging>
99

1010
<name>erlyberly</name>

src/main/java/erlyberly/DbgView.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ private void toggleTraceModFunc(ModFunc function) {
416416
}
417417

418418
private void toggleTraceMod(ObservableList<TreeItem<ModFunc>> functions){
419-
for (TreeItem func : functions) {
419+
for (TreeItem<ModFunc> func : functions) {
420420
if(!func.getValue().toString().equals("module_info/0") &&
421421
!func.getValue().toString().equals("module_info/1")){
422422
ModFunc function = (ModFunc) func.getValue();

src/main/java/erlyberly/TermTreeView.java

+15-9
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ else if(isRecordField(obj)) {
6464

6565
OtpErlangObject value = OtpUtil.tupleElement(2, obj);
6666
if(OtpUtil.isLittleTerm(value))
67-
tupleItem.setValue(value);
67+
tupleItem.setValue(otpObjectToString(value));
6868
else
6969
addToTreeItem(tupleItem, value);
7070

@@ -74,17 +74,18 @@ else if(isRecordField(obj)) {
7474
tupleItem.setExpanded(true);
7575

7676
if(OtpUtil.isLittleTerm(obj)) {
77-
tupleItem.setValue(obj);
77+
tupleItem.setValue(otpObjectToString(obj));
78+
parent.getChildren().add(tupleItem);
7879
}
7980
else {
8081
tupleItem.setValue("{");
8182
for (OtpErlangObject e : elements) {
8283
addToTreeItem(tupleItem, e);
8384
}
85+
parent.getChildren().add(tupleItem);
8486
parent.getChildren().add(new TreeItem("}"));
8587
}
8688

87-
parent.getChildren().add(tupleItem);
8889
}
8990
}
9091
}
@@ -102,26 +103,31 @@ else if(obj instanceof OtpErlangList) {
102103

103104

104105
if(OtpUtil.isLittleTerm(obj)) {
105-
listItem.setValue(obj);
106+
listItem.setValue(otpObjectToString(obj));
107+
parent.getChildren().add(listItem);
106108
}
107109
else {
108110
listItem.setValue("[");
109111
for (OtpErlangObject e : elements) {
110112
addToTreeItem(listItem, e);
111113
}
114+
parent.getChildren().add(listItem);
112115
parent.getChildren().add(new TreeItem("]"));
113116
}
114-
115-
parent.getChildren().add(listItem);
116117
}
117118
}
118119
else {
119-
StringBuilder stringBuilder = new StringBuilder();
120-
OtpUtil.otpObjectToString(obj, stringBuilder);
121-
parent.getChildren().add(new TreeItem(stringBuilder.toString()));
120+
parent.getChildren().add(new TreeItem(otpObjectToString(obj)));
122121
}
123122
}
124123

124+
private String otpObjectToString(OtpErlangObject obj) {
125+
StringBuilder stringBuilder = new StringBuilder();
126+
OtpUtil.otpObjectToString(obj, stringBuilder);
127+
String string = stringBuilder.toString();
128+
return string;
129+
}
130+
125131
private Label recordLabel(String recordNameText) {
126132
Label label;
127133
label = new Label(recordNameText);

0 commit comments

Comments
 (0)