How do I call a function in my code from the debugger?
I am using CrossStudio for ARM for a robotics project.
During development, I capture data on the robot which I then want to upload.
So, I download my program and run it from the debugger and then I disconnect the debugger. The robot does its thing and stores data to RAM and then I attach the debugger to the target.
To send the data back, I break into the target and then manually change the PC to the routine that writes data back to the host and tell the debugger to run to the return for the routine.
Is there a way to tell CrossStudio to jump to one of my routines i.e. type "call vWriteDataHost" into CrossStudio so that I don't have to manually look up the address of vWriteDataHost and then modify the PC?
Thanks,
Harjit
-
I originally was sitting at a breakpoint and it didn't do anything. I then tried it with the CPU sitting in a loop and for "simple" functions it works.
I can't get it to work on a function that has debug_fwrite() in it - based on your response of 4/22 above, I assume all debug_* functions won't work?
My need is that after I've captured data on the robot, I want to ship it over to the PC and wanted to use this mechanism. Any suggestions?
-
None of the debug_ functions work when called from the debugger - we should support this but it's easier said than done.
You could use the JavaScript console to save the contents of a variable to a file when at a breakpoint
d = TargetInterface.peekBytes(Debug.evaluate("&var"), Debug.evaluate("sizeof(var)"));
TargetInterface.writeBinary("c:/tmp/var.bin", d);
Regards
Michael
Please sign in to leave a comment.
Comments
7 comments