From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22504 invoked by alias); 2 Nov 2006 05:57:20 -0000 Received: (qmail 22494 invoked by uid 22791); 2 Nov 2006 05:57:18 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 02 Nov 2006 05:57:17 +0000 Received: (qmail 24991 invoked from network); 2 Nov 2006 05:57:15 -0000 Received: from unknown (HELO localhost) (jimb@127.0.0.2) by mail.codesourcery.com with ESMTPA; 2 Nov 2006 05:57:15 -0000 To: gdb-patches@sourceware.org Subject: RFA: move enum lval_type to value.h From: Jim Blandy Date: Thu, 02 Nov 2006 05:57:00 -0000 Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-11/txt/msg00011.txt.bz2 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 * 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. */