2005-04-28 Andrew Cagney <cagney@gnu.org>
* valops.c (check_field): Make buffer a bfd_byte. * value.c (unpack_long, unpack_double, unpack_pointer) (unpack_field_as_long, modify_field): Ditto. * value.h: Update declarations.
This commit is contained in:
parent
cade9e545b
commit
8929e59d3f
4 changed files with 23 additions and 14 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2005-04-28 Andrew Cagney <cagney@gnu.org>
|
||||||
|
|
||||||
|
* valops.c (check_field): Make buffer a bfd_byte.
|
||||||
|
* value.c (unpack_long, unpack_double, unpack_pointer)
|
||||||
|
(unpack_field_as_long, modify_field): Ditto.
|
||||||
|
* value.h: Update declarations.
|
||||||
|
|
||||||
2005-04-28 Paul Brook <paul@codesourcery.com>
|
2005-04-28 Paul Brook <paul@codesourcery.com>
|
||||||
|
|
||||||
* exceptions.c (print_flush): Handle NULL gdb_stdout_serial.
|
* exceptions.c (print_flush): Handle NULL gdb_stdout_serial.
|
||||||
|
|
|
@ -2317,7 +2317,7 @@ check_field_in (struct type *type, const char *name)
|
||||||
target structure/union is defined, otherwise, return 0. */
|
target structure/union is defined, otherwise, return 0. */
|
||||||
|
|
||||||
int
|
int
|
||||||
check_field (struct value *arg1, const char *name)
|
check_field (struct value *arg1, const bfd_byte *name)
|
||||||
{
|
{
|
||||||
struct type *t;
|
struct type *t;
|
||||||
|
|
||||||
|
|
10
gdb/value.c
10
gdb/value.c
|
@ -996,7 +996,7 @@ value_as_address (struct value *val)
|
||||||
to an INT (or some size). After all, it is only an offset. */
|
to an INT (or some size). After all, it is only an offset. */
|
||||||
|
|
||||||
LONGEST
|
LONGEST
|
||||||
unpack_long (struct type *type, const char *valaddr)
|
unpack_long (struct type *type, const bfd_byte *valaddr)
|
||||||
{
|
{
|
||||||
enum type_code code = TYPE_CODE (type);
|
enum type_code code = TYPE_CODE (type);
|
||||||
int len = TYPE_LENGTH (type);
|
int len = TYPE_LENGTH (type);
|
||||||
|
@ -1045,7 +1045,7 @@ unpack_long (struct type *type, const char *valaddr)
|
||||||
format, result is in host format. */
|
format, result is in host format. */
|
||||||
|
|
||||||
DOUBLEST
|
DOUBLEST
|
||||||
unpack_double (struct type *type, const char *valaddr, int *invp)
|
unpack_double (struct type *type, const bfd_byte *valaddr, int *invp)
|
||||||
{
|
{
|
||||||
enum type_code code;
|
enum type_code code;
|
||||||
int len;
|
int len;
|
||||||
|
@ -1109,7 +1109,7 @@ unpack_double (struct type *type, const char *valaddr, int *invp)
|
||||||
to an INT (or some size). After all, it is only an offset. */
|
to an INT (or some size). After all, it is only an offset. */
|
||||||
|
|
||||||
CORE_ADDR
|
CORE_ADDR
|
||||||
unpack_pointer (struct type *type, const char *valaddr)
|
unpack_pointer (struct type *type, const bfd_byte *valaddr)
|
||||||
{
|
{
|
||||||
/* Assume a CORE_ADDR can fit in a LONGEST (for now). Not sure
|
/* Assume a CORE_ADDR can fit in a LONGEST (for now). Not sure
|
||||||
whether we want this to be true eventually. */
|
whether we want this to be true eventually. */
|
||||||
|
@ -1359,7 +1359,7 @@ value_fn_field (struct value **arg1p, struct fn_field *f, int j, struct type *ty
|
||||||
If the field is signed, we also do sign extension. */
|
If the field is signed, we also do sign extension. */
|
||||||
|
|
||||||
LONGEST
|
LONGEST
|
||||||
unpack_field_as_long (struct type *type, const char *valaddr, int fieldno)
|
unpack_field_as_long (struct type *type, const bfd_byte *valaddr, int fieldno)
|
||||||
{
|
{
|
||||||
ULONGEST val;
|
ULONGEST val;
|
||||||
ULONGEST valmask;
|
ULONGEST valmask;
|
||||||
|
@ -1406,7 +1406,7 @@ unpack_field_as_long (struct type *type, const char *valaddr, int fieldno)
|
||||||
0 <= BITPOS, where lbits is the size of a LONGEST in bits. */
|
0 <= BITPOS, where lbits is the size of a LONGEST in bits. */
|
||||||
|
|
||||||
void
|
void
|
||||||
modify_field (char *addr, LONGEST fieldval, int bitpos, int bitsize)
|
modify_field (bfd_byte *addr, LONGEST fieldval, int bitpos, int bitsize)
|
||||||
{
|
{
|
||||||
ULONGEST oword;
|
ULONGEST oword;
|
||||||
ULONGEST mask = (ULONGEST) -1 >> (8 * sizeof (ULONGEST) - bitsize);
|
ULONGEST mask = (ULONGEST) -1 >> (8 * sizeof (ULONGEST) - bitsize);
|
||||||
|
|
18
gdb/value.h
18
gdb/value.h
|
@ -262,11 +262,12 @@ extern LONGEST value_as_long (struct value *val);
|
||||||
extern DOUBLEST value_as_double (struct value *val);
|
extern DOUBLEST value_as_double (struct value *val);
|
||||||
extern CORE_ADDR value_as_address (struct value *val);
|
extern CORE_ADDR value_as_address (struct value *val);
|
||||||
|
|
||||||
extern LONGEST unpack_long (struct type *type, const char *valaddr);
|
extern LONGEST unpack_long (struct type *type, const bfd_byte *valaddr);
|
||||||
extern DOUBLEST unpack_double (struct type *type, const char *valaddr,
|
extern DOUBLEST unpack_double (struct type *type, const bfd_byte *valaddr,
|
||||||
int *invp);
|
int *invp);
|
||||||
extern CORE_ADDR unpack_pointer (struct type *type, const char *valaddr);
|
extern CORE_ADDR unpack_pointer (struct type *type, const bfd_byte *valaddr);
|
||||||
extern LONGEST unpack_field_as_long (struct type *type, const char *valaddr,
|
extern LONGEST unpack_field_as_long (struct type *type,
|
||||||
|
const bfd_byte *valaddr,
|
||||||
int fieldno);
|
int fieldno);
|
||||||
|
|
||||||
extern struct value *value_from_longest (struct type *type, LONGEST num);
|
extern struct value *value_from_longest (struct type *type, LONGEST num);
|
||||||
|
@ -451,14 +452,15 @@ extern void release_value (struct value *val);
|
||||||
|
|
||||||
extern int record_latest_value (struct value *val);
|
extern int record_latest_value (struct value *val);
|
||||||
|
|
||||||
extern void modify_field (char *addr, LONGEST fieldval, int bitpos,
|
extern void modify_field (bfd_byte *addr, LONGEST fieldval, int bitpos,
|
||||||
int bitsize);
|
int bitsize);
|
||||||
|
|
||||||
extern void type_print (struct type *type, char *varstring,
|
extern void type_print (struct type *type, char *varstring,
|
||||||
struct ui_file *stream, int show);
|
struct ui_file *stream, int show);
|
||||||
|
|
||||||
extern char *baseclass_addr (struct type *type, int index, char *valaddr,
|
extern bfd_byte *baseclass_addr (struct type *type, int index,
|
||||||
struct value **valuep, int *errp);
|
bfd_byte *valaddr,
|
||||||
|
struct value **valuep, int *errp);
|
||||||
|
|
||||||
extern void print_longest (struct ui_file *stream, int format,
|
extern void print_longest (struct ui_file *stream, int format,
|
||||||
int use_local, LONGEST val);
|
int use_local, LONGEST val);
|
||||||
|
@ -493,7 +495,7 @@ extern void print_variable_value (struct symbol *var,
|
||||||
struct frame_info *frame,
|
struct frame_info *frame,
|
||||||
struct ui_file *stream);
|
struct ui_file *stream);
|
||||||
|
|
||||||
extern int check_field (struct value *, const char *);
|
extern int check_field (struct value *, const bfd_byte *);
|
||||||
|
|
||||||
extern void typedef_print (struct type *type, struct symbol *news,
|
extern void typedef_print (struct type *type, struct symbol *news,
|
||||||
struct ui_file *stream);
|
struct ui_file *stream);
|
||||||
|
|
Loading…
Reference in a new issue