@@ -327,6 +327,7 @@ def format_value(value, compact=None):
327
327
def fetch_breakpoints (watchpoints = False , pending = False ):
328
328
# fetch breakpoints addresses
329
329
parsed_breakpoints = dict ()
330
+ catch_what_regex = re .compile (r'([^,]+".*")?[^,]*' )
330
331
for line in run ('info breakpoints' ).split ('\n ' ):
331
332
# just keep numbered lines
332
333
if not line or not line [0 ].isdigit ():
@@ -342,7 +343,11 @@ def fetch_breakpoints(watchpoints=False, pending=False):
342
343
address = None if is_multiple or is_pending else int (fields [4 ], 16 )
343
344
is_enabled = fields [3 ] == 'y'
344
345
address_info = address , is_enabled
345
- parsed_breakpoints [number ] = [address_info ], is_pending
346
+ parsed_breakpoints [number ] = [address_info ], is_pending , ''
347
+ elif len (fields ) >= 5 and fields [1 ] == 'catchpoint' :
348
+ # only take before comma, but ignore commas in quotes
349
+ what = catch_what_regex .search (' ' .join (fields [4 :]))[0 ].strip ()
350
+ parsed_breakpoints [number ] = [], False , what
346
351
elif len (fields ) >= 3 and number in parsed_breakpoints :
347
352
# add this address to the list of multiple locations
348
353
address = int (fields [2 ], 16 )
@@ -351,7 +356,7 @@ def fetch_breakpoints(watchpoints=False, pending=False):
351
356
parsed_breakpoints [number ][0 ].append (address_info )
352
357
else :
353
358
# watchpoints
354
- parsed_breakpoints [number ] = [], False
359
+ parsed_breakpoints [number ] = [], False , ''
355
360
except ValueError :
356
361
pass
357
362
# fetch breakpoints from the API and complement with address and source
@@ -362,7 +367,7 @@ def fetch_breakpoints(watchpoints=False, pending=False):
362
367
# skip internal breakpoints
363
368
if gdb_breakpoint .number < 0 :
364
369
continue
365
- addresses , is_pending = parsed_breakpoints [gdb_breakpoint .number ]
370
+ addresses , is_pending , what = parsed_breakpoints [gdb_breakpoint .number ]
366
371
is_pending = getattr (gdb_breakpoint , 'pending' , is_pending )
367
372
if not pending and is_pending :
368
373
continue
@@ -379,6 +384,7 @@ def fetch_breakpoints(watchpoints=False, pending=False):
379
384
breakpoint ['temporary' ] = gdb_breakpoint .temporary
380
385
breakpoint ['hit_count' ] = gdb_breakpoint .hit_count
381
386
breakpoint ['pending' ] = is_pending
387
+ breakpoint ['what' ] = what
382
388
# add addresses and source information
383
389
breakpoint ['addresses' ] = []
384
390
for address , is_enabled in addresses :
@@ -2223,7 +2229,8 @@ class Breakpoints(Dashboard.Module):
2223
2229
gdb .BP_WATCHPOINT : 'watch' ,
2224
2230
gdb .BP_HARDWARE_WATCHPOINT : 'write watch' ,
2225
2231
gdb .BP_READ_WATCHPOINT : 'read watch' ,
2226
- gdb .BP_ACCESS_WATCHPOINT : 'access watch'
2232
+ gdb .BP_ACCESS_WATCHPOINT : 'access watch' ,
2233
+ gdb .BP_CATCHPOINT : 'catch'
2227
2234
}
2228
2235
2229
2236
def label (self ):
@@ -2273,6 +2280,9 @@ class Breakpoints(Dashboard.Module):
2273
2280
# format user location
2274
2281
location = breakpoint ['location' ]
2275
2282
line += ' for {}' .format (ansi (location , style ))
2283
+ elif breakpoint ['type' ] == gdb .BP_CATCHPOINT :
2284
+ what = breakpoint ['what' ]
2285
+ line += ' {}' .format (ansi (what , style ))
2276
2286
else :
2277
2287
# format user expression
2278
2288
expression = breakpoint ['expression' ]
0 commit comments