Enhanced FW and debugging / tracing / stepping

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
Post Reply
mrblp
Posts: 82
Joined: 02 Oct 2010, 14:33

Enhanced FW and debugging / tracing / stepping

Post by mrblp »

Hello there,

I took a look on the source code of the enhanced FW and found a lot of new commands / enhancements for debugging and tracing. How can those enhancements be used? I am using linux and so I do not use bricxcc. Can nxc programs be debugged / traced / stepped via bricxcc?

Btw I am doing some research because of my idea of integrating the ric-file support in the enhanced FW and adding support for stripping it down (OnBrickProgramming, TryMe, Datalog). So I started to examine the changes John made...

Thank you!

Bye marvin
Bye Marvin

- "I think you ought to know I'm feeling very depressed." - (Android Marvin in "The Hitchhiker's Guide to the Galaxy" by Douglas Adams, 1978)
tcwan
Posts: 186
Joined: 30 Sep 2010, 07:39

Re: Enhanced FW and debugging / tracing / stepping

Post by tcwan »

I took a look on the source code of the enhanced FW and found a lot of new commands / enhancements for debugging and tracing.
Hmm, I'd be interested to know more about that too. Which version of the Enhanced firmware source are you referring to? I am only aware of v1.06 Enhanced Firmware Source being publicly accessible from the BricxCC website. (Unfortunately John Hansen does not tag the files so it's not easy to check the version without actually downloading the file).

I'm currently working on implementing a CPU instruction level debugger for the NXT, but I haven't researched the NBC tracing issue yet.
Work in progress can be seen at http://git.ni.fr.eu.org/?p=tcwan/nxt-fi ... ;a=summary, though it is not in a working state yet. (i.e., don't try to compile this and run it on your NXT unless you have a JTAG Debugger setup for the NXT).
afanofosc
Site Admin
Posts: 1256
Joined: 26 Sep 2010, 19:36
Location: Nashville, TN
Contact:

Re: Enhanced FW and debugging / tracing / stepping

Post by afanofosc »

The code that shows how to do this is in the BricxCC SVN repository. It uses the enhanced firmware's GetVMState and SetVMState direct commands. I haven't implemented support yet for breakpoints but the firmware (in theory) should check for and appropriately switch from the running state to the paused state if it hits a breakpoint. See uProgram.pas for most of the details. See FantomSpirit.pas for the actual direct command code. The symbol table generated by the compiler is used by the code in uProgram.pas to map between source code lines and VM code offsets as well as for variable names to variable indexes.

John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 1 guest