aboutsummaryrefslogtreecommitdiff
path: root/gdb/testenum.c
blob: 3d85f5ec416c8a17789a0ecf6544b17bcc97fdd0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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. */
}