aboutsummaryrefslogtreecommitdiff
path: root/gdb/value.h
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>1998-10-14 01:15:00 +0000
committerJason Molenda <jmolenda@apple.com>1998-10-14 01:15:00 +0000
commitad3b8c4a1a37dc966ddbcc687dcf78ec1f80022f (patch)
tree74fceadbf33b9e1a46c14a699ee7271f2f9963ac /gdb/value.h
parent9a3d6f4eefb862c4302973e6b5bde4820cb70580 (diff)
downloadgdb-ad3b8c4a1a37dc966ddbcc687dcf78ec1f80022f.zip
gdb-ad3b8c4a1a37dc966ddbcc687dcf78ec1f80022f.tar.gz
gdb-ad3b8c4a1a37dc966ddbcc687dcf78ec1f80022f.tar.bz2
1998-10-13 Jason Molenda (jsm@bugshack.cygnus.com)
* blockframe.c (find_pc_sect_partial_function): Add braces to avoid possible nested-if confusion. * breakpoint.c (breakpoint_here_p): Ditto. (breakpoint_inserted_here_p): Ditto. (breakpoint_thread_match): Ditto. * gnu-regex.c: Define _REGEX_RE_COMP only if it isn't already defined. * gnu-regex.h: Define _REGEX_RE_COMP to pick up old compatability prototypes. * symtab.h: Add prototype for _initialize_source. * value.h: Add prototype for _initialize_value. * defs.h: Include sys/types.h or stddef.h to get size_t. (make_cleanup): Add make_cleanup_func typedef and switch to using a prototype for this function. (mfree): Add prototypes for mmalloc, mrealloc, mfree if we aren't using mmalloc. * ax-gdb.c breakpoint.c coffread.c corelow.c dbxread.c dwarf2read.c dwarfread.c elfread.c eval.c exec.c gdbtk-cmds.c gdbtk.c infcmd.c infrun.c mipsread.c nlmread.c os9kread.c parse.c printcmd.c symfile.c symmisc.c symtab.c thread.c top.c tracepoint.c typeprint.c valops.c: Cast parameters passed to make_cleanup to use the new make_cleanup_func typedef. More warning cleanups. There are still a bunch of places where the first argument to make_cleanup is not cast to (make_cleanup_func); these are either due to the function fitting the make_cleanup_func specification already (e.g. free()) or they are in files that weren't compiled when I did my make on a Linux native system. Bwahahaha. You can see them like this: grep make_cleanup\ * | grep -v make_cleanup_func I'll surely go back and clean up the remaining suspicious calls in GDB one of these days. :-)
Diffstat (limited to 'gdb/value.h')
-rw-r--r--gdb/value.h35
1 files changed, 24 insertions, 11 deletions
diff --git a/gdb/value.h b/gdb/value.h
index 7ebd041..ae2545a 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -101,6 +101,8 @@ struct value
/* If nonzero, this is the value of a variable which does not
actually exist in the program. */
char optimized_out;
+ /* The BFD section associated with this value. */
+ asection *bfd_section;
/* Actual contents of the value. For use of this value; setting
it uses the stuff above. Not valid if lazy is nonzero.
Target byte-order. We force it to be aligned properly for any
@@ -111,7 +113,6 @@ struct value
LONGEST force_longlong_align;
char *literal_data;
} aligner;
-
};
typedef struct value *value_ptr;
@@ -141,16 +142,18 @@ extern int value_fetch_lazy PARAMS ((value_ptr val));
#define VALUE_NEXT(val) (val)->next
#define VALUE_REGNO(val) (val)->regno
#define VALUE_OPTIMIZED_OUT(val) ((val)->optimized_out)
+#define VALUE_BFD_SECTION(val) ((val)->bfd_section)
/* Convert a REF to the object referenced. */
#define COERCE_REF(arg) \
-do { CHECK_TYPEDEF (VALUE_TYPE (arg)); \
- if (TYPE_CODE (VALUE_TYPE (arg)) == TYPE_CODE_REF) \
- arg = value_at_lazy (TYPE_TARGET_TYPE (VALUE_TYPE (arg)), \
- unpack_long (VALUE_TYPE (arg), \
- VALUE_CONTENTS (arg))); \
-} while (0)
+do { struct type *value_type_arg_tmp = check_typedef (VALUE_TYPE (arg));\
+ if (TYPE_CODE (value_type_arg_tmp) == TYPE_CODE_REF) \
+ arg = value_at_lazy (TYPE_TARGET_TYPE (value_type_arg_tmp), \
+ unpack_long (VALUE_TYPE (arg), \
+ VALUE_CONTENTS (arg)), \
+ VALUE_BFD_SECTION (arg)); \
+ } while (0)
/* If ARG is an array, convert it to a pointer.
If ARG is an enum, convert it to an integer.
@@ -177,7 +180,7 @@ do { COERCE_REF(arg); \
/* If ARG is an enum, convert it to an integer. */
#define COERCE_ENUM(arg) { \
- if (TYPE_CODE (VALUE_TYPE (arg)) == TYPE_CODE_ENUM) \
+ if (TYPE_CODE (check_typedef (VALUE_TYPE (arg))) == TYPE_CODE_ENUM) \
arg = value_cast (builtin_type_unsigned_int, arg); \
}
@@ -230,9 +233,9 @@ extern value_ptr value_from_longest PARAMS ((struct type *type, LONGEST num));
extern value_ptr value_from_double PARAMS ((struct type *type, DOUBLEST num));
-extern value_ptr value_at PARAMS ((struct type *type, CORE_ADDR addr));
+extern value_ptr value_at PARAMS ((struct type *type, CORE_ADDR addr, asection *sect));
-extern value_ptr value_at_lazy PARAMS ((struct type *type, CORE_ADDR addr));
+extern value_ptr value_at_lazy PARAMS ((struct type *type, CORE_ADDR addr, asection *sect));
extern value_ptr value_from_register PARAMS ((struct type *type, int regnum,
struct frame_info * frame));
@@ -297,6 +300,8 @@ extern value_ptr value_struct_elt_for_reference PARAMS ((struct type *domain,
char *name,
struct type *intype));
+extern value_ptr value_static_field PARAMS ((struct type *type, int fieldno));
+
extern value_ptr value_field PARAMS ((value_ptr arg1, int fieldno));
extern value_ptr value_primitive_field PARAMS ((value_ptr arg1, int offset,
@@ -412,10 +417,16 @@ read_register_gen PARAMS ((int regno, char *myaddr));
extern CORE_ADDR
read_register PARAMS ((int regno));
+extern CORE_ADDR
+read_register_pid PARAMS ((int regno, int pid));
+
extern void
write_register PARAMS ((int regno, LONGEST val));
extern void
+write_register_pid PARAMS ((int regno, LONGEST val, int pid));
+
+extern void
supply_register PARAMS ((int regno, char *val));
extern void
@@ -457,7 +468,7 @@ val_print PARAMS ((struct type *type, char *valaddr, CORE_ADDR address,
int recurse, enum val_prettyprint pretty));
extern int
-val_print_string PARAMS ((CORE_ADDR addr, unsigned int len, GDB_FILE *stream));
+val_print_string PARAMS ((CORE_ADDR addr, int len, int width, GDB_FILE *stream));
extern void
print_variable_value PARAMS ((struct symbol *var, struct frame_info *frame,
@@ -497,4 +508,6 @@ extern value_ptr find_function_in_inferior PARAMS ((char *));
extern value_ptr value_allocate_space_in_inferior PARAMS ((int));
+extern void _initialize_values PARAMS ((void));
+
#endif /* !defined (VALUE_H) */