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

Unified Diff: gdb/testsuite/gdb.mi/var-cmd.c

Issue 11969036: Merge GDB 7.5.1 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@master
Patch Set: Created 7 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.mi/mi2-watch.exp ('k') | gdb/testsuite/gdb.mi/watch-nonstop.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gdb/testsuite/gdb.mi/var-cmd.c
diff --git a/gdb/testsuite/gdb.mi/var-cmd.c b/gdb/testsuite/gdb.mi/var-cmd.c
index 1482cddb6371d0c386f749da1505a528f8f53986..abdeb66deb5a1ee96b0a405f1956fb945156d3e4 100644
--- a/gdb/testsuite/gdb.mi/var-cmd.c
+++ b/gdb/testsuite/gdb.mi/var-cmd.c
@@ -91,6 +91,24 @@ struct _struct_n_pointer {
struct _struct_n_pointer *next;
};
+struct anonymous {
+ int a;
+ struct {
+ int b;
+ char *c;
+ union {
+ int d;
+ void *e;
+ char f;
+ struct {
+ char g;
+ const char **h;
+ simpleton ***simple;
+ };
+ };
+ };
+};
+
void do_locals_tests (void);
void do_block_tests (void);
void subroutine1 (int, long *);
@@ -122,9 +140,9 @@ do_locals_tests ()
float *lpfloat = 0;
double ldouble = 0;
double *lpdouble = 0;
- struct _simple_struct lsimple;
- struct _simple_struct *lpsimple;
- void (*func) (void);
+ struct _simple_struct lsimple = { 0 };
+ struct _simple_struct *lpsimple = 0;
+ void (*func) (void) = 0;
/* Simple assignments */
linteger = 1234;
@@ -502,6 +520,38 @@ void do_bitfield_tests ()
/*: END: bitfield :*/
}
+void
+do_anonymous_type_tests (void)
+{
+ struct anonymous *anon;
+ struct anonymous **ptr;
+ struct
+ {
+ int x;
+ struct
+ {
+ int a;
+ };
+ struct
+ {
+ int b;
+ };
+ } v = {1, {2}, {3}};
+
+ anon = malloc (sizeof (struct anonymous));
+ anon->a = 1;
+ anon->b = 2;
+ anon->c = (char *) 3;
+ anon->d = 4;
+ anon->g = '5';
+ anon->h = (const char **) 6;
+ anon->simple = (simpleton ***) 7;
+
+ ptr = &anon;
+ free (anon);
+ return; /* anonymous type tests breakpoint */
+}
+
int
main (int argc, char *argv [])
{
@@ -512,6 +562,7 @@ main (int argc, char *argv [])
do_frozen_tests ();
do_at_tests ();
do_bitfield_tests ();
+ do_anonymous_type_tests ();
exit (0);
}
« no previous file with comments | « gdb/testsuite/gdb.mi/mi2-watch.exp ('k') | gdb/testsuite/gdb.mi/watch-nonstop.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698