summary history branches tags files
commit:edd8cb4dd0a1e911763e4898965c997716127ccf
author:mrmekon
committer:mrmekon
date:Thu Nov 8 20:39:59 2012 -0500
parents:0578060223c30dd830a4006afe2f57273f2b5b72
Removed hardcoded debugger strings.
diff --git a/README.md b/README.md
line changes: +20/-0
index 123add0..b2eeea4
--- a/README.md
+++ b/README.md
@@ -36,6 +36,26 @@ I wrote this because mdb.sh is currently incomplete, and nearly unusable, so loa
 * 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
 =====
 ```

diff --git a/mdb/picdebugger.py b/mdb/picdebugger.py
line changes: +13/-3
index 35312aa..02dba28
--- a/mdb/picdebugger.py
+++ b/mdb/picdebugger.py
@@ -16,6 +16,7 @@ from com.microchip.mplab.mdbcore.translator.exceptions import TranslatorExceptio
 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
@@ -94,10 +95,15 @@ class picdebugger(com.microchip.mplab.util.observers.Observer):
 
     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)
 
@@ -150,6 +156,10 @@ class picdebugger(com.microchip.mplab.util.observers.Observer):
         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)

diff --git a/picdb.py b/picdb.py
line changes: +1/-2
index c80dab7..2031334
--- a/picdb.py
+++ b/picdb.py
@@ -90,7 +90,7 @@ Continue running target from current PC.
 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.
@@ -152,7 +152,6 @@ class CommandInterpreter:
 
     def _cleanShutdown(self):
         '''Disconnect from debugger and quit.'''
-        print "Exiting!"
         self._handler.dbg.disconnect()
         sys.exit(0) # this will interrupt raw_input()