From: Jim Blandy <jimb@codesourcery.com>
To: gdb-patches@sourceware.org
Subject: RFA: move enum lval_type to value.h
Date: Thu, 02 Nov 2006 05:57:00 -0000 [thread overview]
Message-ID: <m3k62e1jd0.fsf@codesourcery.com> (raw)
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. */
next reply other threads:[~2006-11-02 5:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-02 5:57 Jim Blandy [this message]
2006-11-02 9:54 ` Andreas Schwab
2006-11-02 18:54 ` Jim Blandy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3k62e1jd0.fsf@codesourcery.com \
--to=jimb@codesourcery.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox