Skip to content

Commit

Permalink
renamed _breakpoint_mgmt to input_breakpoint and changed it to use @i…
Browse files Browse the repository at this point in the history
…nputcmd infrastructure
  • Loading branch information
Harry Pierson committed Apr 8, 2009
1 parent 5d3ad72 commit 47a92ed
Showing 1 changed file with 16 additions and 25 deletions.
41 changes: 16 additions & 25 deletions ipydbg.py
Expand Up @@ -311,6 +311,7 @@ def _print_source_line(self, sp, lines):
Console.WriteLine()

_inputcmds = dict()
_breakpointcmds = dict()

@inputcmd(_inputcmds, ConsoleKey.R)
def _input_repl_cmd(self, keyinfo):
Expand Down Expand Up @@ -407,32 +408,22 @@ def _input_step_out_cmd(self, keyinfo):
stepper.StepOut()
return True

@inputcmd(_breakpointcmds, ConsoleKey.L)
def _bp_list(self, keyinfo):
print "\nList Breakpoints"
for bp in self.active_appdomain.Breakpoints:
sp = get_location(bp.Function, bp.Offset)
print " %s:%d" % (sp.doc.URL, sp.start_line)
return False

@inputcmd(_inputcmds, ConsoleKey.B)
def _breakpoint_mgmt(self, keyinfo):
with CC.Cyan:
print "\nBreakpoint Management"
while True:
print "BP» ",
k = Console.ReadKey()

if k.Key == ConsoleKey.L:
print "\nList Breakpoints"
for bp in self.active_appdomain.Breakpoints:
sp = get_location(bp.Function, bp.Offset)
print " %s:%d" % (sp.doc.URL, sp.start_line)
elif k.Key == ConsoleKey.D:
print "\nDelete Breakpoint Not Implemented"
elif k.Key == ConsoleKey.A:
print "\nAdd Breakpoint Not Implemented"
'''Console.Write(' ')
set_bp = Console.ReadLine().split(":")
for doc in self._get_symbol_docs():
if '''
elif k.Key == ConsoleKey.Q:
print "\nExiting BP Management"
break
else:
print "\nPlease enter a valid command"
def _input_breakpoint(self, keyinfo):
keyinfo2 = Console.ReadKey()
if keyinfo2.Key in IPyDebugProcess._breakpointcmds:
return IPyDebugProcess._breakpointcmds[keyinfo2.Key](self, keyinfo2)
else:
print "\nInvalid breakpoint command", str(keyinfo2.Key)
return False

def _get_symbol_docs(self):
for a in self.active_appdomain.Assemblies:
Expand Down

0 comments on commit 47a92ed

Please sign in to comment.