____
  / __/ __  ___ ___  ___ ___
  _\ \/ _ \/ -_) _ `/ __/ -_)
 /___/ .__/\__/\_,_/_/  \__/
    /_/
Speare Pro v1.2.80
The free small IDE for scripting languages.
(c) 2020 http://sevenuc.com

Speare code editor is a small, free and friendly code editor, and a really ultra light IDE. You can use it to edit all kinds of text file, programming and debugging with almost all common programming languages. It designed to make programming feels light, simple and free. Speare code editor not only has an efficient code navigation and call routines tracing ability but also has flexibility to extend the IDE to support special developing requirements and easily to add a new programming language in it. Speare code editor includes builtin debugging environment for C, C++, Ruby, mruby, Lua, Python, PHP, Perl and Tcl, and give you complete freedom to control and customise a debugging environment for any programming language.

The offline document: Speare_debugger_quick_reference.pdf.

Debugger Index:

C and C++ Debugger
mruby Debugger
Ruby Debugger
Lua Debugger
Python Debugger
PHP Debugger
Perl Debugger
Tcl Debugger
Node.js Debugger




If you can't open the link above, please launch App Store and found "Speare - Donate version" by searching.





Debug Mode

1. Click siding bottom button to show the debug toolbar.

2. Debug toolbar:



From left to right, Start, Stop, Step Into, Step Out, Run To, Step Over, Show Watches. The "Step Over" is equals to "Step next", and "Step To" is equals to "Continue" in common debugging words, and the "Step To" is the command that tell the debugger run to meet a breakpoint or an exception occurred or the program meet exit. On the rightmost there are three other function units, they are, search items in the stackview, siding stackview, and clean debug output.

Search in the debug output: click in the output area and use the shortcut key "Control + F" to do the searching.

3. Socket port:
You can set the socket communication port number both used by Debug Server and the Speare code editor. Open the Preferences of Speare and select the "Debug Settings" tab then input your number.

Please remember to empty the port number when you switched to debugging with the default builtin programming languages with default port number.

4. Watches:
Watches used to evaluate variable or expression and their values can be realtime showing in stackview when debugging session paused, the nodes normally has a green colour and always placed on the top of stackview.

Caution:
  • a. Please ensure all source files have been dragged in the left side Treeview (Workspace Explorer) before start a debug session, because macOS app can't be allowed to access files outside of its sandbox.
  • b. When your source code file moved to another folder, you must drag the source code folder in Speare again then the debugging can correctly work.

Debugger Architecture


An free small IDE for C, C++, Ruby, mruby, Lua, Python, PHP, Perl and Tcl.

Proposed debugging environment support in Speare code editor are: GDB, LLDB, Ruby, mruby, Lua, Python, Perl, PHP, Tcl, Node.js, Dart, AWK and shell. Speare code editor provides very concise and simple interface to add new programming language in it, end user can very easily write a new programming language parser, syntax highlighting, code formatter and debugger for it, please refer this guide: language_extension_protocol.pdf.

Debugging code with Speare code editor

Speare code editor provides an intuitive debugging environment allows adding breakpoints and the execution flow can be viewed and controlled and has the abilities that an IDE debugger will give you over trace execution in code, view the call stack at any point in time, giving you a context for your current stack frame, step into libraries or sub modules that you want to tracing the debug symbols, and change variable values while the program is running. It provides simple interfaces that can be integrated with any command line tools without boring configuration, giving you the flexibility you need to debug code at hand. The debuggers of Speare code editor, the source-level debuggers, helps you step through the code line by line and observe the runtime behaviour of your program and got a better understanding of your code.


C and C++ Debugger

The C and C++ debugger of Speare code editor implemented as a script client of LLDB, and support extend it by yourself. The builtin module supports parsing modern C++ source code files including C++11 and C++14 syntax, e.g effectively name and index namespace and anonymous class, function and many other new features of the C++ programming language. You can enjoy debugging almost any type of C and C++ applications under the lightweight debugging environment of Speare code editor.

Start Debugging Steps:
1. Download Speare Debug Server: → http://sevenuc.com/download/c_debugger.tar.gz (10KB)
SHA256: c9e4d8615335d92eae7d2162b1d44b777e32e687fbf8c48d4ddfbbed0c18d4e6
The source code of the C and C++ debugger can be view online here:
https://github.com/chengdu/Speare or here: https://sourceforge.net/projects/speare

2. Uncompress the tarball to your local directory. e.g ~/Desktop and take a look at the readme.txt in it.

3. Start the debug server:
Please refer the readme.txt file.

4. Debug session start: click "Start" button on the debug toolbar of Speare code editor.
Add breakpoint, step in, step out, step next, watch stack trace ...

5. Run extra commands:
Right click in the stackview (bottom left side) and then input any lldb command when the debugging session paused. Left click anywhere outside of the input box to close it and the command will be directly send to the debug server.
a. Add function breakpoints
. breakpoint set --name functioname: add a C function breakpoint.
. breakpoint set --name classname::functioname: add a C++ function breakpoint.
b. Process operation
. process attach --name xxx --waitfor: attach another process by name.
. process attach --pid xxx: attach another process by pid #xxx.
c. Thread operation
. thread list: show all thread of current process.
. thread select 2: select thread #2.
. thread backtrace all: show thread info.
. register read: read all CPU registers.
. thread step-inst: step one machine instruction.
. thread step-over-inst: step return one machine instruction.
d. Watchpoint operation
. watch list -v: list watchpoints.
. watchpoint set variable x: add a watchpoint x.
e. Frame operation
. frame list: print all frame of the current thread.
. frame select 9: select frame #9.
f. Display variable value
. frame variable x: print x value.
...

Tips: Run to (run to meet a breakpoint), the source file that you want debugger stopped in it must already opened and has at least one breakpoint before run the command.

6. Modify the C and C++ debugger:
You can directly modify the script client of lldb to satisfy your requirements.

How to compile and install GCC on macOS?

This page described how to compile GCC on macOS step by step in details: → compile a stable version of GCC on macOS.


About the C programming language

C is not safe but it is the strongest programming language and the most strongest softwares were written with it, including operation system and the most important infrastructure of internet and software industry, think about BIND, Apache, Nginx, MySQL, PostgreSQL, SQLite, Berkeley DB, Redis, Memcached, PHP, Perl, Ruby, Python, Lua, Git, FFmpeg and other countless excellent softwares. If sqlite and git were written with C++ or Java, I'll throw them away immediately. C is top professionals' language, most developer have never written a real C software in their life, a mature developer may needs ten years to really write software with it. The product quality of the software industry is directly proportional to the number of experienced C programming experts.

The Tao and Kung Fu of Programming

Why all attempts failed? They want to create new programming language to resolve problem in software industry, but all attempts failed. Any new programming language that intended to achieve a seamless translation from Lisp (or Lisp like language, e.g Javascript) to native executable code will failed at final. The product quality of the software industry is directly proportional to the number of experienced C programming experts, but experienced C developer and C ninja are rare and rare, because only a few people can walk on this difficult way. C is really unsafe and really difficult to master, to be a mature C developer or an C expert, a developer may needs about ten years to continually experience it. Programming is difficult, there is no shortcuts for programming, programming language itself can't resolve it. Only the honest and continuous improving of the C programming skills is the reliable way.

"C + elegant scripting language" is the reliable, efficient and flexible extending solution.

Most developer have never written a real C software in their life, I wish more and more developer use Speare code editor to develop efficient and excellent software with C instead of current popular bloated programming languages.


mruby Debugger

The mruby debugger of Speare is a patched version of mruby that support remote debugging mruby project, currently support mruby version 2.0.1 and 2.1.0.

1. Install mruby debugging server

Download mruby remote debugger: → http://sevenuc.com/download/mruby_debugger.tar.gz (733KB)
SHA256: 44646d3f13f8840843795b533043e42fd18a239e480b548c92c3e8029ea03a84
Download mruby-2.0.1.tar.gz (518KB) or mruby-2.1.0.tar.gz (585KB) from https://github.com/mruby/mruby
$ cd mruby-2.0.1 or mruby-2.1.0
$ make: compile mruby and replace mrdb under bin directory with the corresponding version.
$ cd bin
$ ./mrdb : start the mruby remote debugger.

2. Configuring Speare code editor

Launch Speare and open the Preferences of Speare and select the tab of "Debug Settings" then check on "Enable mruby debugging". Please remember to turn the option off when you switched to debug common Ruby applications.

3. Debug Session Start

Click "Start" button on the debug toolbar of Speare Pro.
Add breakpoint, step in, step out, step next, watch stack trace ...

Tips: Separate modules of your app with mruby gems instead of using require.


Ruby Debugger

The Ruby debugger of Speare code editor implemented as a client of rdebug-ide, and Ruby interpreter that has a rdebug-ide installed will be running as the debug server.

Ruby debugging environment support all kinds of Ruby interpreters, the version includes: 1.8.x, 1.9.x, 2.x, and JRuby.

Steps of start debugging session:

1. Download and install debug gems:

For Ruby 1.8.x: download: ruby-debug-base (0.10.4)
$ gem install --force --local ruby-debug-base-0.10.4.gem
$ gem install ruby-debug-ide

For Ruby 1.9.x: download: ruby-debug-base19 (0.11.25)
$ gem install --force --local ruby-debug-base19x-0.11.32.gem
$ gem install ruby-debug-ide

For Ruby 2.x:
$ gem install debase
$ gem install ruby-debug-ide

2. Start the debug server:

$ rdebug-ide --host 127.0.0.1 --port 1234 --dispatcher-port 1234 -- main.rb
(please replace the main.rb file with your script file.)
For Rails: $ rdebug-ide --host 0.0.0.0 --port 1234 --dispatcher-port 1234 -- bin/rails s

3. Debug session start:
click "Start" button on the debug toolbar of Speare code editor.
Add breakpoint, step in, step out, step next, watch stack trace ...

4. Add condition breakpoint:
Right click on the breakpoint, on the prompt menu, → select "Condition" and then input expression or use empty string to remove the condition, left click outside of the input box to close it and execute the command. e.g. x>5 means: Pause on the breakpoint only if x>5 is true.

5. Run Extra Commands:
Right click in the stackview (bottom left side) and then input extra command when the debugging session paused. Left click anywhere outside of the input box to close it and the command will be directly send to the debug server.

a. Variables
. var const object: show constants of object.
. var instance object: show instance variables of object, object can be given by its id or an expression.
. var inspect: reference inspection results in order to save them from the GC.

b. Expression
. p expression: evaluate expression and print its value.
. pp expression: evaluate expression and print its value.
. eval expression: evaluate expression and print its value, alias for p.
. expression_info expression: returns parser-related information for the expression given 'incomplete'=true | false indicates whether expression is a complete ruby expression and can be evaluated without getting syntax errors.

c. Backtrace
. where: display frames.
. bt | backtrace: alias for where.
. up | down [count]: move to higher or lower frame.
. frame [frame-number]: Move the current frame to the specified frame number. (A negative number indicates position from the other end. So 'frame -1' moves to the oldest frame, and 'frame 0' moves to the newest frame.)

d. Jump
Change the next line of code to be executed.
. jump line: jump to line number (absolute).
. jump -line: jump back to line (relative).
. jump +line: jump ahead to line (relative).

e. Thread
. thread list: list all threads.
. thread current: show current thread.
. thread switch <nnn>: switch thread context to nnn.
. thread inspect <nnn>: switch thread context to nnn but don't resume any threads.
. thread resume <nnn>: resume thread nnn.
. thread stop <nnn>: stop thread nnn.

f. Type Set
. set_type <var> <type>: Change the type of <var> to <type>.

g. File Operation
. load file: read and parse file every time instead of require.
. file-filter on | off: enable or disable file filtering.
. include file | dir: adds file or dir to file filter (either remove already excluded or add as included).
. exclude file | dir: exclude file or dir from file filter (either remove already included or add as exclude).

6. Switch Ruby interpreter:
You can directly switch between any Ruby interpreter or your own version of Ruby and then config it to support rdebug-ide.

Appendix: make a fresh Ruby debugging environment

Step 1. build an openssl library
$ download https://www.openssl.org/source/openssl-1.0.2t.tar.gz
$ tar -zxvf openssl-1.0.2t.tar.gz
$ cd openssl-1.0.2t
$ export KERNEL_BITS=64
$ ./config no-ssl2 no-ssl3 no-shared enable-ec_nistp_64_gcc_128 \
  --prefix=/Users/yeung/Public/Rdebug/openssl \
  --openssldir=/Users/yeung/Public/Rdebug/openssl
$ make && make install

Step 2. build a ruby interpreter
$ download https://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.2.tar.bz2
$ tar -jxvf ruby-2.1.2.tar.bz2
$ export LDFLAGS=-L/Users/yeung/Public/Rdebug/openssl/lib -lcrypto -lssl
$ export CFLAGS=-I/Users/yeung/Public/Rdebug/openssl/include
$ export PKG_CONFIG_PATH=/Users/yeung/Public/Rdebug/openssl/pkgconfig
$ cd ruby-2.1.2
$ ./configure --prefix=/Users/yeung/Public/Rdebug/2.x/ruby2 \
  --with-openssl-dir=/Users/yeung/Public/Rdebug/openssl
Alternative: directly modify Makefile to add openssl library link options
LDFLAGS =  $(CFLAGS) -L. -fstack-protector -L/usr/local/lib -L/Users/yeung/Public/Rdebug/openssl -lcrypto -lssl
$ make && make install

Step 3. install debug gems
$ download https://rubygems.org/downloads/debase-ruby_core_source-0.10.5.gem
$ download https://rubygems.org/downloads/debase-0.2.5.beta1.gem
$ download https://rubygems.org/downloads/ruby-debug-ide-0.7.0.gem
$ export PATH=/Users/yeung/Public/Rdebug/2.x/ruby2/bin:$PATH
$ gem install --force --local debase-ruby_core_source-0.10.5.gem
$ gem install --force --local debase-0.2.5.beta1.gem
$ gem install --force --local ruby-debug-ide-0.7.0.gem

Step 4. start debugging session
$ rdebug-ide --host 127.0.0.1 --port 1234 --dispatcher-port 1234 -- xxx/xxx/xxx/main.rb
add breakpoints in Speare code editor.
click "Start" button on the debug toolbar of Speare code editor.
step in, step out, step next ...


Lua Debugger

The Lua debugger of Speare code editor implemented as a module of Lua, and support all common versions of Lua. You can conveniently enjoy debugging with any kinds of customised Lua interpreter and LuaJIT.

Tested Lua version includes: 5.1.4, 5.1.5, 5.2.4, 5.3.5 5.4.0-alpha

Start Debugging Steps:

1. Download Speare Debug Server: → http://sevenuc.com/download/lua_debugger.tar.gz (518KB)
SHA256: a9447cedd668553f0b0eb5c2f5221b6af349dd6cf73602513f98e9b366022c94
2. Uncompress the tarball to your local directory. e.g ~/Desktop and take a look at the readme.txt in it.
3. Start the debug server:

$ cd ~/Desktop/debugger/5.1
$ ./lua_514 server.lua

4. Debug session start: click "Start" button on the debug toolbar of Speare code editor.
Add breakpoint, step in, step out, step next, watch stack trace ...

5. Replace Lua interpreter:
You can directly replace the Lua interpreter with your own customised version under the debugger directory.


Python Debugger

The Python debugger of Speare Pro supports Python version 2.5, 2.6, 2.7 and 3.x, and MicroPython. You can enjoy debugging Python scripts as same as debugging web applications that based on web frameworks such as Flask and Django under the lightweight environment of Speare code editor.

Steps of Start Debugging Session:

1. Download Speare Debug Server: → http://sevenuc.com/download/python_debugger.tar.gz (30KB)
SHA256: 74cc8544671eed3de317305573cc9f1f95ae395533d1f08ce84b248cee883250
The source code of the Python debugger can be view online here:
https://github.com/chengdu/Speare or here: https://sourceforge.net/projects/speare
2. Uncompress the tarball to your local directory. e.g ~/Desktop and take a look at the readme.txt in it.
3. Start the debug server:

$ cd ~/Desktop/debugger/2.x
$ python server.py

4. Debug session start: click "Start" button on the debug toolbar of Speare code editor.
Add breakpoint, step in, step out, step next, watch stack trace ...

5. Add condition breakpoint
Described in the Ruby debug section of this page.

6. Run Extra Commands:

a. Remove all breakpoints
. clear: clear all breakpoints of current file.

b. Stack trace and frame operation
. where: Print stack trace, an arrow indicates the "current frame".
. up [count]: Move stack trace to older frame.
. down [count]: Move stack trace to newer frame.

c. Display argument list
. args: Print the argument list of the current function.

d. Display return value
. retval: Print the return value for the last return of a function.

e. Display value of expression
. p expression: Print the value of the expression.
. pp expression: Pretty-print the value of the expression.
. display expression: Display the value of the expression, Python 3.x only.
. undisplay: Clear all display expressions for the current frame, Python 3.x only.
. undisplay expression: Do not display the expression any more in the current frame, Python 3.x only.

f. Display argument type
. whatis argument: Print the type of the argument.

g. Display source code of object
. source expression: Python 3.x only.

h. Continue execution
. until: continue execution until the line number greater than the current is reached.
. until [lineno]: continue execution until line number greater or equal to the lineno is reached.

i. Add module search path
. basedir directory: insert a directory in sys.path.

7. Switch Python interpreter:
You can directly switch CPython interpreter to MicroPython or your own self-compiled version of Python, or others such as PyPy, Jython and IronPython.


PHP Debugger

The PHP debugger of Speare code editor supports all kinds debugging of PHP applications and any version of PHP interpreter that has Xdebug support from PHP 5.x to PHP 7.x. Different with Lua, Ruby and Python debugging, this time Speare acts as debug server and Xdebug as the client.

Setting up Xdebug for PHP Debugging:

1. Download Xdebug:
https://xdebug.org/files/xdebug-2.6.0.tgz

2. Compile and install Xdebug:
$ rm configure.in (optional)
$ rm configure.ac (optional)
$ phpize && ./configure --enable-xdebug && make clean && make all
$ sudo make install
At this step Terminal will report:

/usr/lib/php/extensions Operation not permitted.

This is because SIP default set to be enabled by macOS, even you execute sudo operation, the system protected directories still can't be writable.

WARNING: THE FOLLOWING OPERATION IS VERY DANGERS.
Assuming that you know what you’re doing, here is how to change SIP (System Integrity Protection) settings on your Mac. Turn off your Mac (Apple → Shut Down...), hold down Command-R and press the Power button. Keep holding Command-R until the Apple logo appears and wait for OS X to boot into the "OS X Utility" window and then choose Utilities → Terminal.

Turn off SIP:
$ csrutil disable
$ csrutil status
$ reboot

Turn on SIP:
$ csrutil enable
$ csrutil status
$ reboot

After you turn off SIP and execute "$ sudo make install" again, Xdebug should be successfully installed on you system, you can check it by this command:
$ php -v
It should print something like the following:

PHP 7.1.23 (cli) (built: Nov 27 2018 16:59:25) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans

3. Configuring web server:
$ cp /etc/apache2/httpd.conf ~/Desktop/

LoadModule userdir_module libexec/apache2/mod_userdir.so
LoadModule alias_module libexec/apache2/mod_alias.so
LoadModule rewrite_module libexec/apache2/mod_rewrite.so
LoadModule php7_module libexec/apache2/libphp7.so
Include /private/etc/apache2/other/*.conf

Edit file http.conf and ensure the above lines not be commented.
$ sudo cp ~/Desktop/httpd.conf /etc/apache2/
Save back the settings file.
$ apachectl configtest
Check there syntax is legal (optional).

4. Configuring PHP interpreter:
$ cp /etc/php.ini.default ~/Desktop/

enable_dl = On
[xdebug]
zend_extension = /usr/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so
xdebug.remote_enable = 1
xdebug.remote_host = "127.0.0.1"
xdebug.remote_port = 9000
xdebug.remote_handler = "dbgp"
xdebug.remote_mode = req
xdebug.remote_connect_back = 1
xdebug.remote_autostart=1

Edit file php.ini.default and carefully check the above content have been written in it.
Note: xdebug.remote_autostart=1 should be removed at product environment.
$ sudo cp ~/Desktop/php.ini.default /etc/
Save back the settings file.
$ sudo mv /etc/php.ini.default /etc/php.ini
Rename the settings file to take effect.

5. Run PHP test with Xdebug:

<?php
echo phpinfo();
?>

Save the above content in a file named test.php and put it under /Library/WebServer/Documents/
$ sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist
$ sudo launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plist
Restart apache, launch Safari and request: http://127.0.0.1/test.php.
There're some text in zend engine section should be as same as printed by execute the command "$ php -v" on command line.

Steps of PHP Debugging with Speare code editor:

1. Launch Speare and dragging the PHP source code folder into the "Workspace Explorer".
2. Select the startup php script and Click siding bottom button to show the debug toolbar and then click "Start" button.
3. Launch Safari and request: http://127.0.0.1/xxx/xxx/index.php

Note: Don't use localhost but should use 127.0.0.1 instead.

4. After Speare paused and highlighting at a special line of your startup PHP script there that means the debugging session started, you can execute the common debugging command now:

Add breakpoint, step in, step out, step next, watch stack trace ...

6. Switch PHP interpreter:
You can switch any version of PHP interpreter directly, it does not affect the server side Speare code editor. PHP is an excellent programming language to develop Web Applications based on frameworks such as Drupal, Zend Framework, CodeIgniter, Symfony and Yii framework etc, but not limited that, in fact PHP is also very suitable to develop command line applications.


Perl Debugger

The Perl debugger of Speare code editor implemented as a patched version of perl5db.pl, and support extend it by yourself. The debugger was based on the builtin debugger of Perl, so it can work with all versions of Perl interpreter that perl5db.pl supported.

Start Debugging Steps:
1. Download Speare Debug Server: → http://sevenuc.com/download/perl_debugger.tar.gz(104KB)
SHA256: 83f8674ee4dfdf8e8155551d2d8483942ee80b634dd90e362e62c2222744b6b6
The source code of the Perl debugger can be view online here:
https://github.com/chengdu/Speare or here: https://sourceforge.net/projects/speare

2. Uncompress the tarball to your local directory. e.g ~/Desktop and take a look at the readme.txt in it.
3. Start the debug server:

$ cd ~/Desktop/debugger
$ perl -I ~/Desktop/debugger/Speare -d:Debugger fullpath.pl
* Warning: fullpath.pl the file must input with full path.

4. Debug session start: click "Start" button on the debug toolbar of Speare code editor.
Add breakpoint, step in, step out, step next, watch stack trace ...

5. Run extra commands:
Right click in the stackview (bottom left side) and then input any Perl debug command when the debugging session paused. Left click anywhere outside of the input box to close it and the command will be directly send to the debug server.
a. Add function breakpoints
. b functionname: add a function breakpoint.
b. Add condition breakpoints
. via breakpoint marker: Right click on the breakpoint, on the prompt menu, → select "Condition" and then input expression or use empty string to remove the condition, left click outside of the input box to close it and execute the command. e.g. x > 5 means: Pause on the breakpoint only if x > 5 is true.
. b fullpath.pl condition: e.g. b /xxx/xxx/code.pl 6 $x > 5.
/xxx/xxx/code.pl: fullpath of the script file. (do the same thing, optional)
c. Watchpoint operation
. w expr: add a watchpoint expr.
. W expr: delete watchpoint expr.
. W *: delete all watchpoints.
d. Evaluate express
. e expr: e.g. "e $x+$y".
e. Display variable value
. p $x: print value of variable x.
. p expr: print value of expression expr.
...

6. Switch Perl interpreter:
You can directly switch the Perl interpreter on the command line or debugging with your own self-compiled version of Perl.

About Perl

There exists huge number of mature and reliable Perl modules in cpan, as a general-purpose Unix scripting language, Perl is the most suitable programming language to resolve your problem at some situation, from the server side powerful tool such as load balancer to web applications, and large scale enterprise applications.


Tcl Debugger

The Tcl debugger of Speare code editor implemented with Tcl scripts and an extension written with C to parse Tcl source code, and support extend it by yourself. You can enjoy debugging almost all kinds of Tcl applications under the lightweight debugging environment of Speare code editor.

Start Debugging Steps:
1. Download Speare Debug Server: → http://sevenuc.com/download/tcl_debugger.tar.gz (223KB)
SHA256: 289aebaa433bd6acc46eaf6b0a347b474cc534427968e66e1740503e3f6f90d2
The source code of the Tcl debugger can be view online here:
https://github.com/chengdu/Speare or here: https://sourceforge.net/projects/speare

2. Uncompress the tarball to your local directory. e.g ~/Desktop and take a look at the readme.txt in it.

3. Start the debug server:
Please refer the readme.txt file.

4. Debug session start: click "Start" button on the debug toolbar of Speare code editor.
Add breakpoint, step in, step out, step next, watch stack trace ...

5. Modify the Tcl debugger:
You can directly modify the source code of the Tcl Debugger to satisfy your requirements.

6. Switch Tcl interpreter:
You can directly switch the Tcl interpreter on the command line or debugging with your own self-compiled version of Tcl.


Debug Node.js applications

1. node --inspect-brk index.js : run Node.js application with the --inspect-brk option on command line.
2. chrome://inspect: input this url in Google Chrome browser, click "Inspect" to start the debugger.
Above is the simplest approach to debug Javascript scripts or Node.js application with Chrome Developer Tools.