I'm doing my first steps in tcl programming to use them on breakpoints and watchpoints.
But, oh my. It would be really a speed saver if I could keep my mostly used conditions of a session of debugging in a notepad, then paste them on the console when needed. And vice-versa.
I know I can create scripts in the scripts directory, but those conditions are the type ad-hoc and it doesn't make sense to create a lot of scripts for that. Not to mention that openMSX would require me to reboot at every new script I add.
I'm thinking on maintaining a lot of "lego like" conditions on the said notepad to mount a new expression as needed.
Like this one:
debug set_bp 0xADDR { [ expr [expr [reg A] == 8] && [expr [peek [expr [reg IX]+0x10 ]] == 3 ] ] } {debug break}
Note1: 0xADDR was the address I used at each time I needed
Note2: Sometimes I do include even more conditions, like:
debug set_bp 0xADDR { [ expr [expr [reg A] == 8] && [expr [peek [expr [reg IX]+0x10 ]] == 3 ] && [expr [reg B] == 3] ] } {debug break}
Note3: I'm sure my TCL scripts above probably suck. But give me a time, I never programmed anything in TCL until now.
Note4: This one looks like Manuel's 563774 request, but it is not the same. His request was for copy/paste into the emulated machine, not on the console
This is indeed a long standing feature request. Any idea how to access the clipboard in a platform-independent way? Or if there is no such way, how to do it in windows, linux, macosx, ...? And even in linux, is it the same for gnome, KDE, other desktops evnironments?
A workaround for pasting to the console is using the Tcl 'source <filename>' command. It will execute the content of the file just as if you typed it into the console.
about note3: Your command is not too bad, but it indeed can be written a bit simpler (i didn't test this)
debug set_bp 0xADDR {([reg A] == 8) && ([peek [expr [reg IX] + 0x10]] == 3) && ([reg B] == 3)}
Two main changes:
- debug break is the default action, so you can omit it
- using the 'expr' command in an expression context is not needed, so 3 of the 4 'expr' commands can be left out.
There are lots of good Tcl tutorials available, e.g. http://www.tcl.tk/man/tcl8.5/tutorial/tcltutorial.html (of course in addition to the Tcl language you also need to know openMSX specific Tcl commands).
> Any idea how to access the clipboard in a platform-independent way?
Does this solve the problem?
http://lists.libsdl.org/pipermail/sdl-libsdl.org/2010-July/077115.html