Adrian Prantl 6462eadbd3
Report back errors in GetNumChildren() (#84265)
This is a proof-of-concept patch that illustrates how to use the
Expected return values to surface rich error messages all the way up
to the ValueObjectPrinter.

This is the final patch in the series that includes
https://github.com/llvm/llvm-project/pull/83501 and
https://github.com/llvm/llvm-project/pull/84219
2024-03-11 13:04:56 -07:00

15 lines
527 B
Python

import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class ValueObjectErrorsTestCase(TestBase):
def test(self):
"""Test that the error message for a missing type
is visible when printing an object"""
self.build()
lldbutil.run_to_source_breakpoint(self, "break here",
lldb.SBFileSpec('main.c'))
self.expect('v -ptr-depth 1 x', substrs=['<incomplete type "Opaque">'])