nldebug user help
nldebug is for the non-linear, multi-threaded or non-causal universe.
nldebug is a graphical debugger for programs that don't just follow one stream (e.g. threaded, web applications). It even allows debugging of headless computers, distributed environments and for crashing applications.
What does nldebug do?
nldebug listens to an UDP port (5542 by default).
Then it distributes each packet (usually only one line) according to the split regex to different tabs.
How can I use it to debug my application?
In the program you want to debug, whereever you want to write debug
messages, call a function that sends one line out to localhost,
You can find helper functions for various languages in the examples directory.
Or, pipe the debug output to "netcat --udp localhost 5542".
If you add timestamps to the debug output messages, you can also measure how long parts of your program take.
If you add stack traces to the debug output messages (after a empty line by itself), you can jump from a debug output to the exact line in your editor.
These are flash screencasts of example usages:
- Presenting Stacktrace functionality
- Debugging a ssh session.
This shows that you can debug applications without having to change them.
It emphasizes how you can modify debug levels while not having to restart the app.
$ ssh -v -v -v $LOGIN 2>&1 | examples/sendlines.py
- A simple inheritance program example using nldebug.
This shows the flexibility of the regular expression distributor.
- Pretty much the same as the third.
- On web applications, the html output isn't messed up
- By using UDP, the applications isn't slower.
- During debugging, you can change the output you want to look at.
- The debug output is live.
- The debug output is structured in the way you want it.
- If you change your mind, no need to replay a scenario, you can
reparse the captured output with a new regex and keep following it.
- You can save the debug output and load it into the application. (plain text files)
Example usage scenarios
- Web applications
- You want to test timings
- You want to see where your script crashes
- You don't want to mess up your html output with debug messages
- Threaded applications
- Various Debug levels (and changing between them)
- Applications with different contexts (e.g. classes, modules)
You can either
- pipe the data in nldebug (e.g. using examples/sendlines.py, or netcat) or
- send the debug data in your program
You will want the second in web applications.
I provide language bindings (these are just ~10 lines) in
Python, PHP and C
nldebug is under a BSD license (OSI approved, GPL compatible).
The language bindings are in public domain.
If you have a license problem or questions, just mail me: firstname.lastname@example.org or file a bug in the bugtracker.