diff options
author | Daniel Malea <daniel.malea@intel.com> | 2013-02-12 00:31:40 +0000 |
---|---|---|
committer | Daniel Malea <daniel.malea@intel.com> | 2013-02-12 00:31:40 +0000 |
commit | 69357ecb6d4fe8c5d499d7f5e0ae224815106c29 (patch) | |
tree | bcaf0984d6456d1945856774ba32fc87acdc55ae /lldb/utils/vim-lldb/python-vim-lldb/vim_panes.py | |
parent | d21cdd49471783a6743e6d449434de401aa9a2b0 (diff) | |
download | bcm5719-llvm-69357ecb6d4fe8c5d499d7f5e0ae224815106c29.tar.gz bcm5719-llvm-69357ecb6d4fe8c5d499d7f5e0ae224815106c29.zip |
Minor update to Vim frontend: simplify breakpoints display (and list unresolved breakpoints)
llvm-svn: 174923
Diffstat (limited to 'lldb/utils/vim-lldb/python-vim-lldb/vim_panes.py')
-rw-r--r-- | lldb/utils/vim-lldb/python-vim-lldb/vim_panes.py | 38 |
1 files changed, 10 insertions, 28 deletions
diff --git a/lldb/utils/vim-lldb/python-vim-lldb/vim_panes.py b/lldb/utils/vim-lldb/python-vim-lldb/vim_panes.py index 729e7c26d7a..ec537199922 100644 --- a/lldb/utils/vim-lldb/python-vim-lldb/vim_panes.py +++ b/lldb/utils/vim-lldb/python-vim-lldb/vim_panes.py @@ -374,32 +374,6 @@ class VimPane(object): return {} -class BreakpointsPane(VimPane): - MSG_NO_BREAKPOINTS = "No breakpoints set." - - def __init__(self, owner, name = 'breakpoints'): - VimPane.__init__(self, owner, name, open_below = True) - - def format_breakpoint_location(self, bploc): - return "breakpoint %s\n" % get_description(bploc, lldb.eDescriptionLevelFull).strip() - - def get_content(self, target, controller): - """ Update breakpoint locations for the specified target. """ - if target is None or not target.IsValid(): - return VimPane.MSG_NO_TARGET - elif target.GetNumBreakpoints() == 0: - return BreakpointsPane.MSG_NO_BREAKPOINTS - - bpdesc = "" - for i in range(target.GetNumBreakpoints()): - bp = target.GetBreakpointAtIndex(i) - if bp.IsValid and bp.IsEnabled(): - for j in range(bp.GetNumLocations()): - loc = bp.GetLocationAtIndex(j) - bpdesc += self.format_breakpoint_location(loc) - - return bpdesc - class FrameKeyValuePane(VimPane): def __init__(self, owner, name, open_below): """ Initialize parent, define member variables, choose which highlight @@ -524,8 +498,9 @@ class RegistersPane(FrameKeyValuePane): class CommandPane(VimPane): """ Pane that displays the output of an LLDB command """ - def __init__(self, owner, name, open_below): + def __init__(self, owner, name, open_below, process_required=True): VimPane.__init__(self, owner, name, open_below) + self.process_required = process_required def setCommand(self, command, args = ""): self.command = command @@ -533,7 +508,9 @@ class CommandPane(VimPane): def get_content(self, target, controller): output = "" - if not target or not target.GetProcess(): + if not target: + output = VimPane.MSG_NO_TARGET + elif self.process_required and not target.GetProcess(): output = VimPane.MSG_NO_PROCESS else: (success, output) = controller.getCommandOutput(self.command, self.args) @@ -634,3 +611,8 @@ class BacktracePane(StoppedCommandPane): return None else: return frame.GetFrameID() + 2 + +class BreakpointsPane(CommandPane): + def __init__(self, owner, name = 'breakpoints'): + super(BreakpointsPane, self).__init__(owner, name, open_below=False, process_required=False) + self.setCommand("breakpoint", "list") |