Do not set saved registers from heuristics for a sigtramp frame.
* dwarfread.c (enum_type): Determine signedness of enum type
from enumerators.
* mips-tdep.c: Include gdb_string.h, gcc -Wall lint.
* rs6000-nat.c (xcoff_relocate_core): Fix typo.
* valops.c (value_repeat): Fix length of memory transfer to
match recent allocate_repeat_value change.
+Sat Oct 21 06:11:49 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * alpha-tdep.c, mips-tdep.c (init_extra_frame_info):
+ Do not set saved registers from heuristics for a sigtramp frame.
+
+ * dwarfread.c (enum_type): Determine signedness of enum type
+ from enumerators.
+
+ * mips-tdep.c: Include gdb_string.h, gcc -Wall lint.
+
+ * rs6000-nat.c (xcoff_relocate_core): Fix typo.
+
+ * valops.c (value_repeat): Fix length of memory transfer to
+ match recent allocate_repeat_value change.
+
+Thu Oct 19 19:04:35 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * gdbtypes.c (get_discrete_bounds): Fix typo.
+
Thu Oct 19 12:15:37 1995 Stan Shebs <shebs@andros.cygnus.com>
* defs.h (SEEK_SET, SEEK_CUR): Add default definitions.
* irix5-nat.c (solib_add): Update the to_sections and
to_sections_end fields in core_ops here if needed.
* osfsolib.c (solib_add): Likewise.
- * rs6000-nat.c (xcoff_reload_core): Likewise.
+ * rs6000-nat.c (xcoff_relocate_core): Likewise.
* solib.c (solib_add): Likewise.
* somsolib.c (solib_add): Likewise.
Thu Oct 5 17:28:09 1995 Per Bothner <bothner@kalessin.cygnus.com>
- * values.c allocate_repeat_value): Allocate an array type, and
+ * values.c (allocate_repeat_value): Allocate an array type, and
a value of that type; use that instead of setting VALUE_REPEATED.
* value.h (struct value): Remove fields repetitions and repeated.
(VALUE_REPEATED, VALUE_REPETITIONS): Removed, no longer used.
} *linked_proc_desc_table = NULL;
\f
-/* Guaranteed to set fci->saved_regs to some values (it never leaves it
+/* Guaranteed to set frame->saved_regs to some values (it never leaves it
NULL). */
void
if (proc_desc == &temp_proc_desc)
{
- frame->saved_regs = (struct frame_saved_regs*)
- obstack_alloc (&frame_cache_obstack,
- sizeof (struct frame_saved_regs));
- *frame->saved_regs = temp_saved_regs;
- frame->saved_regs->regs[PC_REGNUM] = frame->saved_regs->regs[RA_REGNUM];
+ char *name;
+
+ /* Do not set the saved registers for a sigtramp frame,
+ alpha_find_saved_registers will do that for us.
+ We can't use frame->signal_handler_caller, it is not yet set. */
+ find_pc_partial_function (frame->pc, &name,
+ (CORE_ADDR *)NULL,(CORE_ADDR *)NULL);
+ if (!IN_SIGTRAMP (frame->pc, name))
+ {
+ frame->saved_regs = (struct frame_saved_regs*)
+ obstack_alloc (&frame_cache_obstack,
+ sizeof (struct frame_saved_regs));
+ *frame->saved_regs = temp_saved_regs;
+ frame->saved_regs->regs[PC_REGNUM]
+ = frame->saved_regs->regs[RA_REGNUM];
+ }
}
}
}
unsigned short blocksz;
struct symbol *sym;
int nbytes;
+ int unsigned_enum = 1;
if ((type = lookup_utype (dip -> die_ref)) == NULL)
{
SYMBOL_CLASS (sym) = LOC_CONST;
SYMBOL_TYPE (sym) = type;
SYMBOL_VALUE (sym) = list -> field.bitpos;
+ if (SYMBOL_VALUE (sym) < 0)
+ unsigned_enum = 0;
add_symbol_to_list (sym, list_in_scope);
}
/* Now create the vector of fields, and record how big it is. This is
vector. */
if (nfields > 0)
{
+ if (unsigned_enum)
+ TYPE_FLAGS (type) |= TYPE_FLAG_UNSIGNED;
TYPE_NFIELDS (type) = nfields;
TYPE_FIELDS (type) = (struct field *)
obstack_alloc (&objfile->symbol_obstack, sizeof (struct field) * nfields);
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h"
+#include "gdb_string.h"
#include "frame.h"
#include "inferior.h"
#include "symtab.h"
if (proc_desc == &temp_proc_desc)
{
- fci->saved_regs = (struct frame_saved_regs*)
- obstack_alloc (&frame_cache_obstack,
- sizeof (struct frame_saved_regs));
- *fci->saved_regs = temp_saved_regs;
- fci->saved_regs->regs[PC_REGNUM] = fci->saved_regs->regs[RA_REGNUM];
+ char *name;
+
+ /* Do not set the saved registers for a sigtramp frame,
+ mips_find_saved_registers will do that for us.
+ We can't use fci->signal_handler_caller, it is not yet set. */
+ find_pc_partial_function (fci->pc, &name,
+ (CORE_ADDR *)NULL,(CORE_ADDR *)NULL);
+ if (!IN_SIGTRAMP (fci->pc, name))
+ {
+ fci->saved_regs = (struct frame_saved_regs*)
+ obstack_alloc (&frame_cache_obstack,
+ sizeof (struct frame_saved_regs));
+ *fci->saved_regs = temp_saved_regs;
+ fci->saved_regs->regs[PC_REGNUM]
+ = fci->saved_regs->regs[RA_REGNUM];
+ }
}
/* hack: if argument regs are saved, guess these contain args */
}
else
{
- int did_newline;
+ int did_newline = 0;
for (regnum = 0; regnum < NUM_REGS; )
{
/* We must update the to_sections field in the core_ops structure
now to avoid dangling pointer dereferences. */
- update_coreops = core_ops.to_sections === target->to_sections;
+ update_coreops = core_ops.to_sections == target->to_sections;
count = target->to_sections_end - target->to_sections;
count += 2;
#define VALUE_SUBSTRING_START(VAL) VALUE_FRAME(VAL)
\f
-/* Allocate NBYTES of space in the inferior using the inferior's malloc
- and return a value that is a pointer to the allocated space. */
+/* Find the address of function name NAME in the inferior. */
-static CORE_ADDR
-allocate_space_in_inferior (len)
- int len;
+value_ptr
+find_function_in_inferior (name)
+ char *name;
{
- register value_ptr val;
register struct symbol *sym;
- struct minimal_symbol *msymbol;
- struct type *type;
- value_ptr blocklen;
- LONGEST maddr;
-
- /* Find the address of malloc in the inferior. */
-
- sym = lookup_symbol ("malloc", 0, VAR_NAMESPACE, 0, NULL);
+ sym = lookup_symbol (name, 0, VAR_NAMESPACE, 0, NULL);
if (sym != NULL)
{
if (SYMBOL_CLASS (sym) != LOC_BLOCK)
{
- error ("\"malloc\" exists in this program but is not a function.");
+ error ("\"%s\" exists in this program but is not a function.",
+ name);
}
- val = value_of_variable (sym, NULL);
+ return value_of_variable (sym, NULL);
}
else
{
- msymbol = lookup_minimal_symbol ("malloc", NULL, NULL);
+ struct minimal_symbol *msymbol = lookup_minimal_symbol(name, NULL, NULL);
if (msymbol != NULL)
{
+ struct type *type;
+ LONGEST maddr;
type = lookup_pointer_type (builtin_type_char);
type = lookup_function_type (type);
type = lookup_pointer_type (type);
maddr = (LONGEST) SYMBOL_VALUE_ADDRESS (msymbol);
- val = value_from_longest (type, maddr);
+ return value_from_longest (type, maddr);
}
else
{
- error ("evaluation of this expression requires the program to have a function \"malloc\".");
+ error ("evaluation of this expression requires the program to have a function \"%s\".", name);
}
}
+}
+
+/* Allocate NBYTES of space in the inferior using the inferior's malloc
+ and return a value that is a pointer to the allocated space. */
+
+value_ptr
+value_allocate_space_in_inferior (len)
+ int len;
+{
+ value_ptr blocklen;
+ register value_ptr val = find_function_in_inferior ("malloc");
blocklen = value_from_longest (builtin_type_int, (LONGEST) len);
val = call_function_by_hand (val, 1, &blocklen);
{
error ("No memory available to program.");
}
- return (value_as_long (val));
+ return val;
+}
+
+static CORE_ADDR
+allocate_space_in_inferior (len)
+ int len;
+{
+ return value_as_long (value_allocate_space_in_inferior (len));
}
/* Cast value ARG2 to type TYPE and return as a value.
}
if (current_language->c_style_arrays
- && (VALUE_REPEATED (arg2)
- || TYPE_CODE (VALUE_TYPE (arg2)) == TYPE_CODE_ARRAY))
+ && TYPE_CODE (VALUE_TYPE (arg2)) == TYPE_CODE_ARRAY)
arg2 = value_coerce_array (arg2);
if (TYPE_CODE (VALUE_TYPE (arg2)) == TYPE_CODE_FUNC)
error ("Only values in memory can be extended with '@'.");
if (count < 1)
error ("Invalid number %d of repetitions.", count);
- if (VALUE_REPEATED (arg1))
- error ("Cannot create artificial arrays of artificial arrays.");
val = allocate_repeat_value (VALUE_TYPE (arg1), count);
read_memory (VALUE_ADDRESS (arg1) + VALUE_OFFSET (arg1),
VALUE_CONTENTS_RAW (val),
- TYPE_LENGTH (VALUE_TYPE (val)) * count);
+ TYPE_LENGTH (VALUE_TYPE (val)));
VALUE_LVAL (val) = lval_memory;
VALUE_ADDRESS (val) = VALUE_ADDRESS (arg1) + VALUE_OFFSET (arg1);
#if 1 /* FIXME: This is only a temporary patch. -fnf */
if (current_language->c_style_arrays
- && (VALUE_REPEATED (arg)
- || TYPE_CODE (VALUE_TYPE (arg)) == TYPE_CODE_ARRAY))
+ && TYPE_CODE (VALUE_TYPE (arg)) == TYPE_CODE_ARRAY)
arg = value_coerce_array (arg);
#endif
/* We should be doing hairy argument matching, as below. */
&& (TYPE_CODE (TYPE_TARGET_TYPE (tt1)) == TYPE_CODE (tt2)))
{
- if (TYPE_CODE (tt2) == TYPE_CODE_ARRAY || VALUE_REPEATED (t2[i]))
+ if (TYPE_CODE (tt2) == TYPE_CODE_ARRAY)
t2[i] = value_coerce_array (t2[i]);
else
t2[i] = value_addr (t2[i]);