This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RFA: move enum lval_type to value.h


The file defs.h has a lot of stuff that doesn't really belong there,
but recent cleanups have made a lot of that unnecessary.

How does this look?

new-src/gdb/ChangeLog:
2006-11-01  Jim Blandy  <jimb@codesourcery.com>

	* defs.h (enum lval_type): Move this from here...
	* value.h (enum lval_type): To here.
	Don't #include "frame.h" any more.
	(struct frame_id): Add forward declaration for structure.
	* frame.h: #include "value.h" here, for enum lval_type.
	* symfile-mem.c, valarith.c, value.c: Explicitly #include
	"frame.h".  These files use definitions from that file, but were
	only #including it implicitly via value.h.

diff -rN -u old-src/gdb/defs.h new-src/gdb/defs.h
--- gdb/defs.h	2006-11-01 17:15:51.000000000 -0800
+++ gdb/defs.h	2006-11-01 17:15:51.000000000 -0800
@@ -654,23 +654,6 @@
 							    void *),
 						   void *));
 
-/* Possible lvalue types.  Like enum language, this should be in
-   value.h, but needs to be here for the same reason. */
-
-enum lval_type
-  {
-    /* Not an lval. */
-    not_lval,
-    /* In memory.  */
-    lval_memory,
-    /* In a register.  Registers are relative to a frame.  */
-    lval_register,
-    /* In a gdb internal variable.  */
-    lval_internalvar,
-    /* Part of a gdb internal variable (structure field).  */
-    lval_internalvar_component
-  };
-
 /* Control types for commands */
 
 enum misc_command_type
diff -rN -u old-src/gdb/frame.h new-src/gdb/frame.h
--- gdb/frame.h	2006-11-01 17:15:51.000000000 -0800
+++ gdb/frame.h	2006-11-01 17:15:51.000000000 -0800
@@ -23,6 +23,8 @@
 #if !defined (FRAME_H)
 #define FRAME_H 1
 
+#include "value.h"              /* for enum lval_type */
+
 /* The following is the intended naming schema for frame functions.
    It isn't 100% consistent, but it is aproaching that.  Frame naming
    schema:
diff -rN -u old-src/gdb/symfile-mem.c new-src/gdb/symfile-mem.c
--- gdb/symfile-mem.c	2006-11-01 17:15:51.000000000 -0800
+++ gdb/symfile-mem.c	2006-11-01 17:15:52.000000000 -0800
@@ -52,6 +52,7 @@
 #include "gdbcmd.h"
 #include "target.h"
 #include "value.h"
+#include "frame.h"
 #include "symfile.h"
 #include "observer.h"
 #include "auxv.h"
diff -rN -u old-src/gdb/valarith.c new-src/gdb/valarith.c
--- gdb/valarith.c	2006-11-01 17:15:51.000000000 -0800
+++ gdb/valarith.c	2006-11-01 17:15:51.000000000 -0800
@@ -23,6 +23,7 @@
 
 #include "defs.h"
 #include "value.h"
+#include "frame.h"
 #include "symtab.h"
 #include "gdbtypes.h"
 #include "expression.h"
diff -rN -u old-src/gdb/value.c new-src/gdb/value.c
--- gdb/value.c	2006-11-01 17:15:51.000000000 -0800
+++ gdb/value.c	2006-11-01 17:15:52.000000000 -0800
@@ -26,6 +26,7 @@
 #include "symtab.h"
 #include "gdbtypes.h"
 #include "value.h"
+#include "frame.h"
 #include "gdbcore.h"
 #include "command.h"
 #include "gdbcmd.h"
diff -rN -u old-src/gdb/value.h new-src/gdb/value.h
--- gdb/value.h	2006-11-01 17:15:51.000000000 -0800
+++ gdb/value.h	2006-11-01 17:15:51.000000000 -0800
@@ -25,8 +25,8 @@
 #define VALUE_H 1
 
 #include "doublest.h"
-#include "frame.h"		/* For struct frame_id.  */
 
+struct frame_id;
 struct block;
 struct expression;
 struct regcache;
@@ -193,6 +193,23 @@
 extern int value_optimized_out (struct value *value);
 extern void set_value_optimized_out (struct value *value, int val);
 
+/* Possible lvalue types.  Like enum language, this should be in
+   value.h, but needs to be here for the same reason. */
+
+enum lval_type
+  {
+    /* Not an lval. */
+    not_lval,
+    /* In memory.  */
+    lval_memory,
+    /* In a register.  Registers are relative to a frame.  */
+    lval_register,
+    /* In a gdb internal variable.  */
+    lval_internalvar,
+    /* Part of a gdb internal variable (structure field).  */
+    lval_internalvar_component
+  };
+
 /* While the following fields are per- VALUE .CONTENT .PIECE (i.e., a
    single value might have multiple LVALs), this hacked interface is
    limited to just the first PIECE.  Expect further change.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]