Z88Dk source level debugging.

If you like transforming your statements into code, this is the place for you

Moderator: Programming Moderators

User avatar
ckirby101
Posts: 73
Joined: Mon May 29, 2017 7:09 pm

Z88Dk source level debugging.

Post by ckirby101 » Fri Jul 07, 2017 6:04 am

I'm gonna write a full source lever debugger for Z88dk Spectrum.

What i need though is access to a emulator, so i have a few questions..

Is there a open source spectrum emulator that i can add my hooks into and add Next support.
or
Is there a way to get data in / out of zesaurus from a separate application.

I would need to request list of registers, data from memory, request PC steps forward, a way to write to memory (so i can add breakpoints), a way to get signalled when a break point is hit etc etc..

User avatar
ckirby101
Posts: 73
Joined: Mon May 29, 2017 7:09 pm

Re: Z88Dk source level debugging.

Post by ckirby101 » Fri Jul 07, 2017 6:44 am

Found one.. Emulator called Zero full source was on github as OS.. I now have it running and compiling.. :-)

Spec-chum
Posts: 36
Joined: Tue May 30, 2017 11:14 am

Re: Z88Dk source level debugging.

Post by Spec-chum » Fri Jul 07, 2017 7:55 am

This sounds very interesting.

Will you be updating via this thread and/or publishing to github?

I'd love to follow this and perhaps even contribute.
I'm not insane; my mother had me tested

User avatar
ckirby101
Posts: 73
Joined: Mon May 29, 2017 7:09 pm

Re: Z88Dk source level debugging.

Post by ckirby101 » Fri Jul 07, 2017 8:20 am

Yeah will push up to github.. Debugger is gonna be standalone and use ports for comms.. That way i can make it work for the real spectrum next (maybe via the RPI)..

User avatar
Pgartside
Posts: 59
Joined: Tue May 30, 2017 2:56 am

Re: Z88Dk source level debugging.

Post by Pgartside » Fri Jul 07, 2017 9:34 am

ZEsarUX has a telnet interface you can remotely access, so you can set brake points, single step and access all the memory and registers and download into memory.

User avatar
chernandezba
Posts: 229
Joined: Mon May 29, 2017 8:14 pm

Re: Z88Dk source level debugging.

Post by chernandezba » Fri Jul 07, 2017 10:08 am

Pgartside wrote:
Fri Jul 07, 2017 9:34 am
ZEsarUX has a telnet interface you can remotely access, so you can set brake points, single step and access all the memory and registers and download into memory.
:)
You can also do it from the menu, although telnet is more confortable
----

ZEsarUX
ZX Second-Emulator And Released for UniX
https://github.com/chernandezba/zesarux

User avatar
chernandezba
Posts: 229
Joined: Mon May 29, 2017 8:14 pm

Re: Z88Dk source level debugging.

Post by chernandezba » Fri Jul 07, 2017 10:10 am

You can also read a source code and debug the Spectrum viewing the Z80 opcodes and the source code

[youtube]https://www.youtube.com/watch?v=z-TipWv0n9g[/youtube]
----

ZEsarUX
ZX Second-Emulator And Released for UniX
https://github.com/chernandezba/zesarux

User avatar
chernandezba
Posts: 229
Joined: Mon May 29, 2017 8:14 pm

Re: Z88Dk source level debugging.

Post by chernandezba » Fri Jul 07, 2017 10:17 am

ckirby101 wrote:
Fri Jul 07, 2017 6:04 am

Is there a way to get data in / out of zesaurus from a separate application.

I would need to request list of registers, data from memory, request PC steps forward, a way to write to memory (so i can add breakpoints), a way to get signalled when a break point is hit etc etc..
I suppose you mean ZEsarUX and not zesaurus ;)

Definitively, ZRCP (ZEsarUX Remote Command Protocol) is what you need:

https://www.youtube.com/watch?v=ZN9Lho6j_xY
https://www.youtube.com/watch?v=bk29R4BU5_Y

There are currently more commands that the ones you see on the video, exactly today all these (and growing every day ;) ):

Welcome to ZEsarUX remote command protocol (ZRCP)
Write help for available commands

command> help
Available commands:
about Shows about message
cpu-step Run single opcode cpu step
cpu-step-over Runs until returning from the current opcode
disable-breakpoint Disable specific breakpoint
disable-breakpoints Disable all breakpoints
disassemble Disassemble at address
dump-nested-functions Shows internal nested core functions
enable-breakpoint Enable specific breakpoint
enable-breakpoints Enable breakpoints
enter-cpu-step Enter cpu step to step mode
evaluate Evaluate expression, can be more than one register separated by spaces
exit-cpu-step Exit cpu step to step mode
exit-emulator Ends emulator
find-label Finds label on source code
generate-nmi Generates a NMI
get-audio-buffer-info Get audio buffer information
get-breakpoints Get breakpoints list
get-breakpointsactions Get breakpoints actions list
get-cpu-core-name Get emulation cpu core name
get-current-machine Returns current machine name
get-debug-settings Get debug settings on remote command protocol
get-io-ports Returns currently i/o ports used
get-machines Returns list of emulated machines
get-ocr Get OCR output text
get-os Shows emulator operating system
get-registers Get CPU registers
get-stack-backtrace Get last 5 16-bit values from the stack
get-version Shows emulator version
hard-reset-cpu Hard resets the machine
help Shows help screen or command help
hexdump Dumps mapped memory at address, showing hex and ascii
hexdump-internal Dumps internal memory (hexadecimal and ascii) for a given memory pointer
load-source-code Load source file to be used on disassemble opcode functions
ls Minimal command list
noop This command does nothing
quit Closes connection
read-mapped-memory Dumps mapped memory at address
reset-cpu Resets CPU
run Run cpu when on cpu step mode
save-binary-internal Dumps internal memory to file for a given memory pointer
send-keys-ascii Simulates sending some ascii keys on parameters asciichar, separated by spaces
send-keys-string Simulates sending some keys on parameter string
set-breakpoint Sets a breakpoint at desired index entry with condition
set-breakpointaction Sets a breakpoint action at desired index entry with condition
set-cr Sends carriage return to every command output received, useful on Windows environments
set-debug-settings Set debug settings on remote command protocol
set-machine Set machine
set-register Changes register value
set-verbose-level Sets verbose level for console output
set-window-zoom Sets window zoom
smartload Smart-loads a file
tbblue-get-palette Get palette colour at index
tbblue-get-pattern Get patterns at index, if not specified items parameters, returns only one
tbblue-get-sprite Get sprites at index, if not specified items parameters, returns only one
tsconf-get-af-port Get TSConf XXAF port value
tsconf-get-vram Get TSConf NVRAM value at index
view-basic Gets Basic program listing
write-mapped-memory Writes a sequence of bytes starting at desired address on mapped memory
write-mapped-memory-raw Writes a sequence of bytes starting at desired address on mapped memory

You can get descriptive help for every command with: help command
Note: When help shows an argument in brackets [], it means the argument is optional, and when written, you must not write these brackets
----

ZEsarUX
ZX Second-Emulator And Released for UniX
https://github.com/chernandezba/zesarux

User avatar
ckirby101
Posts: 73
Joined: Mon May 29, 2017 7:09 pm

Re: Z88Dk source level debugging.

Post by ckirby101 » Fri Jul 07, 2017 2:21 pm

ZEsarUX has a telnet interface you can remotely access, so you can set brake points, single step and access all the memory and registers and download into memory.

oooooooo that is really interesting!!

User avatar
ckirby101
Posts: 73
Joined: Mon May 29, 2017 7:09 pm

Re: Z88Dk source level debugging.

Post by ckirby101 » Fri Jul 07, 2017 2:22 pm

so scratch that.. im now writing a source level debugger for Next Hardware and ZEsarUX !! hurray.

Post Reply