From 4e38b3864ce96e88108671bd271c71ee461e9404 Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Tue, 17 Jan 2006 22:30:29 +0000 Subject: [PATCH] gdb/ChangeLog: 2006-01-17 Jim Blandy * symtab.h (struct general_symbol_info): Use gdb_byte for value.bytes. * stabsread.c (define_symbol): Use gdb_byte for the buffer holding a floating-point constant's value. * dwarf2read.c (dwarf2_const_value): Remove casts of value buffer to char *. * findvar.c (read_var_value): Eliminate needless temporary. --- gdb/ChangeLog | 8 ++++++++ gdb/dwarf2read.c | 4 ++-- gdb/findvar.c | 4 +--- gdb/stabsread.c | 4 ++-- gdb/symtab.h | 2 +- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 6c55b9e9ba0..5c7dc28bcc7 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,13 @@ 2006-01-17 Jim Blandy + * symtab.h (struct general_symbol_info): Use gdb_byte for + value.bytes. + * stabsread.c (define_symbol): Use gdb_byte for the buffer holding + a floating-point constant's value. + * dwarf2read.c (dwarf2_const_value): Remove casts of value buffer + to char *. + * findvar.c (read_var_value): Eliminate needless temporary. + * dwarf2-frame.c (dwarf2_read_section): Update forward declaration to match prior change to dwarf2_read_section's type. diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index a2a066a1bbf..943f30477f8 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -7053,7 +7053,7 @@ dwarf2_const_value (struct attribute *attr, struct symbol *sym, cu_header->addr_size, TYPE_LENGTH (SYMBOL_TYPE (sym))); - SYMBOL_VALUE_BYTES (sym) = (char *) + SYMBOL_VALUE_BYTES (sym) = obstack_alloc (&objfile->objfile_obstack, cu_header->addr_size); /* NOTE: cagney/2003-05-09: In-lined store_address call with it's body - store_unsigned_integer. */ @@ -7071,7 +7071,7 @@ dwarf2_const_value (struct attribute *attr, struct symbol *sym, blk->size, TYPE_LENGTH (SYMBOL_TYPE (sym))); - SYMBOL_VALUE_BYTES (sym) = (char *) + SYMBOL_VALUE_BYTES (sym) = obstack_alloc (&objfile->objfile_obstack, blk->size); memcpy (SYMBOL_VALUE_BYTES (sym), blk->data, blk->size); SYMBOL_CLASS (sym) = LOC_CONST_BYTES; diff --git a/gdb/findvar.c b/gdb/findvar.c index 7d06085b6b9..0cda35e75ad 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -433,9 +433,7 @@ read_var_value (struct symbol *var, struct frame_info *frame) case LOC_CONST_BYTES: { - char *bytes_addr; - bytes_addr = SYMBOL_VALUE_BYTES (var); - memcpy (value_contents_raw (v), bytes_addr, len); + memcpy (value_contents_raw (v), SYMBOL_VALUE_BYTES (var), len); VALUE_LVAL (v) = not_lval; return v; } diff --git a/gdb/stabsread.c b/gdb/stabsread.c index e346ad285fd..428cbc2e8bf 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -722,7 +722,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, case 'r': { double d = atof (p); - char *dbl_valu; + gdb_byte *dbl_valu; /* FIXME-if-picky-about-floating-accuracy: Should be using target arithmetic to get the value. real.c in GCC @@ -737,7 +737,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type, SYMBOL_TYPE (sym) = lookup_fundamental_type (objfile, FT_DBL_PREC_FLOAT); - dbl_valu = (char *) + dbl_valu = obstack_alloc (&objfile->objfile_obstack, TYPE_LENGTH (SYMBOL_TYPE (sym))); store_typed_floating (dbl_valu, SYMBOL_TYPE (sym), d); diff --git a/gdb/symtab.h b/gdb/symtab.h index 6c17037c416..840478ad5db 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -110,7 +110,7 @@ struct general_symbol_info struct block *block; - char *bytes; + gdb_byte *bytes; CORE_ADDR address; -- 2.30.2