Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Unified Diff: gdb/testsuite/gdb.python/py-value.c

Issue 124383005: GDB 7.6.50 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@upstream
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gdb/testsuite/gdb.python/py-typeprint.py ('k') | gdb/testsuite/gdb.python/py-value.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gdb/testsuite/gdb.python/py-value.c
diff --git a/gdb/testsuite/gdb.python/py-value.c b/gdb/testsuite/gdb.python/py-value.c
index aed70c8af8eb62a558287b24678106abc37ff44b..4f8c27b4c9f597aa63203ab1adf1c3e7d2f71e0e 100644
--- a/gdb/testsuite/gdb.python/py-value.c
+++ b/gdb/testsuite/gdb.python/py-value.c
@@ -1,6 +1,6 @@
/* This testcase is part of GDB, the GNU debugger.
- Copyright 2008-2012 Free Software Foundation, Inc.
+ Copyright 2008-2013 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -16,6 +16,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
struct s
{
@@ -39,6 +41,13 @@ typedef struct s *PTR;
enum e evalue = TWO;
+struct str
+{
+ int length;
+ /* Variable length. */
+ char text[1];
+};
+
#ifdef __cplusplus
struct Base {
@@ -86,6 +95,8 @@ main (int argc, char *argv[])
int i = 2;
int *ptr_i = &i;
const char *sn = 0;
+ struct str *xstr;
+
s.a = 3;
s.b = 5;
u.a = 7;
@@ -96,6 +107,12 @@ main (int argc, char *argv[])
ptr_ref(ptr_i);
#endif
+#define STR_LENGTH 100
+ xstr = (struct str *) malloc (sizeof (*xstr) + STR_LENGTH);
+ xstr->length = STR_LENGTH;
+ memset (xstr->text, 'x', STR_LENGTH);
+#undef STR_LENGTH
+
save_argv = argv; /* break to inspect struct and union */
return 0;
}
« no previous file with comments | « gdb/testsuite/gdb.python/py-typeprint.py ('k') | gdb/testsuite/gdb.python/py-value.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698