https://github.com/hachreak/cedb
Console Erlang DeBugger
https://github.com/hachreak/cedb
console debugger erlang erlang-libraries erlang-library
Last synced: 21 days ago
JSON representation
Console Erlang DeBugger
- Host: GitHub
- URL: https://github.com/hachreak/cedb
- Owner: hachreak
- License: apache-2.0
- Created: 2018-02-27T16:17:31.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-19T00:55:30.000Z (over 6 years ago)
- Last Synced: 2025-03-23T18:11:12.282Z (about 1 month ago)
- Topics: console, debugger, erlang, erlang-libraries, erlang-library
- Language: Erlang
- Homepage: https://github.com/hachreak/cedb
- Size: 17.6 KB
- Stars: 44
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
cedb
====Console Erlang Debugger.
Run debug directly from console.
Run debug
---------Go inside the example app and run the shell:
```sh
cd examples/test
rebar3 shell
``````erlang
1> application:ensure_all_started(cedb).
2> % Set a breakpoint in `test.erl` module in line `16`
2> cedb:break(test, 16).
3> % Set a breakpoint in `test.erl` module `function2` with arity `1`
3> cedb:break(test, function2, 1).
4> % run the application to debug
4> test:start().=> {<0.258.0>,{attached,test,16,false}}
File /projects/cedb/examples/test/_build/default/lib/test/src/test.erl
11: function1(),
12: io:format("Finish~n").
13:
14: function1() ->
*15: A = "Hello",
16: B = #{A => <<"c">>},
17: function2(B),
18: io:format("I'm in function 1~n").
19:
20: function2(C) ->
21: io:format("I'm in function 2, the value is ~p~n", [C]),cedb> next.
ok
=> {<0.258.0>,running}File /projects/cedb/examples/test/_build/default/lib/test/src/test.erl
11: function1(),
12: io:format("Finish~n").
13:
14: function1() ->
15: A = "Hello",
*16: B = #{A => <<"c">>},
17: function2(B),
18: io:format("I'm in function 1~n").
19:
20: function2(C) ->
21: io:format("I'm in function 2, the value is ~p~n", [C]),cedb> A.
"Hello"
cedb> n.
ok
=> {<0.258.0>,running}
cedb>
```Commands
--------You can run the current commands when the debugger is running:
Command | Description
-------------|-------------------------------------------
backtrace | Show backtrace.
bindings | Show binded variables.
continue | Continue the execution of the process.
finish | Finish the debug session.
messages | Show process messages.
next | Execute next instruction.
skip | Skip.
step | Step inside next instruction.
stop | Stop debugging.
timeout | Timeout.
Var | Variable names are evaluated in the current context.Abbreviations of the above commands are also accepted, like `n` for `next`,
`ba` for `backtrace` etc.Breakpoints
-----------Command | Description
--------------------------------|-------------------------------------------
cedb:break(test, 16). | Add a breakpoint to line 16.
cedb:break(test, function2, 1). | Add a breakpoint to function `function2`.