substrs=['stopped',
'stop reason = breakpoint'])
- # global variables are no longer displayed with the "frame variable"
+ # Global variables are no longer displayed with the "frame variable"
# command.
self.expect(
'target variable A::g_points',
VARIABLES_DISPLAYED_CORRECTLY,
- patterns=['\(PointType \[[1-9]*\]\) A::g_points = {'])
- self.expect('target variable g_points', VARIABLES_DISPLAYED_CORRECTLY,
- substrs=['(PointType [2]) g_points'])
+ patterns=[
+ '\(PointType \[[1-9]*\]\) A::g_points = {', '(x = 1, y = 2)',
+ '(x = 11, y = 22)'
+ ])
+
+ # Ensure that we take the context into account and only print
+ # A::g_points.
+ self.expect(
+ 'target variable A::g_points',
+ VARIABLES_DISPLAYED_CORRECTLY,
+ matching=False,
+ patterns=['(x = 3, y = 4)', '(x = 33, y = 44)'])
+
+ # Finally, ensure that we print both points when not specifying a
+ # context.
+ self.expect(
+ 'target variable g_points',
+ VARIABLES_DISPLAYED_CORRECTLY,
+ substrs=[
+ '(PointType [2]) g_points', '(x = 1, y = 2)',
+ '(x = 11, y = 22)', '(x = 3, y = 4)', '(x = 33, y = 44)'
+ ])
# On Mac OS X, gcc 4.2 emits the wrong debug info for A::g_points.
# A::g_points is an array of two elements.