(expr, value, is_child)
return False
Function to explore pointer values.
        See Explorer.explore_expr for more information.
Function to explore pointer values.
        See Explorer.explore_expr for more information.
Function to explore pointer values . See Explorer . explore_expr for more information .
def explore_expr(expr, value, is_child):
        """Function to explore pointer values.
        See Explorer.explore_expr for more information.
        """
        print ("'%s' is a pointer to a value of type '%s'" %
               (expr, str(value.type.target())))
        option  = raw_input("Continue exploring it as a pointer to a single "
                            "value [y/n]: ")
        if option == "y":
            deref_value = None
            try:
                deref_value = value.dereference()
                str(deref_value)
            except gdb.MemoryError:
                print ("'%s' a pointer pointing to an invalid memory "
                       "location." % expr)
                if is_child:
                    Explorer.return_to_parent_value_prompt()
                return False
            Explorer.explore_expr("*%s" % Explorer.guard_expr(expr),
                                  deref_value, is_child)
            return False
        
        option  = raw_input("Continue exploring it as a pointer to an "
                            "array [y/n]: ")
        if option == "y":
            while True:
                index = 0
                try:
                    index = int(raw_input("Enter the index of the element you "
                                          "want to explore in '%s': " % expr))
                except ValueError:
                    break
                element_expr = "%s[%d]" % (Explorer.guard_expr(expr), index)
                element = value[index]
                try:
                    str(element)
                except gdb.MemoryError:
                    print ("Cannot read value at index %d." % index)
                    continue
                Explorer.explore_expr(element_expr, element, True)
            return False

        if is_child:
            Explorer.return_to_parent_value()
        return False
def explore_expr ( expr , value , is_child ) : print ( "'%s' is a pointer to a value of type '%s'" % ( expr , str ( value . type . target ( ) ) ) ) option = raw_input ( "Continue exploring it as a pointer to a single " "value [y/n]: " ) if option == "y" : deref_value = None try : deref_value = value . dereference ( ) str ( deref_value ) except gdb . MemoryError : print ( "'%s' a pointer pointing to an invalid memory " "location." % expr ) if is_child : Explorer . return_to_parent_value_prompt ( ) return False Explorer . explore_expr ( "*%s" % Explorer . guard_expr ( expr ) , deref_value , is_child ) return False option = raw_input ( "Continue exploring it as a pointer to an " "array [y/n]: " ) if option == "y" : while True : index = 0 try : index = int ( raw_input ( "Enter the index of the element you " "want to explore in '%s': " % expr ) ) except ValueError : break element_expr = "%s[%d]" % ( Explorer . guard_expr ( expr ) , index ) element = value [ index ] try : str ( element ) except gdb . MemoryError : print ( "Cannot read value at index %d." % index ) continue Explorer . explore_expr ( element_expr , element , True ) return False if is_child : Explorer . return_to_parent_value ( ) return False