Skip to content

Commit 95c50c4

Browse files
committed
Print data breakpoints in the bps window
1 parent 95bd610 commit 95c50c4

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

python3/vimspector/breakpoints.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,17 @@ def BreakpointsAsQuickFix( self ):
449449
bp[ 'function' ],
450450
json.dumps( bp[ 'options' ] ) )
451451
} )
452+
for bp in self._data_breakponts:
453+
qf.append( {
454+
'filename': bp[ 'info' ][ 'description' ],
455+
'lnum': 1,
456+
'col': 1,
457+
'type': 'D',
458+
'valid': 0,
459+
'text': f"{ bp['name'] }: Data breakpoint - "
460+
f"{ bp['info' ][ 'description' ] }: " +
461+
json.dumps( bp[ 'options' ] )
462+
} )
452463

453464
return qf
454465

@@ -811,11 +822,13 @@ def AddFunctionBreakpoint( self, function, options ):
811822

812823
def AddDataBreakpoint( self,
813824
conn: DebugAdapterConnection,
825+
name,
814826
info,
815827
options ):
816828
self._data_breakponts.append( {
817829
'state': 'ENABLED',
818830
'conn': conn.GetSessionId(),
831+
'name': name,
819832
'info': info,
820833
'options': options
821834
} )

python3/vimspector/debug_session.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,7 @@ def AddDataBreakpoint( self, opts, buf = None, line_num = None ):
10211021
# Use the parent session, because the _connection_ comes from the
10221022
# variable/watch result that is actually chosen
10231023

1024-
def add_bp( conn, msg ):
1024+
def add_bp( conn, name, msg ):
10251025
breakpoint_info = msg.get( 'body' )
10261026
if not breakpoint_info:
10271027
utils.UserMessage( "Can't set data breakpoint here" )
@@ -1041,6 +1041,7 @@ def add_bp( conn, msg ):
10411041
opts[ 'accessType' ] = access_type
10421042

10431043
self._breakpoints.AddDataBreakpoint( conn,
1044+
name,
10441045
breakpoint_info,
10451046
opts )
10461047

python3/vimspector/variables.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -927,6 +927,7 @@ def GetDataBreakpointInfo( self,
927927
variable.container.VariablesReference() )
928928

929929
variable.connection.DoRequest( lambda msg: then( variable.connection,
930+
variable.Name(),
930931
msg ), {
931932
'command': 'dataBreakpointInfo',
932933
'arguments': arguments,

0 commit comments

Comments
 (0)