Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI-Nspire => Topic started by: ExtendeD on August 31, 2010, 06:34:45 am

Title: Ncubate - nspire_emu enhanced
Post by: ExtendeD on August 31, 2010, 06:34:45 am
Ncubate is a custom version of Goplat's nspire_emu (released with his permission) enhanced with features I personally needed for my own use and I'd like to share.
This version mainly adds calculator state save and reload, useful debugger commands and support for the GDB debugger.

-> Ncubate v032b (http://www.omnimaga.org/index.php?action=downloads;sa=downfile&id=595)

Help for the GDB support is available on Hackspire (http://hackspire.unsads.com/wiki/index.php/Debugging_programs).

Ncubate adds the following features to nspire_emu v032:

GUI:
- NEW: 'File -> Save State' let you save the whole emulator state to a file
  named <flash_image>.sav. The file is loaded on startup if it exists. You can
  request a state reload with 'File -> Reload State'
  Caution, newer versions of Ncubate may fail to read .sav files produced by
  previous versions. Delete these files when upgrading.
- NEW: 'File -> Save Flash As...' suggests the current flash image name
- NEW: several keyboard shortcuts added

Debugger:
- NEW: Supports the GNU Debugger GDB. You can debug at source-level programs
  built with Ndless. More information available at http://hackspire.unsads.com
- NEW: The register PC can be changed with the command 'rs
- NEW: Command 'j' to jump to the next instruction. This is useful for example
  to jump over an halt() call in an Ndless program.
- NEW: Command 'ww' to write a word to an address
- NEW: Command 'ss' to search a string in memory
- NEW: "+x" is the default flag for the breakpoint command 'k'
- NEW: Command 'wf' to load a file to memory
- NEW: Command-line option /R=cmdfile can be used to automatically run debugger
  commands on startup. Use a single line for each command. At the end of the file,
  the debugger switches to the standard input. You can use 'c' as the last
  command to continue the emulation.
- CHG: The breakpoint command 'k' takes as parameter a virtual address instead
  of a physical address
- CHG: Debugger command 'w' renamed to 'wm'
- CHG: The command 'wm' takes as parameter a virtual address instead of a
  physical address
- CHG: Read/write breakpoint logs display a virtual address instead of a
  physical address
- FIX: Command 'd' doesn't crash if the parameter is missing
- FIX: Broken 'w' command

CPU/Ports:
- ADD: (internal) ARM loader for arbitrary ARM snippet execution by the emulator
- FIX: no more 'bad read word' on auto power down, but still hangs

Flash:
- FIX: Flash image closed when synced to disk, for external edition

Build:
- NEW: Makefile.config for custom compilation flags
- NEW: make clean
- FIX: compilation warnings
Title: Re: Ncubate - nspire_emu enhanced
Post by: Snake X on August 31, 2010, 07:10:45 am
good work ExtendeD! :)
Title: Re: Ncubate - nspire_emu enhanced
Post by: Deep Toaster on August 31, 2010, 01:36:58 pm
Yep, great work! The new features are pretty useful. And nice job on the name, as usual :D
Title: Re: Ncubate - nspire_emu enhanced
Post by: DJ Omnimaga on August 31, 2010, 01:42:52 pm
Great work ExtendeD. Those features should be pretty useful, especially programmers :)
Title: Re: Ncubate - nspire_emu enhanced
Post by: apcalc on August 31, 2010, 03:23:19 pm
Looks nice ExtendeD!

/me replaces his Nspire emulator with this
 :)
Title: Re: Ncubate - nspire_emu enhanced
Post by: bwang on August 31, 2010, 05:04:55 pm
Yes, save states are pro :D
Title: Re: Ncubate - nspire_emu enhanced
Post by: fb39ca4 on September 01, 2010, 03:29:04 pm
Nice job! Now only if you could add the GUI to that...
Title: Re: Ncubate - nspire_emu enhanced
Post by: qazz42 on September 01, 2010, 03:33:54 pm
wow, this is great, awsome job extended
Title: Re: Ncubate - nspire_emu enhanced
Post by: ExtendeD on September 21, 2010, 04:02:16 am
New version (http://ourl.ca/6877/113599) available:

* v032a - 2010/09/21
 - Migrate to nspire_emu v032
 - ADD: Debugger command 'ss'
 - ADD: Debugger command 'wf'
 - CHG: Debugger command 'w' renamed to 'wm'
 - FIX: Debugger command 'j' supports thumb state
 - FIX: Broken debugger command 'w' (now 'wm')
Title: Re: Ncubate - nspire_emu enhanced
Post by: DJ Omnimaga on September 21, 2010, 04:13:30 am
Nice! Keep up the good work on this :)
Title: Re: Ncubate - nspire_emu enhanced
Post by: ExtendeD on October 08, 2010, 06:27:48 pm
I'm currently working on the integration of the GNU Debugger GDB in Ncubate. It should greatly improve the C and ARM development experience for the TI-Nspire.

Ncubate is going to implement the GDB remote protocol, so any debugger compatible with it will be able to plug into the emulator for source level debugging.

Here are a few screenshots which give an idea of this feature:

With the Eclipse CDT debugger:
(http://lh5.ggpht.com/_7VztOkmAAfE/TK-XpZ20_5I/AAAAAAAABg4/AtNi3HZ6tdk/s128/Capture%20plein%20%C3%A9cran%2009102010%20001304.jpg) (http://picasaweb.google.fr/olivier.armand/TINspire#5525802005378170770)

An older one with Insight (RedHat's GUI for GDB):
(http://lh4.ggpht.com/_7VztOkmAAfE/S1tvgq3CCvI/AAAAAAAABOU/rFzj7twErww/s128/Capture%20plein%20%C3%A9cran%2023012010%20224947.jpg) (http://picasaweb.google.fr/olivier.armand/TINspire#5430056382776871666)

An other one also quite old, with the debugger of the disassembler IDA, which would allow OS live analysis with all its symbols:
(http://lh4.ggpht.com/_7VztOkmAAfE/S1xdLk01xRI/AAAAAAAABOw/ttbRi0lxYVc/s128/IDA%20-%20CDocuments%20and%20SettingsOlivierMes%20documentsDocumentsDeveloppementTInspireboot2boot2_decomp.idb%20%28boot2_decomp.bin%29%2024012010%20154522.jpg) (http://picasaweb.google.fr/olivier.armand/TINspire#5430317704147223826)

Integration of GDB (through Ncubate) with Ndless's program loader still needs to be implemented. Currently programs to debug are transfered manually with GDB's load command (as you can see on the first screenshot) at a fixed addressed define at compile time (for example in the middle of the TI-Nspire screen as you can also see).
Title: Re: Ncubate - nspire_emu enhanced
Post by: Deep Toaster on October 08, 2010, 07:49:15 pm
Nice! Would we need to install extra stuff for it to work, though?
Title: Re: Ncubate - nspire_emu enhanced
Post by: DJ Omnimaga on October 08, 2010, 10:02:32 pm
Nice!
Title: Re: Ncubate - nspire_emu enhanced
Post by: ExtendeD on October 09, 2010, 04:11:45 am
Deep Thought: YAGARTO brings the command line version of GDB, you could use it directly but, well, it's command-line. Insight isn't distributed with it anymore, anyway I saw strange behaviors when using it.
At the moment I find that Eclipse CDT (http://www.eclipse.org/cdt/) is the most pleasant to use. You need to download a zip and enter a few setup values.
Title: Re: Ncubate - nspire_emu enhanced
Post by: Deep Toaster on October 09, 2010, 06:32:06 pm
Oh, I see, so the UI changes depending on what you have installed.
Title: Re: Ncubate - nspire_emu enhanced
Post by: Lionel Debroux on October 10, 2010, 08:54:14 am
Providing a gdbstub gives users the choice of tools they want to use, and reduces maintenance of the emulator (as it removes the _need_ for bundling a user interface for the debugger).
Title: Re: Ncubate - nspire_emu enhanced
Post by: ExtendeD on October 14, 2010, 05:33:47 pm
Now the GDB support of Ncubate collaborates with the program loader of Ndless v1.7. This mean you just have to start your debug session from you GDB front-end, set a breakpoint on the main() function (or anywhere else) and run the program you want to debug from the documents screen of the emulator as usual :)

I'm excited to share this with you as soon as possible. There are still a few things to fix up before a release.
Title: Re: Ncubate - nspire_emu enhanced
Post by: DJ Omnimaga on October 14, 2010, 05:56:02 pm
Nice :D
Title: Re: Ncubate - nspire_emu enhanced
Post by: Silver Shadow on October 15, 2010, 12:25:55 am
Nice :D
Exactly!
Title: Re: Ncubate - nspire_emu enhanced
Post by: Jonius7 on October 15, 2010, 12:40:51 am
ndless 1.7 is out? man im behind the times now. anyway nice new features for ncubate! what version is it now?
Title: Re: Ncubate - nspire_emu enhanced
Post by: Silver Shadow on October 15, 2010, 12:46:26 am
Ndless 1.7 isn't officially out yet, an alpha version is available for developers (and anyone who cares enough to compile the program himself).
Title: Re: Ncubate - nspire_emu enhanced
Post by: Jonius7 on October 16, 2010, 05:26:13 am
yeah i just read the topic on it, it's not stable yet.
Title: Re: Ncubate - nspire_emu enhanced
Post by: ExtendeD on October 17, 2010, 04:20:55 pm
I am also thinking of adding RLE compression to the saved state files. I don't know how it runs on your side, but my laptop is quite old and restoring a 32MB file to memory is painful for its slow hard drive.
Title: Re: Ncubate - nspire_emu enhanced
Post by: Deep Toaster on October 18, 2010, 06:44:51 pm
Sounds good. Even with Vista it took quite a while.
Title: Re: Ncubate - nspire_emu enhanced
Post by: willrandship on November 13, 2010, 10:56:27 pm
Even with Vista?
/me shudders at the use of vista for programming

I can't get it compiled on linux. Is this windows only? :( Make throws a whole bunch of errors, but it might just be that I'm doing it wrong. :P

Title: Re: Ncubate - nspire_emu enhanced
Post by: ExtendeD on November 14, 2010, 09:36:51 am
Yes, this is Windows only.
To emulate the TI-Nspire on Linux you will need Xspire (http://hackspire.unsads.com/wiki/index.php/Emulators#Xspire), but it doesn't include the improvements brought by Ncubate.
Title: Re: Ncubate - nspire_emu enhanced
Post by: DJ Omnimaga on November 14, 2010, 01:11:37 pm
/me wonders if someone plans to port Ncubate to Linux at one point
Title: Re: Ncubate - nspire_emu enhanced
Post by: AzNg0d1030 on December 10, 2011, 08:44:14 pm
just happening to stumble upon this forum and downloading its contents... :)