def METHOD_NAME(self, arg, from_tty):
    try:
        # Stack frame is:
        # 0. StopForDebugger
        # 1. ComparePrettyPrintToChars or ComparePrettyPrintToRegex
        # 2. TestCase
        compare_frame = gdb.newest_frame().older()
        testcase_frame = compare_frame.older()
        test_loc = testcase_frame.find_sal()
        # Use interactive commands in the correct context to get the pretty
        # printed version
        value_str = self._get_value_string(compare_frame, testcase_frame)
        # Ignore the convenience variable name and newline
        value = value_str[value_str.find("= ") + 2:-1]
        gdb.newest_frame().select()
        expectation_val = compare_frame.read_var("expectation")
        if "PrettyPrintToRegex" in compare_frame.name():
            check_literal = expectation_val.string()
            test_fails = not re.match(check_literal, value)
        else:
            check_literal_string = expectation_val.string(encoding="utf-8")
            check_literal = str(check_literal_string.encode("utf-8"))
            test_fails = value != check_literal
        if test_fails:
            global test_failures
            print("FAIL: " + test_loc.symtab.filename +
                  ":" + str(test_loc.line))
            print("GDB printed:")
            print("   " + value)
            print("Value should match:")
            print("   " + check_literal)
            test_failures += 1
        else:
            print("PASS: " + test_loc.symtab.filename +
                  ":" + str(test_loc.line))
    except RuntimeError as e:
        # At this point, lots of different things could be wrong, so don't try to
        # recover or figure it out. Don't exit either, because then it's
        # impossible debug the framework itself.
        print("FAIL: Something is wrong in the test framework.")
        print(str(e))
        test_failures += 1