(arg, flag)
Internal worker for enabling/disabling pretty-printers.
Internal worker for enabling/disabling pretty-printers.
Internal worker for enabling / disabling pretty - printers .
def do_enable_pretty_printer (arg, flag):
    """Internal worker for enabling/disabling pretty-printers."""
    (object_re, name_re, subname_re) = parse_printer_regexps(arg)

    total = 0
    if object_re.match("global"):
        total += do_enable_pretty_printer_1(gdb.pretty_printers,
                                            name_re, subname_re, flag)
    cp = gdb.current_progspace()
    if object_re.match("progspace"):
        total += do_enable_pretty_printer_1(cp.pretty_printers,
                                            name_re, subname_re, flag)
    for objfile in gdb.objfiles():
        if object_re.match(objfile.filename):
            total += do_enable_pretty_printer_1(objfile.pretty_printers,
                                                name_re, subname_re, flag)

    if flag:
        state = "enabled"
    else:
        state = "disabled"
    print ("%d %s %s" % (total, pluralize("printer", total), state))

    # Print the total list of printers currently enabled/disabled.
    # This is to further assist the user in determining whether the result
    # is expected.  Since we use regexps to select it's useful.
    show_pretty_printer_enabled_summary()
def do_enable_pretty_printer ( arg , flag ) : ( object_re , name_re , subname_re ) = parse_printer_regexps ( arg ) total = 0 if object_re . match ( "global" ) : total += do_enable_pretty_printer_1 ( gdb . pretty_printers , name_re , subname_re , flag ) cp = gdb . current_progspace ( ) if object_re . match ( "progspace" ) : total += do_enable_pretty_printer_1 ( cp . pretty_printers , name_re , subname_re , flag ) for objfile in gdb . objfiles ( ) : if object_re . match ( objfile . filename ) : total += do_enable_pretty_printer_1 ( objfile . pretty_printers , name_re , subname_re , flag ) if flag : state = "enabled" else : state = "disabled" print ( "%d %s %s" % ( total , pluralize ( "printer" , total ) , state ) ) # Print the total list of printers currently enabled/disabled. # This is to further assist the user in determining whether the result # is expected.  Since we use regexps to select it's useful. show_pretty_printer_enabled_summary ( )