Author Topic: Axe Debug  (Read 5474 times)

0 Members and 2 Guests are viewing this topic.

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Axe Debug
« Reply #15 on: September 18, 2010, 08:00:59 pm »
It will certainly return where in the executable it was called from, whether it's an interrupt or a normal call. But as to how you will match the executable to the source code, I have no idea.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Axe Debug
« Reply #16 on: September 18, 2010, 08:04:36 pm »
Yeah thats the real question i have

SirCmpwn

  • Guest
Re: Axe Debug
« Reply #17 on: September 18, 2010, 09:24:12 pm »
Well, it would return the currently executing address.  Perhaps Quigibo could shed some light on this, but I believe that each command really calls a subroutine in the code, and has a certain length, and I could interpret the code for size until I reached the currently executing line.

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Axe Debug
« Reply #18 on: September 18, 2010, 09:26:23 pm »
This sounds neat!  Good luck Sir. :)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Axe Debug
« Reply #19 on: September 19, 2010, 12:33:27 am »
Hello,
I'm working on a debugging library that will make it much easier to debug Axe code.  It works as an interrupt, and when you hold down Y= and Graph, it will break (which means that it will stop executing your program and temporarily execute its own code instead, not that it crashes your calc :P).  You can browse a menu of available options and things to do while you are in the breakpoint.  So far, the following is implemented:
-Logging
   -You can maintain a log that saves to a program file, and view it from the debugger or from TIOS
-Variable Editing
   -While debugging, you can break and view/edit the variables
-Hex Editor
   -You can view RAM and ROM, and modify RAM
Planned:
-Code View
   -An interactive view that will let you navigate the code and do some sweet stuff, like Visual Studio
Wow that's great. It reminds me a bit the RPG Maker 2003 debug mode. No more need to manually add Text(0,0,varname):Pause 3000 in our programs to check a variable value, rigth? :)

Wouldn't viewing code be hard to implement, though? I mean, how would you convert binary back to Axe code?
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Axe Debug
« Reply #20 on: September 19, 2010, 03:45:42 am »
Well, it would return the currently executing address.  Perhaps Quigibo could shed some light on this, but I believe that each command really calls a subroutine in the code, and has a certain length, and I could interpret the code for size until I reached the currently executing line.

Well the really hard things would be like things like this line:

5/4+(4-B)*2^16 And (7*(9+B)->B)->C+5->B

Things like 5/4, *2, ^16, and others are automatically optimized, so it might be uber hard to anticipate the compile size.  Not to mention as Axe parser evolves and changes, optimizations will change and your program will be out of date.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Axe Debug
« Reply #21 on: September 19, 2010, 11:25:09 am »
This sound awesome! Good luck, Sir, but remember someone could have deleted the source :P




SirCmpwn

  • Guest
Re: Axe Debug
« Reply #22 on: September 19, 2010, 11:42:10 am »
Yeah, I'm having second thoughts about finding the current code, but I may make it easier on the programmer to browse their source, like having them scroll by label.
Deep Thought, if the source code is gone, code view is disabled.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Axe Debug
« Reply #23 on: September 19, 2010, 11:49:39 am »
Yeah, I'm having second thoughts about finding the current code, but I may make it easier on the programmer to browse their source, like having them scroll by label.

And two parts of the code could very well say the same thing (despite subroutines being available). Scrolling by label is a good idea.

Also, one thing that would be really useful: something like Mirage's Instant Break, where it resets the stack to its original condition, then breaks. That way, if you suddenly find a freeze point, you can at least get out of it.

EDIT: A few tweaks and this could be used for a pure ASM debugger...
« Last Edit: September 19, 2010, 11:50:21 am by Deep Thought »




SirCmpwn

  • Guest
Re: Axe Debug
« Reply #24 on: September 19, 2010, 11:56:30 am »
Can you describe the Instant Break thing again?

EDIT: A few tweaks and this could be used for a pure ASM debugger...
I thought the same thing :)

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Axe Debug
« Reply #25 on: September 19, 2010, 12:24:13 pm »
I meant the ON+CLEAR/ON+MODE interrupts when you run a prgm from Mirage. Mirage calls them Interrupt Taskers: http://www.detachedsolutions.com/mirageos/manual/hkeyopts.php.

EDIT: I can see the potential of this as an ASM debugger: basically, Calcsys in-prgm :D
« Last Edit: September 19, 2010, 12:25:09 pm by Deep Thought »




Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Axe Debug
« Reply #26 on: September 19, 2010, 12:29:01 pm »
Yeah, I'm having second thoughts about finding the current code, but I may make it easier on the programmer to browse their source, like having them scroll by label.
Deep Thought, if the source code is gone, code view is disabled.
Scrolling by label would be nice. Might make it much easier to go to parts of code in particular.

Maybe a search function too? On Casio calcs, in the on-calc BASIC editor it's possible to search for stuff in the code.
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

SirCmpwn

  • Guest
Re: Axe Debug
« Reply #27 on: September 19, 2010, 01:07:28 pm »
Deep Thought, that's more or less the idea - calcsys in-program.  DJ, search could be easily implemented.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Axe Debug
« Reply #28 on: September 19, 2010, 04:01:40 pm »
If it's reasonable, maybe have the program keep a list of the labels used in the program, then allow the user to select one to jump to?




Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Axe Debug
« Reply #29 on: September 19, 2010, 04:51:41 pm »
This sounds like a really cool project. Good luck on it :)
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)