]>
Commit | Line | Data |
---|---|---|
7b4ac7e1 | 1 | /* Source file for showing ENUM lossage in GDB. |
2 | Compile with "cc -o foo -g foo.c". */ | |
3 | ||
4 | enum bar { value1, value2, value3 }; | |
5 | ||
6 | struct foo { | |
7 | enum bar enum_value; | |
8 | int int_value; | |
9 | char *pointer_value; | |
10 | }; | |
11 | ||
12 | struct foo foo_instance; | |
13 | struct foo *foo_instance_pointer; | |
14 | ||
15 | main () | |
16 | { | |
17 | foo_instance_pointer = &foo_instance; | |
18 | foo_instance.enum_value = value2; | |
19 | foo_instance.int_value = 1; | |
20 | foo_instance.pointer_value = "Text to make a char *"; | |
21 | ||
22 | /* In GDB, set a breakpoint at this line. Then try to change the | |
23 | value of foo_instance.enum_value in any way. I can't do it. */ | |
24 | } | |
25 |