This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: RFA: move enum lval_type to value.h
Andreas Schwab <schwab@suse.de> writes:
> Jim Blandy <jimb@codesourcery.com> writes:
>
>> 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?
>
> Please don't forget to update the makefile dependencies.
Oops --- thank you!
new-lval/gdb/ChangeLog:
2006-11-01 Jim Blandy <jimb@codesourcery.com>
Move 'enum lval_type' from defs.h to value.h.
* 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.
* Makefile.in (frame_h, value_h): Sub-#includes updated.
(symfile-mem.o, valarith.o, value.o): Dependencies updated.
diff -rN -u old-lval/gdb/defs.h new-lval/gdb/defs.h
--- gdb/defs.h 2006-11-02 10:51:41.000000000 -0800
+++ gdb/defs.h 2006-11-02 10:51:42.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-lval/gdb/frame.h new-lval/gdb/frame.h
--- gdb/frame.h 2006-11-02 10:51:41.000000000 -0800
+++ gdb/frame.h 2006-11-02 10:51:42.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-lval/gdb/Makefile.in new-lval/gdb/Makefile.in
--- gdb/Makefile.in 2006-11-02 10:51:41.000000000 -0800
+++ gdb/Makefile.in 2006-11-02 10:51:42.000000000 -0800
@@ -690,7 +690,7 @@
fbsd_nat_h = fbsd-nat.h
f_lang_h = f-lang.h
frame_base_h = frame-base.h
-frame_h = frame.h
+frame_h = frame.h $(value_h)
frame_unwind_h = frame-unwind.h $(frame_h)
frv_tdep_h = frv-tdep.h
gdbarch_h = gdbarch.h
@@ -815,8 +815,7 @@
ui_out_h = ui-out.h
user_regs_h = user-regs.h
valprint_h = valprint.h
-value_h = value.h $(doublest_h) $(frame_h) $(symtab_h) $(gdbtypes_h) \
- $(expression_h)
+value_h = value.h $(doublest_h) $(symtab_h) $(gdbtypes_h) $(expression_h)
varobj_h = varobj.h $(symtab_h) $(gdbtypes_h)
vax_tdep_h = vax-tdep.h
vec_h = vec.h $(gdb_assert_h) $(gdb_string_h)
@@ -2742,7 +2741,7 @@
$(parser_defs_h)
symfile-mem.o: symfile-mem.c $(defs_h) $(symtab_h) $(gdbcore_h) \
$(objfiles_h) $(exceptions_h) $(gdbcmd_h) $(target_h) $(value_h) \
- $(symfile_h) $(observer_h) $(auxv_h) $(elf_common_h)
+ $(frame_h) $(symfile_h) $(observer_h) $(auxv_h) $(elf_common_h)
symmisc.o: symmisc.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(bfd_h) \
$(symfile_h) $(objfiles_h) $(breakpoint_h) $(command_h) \
$(gdb_obstack_h) $(exceptions_h) $(language_h) $(bcache_h) \
@@ -2804,9 +2803,9 @@
$(frame_unwind_h) $(dwarf2_frame_h) $(gdbtypes_h) $(inferior_h) \
$(gdb_string_h) $(gdb_assert_h) $(gdbcore_h) $(arch_utils_h) \
$(regcache_h) $(dis_asm_h) $(osabi_h)
-valarith.o: valarith.c $(defs_h) $(value_h) $(symtab_h) $(gdbtypes_h) \
- $(expression_h) $(target_h) $(language_h) $(gdb_string_h) \
- $(doublest_h) $(infcall_h)
+valarith.o: valarith.c $(defs_h) $(value_h) $(frame_h) $(symtab_h) \
+ $(gdbtypes_h) $(expression_h) $(target_h) $(language_h) \
+ $(gdb_string_h) $(doublest_h) $(infcall_h)
valops.o: valops.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(value_h) $(frame_h) \
$(inferior_h) $(gdbcore_h) $(target_h) $(demangle_h) $(language_h) \
$(gdbcmd_h) $(regcache_h) $(cp_abi_h) $(block_h) $(infcall_h) \
@@ -2817,8 +2816,8 @@
$(annotate_h) $(valprint_h) $(floatformat_h) $(doublest_h) \
$(exceptions_h)
value.o: value.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \
- $(value_h) $(gdbcore_h) $(command_h) $(gdbcmd_h) $(target_h) \
- $(language_h) $(scm_lang_h) $(demangle_h) $(doublest_h) \
+ $(value_h) $(frame_h) $(gdbcore_h) $(command_h) $(gdbcmd_h) \
+ $(target_h) $(language_h) $(scm_lang_h) $(demangle_h) $(doublest_h) \
$(gdb_assert_h) $(regcache_h) $(block_h)
varobj.o: varobj.c $(defs_h) $(exceptions_h) $(value_h) $(expression_h) \
$(frame_h) $(language_h) $(wrapper_h) $(gdbcmd_h) $(gdb_assert_h) \
diff -rN -u old-lval/gdb/symfile-mem.c new-lval/gdb/symfile-mem.c
--- gdb/symfile-mem.c 2006-11-02 10:51:41.000000000 -0800
+++ gdb/symfile-mem.c 2006-11-02 10:51:42.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-lval/gdb/valarith.c new-lval/gdb/valarith.c
--- gdb/valarith.c 2006-11-02 10:51:41.000000000 -0800
+++ gdb/valarith.c 2006-11-02 10:51:42.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-lval/gdb/value.c new-lval/gdb/value.c
--- gdb/value.c 2006-11-02 10:51:41.000000000 -0800
+++ gdb/value.c 2006-11-02 10:51:42.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-lval/gdb/value.h new-lval/gdb/value.h
--- gdb/value.h 2006-11-02 10:51:41.000000000 -0800
+++ gdb/value.h 2006-11-02 10:51:42.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. */