From: <ni...@us...> - 2008-04-24 15:14:35
|
Revision: 262 http://mspsim.svn.sourceforge.net/mspsim/?rev=262&view=rev Author: nifi Date: 2008-04-24 08:14:09 -0700 (Thu, 24 Apr 2008) Log Message: ----------- added stack command to show stack information Modified Paths: -------------- mspsim/se/sics/mspsim/cli/DebugCommands.java Modified: mspsim/se/sics/mspsim/cli/DebugCommands.java =================================================================== --- mspsim/se/sics/mspsim/cli/DebugCommands.java 2008-04-24 15:13:20 UTC (rev 261) +++ mspsim/se/sics/mspsim/cli/DebugCommands.java 2008-04-24 15:14:09 UTC (rev 262) @@ -211,6 +211,15 @@ return 0; } }); + ch.registerCommand("stack", new BasicCommand("show stack info", "") { + public int executeCommand(CommandContext context) { + int stackEnd = context.getMapTable().heapStartAddress; + int stackStart = context.getMapTable().stackStartAddress; + int current = cpu.readRegister(MSP430Constants.SP); + context.out.println("Current stack: $" + Utils.hex16(current) + " (" + (stackStart - current) + " used of " + (stackStart - stackEnd) + ')'); + return 0; + } + }); ch.registerCommand("print", new BasicCommand("print value of an address or symbol", "<address or symbol>") { public int executeCommand(CommandContext context) { int adr = context.getArgumentAsAddress(0); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |