Removed hardcoded debugger strings.
* Partial assembly code output when stepping.
+## TODO
+=====
+
+Basic functionality:
+* Display source code
+* Set breakpoints by file/line
+* View memory
+* View disassembly
+* View global and local symbols
+* View registers
+* Delete/modify/disable breakpoints
+* Advanced breakpoints (conditional, watchpoints)
+
+More advanced:
+
+* Recover nicely from losing the debugger/target
+* Command line arguments
+* Scripting
+
+
## Example session
=====
```
from com.microchip.mplab.mdbcore.disasm import DisAsm
from com.microchip.mplab.mdbcore.memory.memorytypes import ProgramMemory
from com.microchip.mplab.mdbcore.objectfileparsing.exception import ProgramFileParsingException
+from com.microchip.mplab.mdbcore.platformtool import PlatformToolMetaManager
from com.microchip.mplab.mdbcore.ControlPointMediator.ControlPoint import BreakType
from com.microchip.mplab.mdbcore.ControlPointMediator import ControlPointMediator
def selectDebugger(self):
# Select PICkit3 debugger
+ alltools = PlatformToolMetaManager.getAllTools()
+ devname = self.devices[0].split(":=")[6] # name is 6th entry in device string
+ if devname.find("PICkit") == 0:
+ devname = devname.replace(" ", "") # damn tools report the wrong name
+ tool = [x for x in alltools if x.getName() == devname][0]
self.factory.ChangeTool(self.assembly,
- "PICkit3PlatformTool",
- "com.microchip.mplab.mdbcore.PICKit3Tool.PICkit3DbgToolManager",
- "debuggerProgrammer",
+ tool.getConfigurationObjectID(),
+ tool.getClassName(),
+ tool.getFlavor(),
self.devices[0])
self.factory.SetToolProperties(self.assembly,None)
if self.mdb:
self.mdb.Disconnect()
+ def getDeviceFamily(self):
+ bits = assembly.GetDevice().getFamilyCode()
+ return assembly.GetDevice().getSubFamily()
+
def addressToSourceLine(self, addr):
try:
info = self.translator.addressToSourceLine(addr)
Usage: continue
'''
self.dbg.run()
- self.dbg.waitForHalt()
+ self.dbg.waitForHalt() # block
# It doesn't know where it is immediately after stopping.
# But it also LIES.
def _cleanShutdown(self):
'''Disconnect from debugger and quit.'''
- print "Exiting!"
self._handler.dbg.disconnect()
sys.exit(0) # this will interrupt raw_input()