aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.python/py-prettyprint.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.python/py-prettyprint.c')
-rw-r--r--gdb/testsuite/gdb.python/py-prettyprint.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.python/py-prettyprint.c b/gdb/testsuite/gdb.python/py-prettyprint.c
index b1a12b1..14fd528 100644
--- a/gdb/testsuite/gdb.python/py-prettyprint.c
+++ b/gdb/testsuite/gdb.python/py-prettyprint.c
@@ -196,6 +196,13 @@ add_item (zzz_type *c, int val)
++c->len;
}
+void
+set_item(zzz_type *c, int i, int val)
+{
+ if (i < c->len)
+ c->elements[i] = val;
+}
+
void init_s(struct s *s, int a)
{
s->a = a;
@@ -239,6 +246,15 @@ eval_sub (void)
eval1.x++; /* eval-break */
}
+static void
+bug_14741()
+{
+ zzz_type c = make_container ("bug_14741");
+ add_item (&c, 71);
+ set_item(&c, 0, 42); /* breakpoint bug 14741 */
+ set_item(&c, 0, 5);
+}
+
int
main ()
{
@@ -332,5 +348,6 @@ main ()
eval_sub ();
- return 0; /* break to inspect struct and union */
+ bug_14741(); /* break to inspect struct and union */
+ return 0;
}