* valarith.c: White space.
* valops.c: White space.
* valprint.c: White space.
* value.c: White space.
* varobj.c: White space.
* xcoffread.c: White space.
* xml-support.c: White space.
* xml-tdesc.c: White space.
+2010-05-17 Michael Snyder <msnyder@vmware.com>
+
+ * valarith.c: White space.
+ * valops.c: White space.
+ * valprint.c: White space.
+ * value.c: White space.
+ * varobj.c: White space.
+ * xcoffread.c: White space.
+ * xml-support.c: White space.
+ * xml-tdesc.c: White space.
+
2010-05-17 Andreas Schwab <schwab@redhat.com>
PR gdb/11092
{
struct type *range_type = TYPE_INDEX_TYPE (tarray);
LONGEST lowerbound, upperbound;
- get_discrete_bounds (range_type, &lowerbound, &upperbound);
+ get_discrete_bounds (range_type, &lowerbound, &upperbound);
if (VALUE_LVAL (array) != lval_memory)
return value_subscripted_rvalue (array, index, lowerbound);
unop_user_defined_p (enum exp_opcode op, struct value *arg1)
{
struct type *type1;
+
if (op == UNOP_ADDR)
return 0;
type1 = check_typedef (value_type (arg1));
if (noside == EVAL_AVOID_SIDE_EFFECTS)
{
struct type *return_type;
+
return_type
= TYPE_TARGET_TYPE (check_typedef (value_type (argvec[0])));
return value_zero (return_type, VALUE_LVAL (arg1));
if (noside == EVAL_AVOID_SIDE_EFFECTS)
{
struct type *return_type;
+
return_type
= TYPE_TARGET_TYPE (check_typedef (value_type (argvec[0])));
return value_zero (return_type, VALUE_LVAL (arg1));
if (TYPE_CODE (type2) == TYPE_CODE_INT)
{
struct type *tmp = type1;
+
type1 = tmp;
tmp = type2;
inval1 = arg2;
if (TYPE_CODE (type2) == TYPE_CODE_CHAR)
{
char_type = type2;
+
inchar = (char) unpack_long (type2,
value_contents (inval2));
for (idx = 0; idx < count; idx++)
else
{
char_type = TYPE_TARGET_TYPE (type2);
+
for (idx = 0; idx < count; idx++)
{
memcpy (ptr + (idx * inval2len), value_contents (inval2),
if (TYPE_CODE (type1) == TYPE_CODE_CHAR)
{
char_type = type1;
+
*ptr = (char) unpack_long (type1, value_contents (inval1));
}
else
{
char_type = TYPE_TARGET_TYPE (type1);
+
memcpy (ptr, value_contents (inval1), inval1len);
}
if (TYPE_CODE (type2) == TYPE_CODE_CHAR)
in target format. real.c in GCC probably has the necessary
code. */
DOUBLEST v1, v2, v = 0;
+
v1 = value_as_double (arg1);
v2 = value_as_double (arg2);
|| TYPE_CODE (type2) == TYPE_CODE_BOOL)
{
LONGEST v1, v2, v = 0;
+
v1 = value_as_long (arg1);
v2 = value_as_long (arg2);
{
LONGEST v2_signed = value_as_long (arg2);
ULONGEST v1, v2, v = 0;
+
v1 = (ULONGEST) value_as_long (arg1);
v2 = (ULONGEST) v2_signed;
else
{
LONGEST v1, v2, v = 0;
+
v1 = value_as_long (arg1);
v2 = value_as_long (arg2);
/* NOTE: kettenis/20050816: Avoid compiler bug on systems where
`long double' values are returned in static storage (m68k). */
DOUBLEST d = value_as_double (arg1);
+
return d == value_as_double (arg2);
}
else if ((code1 == TYPE_CODE_DECFLOAT || is_int1)
/* NOTE: kettenis/20050816: Avoid compiler bug on systems where
`long double' values are returned in static storage (m68k). */
DOUBLEST d = value_as_double (arg1);
+
return d < value_as_double (arg2);
}
else if ((code1 == TYPE_CODE_DECFLOAT || is_int1)
LONGEST word;
unsigned rel_index;
struct type *range = TYPE_INDEX_TYPE (type);
+
if (get_discrete_bounds (range, &low_bound, &high_bound) < 0)
return -2;
if (index < low_bound || index > high_bound)
int member;
struct type *settype = check_typedef (value_type (set));
struct type *eltype = check_typedef (value_type (element));
+
if (TYPE_CODE (eltype) == TYPE_CODE_RANGE)
eltype = TYPE_TARGET_TYPE (eltype);
if (TYPE_CODE (settype) != TYPE_CODE_SET)
find_function_in_inferior (const char *name, struct objfile **objf_p)
{
struct symbol *sym;
+
sym = lookup_symbol (name, 0, VAR_DOMAIN, 0);
if (sym != NULL)
{
{
struct minimal_symbol *msymbol =
lookup_minimal_symbol (name, NULL, NULL);
+
if (msymbol != NULL)
{
struct objfile *objfile = msymbol_objfile (msymbol);
{
/* Downcasting is possible (t1 is superclass of v2). */
CORE_ADDR addr2 = value_address (v2);
+
addr2 -= value_address (v) + value_embedded_offset (v);
return value_at (type, addr2);
}
if (v2)
{
struct value *v = value_addr (v2);
+
deprecated_set_value_type (v, type);
return v;
}
struct type *t1 = check_typedef (type);
struct type *dereftype = check_typedef (TYPE_TARGET_TYPE (t1));
struct value *val = value_cast (dereftype, arg2);
+
return value_ref (val);
}
{
struct type *element_type = TYPE_TARGET_TYPE (type);
unsigned element_length = TYPE_LENGTH (check_typedef (element_type));
+
if (element_length > 0 && TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type))
{
struct type *range_type = TYPE_INDEX_TYPE (type);
int val_length = TYPE_LENGTH (type2);
LONGEST low_bound, high_bound, new_length;
+
if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0)
low_bound = 0, high_bound = 0;
new_length = val_length / element_length;
&& TYPE_NAME (type) != 0)
{
struct value *v = value_cast_structs (type, arg2);
+
if (v)
return v;
}
pointers and four byte addresses. */
int addr_bit = gdbarch_addr_bit (get_type_arch (type2));
-
LONGEST longest = value_as_long (arg2);
+
if (addr_bit < sizeof (LONGEST) * HOST_CHAR_BIT)
{
if (longest >= ((LONGEST) 1 << addr_bit)
&& value_as_long (arg2) == 0)
{
struct value *result = allocate_value (type);
+
cplus_make_method_ptr (type, value_contents_writeable (result), 0, 0);
return result;
}
for (i = 0; i < TYPE_N_BASECLASSES (search_type) && result_count < 2; ++i)
{
int offset = baseclass_offset (search_type, i, contents, address);
+
if (offset == -1)
error (_("virtual baseclass botch"));
if (class_types_same_p (desired_type, TYPE_BASECLASS (search_type, i)))
value_zero (struct type *type, enum lval_type lv)
{
struct value *val = allocate_value (type);
- VALUE_LVAL (val) = lv;
+ VALUE_LVAL (val) = lv;
return val;
}
{
enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type));
gdb_byte v[16];
+
decimal_from_string (v, TYPE_LENGTH (type), byte_order, "1");
val = value_from_decfloat (type, v);
}
value_bitpos (val),
value_bitsize (val));
int length = TYPE_LENGTH (type);
+
store_signed_integer (value_contents_raw (val), length, byte_order, num);
}
else if (VALUE_LVAL (val) == lval_memory)
if (value_bitsize (toval))
{
struct value *parent = value_parent (toval);
- changed_addr = value_address (parent) + value_offset (toval);
+ changed_addr = value_address (parent) + value_offset (toval);
changed_len = (value_bitpos (toval)
+ value_bitsize (toval)
+ HOST_CHAR_BIT - 1)
{
struct frame_info *fi = frame_find_by_id (old_frame);
+
if (fi != NULL)
select_frame (fi);
}
|| TYPE_CODE (type) == TYPE_CODE_FUNC)
{
CORE_ADDR addr = value_address (val);
+
return value_from_pointer (lookup_pointer_type (type), addr);
}
value_addr (struct value *arg1)
{
struct value *arg2;
-
struct type *type = check_typedef (value_type (arg1));
+
if (TYPE_CODE (type) == TYPE_CODE_REF)
{
/* Copy the value, but change the type from (T&) to (T*). We
value_ref (struct value *arg1)
{
struct value *arg2;
-
struct type *type = check_typedef (value_type (arg1));
+
if (TYPE_CODE (type) == TYPE_CODE_REF)
return arg1;
if (TYPE_CODE (base_type) == TYPE_CODE_PTR)
{
struct type *enc_type;
+
/* We may be pointing to something embedded in a larger object.
Get the real type of the enclosing object. */
enc_type = check_typedef (value_enclosing_type (arg1));
struct type *domain_type
= create_range_type (NULL, index_type, 0, len - 1);
struct type *type = create_set_type (NULL, domain_type);
+
TYPE_CODE (type) = TYPE_CODE_BITSTRING;
val = allocate_value (type);
memcpy (value_contents_raw (val), ptr, TYPE_LENGTH (type));
if (t_field_name && (strcmp_iw (t_field_name, name) == 0))
{
struct value *v;
+
if (field_is_static (&TYPE_FIELD (type, i)))
{
v = value_static_field (type, i);
&& (strcmp_iw (t_field_name, "else") == 0))))
{
struct type *field_type = TYPE_FIELD_TYPE (type, i);
+
if (TYPE_CODE (field_type) == TYPE_CODE_UNION
|| TYPE_CODE (field_type) == TYPE_CODE_STRUCT)
{
for (i = TYPE_NFN_FIELDS (type) - 1; i >= 0; i--)
{
char *t_field_name = TYPE_FN_FIELDLIST_NAME (type, i);
+
/* FIXME! May need to check for ARM demangling here */
if (strncmp (t_field_name, "__", 2) == 0 ||
strncmp (t_field_name, "op", 2) == 0 ||
{
int j = TYPE_FN_FIELDLIST_LENGTH (type, i) - 1;
struct fn_field *f = TYPE_FN_FIELDLIST1 (type, i);
- name_matched = 1;
+ name_matched = 1;
check_stub_method_group (type, i);
if (j > 0 && args == 0)
error (_("cannot resolve overloaded method `%s': no arguments supplied"), name);
if (offset < 0 || offset >= TYPE_LENGTH (type))
{
gdb_byte *tmp = alloca (TYPE_LENGTH (baseclass));
+
if (target_read_memory (value_address (*arg1p) + offset,
tmp, TYPE_LENGTH (baseclass)) != 0)
error (_("virtual baseclass botch"));
{
/* pai: FIXME What about operators and type conversions? */
char *fn_field_name = TYPE_FN_FIELDLIST_NAME (type, i);
+
if (fn_field_name && (strcmp_iw (fn_field_name, method) == 0))
{
int len = TYPE_FN_FIELDLIST_LENGTH (type, i);
for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--)
{
int base_offset;
+
if (BASETYPE_VIA_VIRTUAL (type, i))
{
base_offset = value_offset (*argp) + offset;
{
struct type *temp_type = check_typedef (value_type (temp));
struct type *obj_type = check_typedef (value_type (*objp));
+
if (TYPE_CODE (temp_type) != TYPE_CODE_PTR
&& (TYPE_CODE (obj_type) == TYPE_CODE_PTR
|| TYPE_CODE (obj_type) == TYPE_CODE_REF))
for (i = TYPE_NFIELDS (type) - 1; i >= TYPE_N_BASECLASSES (type); i--)
{
char *t_field_name = TYPE_FIELD_NAME (type, i);
+
if (t_field_name && (strcmp_iw (t_field_name, name) == 0))
return 1;
}
if ((TYPE_NFIELDS (t1) - start) == TYPE_NFIELDS (t2))
{
int i;
+
for (i = 0; i < TYPE_NFIELDS (t2); ++i)
{
if (rank_one_type (TYPE_FIELD_TYPE (t1, start + i),
struct symbol *s =
lookup_symbol (TYPE_FN_FIELD_PHYSNAME (f, j),
0, VAR_DOMAIN, 0);
+
if (s == NULL)
return NULL;
struct symbol *s =
lookup_symbol (TYPE_FN_FIELD_PHYSNAME (f, j),
0, VAR_DOMAIN, 0);
+
if (s == NULL)
return NULL;
int element = value_bit_index (array_type,
value_contents (array),
lowbound + i);
+
if (element < 0)
error (_("internal error accessing bitstring"));
else if (element > 0)
{
int j = i % TARGET_CHAR_BIT;
+
if (gdbarch_bits_big_endian (get_type_arch (array_type)))
j = TARGET_CHAR_BIT - 1 - j;
value_contents_raw (slice)[i / TARGET_CHAR_BIT] |= (1 << j);
value_address (val),
stream, 0, options,
current_language);
+
if (r)
return r;
}
else
{
long low, hi;
+
if (get_array_bounds (type, &low, &hi))
len = hi - low + 1;
else
allocate_value (struct type *type)
{
struct value *val = allocate_value_lazy (type);
+
allocate_value_contents (val);
val->lazy = 0;
return val;
done with it. */
struct type *array_type
= lookup_array_range_type (type, low_bound, count + low_bound - 1);
+
return allocate_value (array_type);
}
void *closure)
{
struct value *v = allocate_value (type);
+
VALUE_LVAL (v) = lval_computed;
v->location.computed.funcs = funcs;
v->location.computed.closure = closure;
if (i == 0)
{
struct value_history_chunk *new
- = (struct value_history_chunk *)
+ = (struct value_history_chunk *)
+
xmalloc (sizeof (struct value_history_chunk));
memset (new->values, 0, sizeof new->values);
new->next = value_history_chain;
for (i = num; i < num + 10 && i <= value_history_count; i++)
{
struct value_print_options opts;
+
val = access_value_history (i);
printf_filtered (("$%d = "), i);
get_user_print_options (&opts);
create_internalvar (const char *name)
{
struct internalvar *var;
+
var = (struct internalvar *) xmalloc (sizeof (struct internalvar));
var->name = concat (name, (char *)NULL);
var->kind = INTERNALVAR_VOID;
create_internalvar_type_lazy (char *name, internalvar_make_value fun)
{
struct internalvar *var = create_internalvar (name);
+
var->kind = INTERNALVAR_MAKE_VALUE;
var->u.make_value = fun;
return var;
internal_function_fn handler, void *cookie)
{
struct internal_function *ifn = XNEW (struct internal_function);
+
ifn->name = xstrdup (name);
ifn->handler = handler;
ifn->cookie = cookie;
else
{
char *phys_name = TYPE_FIELD_STATIC_PHYSNAME (type, fieldno);
- /*TYPE_FIELD_NAME (type, fieldno);*/
+ /*TYPE_FIELD_NAME (type, fieldno);*/
struct symbol *sym = lookup_symbol (phys_name, 0, VAR_DOMAIN, 0);
if (sym == NULL)
{
- /* With some compilers, e.g. HP aCC, static data members are reported
- as non-debuggable symbols */
- struct minimal_symbol *msym = lookup_minimal_symbol (phys_name, NULL, NULL);
+ /* With some compilers, e.g. HP aCC, static data members are
+ reported as non-debuggable symbols */
+ struct minimal_symbol *msym = lookup_minimal_symbol (phys_name,
+ NULL, NULL);
+
if (!msym)
return NULL;
else
struct value *val = allocate_value (type);
pack_long (value_contents_raw (val), type, num);
-
return val;
}
value_from_pointer (struct type *type, CORE_ADDR addr)
{
struct value *val = allocate_value (type);
+
store_typed_address (value_contents_raw (val), check_typedef (type), addr);
return val;
}
CORE_ADDR address)
{
struct value *v = allocate_value (type);
+
if (valaddr == NULL)
set_value_lazy (v, 1);
else
struct value *val = allocate_value (type);
memcpy (value_contents_raw (val), dec, TYPE_LENGTH (type));
-
return val;
}
coerce_ref (struct value *arg)
{
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_pointer (value_type (arg),
comparing it against our argument. */
CORE_ADDR frame_base = get_frame_base_address (frame);
int addr_bit = gdbarch_addr_bit (get_frame_arch (frame));
+
if (addr_bit < (sizeof (CORE_ADDR) * HOST_CHAR_BIT))
frame_base &= ((CORE_ADDR) 1 << addr_bit) - 1;
/* Error getting the value. Try to at least get the
right type. */
struct value *type_only_value = evaluate_type (var->root->exp);
+
var->type = value_type (type_only_value);
}
else
{
/* There's no child yet. */
struct varobj *child = varobj_add_child (var, name, value);
+
if (new)
{
VEC_safe_push (varobj_p, *new, child);
else
{
varobj_p existing = VEC_index (varobj_p, var->children, index);
+
if (install_new_value (existing, value, 0))
{
if (changed)
if (i < VEC_length (varobj_p, var->children))
{
int j;
+
*cchanged = 1;
for (j = i; j < VEC_length (varobj_p, var->children); ++j)
varobj_delete (VEC_index (varobj_p, var->children, j), NULL, 0);
varobj_p v = create_child_with_value (var,
VEC_length (varobj_p, var->children),
name, value);
+
VEC_safe_push (varobj_p, var->children, v);
return v;
}
{
struct varobj *parent = var->parent;
int frozen = var->frozen;
+
for (; !frozen && parent; parent = parent->parent)
frozen |= parent->frozen;
if (!(*varp)->root->is_valid)
{
varobj_update_result r = {0};
+
r.varobj = *varp;
r.status = VAROBJ_INVALID;
VEC_safe_push (varobj_update_result, result, &r);
if ((*varp)->root->rootvar == *varp)
{
varobj_update_result r = {0};
+
r.varobj = *varp;
r.status = VAROBJ_IN_SCOPE;
else
{
varobj_update_result r = {0};
+
r.varobj = *varp;
VEC_safe_push (varobj_update_result, stack, &r);
}
{
varobj_p tmp = VEC_index (varobj_p, changed, i);
varobj_update_result r = {0};
+
r.varobj = tmp;
r.changed = 1;
r.value_installed = 1;
for (i = VEC_length (varobj_p, unchanged) - 1; i >= 0; --i)
{
varobj_p tmp = VEC_index (varobj_p, unchanged, i);
+
if (!tmp->frozen)
{
varobj_update_result r = {0};
+
r.varobj = tmp;
r.value_installed = 1;
VEC_safe_push (varobj_update_result, stack, &r);
for (i = VEC_length (varobj_p, v->children)-1; i >= 0; --i)
{
varobj_p c = VEC_index (varobj_p, v->children, i);
+
/* Child may be NULL if explicitly deleted by -var-delete. */
if (c != NULL && !c->frozen)
{
varobj_update_result r = {0};
+
r.varobj = c;
VEC_safe_push (varobj_update_result, stack, &r);
}
for (i = 0; i < VEC_length (varobj_p, var->children); ++i)
{
varobj_p child = VEC_index (varobj_p, var->children, i);
+
if (!child)
continue;
if (!remove_from_parent_p)
new_root_variable (void)
{
struct varobj *var = new_variable ();
+
var->root = (struct varobj_root *) xmalloc (sizeof (struct varobj_root));;
var->root->lang = NULL;
var->root->exp = NULL;
get_type (struct varobj *var)
{
struct type *type;
- type = var->type;
+ type = var->type;
if (type != NULL)
type = check_typedef (type);
correct in other frames, so update the expression. */
struct expression *tmp_exp = var->root->exp;
+
var->root->exp = tmp_var->root->exp;
tmp_var->root->exp = tmp_exp;
{
PyObject *py_str
= python_string_to_target_python_string (output);
+
if (py_str)
{
char *s = PyString_AsString (py_str);
+
len = PyString_Size (py_str);
thevalue = xmemdup (s, len + 1, len + 1);
type = builtin_type (gdbarch)->builtin_char;
{
if (value && *value)
{
- int success = gdb_value_ind (*value, value);
+ int success = gdb_value_ind (*value, value);
+
if (!success)
*value = NULL;
}
{
struct value *result = NULL;
volatile struct gdb_exception e;
-
struct type *type = value_type (value);
+
type = check_typedef (type);
gdb_assert (TYPE_CODE (type) == TYPE_CODE_STRUCT
if (cvalue && value)
{
int real_index = index + TYPE_LOW_BOUND (TYPE_INDEX_TYPE (type));
+
gdb_value_subscript (value, real_index, cvalue);
}
if (cfull_expression)
{
char *join = was_ptr ? "->" : ".";
+
*cfull_expression = xstrprintf ("(%s)%s%s", parent_expression, join,
TYPE_FIELD_NAME (type, index));
}
if (cvalue && value)
{
int success = gdb_value_ind (value, cvalue);
+
if (!success)
*cvalue = NULL;
}
c_name_of_child (struct varobj *parent, int index)
{
char *name;
+
c_describe_child (parent, index, &name, NULL, NULL, NULL);
return name;
}
if (fi)
{
CORE_ADDR pc = get_frame_pc (fi);
+
if (pc < BLOCK_START (var->root->valid_block) ||
pc >= BLOCK_END (var->root->valid_block))
scope = 0;
c_value_of_child (struct varobj *parent, int index)
{
struct value *value = NULL;
- c_describe_child (parent, index, NULL, &value, NULL, NULL);
+ c_describe_child (parent, index, NULL, &value, NULL, NULL);
return value;
}
c_type_of_child (struct varobj *parent, int index)
{
struct type *type = NULL;
+
c_describe_child (parent, index, NULL, NULL, &type, NULL);
return type;
}
case TYPE_CODE_ARRAY:
{
char *number;
+
number = xstrprintf ("[%d]", var->num_children);
return (number);
}
|| TYPE_CODE (type) == TYPE_CODE_UNION)
{
char *join = was_ptr ? "->" : ".";
+
if (CPLUS_FAKE_CHILD (parent))
{
/* The fields of the class type are ordered as they
if (cfull_expression)
{
char *ptr = was_ptr ? "*" : "";
+
/* Cast the parent to the base' type. Note that in gdb,
expression like
(Base1)d
{
char *access = NULL;
int children[3];
+
cplus_class_num_children (type, children);
/* Everything beyond the baseclasses can
cplus_name_of_child (struct varobj *parent, int index)
{
char *name = NULL;
+
cplus_describe_child (parent, index, &name, NULL, NULL, NULL);
return name;
}
cplus_value_of_child (struct varobj *parent, int index)
{
struct value *value = NULL;
+
cplus_describe_child (parent, index, NULL, &value, NULL, NULL);
return value;
}
cplus_type_of_child (struct varobj *parent, int index)
{
struct type *type = NULL;
+
cplus_describe_child (parent, index, NULL, NULL, &type, NULL);
return type;
}
static char *
-cplus_value_of_variable (struct varobj *var, enum varobj_display_formats format)
+cplus_value_of_variable (struct varobj *var,
+ enum varobj_display_formats format)
{
/* If we have one of our special types, don't print out
{
struct find_targ_sec_arg *args = (struct find_targ_sec_arg *) obj;
struct objfile *objfile = args->objfile;
+
if (sect->target_index == args->targ_index)
{
/* This is the section. Figure out what SECT_OFF_* code it is. */
secnum_to_section (int secnum, struct objfile *objfile)
{
int off = SECT_OFF_TEXT (objfile);
+
asection *sect = NULL;
struct find_targ_sec_arg args;
args.targ_index = secnum;
secnum_to_bfd_section (int secnum, struct objfile *objfile)
{
int off = SECT_OFF_TEXT (objfile);
+
asection *sect = NULL;
struct find_targ_sec_arg args;
args.targ_index = secnum;
{
struct linetable_entry *lte1 = (struct linetable_entry *) lte1p;
struct linetable_entry *lte2 = (struct linetable_entry *) lte2p;
+
return lte1->pc - lte2->pc;
}
for (function_count = 0, ii = 0; ii < oldLineTb->nitems; ++ii)
{
-
if (oldLineTb->item[ii].line == 0)
{ /* function entry found. */
-
if (function_count >= fentry_size)
{ /* make sure you have room. */
fentry_size *= 2;
{
int offset, ii;
file_ptr max_offset =
- ((struct coff_symfile_info *) this_symtab_psymtab->objfile->deprecated_sym_private)
- ->max_lineno_offset;
+ ((struct coff_symfile_info *) this_symtab_psymtab->objfile
+ ->deprecated_sym_private)->max_lineno_offset;
/* subfile structure for the main compilation unit. */
struct subfile main_subfile;
}
else
{
-
/* Have a new subfile for the include file. */
tmpSubfile = inclTable[ii].subfile =
one when passed to deduce_language_from_filename. Kludge on
top of kludge. */
char *fakename = strrchr (inclTable[ii].name, '.');
+
if (fakename == NULL)
fakename = " ?";
start_subfile (fakename, (char *) 0);
#define RECORD_MINIMAL_SYMBOL(NAME, ADDR, TYPE, SECTION, OBJFILE) \
{ \
char *namestr; \
- namestr = (NAME); \
- if (namestr[0] == '.') ++namestr; \
- prim_record_minimal_symbol_and_info (namestr, (ADDR), (TYPE), \
- (SECTION), (asection *)NULL, (OBJFILE)); \
- misc_func_recorded = 1; \
+ \
+ namestr = (NAME); \
+ if (namestr[0] == '.') ++namestr; \
+ prim_record_minimal_symbol_and_info (namestr, (ADDR), (TYPE), \
+ (SECTION), (asection *)NULL, \
+ (OBJFILE)); \
+ misc_func_recorded = 1; \
}
{
struct internal_syment symbol;
char *retval;
+
/* FIXME: is this the same as the passed arg? */
if (this_symtab_psymtab)
objfile = this_symtab_psymtab->objfile;
struct objfile *objfile = pst->objfile;
bfd *abfd = objfile->obfd;
char *raw_auxptr; /* Pointer to first raw aux entry for sym */
- char *strtbl = ((struct coff_symfile_info *) objfile->deprecated_sym_private)->strtbl;
+ char *strtbl =
+ ((struct coff_symfile_info *) objfile->deprecated_sym_private)->strtbl;
char *debugsec =
- ((struct coff_symfile_info *) objfile->deprecated_sym_private)->debugsec;
+ ((struct coff_symfile_info *) objfile->deprecated_sym_private)->debugsec;
char *debugfmt = bfd_xcoff_is_xcoff64 (abfd) ? "XCOFF64" : "XCOFF";
struct internal_syment symbol[1];
while (symnum < max_symnum)
{
-
QUIT; /* make this command interruptable. */
/* READ_ONE_SYMBOL (symbol, cs, symname_alloced); */
if (cs->c_name[E_SYMNMLEN - 1] != '\0')
{
char *p;
+
p = obstack_alloc (&objfile->objfile_obstack, E_SYMNMLEN + 1);
strncpy (p, cs->c_name, E_SYMNMLEN);
p[E_SYMNMLEN] = '\0';
switch (cs->c_sclass)
{
-
case C_FILE:
/* c_value field contains symnum of next .file entry in table
{
CORE_ADDR off = ANOFFSET (objfile->section_offsets,
SECT_OFF_TEXT (objfile));
+
bfd_coff_swap_aux_in (abfd, raw_auxptr, cs->c_type, cs->c_sclass,
0, cs->c_naux, &main_aux);
}
else if (strcmp (cs->c_name, ".ef") == 0)
{
-
bfd_coff_swap_aux_in (abfd, raw_auxptr, cs->c_type, cs->c_sclass,
0, cs->c_naux, &main_aux);
contains number of lines to '}' */
if (context_stack_depth <= 0)
- { /* We attempted to pop an empty context stack */
+ { /* We attempted to pop an empty context stack */
ef_complaint (cs->c_symnum);
within_function = 0;
break;
read_symbol (struct internal_syment *symbol, int symno)
{
int nsyms =
- ((struct coff_symfile_info *) this_symtab_psymtab->objfile->deprecated_sym_private)->symtbl_num_syms;
+ ((struct coff_symfile_info *) this_symtab_psymtab->objfile->deprecated_sym_private)->symtbl_num_syms;
char *stbl =
- ((struct coff_symfile_info *) this_symtab_psymtab->objfile->deprecated_sym_private)->symtbl;
+ ((struct coff_symfile_info *) this_symtab_psymtab->objfile->deprecated_sym_private)->symtbl;
+
if (symno < 0 || symno >= nsyms)
{
complaint (&symfile_complaints, _("Invalid symbol offset"));
if (symbol->n_sclass == C_FCN)
{
char *name = xcoff64 ? strtbl + symbol->n_offset : symbol->n_name;
+
if (strcmp (name, ".bf") == 0)
goto gotit;
}
struct partial_symbol **static_syms)
{
struct partial_symtab *result =
- start_psymtab_common (objfile, objfile->section_offsets,
- filename,
- /* We fill in textlow later. */
- 0,
- global_syms, static_syms);
+ start_psymtab_common (objfile, objfile->section_offsets,
+ filename,
+ /* We fill in textlow later. */
+ 0,
+ global_syms, static_syms);
result->read_symtab_private = obstack_alloc (&objfile->objfile_obstack,
sizeof (struct symloc));
for (i = 0; i < num_includes; i++)
{
struct partial_symtab *subpst =
- allocate_psymtab (include_list[i], objfile);
+ allocate_psymtab (include_list[i], objfile);
subpst->section_offsets = pst->section_offsets;
subpst->read_symtab_private = obstack_alloc (&objfile->objfile_obstack,
/* FIXME: wastes memory for symbols which we don't end up putting
into the minimal symbols. */
char *p;
+
p = obstack_alloc (&objfile->objfile_obstack, E_SYMNMLEN + 1);
strncpy (p, symbol->n_name, E_SYMNMLEN);
p[E_SYMNMLEN] = '\0';
if (pst != NULL)
{
CORE_ADDR highval =
- symbol.n_value + csect_aux.x_csect.x_scnlen.l;
+ symbol.n_value + csect_aux.x_csect.x_scnlen.l;
+
if (highval > pst->texthigh)
pst->texthigh = highval;
if (pst->textlow == 0 || symbol.n_value < pst->textlow)
if (last_csect_name && !misc_func_recorded)
{
-
/* If no misc. function recorded in the last seen csect, enter
it as a function. This will take care of functions like
strcmp() compiled by xlc. */
/* We probably could save a few instructions by assuming that
C_LSYM, C_PSYM, etc., never have auxents. */
int naux1 = symbol.n_numaux + 1;
+
ssymnum += naux1;
sraw_symbol += bfd_coff_symesz (abfd) * naux1;
}
{
/* Mark down an include file in the current psymtab */
enum language tmp_language;
+
swap_sym (&symbol, &main_aux[0], &namestring, &sraw_symbol,
&ssymnum, objfile);
in a binary tree, if profiling shows this is a major hog). */
if (pst && strcmp (namestring, pst->filename) == 0)
continue;
+
{
int i;
+
for (i = 0; i < includes_used; i++)
if (strcmp (namestring, psymtab_include_list[i]) == 0)
{
case C_STSYM:
{
char *p;
+
swap_sym (&symbol, &main_aux[0], &namestring, &sraw_symbol,
&ssymnum, objfile);
{
int name_len = p - namestring;
char *name = xmalloc (name_len + 1);
+
memcpy (name, namestring, name_len);
name[name_len] = '\0';
function_outside_compilation_unit_complaint (name);
{
int name_len = p - namestring;
char *name = xmalloc (name_len + 1);
+
memcpy (name, namestring, name_len);
name[name_len] = '\0';
function_outside_compilation_unit_complaint (name);
else if (status == XML_STATUS_ERROR)
{
enum XML_Error err = XML_GetErrorCode (parser->expat_parser);
+
error_string = XML_ErrorString (err);
}
else
{
char *p;
char *a = va_arg (ap, char *);
+
obstack_grow (obstack, prev, f - prev - 1);
p = xml_escape_text (a);
obstack_grow_str (obstack, p);
if (dirname && *dirname)
{
char *fullname = concat (dirname, "/", filename, (char *) NULL);
+
if (fullname == NULL)
nomem (0);
file = fopen (fullname, FOPEN_RT);
{
int size = (int) * (ULONGEST *)
VEC_index (gdb_xml_value_s, attributes, 1)->value;
+
tdesc_set_struct_size (type, size);
data->current_type_size = size;
}