aboutsummaryrefslogtreecommitdiff
path: root/gdb/testenum.c
diff options
context:
space:
mode:
authorgdb-2.4+.aux.coff <gdb@fsf.org>1988-01-16 04:39:57 +0000
committerPedro Alves <palves@redhat.com>2012-06-03 15:36:30 +0100
commit7b4ac7e1ed2c4616bce56d1760807798be87ac9e (patch)
tree777c9f6aba126e91e4a25d7b1fa34c2213d038da /gdb/testenum.c
downloadbinutils-7b4ac7e1ed2c4616bce56d1760807798be87ac9e.zip
binutils-7b4ac7e1ed2c4616bce56d1760807798be87ac9e.tar.gz
binutils-7b4ac7e1ed2c4616bce56d1760807798be87ac9e.tar.bz2
gdb-2.4+.aux.coff
Diffstat (limited to 'gdb/testenum.c')
-rw-r--r--gdb/testenum.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gdb/testenum.c b/gdb/testenum.c
new file mode 100644
index 0000000..3d85f5e
--- /dev/null
+++ b/gdb/testenum.c
@@ -0,0 +1,25 @@
+/* Source file for showing ENUM lossage in GDB.
+ Compile with "cc -o foo -g foo.c". */
+
+enum bar { value1, value2, value3 };
+
+struct foo {
+ enum bar enum_value;
+ int int_value;
+ char *pointer_value;
+};
+
+struct foo foo_instance;
+struct foo *foo_instance_pointer;
+
+main ()
+{
+ foo_instance_pointer = &foo_instance;
+ foo_instance.enum_value = value2;
+ foo_instance.int_value = 1;
+ foo_instance.pointer_value = "Text to make a char *";
+
+ /* In GDB, set a breakpoint at this line. Then try to change the
+ value of foo_instance.enum_value in any way. I can't do it. */
+}
+