2011-01-07 Michael Snyder <msnyder@vmware.com>
* ada-lang.c: Comment cleanup, mostly periods and spaces. * ada-lang.h: Ditto. * ada-tasks.c: Ditto. * ada-valprint.c: Ditto. * aix-threads.c: Ditto. * alpha-linux-nat.c: Ditto. * alpha-linux-tdep.c: Ditto. * alpha-mdebug-tdep.c: Ditto. * alpha-nat.c: Ditto. * alpha-osf1-tdep.c: Ditto. * alpha-tdep.c: Ditto. * alphabsd-nat.c: Ditto. * alphabsd-tdep.c: Ditto. * amd64-darwin-tdep.c: Ditto. * amd64-linux-nat.c: Ditto. * amd64-linux-tdep.c: Ditto. * amd64-sol2-tdep.c: Ditto. * amd64-tdep.c: Ditto. * amd64-fbsd-tdep.c: Ditto. * amd64-nbsd-tdep.c: Ditto. * amd64-obsd-tdep.c: Ditto. * amd64-linux-nat.c: Ditto. * amd64-linux-tdep.c: Ditto. * arm-tdep.c: Ditto. * arm-tdep.h: Ditto. * armnbsd-nat.c: Ditto. * avr-tdep.c: Ditto. * bfin-tdep.c: Ditto. * bsd-kvm.c: Ditto. * c-typeprintc: Ditto. * c-valprint.c: Ditto. * coff-pe-read.h: Ditto. * coffreead.c: Ditto. * cris-tdep.c: Ditto. * d-lang.c: Ditto. * darwin-nat-info.c: Ditto. * darwin-nat.c: Ditto. * dbug-rom.c: Ditto. * dbxread.c: Ditto. * dcache.c: Ditto. * dcache.h: Ditto. * dec-thread.c: Ditto. * defs.h: Ditto. * demangle.c: Ditto. * dicos-tdep.c: Ditto. * dictionary.c: Ditto. * dictionary.h: Ditto. * dink32-rom.c: Ditto. * disasm.c: Ditto. * doublest.c: Ditto. * dsrec.c: Ditto. * dummy-frame.c: Ditto. * dwarf2-frame.c: Ditto. * dwarf2expr.c: Ditto. * dwarf2loc.c: Ditto. * dwarf2read.c: Ditto. * elfread.c: Ditto. * environ.c: Ditto. * eval.c: Ditto. * event-top.h: Ditto. * exceptions.c: Ditto. * exceptions.h: Ditto. * exec.c: Ditto. * expprint.c: Ditto. * expression.h: Ditto. * f-exp.y: Ditto. * f-lang.c: Ditto. * f-lang.h: Ditto. * f-typeprint.c: Ditto. * f-valprint.c: Ditto. * fbsd-nat.c: Ditto. * findvar.c: Ditto. * fork-child.c: Ditto. * frame.c: Ditto. * frame.h: Ditto. * frv-linux-tdep.c: Ditto. * frv-tdep.c: Ditto. * gcore.c: Ditto. * gdb-stabs.h: Ditto. * gdb_assert.h: Ditto. * gdb_string.h: Ditto. * gdb_thread_db.h: Ditto. * gdb_wait.h: Ditto. * gdbarch.sh: Ditto. * gdbcore.h: Ditto. * gdbthread.h: Ditto. * gdbtypes.c: Ditto. * gdbtypes.h: Ditto. * gnu-nat.c: Ditto. * gnu-nat.h: Ditto. * gnu-v2-abi.c: Ditto. * gnu-v3-abi.c: Ditto. * go32-nat.c: Ditto. * gdbarch.c: Regenerate. * gdbarch.h: Regenerate.
This commit is contained in:
parent
87973e9f82
commit
0963b4bd45
@ -1,3 +1,101 @@
|
||||
2011-01-07 Michael Snyder <msnyder@vmware.com>
|
||||
|
||||
* ada-lang.c: Comment cleanup, mostly periods and spaces.
|
||||
* ada-lang.h: Ditto.
|
||||
* ada-tasks.c: Ditto.
|
||||
* ada-valprint.c: Ditto.
|
||||
* aix-threads.c: Ditto.
|
||||
* alpha-linux-nat.c: Ditto.
|
||||
* alpha-linux-tdep.c: Ditto.
|
||||
* alpha-mdebug-tdep.c: Ditto.
|
||||
* alpha-nat.c: Ditto.
|
||||
* alpha-osf1-tdep.c: Ditto.
|
||||
* alpha-tdep.c: Ditto.
|
||||
* alphabsd-nat.c: Ditto.
|
||||
* alphabsd-tdep.c: Ditto.
|
||||
* amd64-darwin-tdep.c: Ditto.
|
||||
* amd64-linux-nat.c: Ditto.
|
||||
* amd64-linux-tdep.c: Ditto.
|
||||
* amd64-sol2-tdep.c: Ditto.
|
||||
* amd64-tdep.c: Ditto.
|
||||
* amd64-fbsd-tdep.c: Ditto.
|
||||
* amd64-nbsd-tdep.c: Ditto.
|
||||
* amd64-obsd-tdep.c: Ditto.
|
||||
* amd64-linux-nat.c: Ditto.
|
||||
* amd64-linux-tdep.c: Ditto.
|
||||
* arm-tdep.c: Ditto.
|
||||
* arm-tdep.h: Ditto.
|
||||
* armnbsd-nat.c: Ditto.
|
||||
* avr-tdep.c: Ditto.
|
||||
* bfin-tdep.c: Ditto.
|
||||
* bsd-kvm.c: Ditto.
|
||||
* c-typeprintc: Ditto.
|
||||
* c-valprint.c: Ditto.
|
||||
* coff-pe-read.h: Ditto.
|
||||
* coffreead.c: Ditto.
|
||||
* cris-tdep.c: Ditto.
|
||||
* d-lang.c: Ditto.
|
||||
* darwin-nat-info.c: Ditto.
|
||||
* darwin-nat.c: Ditto.
|
||||
* dbug-rom.c: Ditto.
|
||||
* dbxread.c: Ditto.
|
||||
* dcache.c: Ditto.
|
||||
* dcache.h: Ditto.
|
||||
* dec-thread.c: Ditto.
|
||||
* defs.h: Ditto.
|
||||
* demangle.c: Ditto.
|
||||
* dicos-tdep.c: Ditto.
|
||||
* dictionary.c: Ditto.
|
||||
* dictionary.h: Ditto.
|
||||
* dink32-rom.c: Ditto.
|
||||
* disasm.c: Ditto.
|
||||
* doublest.c: Ditto.
|
||||
* dsrec.c: Ditto.
|
||||
* dummy-frame.c: Ditto.
|
||||
* dwarf2-frame.c: Ditto.
|
||||
* dwarf2expr.c: Ditto.
|
||||
* dwarf2loc.c: Ditto.
|
||||
* dwarf2read.c: Ditto.
|
||||
* elfread.c: Ditto.
|
||||
* environ.c: Ditto.
|
||||
* eval.c: Ditto.
|
||||
* event-top.h: Ditto.
|
||||
* exceptions.c: Ditto.
|
||||
* exceptions.h: Ditto.
|
||||
* exec.c: Ditto.
|
||||
* expprint.c: Ditto.
|
||||
* expression.h: Ditto.
|
||||
* f-exp.y: Ditto.
|
||||
* f-lang.c: Ditto.
|
||||
* f-lang.h: Ditto.
|
||||
* f-typeprint.c: Ditto.
|
||||
* f-valprint.c: Ditto.
|
||||
* fbsd-nat.c: Ditto.
|
||||
* findvar.c: Ditto.
|
||||
* fork-child.c: Ditto.
|
||||
* frame.c: Ditto.
|
||||
* frame.h: Ditto.
|
||||
* frv-linux-tdep.c: Ditto.
|
||||
* frv-tdep.c: Ditto.
|
||||
* gcore.c: Ditto.
|
||||
* gdb-stabs.h: Ditto.
|
||||
* gdb_assert.h: Ditto.
|
||||
* gdb_string.h: Ditto.
|
||||
* gdb_thread_db.h: Ditto.
|
||||
* gdb_wait.h: Ditto.
|
||||
* gdbarch.sh: Ditto.
|
||||
* gdbcore.h: Ditto.
|
||||
* gdbthread.h: Ditto.
|
||||
* gdbtypes.c: Ditto.
|
||||
* gdbtypes.h: Ditto.
|
||||
* gnu-nat.c: Ditto.
|
||||
* gnu-nat.h: Ditto.
|
||||
* gnu-v2-abi.c: Ditto.
|
||||
* gnu-v3-abi.c: Ditto.
|
||||
* go32-nat.c: Ditto.
|
||||
* gdbarch.c: Regenerate.
|
||||
* gdbarch.h: Regenerate.
|
||||
|
||||
2011-01-07 Michael Snyder <msnyder@vmware.com>
|
||||
|
||||
* ax-gdb.c: Adjust some long output strings.
|
||||
|
142
gdb/ada-lang.c
142
gdb/ada-lang.c
@ -239,7 +239,8 @@ static struct value *ada_index_struct_field (int, struct value *, int,
|
||||
struct type *);
|
||||
|
||||
static struct value *assign_aggregate (struct value *, struct value *,
|
||||
struct expression *, int *, enum noside);
|
||||
struct expression *,
|
||||
int *, enum noside);
|
||||
|
||||
static void aggregate_assign_from_choices (struct value *, struct value *,
|
||||
struct expression *,
|
||||
@ -621,7 +622,7 @@ check_size (const struct type *type)
|
||||
error (_("object size is larger than varsize-limit"));
|
||||
}
|
||||
|
||||
/* Maximum value of a SIZE-byte signed integer type. */
|
||||
/* Maximum value of a SIZE-byte signed integer type. */
|
||||
static LONGEST
|
||||
max_of_size (int size)
|
||||
{
|
||||
@ -630,14 +631,14 @@ max_of_size (int size)
|
||||
return top_bit | (top_bit - 1);
|
||||
}
|
||||
|
||||
/* Minimum value of a SIZE-byte signed integer type. */
|
||||
/* Minimum value of a SIZE-byte signed integer type. */
|
||||
static LONGEST
|
||||
min_of_size (int size)
|
||||
{
|
||||
return -max_of_size (size) - 1;
|
||||
}
|
||||
|
||||
/* Maximum value of a SIZE-byte unsigned integer type. */
|
||||
/* Maximum value of a SIZE-byte unsigned integer type. */
|
||||
static ULONGEST
|
||||
umax_of_size (int size)
|
||||
{
|
||||
@ -646,7 +647,7 @@ umax_of_size (int size)
|
||||
return top_bit | (top_bit - 1);
|
||||
}
|
||||
|
||||
/* Maximum value of integral type T, as a signed quantity. */
|
||||
/* Maximum value of integral type T, as a signed quantity. */
|
||||
static LONGEST
|
||||
max_of_type (struct type *t)
|
||||
{
|
||||
@ -656,7 +657,7 @@ max_of_type (struct type *t)
|
||||
return max_of_size (TYPE_LENGTH (t));
|
||||
}
|
||||
|
||||
/* Minimum value of integral type T, as a signed quantity. */
|
||||
/* Minimum value of integral type T, as a signed quantity. */
|
||||
static LONGEST
|
||||
min_of_type (struct type *t)
|
||||
{
|
||||
@ -934,7 +935,7 @@ ada_remove_po_subprogram_suffix (const char *encoded, int *len)
|
||||
/* Protected entry subprograms are broken into two
|
||||
separate subprograms: The first one is unprotected, and has
|
||||
a 'N' suffix; the second is the protected version, and has
|
||||
the 'P' suffix. The second calls the first one after handling
|
||||
the 'P' suffix. The second calls the first one after handling
|
||||
the protection. Since the P subprograms are internally generated,
|
||||
we leave these names undecoded, giving the user a clue that this
|
||||
entity is internal. */
|
||||
@ -1114,7 +1115,7 @@ ada_decode (const char *encoded)
|
||||
/* Remove _E{DIGITS}+[sb] */
|
||||
|
||||
/* Just as for protected object subprograms, there are 2 categories
|
||||
of subprograms created by the compiler for each entry. The first
|
||||
of subprograms created by the compiler for each entry. The first
|
||||
one implements the actual entry code, and has a suffix following
|
||||
the convention above; the second one implements the barrier and
|
||||
uses the same convention as above, except that the 'E' is replaced
|
||||
@ -1235,8 +1236,7 @@ static struct htab *decoded_names_store;
|
||||
GSYMBOL).
|
||||
The GSYMBOL parameter is "mutable" in the C++ sense: logically
|
||||
const, but nevertheless modified to a semantically equivalent form
|
||||
when a decoded name is cached in it.
|
||||
*/
|
||||
when a decoded name is cached in it. */
|
||||
|
||||
char *
|
||||
ada_decode_symbol (const struct general_symbol_info *gsymbol)
|
||||
@ -1708,7 +1708,7 @@ ada_is_direct_array_type (struct type *type)
|
||||
}
|
||||
|
||||
/* Non-zero iff TYPE represents any kind of array in Ada, or a pointer
|
||||
* to one. */
|
||||
* to one. */
|
||||
|
||||
static int
|
||||
ada_is_array_type (struct type *type)
|
||||
@ -2039,7 +2039,8 @@ decode_constrained_packed_array_type (struct type *type)
|
||||
|
||||
if (TYPE_CODE (shadow_type) != TYPE_CODE_ARRAY)
|
||||
{
|
||||
lim_warning (_("could not understand bounds information on packed array"));
|
||||
lim_warning (_("could not understand bounds "
|
||||
"information on packed array"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -2125,7 +2126,8 @@ value_subscript_packed (struct value *arr, int arity, struct value **ind)
|
||||
if (TYPE_CODE (elt_type) != TYPE_CODE_ARRAY
|
||||
|| TYPE_FIELD_BITSIZE (elt_type, 0) == 0)
|
||||
error
|
||||
(_("attempt to do packed indexing of something other than a packed array"));
|
||||
(_("attempt to do packed indexing of "
|
||||
"something other than a packed array"));
|
||||
else
|
||||
{
|
||||
struct type *range_type = TYPE_INDEX_TYPE (elt_type);
|
||||
@ -2140,7 +2142,8 @@ value_subscript_packed (struct value *arr, int arity, struct value **ind)
|
||||
|
||||
idx = pos_atr (ind[i]);
|
||||
if (idx < lowerbound || idx > upperbound)
|
||||
lim_warning (_("packed array index %ld out of bounds"), (long) idx);
|
||||
lim_warning (_("packed array index %ld out of bounds"),
|
||||
(long) idx);
|
||||
bits = TYPE_FIELD_BITSIZE (elt_type, 0);
|
||||
elt_total_bit_offset += (idx - lowerbound) * bits;
|
||||
elt_type = ada_check_typedef (TYPE_TARGET_TYPE (elt_type));
|
||||
@ -2550,7 +2553,7 @@ ada_value_ptr_subscript (struct value *arr, struct type *type, int arity,
|
||||
/* Given that ARRAY_PTR is a pointer or reference to an array of type TYPE (the
|
||||
actual type of ARRAY_PTR is ignored), returns the Ada slice of HIGH-LOW+1
|
||||
elements starting at index LOW. The lower bound of this array is LOW, as
|
||||
per Ada rules. */
|
||||
per Ada rules. */
|
||||
static struct value *
|
||||
ada_value_slice_from_ptr (struct value *array_ptr, struct type *type,
|
||||
int low, int high)
|
||||
@ -3823,7 +3826,7 @@ possible_user_operator_p (enum exp_opcode op, struct value *args[])
|
||||
sets *LEN to the length of the renamed entity's name,
|
||||
*RENAMED_ENTITY to that name (not null-terminated), and *RENAMING_EXPR to
|
||||
the string describing the subcomponent selected from the renamed
|
||||
entity. Returns ADA_NOT_RENAMING if SYM does not encode a renaming
|
||||
entity. Returns ADA_NOT_RENAMING if SYM does not encode a renaming
|
||||
(in which case, the values of *RENAMED_ENTITY, *LEN, and *RENAMING_EXPR
|
||||
are undefined). Otherwise, returns a value indicating the category
|
||||
of entity renamed: an object (ADA_OBJECT_RENAMING), exception
|
||||
@ -4069,7 +4072,8 @@ make_array_descriptor (struct type *type, struct value *arr)
|
||||
struct value *bounds = allocate_value (bounds_type);
|
||||
int i;
|
||||
|
||||
for (i = ada_array_arity (ada_check_typedef (value_type (arr))); i > 0; i -= 1)
|
||||
for (i = ada_array_arity (ada_check_typedef (value_type (arr)));
|
||||
i > 0; i -= 1)
|
||||
{
|
||||
modify_field (value_type (bounds), value_contents_writeable (bounds),
|
||||
ada_array_bound (arr, i, 0),
|
||||
@ -4106,7 +4110,7 @@ make_array_descriptor (struct type *type, struct value *arr)
|
||||
}
|
||||
|
||||
/* Dummy definitions for an experimental caching module that is not
|
||||
* used in the public sources. */
|
||||
* used in the public sources. */
|
||||
|
||||
static int
|
||||
lookup_cached_symbol (const char *name, domain_enum namespace,
|
||||
@ -4546,7 +4550,7 @@ remove_irrelevant_renamings (struct ada_symbol_info *syms,
|
||||
|
||||
/* If there is both a renaming foo___XR... encoded as a variable and
|
||||
a simple variable foo in the same block, discard the latter.
|
||||
First, zero out such symbols, then compress. */
|
||||
First, zero out such symbols, then compress. */
|
||||
is_new_style_renaming = 0;
|
||||
for (i = 0; i < nsyms; i += 1)
|
||||
{
|
||||
@ -4784,8 +4788,10 @@ add_nonlocal_symbols (struct obstack *obstackp, const char *name,
|
||||
strcpy (name1, "_ada_");
|
||||
strcpy (name1 + sizeof ("_ada_") - 1, name);
|
||||
data.objfile = objfile;
|
||||
objfile->sf->qf->map_matching_symbols (name1, domain, objfile, global,
|
||||
aux_add_nonlocal_symbols, &data,
|
||||
objfile->sf->qf->map_matching_symbols (name1, domain,
|
||||
objfile, global,
|
||||
aux_add_nonlocal_symbols,
|
||||
&data,
|
||||
full_match, compare_names);
|
||||
}
|
||||
}
|
||||
@ -4992,14 +4998,14 @@ is_name_suffix (const char *str)
|
||||
|
||||
#if 0
|
||||
/* FIXME: brobecker/2005-09-23: Protected Object subprograms end
|
||||
with a N at the end. Unfortunately, the compiler uses the same
|
||||
convention for other internal types it creates. So treating
|
||||
with a N at the end. Unfortunately, the compiler uses the same
|
||||
convention for other internal types it creates. So treating
|
||||
all entity names that end with an "N" as a name suffix causes
|
||||
some regressions. For instance, consider the case of an enumerated
|
||||
type. To support the 'Image attribute, it creates an array whose
|
||||
some regressions. For instance, consider the case of an enumerated
|
||||
type. To support the 'Image attribute, it creates an array whose
|
||||
name ends with N.
|
||||
Having a single character like this as a suffix carrying some
|
||||
information is a bit risky. Perhaps we should change the encoding
|
||||
information is a bit risky. Perhaps we should change the encoding
|
||||
to be something like "_N" instead. In the meantime, do not do
|
||||
the following check. */
|
||||
/* Protected Object Subprograms */
|
||||
@ -5673,7 +5679,7 @@ ada_is_ignored_field (struct type *type, int field_num)
|
||||
}
|
||||
|
||||
/* True iff TYPE has a tag field. If REFOK, then TYPE may also be a
|
||||
pointer or reference type whose ultimate target has a tag field. */
|
||||
pointer or reference type whose ultimate target has a tag field. */
|
||||
|
||||
int
|
||||
ada_is_tagged_type (struct type *type, int refok)
|
||||
@ -5715,7 +5721,7 @@ ada_value_tag (struct value *val)
|
||||
|
||||
/* The value of the tag on the object of type TYPE whose contents are
|
||||
saved at VALADDR, if it is non-null, or is at memory address
|
||||
ADDRESS. */
|
||||
ADDRESS. */
|
||||
|
||||
static struct value *
|
||||
value_tag_from_contents_and_address (struct type *type,
|
||||
@ -5801,7 +5807,7 @@ ada_get_tsd_type (struct inferior *inf)
|
||||
/* Utility function for ada_tag_name_1 that tries the second
|
||||
representation for the dispatch table (in which there is no
|
||||
explicit 'tsd' field in the referent of the tag pointer, and instead
|
||||
the tsd pointer is stored just before the dispatch table. */
|
||||
the tsd pointer is stored just before the dispatch table. */
|
||||
|
||||
static int
|
||||
ada_tag_name_2 (struct tag_args *args)
|
||||
@ -6092,7 +6098,7 @@ ada_in_variant (LONGEST val, struct type *type, int field_num)
|
||||
}
|
||||
}
|
||||
|
||||
/* FIXME: Lots of redundancy below. Try to consolidate. */
|
||||
/* FIXME: Lots of redundancy below. Try to consolidate. */
|
||||
|
||||
/* Given a value ARG1 (offset by OFFSET bytes) of a struct or union type
|
||||
ARG_TYPE, extract and return the value of one of its (non-static)
|
||||
@ -6136,7 +6142,7 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno,
|
||||
number of fields if not found. A NULL value of NAME never
|
||||
matches; the function just counts visible fields in this case.
|
||||
|
||||
Returns 1 if found, 0 otherwise. */
|
||||
Returns 1 if found, 0 otherwise. */
|
||||
|
||||
static int
|
||||
find_struct_field (char *name, struct type *type, int offset,
|
||||
@ -6211,7 +6217,7 @@ find_struct_field (char *name, struct type *type, int offset,
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Number of user-visible fields in record type TYPE. */
|
||||
/* Number of user-visible fields in record type TYPE. */
|
||||
|
||||
static int
|
||||
num_visible_fields (struct type *type)
|
||||
@ -6248,7 +6254,7 @@ ada_search_struct_field (char *name, struct value *arg, int offset,
|
||||
|
||||
else if (ada_is_wrapper_field (type, i))
|
||||
{
|
||||
struct value *v = /* Do not let indent join lines here. */
|
||||
struct value *v = /* Do not let indent join lines here. */
|
||||
ada_search_struct_field (name, arg,
|
||||
offset + TYPE_FIELD_BITPOS (type, i) / 8,
|
||||
TYPE_FIELD_TYPE (type, i));
|
||||
@ -6259,7 +6265,7 @@ ada_search_struct_field (char *name, struct value *arg, int offset,
|
||||
|
||||
else if (ada_is_variant_part (type, i))
|
||||
{
|
||||
/* PNH: Do we ever get here? See find_struct_field. */
|
||||
/* PNH: Do we ever get here? See find_struct_field. */
|
||||
int j;
|
||||
struct type *field_type = ada_check_typedef (TYPE_FIELD_TYPE (type,
|
||||
i));
|
||||
@ -6267,7 +6273,8 @@ ada_search_struct_field (char *name, struct value *arg, int offset,
|
||||
|
||||
for (j = 0; j < TYPE_NFIELDS (field_type); j += 1)
|
||||
{
|
||||
struct value *v = ada_search_struct_field /* Force line break. */
|
||||
struct value *v = ada_search_struct_field /* Force line
|
||||
break. */
|
||||
(name, arg,
|
||||
var_offset + TYPE_FIELD_BITPOS (field_type, j) / 8,
|
||||
TYPE_FIELD_TYPE (field_type, j));
|
||||
@ -6287,7 +6294,7 @@ static struct value *ada_index_struct_field_1 (int *, struct value *,
|
||||
/* Return field #INDEX in ARG, where the index is that returned by
|
||||
* find_struct_field through its INDEX_P argument. Adjust the address
|
||||
* of ARG by OFFSET bytes, and search in it assuming it has (class) type TYPE.
|
||||
* If found, return value, else return NULL. */
|
||||
* If found, return value, else return NULL. */
|
||||
|
||||
static struct value *
|
||||
ada_index_struct_field (int index, struct value *arg, int offset,
|
||||
@ -6299,7 +6306,7 @@ ada_index_struct_field (int index, struct value *arg, int offset,
|
||||
|
||||
/* Auxiliary function for ada_index_struct_field. Like
|
||||
* ada_index_struct_field, but takes index from *INDEX_P and modifies
|
||||
* *INDEX_P. */
|
||||
* *INDEX_P. */
|
||||
|
||||
static struct value *
|
||||
ada_index_struct_field_1 (int *index_p, struct value *arg, int offset,
|
||||
@ -6314,7 +6321,7 @@ ada_index_struct_field_1 (int *index_p, struct value *arg, int offset,
|
||||
continue;
|
||||
else if (ada_is_wrapper_field (type, i))
|
||||
{
|
||||
struct value *v = /* Do not let indent join lines here. */
|
||||
struct value *v = /* Do not let indent join lines here. */
|
||||
ada_index_struct_field_1 (index_p, arg,
|
||||
offset + TYPE_FIELD_BITPOS (type, i) / 8,
|
||||
TYPE_FIELD_TYPE (type, i));
|
||||
@ -6326,7 +6333,7 @@ ada_index_struct_field_1 (int *index_p, struct value *arg, int offset,
|
||||
else if (ada_is_variant_part (type, i))
|
||||
{
|
||||
/* PNH: Do we ever get here? See ada_search_struct_field,
|
||||
find_struct_field. */
|
||||
find_struct_field. */
|
||||
error (_("Cannot assign this kind of variant record"));
|
||||
}
|
||||
else if (*index_p == 0)
|
||||
@ -6430,7 +6437,8 @@ ada_value_struct_elt (struct value *arg, char *name, int no_err)
|
||||
if (no_err)
|
||||
return NULL;
|
||||
else
|
||||
error (_("Attempt to extract a component of a value that is not a record."));
|
||||
error (_("Attempt to extract a component of "
|
||||
"a value that is not a record."));
|
||||
}
|
||||
|
||||
/* Given a type TYPE, look up the type of the component of type named NAME.
|
||||
@ -6441,7 +6449,7 @@ ada_value_struct_elt (struct value *arg, char *name, int no_err)
|
||||
Matches any field whose name has NAME as a prefix, possibly
|
||||
followed by "___".
|
||||
|
||||
TYPE can be either a struct or union. If REFOK, TYPE may also
|
||||
TYPE can be either a struct or union. If REFOK, TYPE may also
|
||||
be a (pointer or reference)+ to a struct or union, and the
|
||||
ultimate target type will be searched.
|
||||
|
||||
@ -6533,14 +6541,15 @@ ada_lookup_struct_elt_type (struct type *type, char *name, int refok,
|
||||
/* FIXME pnh 2008/01/26: We check for a field that is
|
||||
NOT wrapped in a struct, since the compiler sometimes
|
||||
generates these for unchecked variant types. Revisit
|
||||
if the compiler changes this practice. */
|
||||
if the compiler changes this practice. */
|
||||
char *v_field_name = TYPE_FIELD_NAME (field_type, j);
|
||||
disp = 0;
|
||||
if (v_field_name != NULL
|
||||
&& field_name_match (v_field_name, name))
|
||||
t = ada_check_typedef (TYPE_FIELD_TYPE (field_type, j));
|
||||
else
|
||||
t = ada_lookup_struct_elt_type (TYPE_FIELD_TYPE (field_type, j),
|
||||
t = ada_lookup_struct_elt_type (TYPE_FIELD_TYPE (field_type,
|
||||
j),
|
||||
name, 0, 1, &disp);
|
||||
|
||||
if (t != NULL)
|
||||
@ -6581,7 +6590,7 @@ BadName:
|
||||
/* Assuming that VAR_TYPE is the type of a variant part of a record (a union),
|
||||
within a value of type OUTER_TYPE, return true iff VAR_TYPE
|
||||
represents an unchecked union (that is, the variant part of a
|
||||
record that is named in an Unchecked_Union pragma). */
|
||||
record that is named in an Unchecked_Union pragma). */
|
||||
|
||||
static int
|
||||
is_unchecked_variant (struct type *var_type, struct type *outer_type)
|
||||
@ -6779,7 +6788,7 @@ ada_find_renaming_symbol (const char *name, struct block *block)
|
||||
if (sym != NULL)
|
||||
return sym;
|
||||
|
||||
/* Not right yet. FIXME pnh 7/20/2007. */
|
||||
/* Not right yet. FIXME pnh 7/20/2007. */
|
||||
sym = ada_find_any_symbol (name);
|
||||
if (sym != NULL && strstr (SYMBOL_LINKAGE_NAME (sym), "___XR") != NULL)
|
||||
return sym;
|
||||
@ -7130,7 +7139,7 @@ ada_template_to_fixed_record_type_1 (struct type *type,
|
||||
/* rtype's length is computed based on the run-time
|
||||
value of discriminants. If the discriminants are not
|
||||
initialized, the type size may be completely bogus and
|
||||
GDB may fail to allocate a value for it. So check the
|
||||
GDB may fail to allocate a value for it. So check the
|
||||
size first before creating the value. */
|
||||
check_size (rtype);
|
||||
dval = value_from_contents_and_address (rtype, valaddr, address);
|
||||
@ -7259,7 +7268,7 @@ ada_template_to_fixed_record_type_1 (struct type *type,
|
||||
should contain the alignment of that record, which should be a strictly
|
||||
positive value. If null or negative, then something is wrong, most
|
||||
probably in the debug info. In that case, we don't round up the size
|
||||
of the resulting type. If this record is not part of another structure,
|
||||
of the resulting type. If this record is not part of another structure,
|
||||
the current RTYPE length might be good enough for our purposes. */
|
||||
if (TYPE_LENGTH (type) <= 0)
|
||||
{
|
||||
@ -7465,7 +7474,7 @@ to_fixed_record_type (struct type *type0, const gdb_byte *valaddr,
|
||||
a record value. That is, this routine selects the appropriate
|
||||
branch of the union at ADDR according to the discriminant value
|
||||
indicated in the union's type name. Returns VAR_TYPE0 itself if
|
||||
it represents a variant subject to a pragma Unchecked_Union. */
|
||||
it represents a variant subject to a pragma Unchecked_Union. */
|
||||
|
||||
static struct type *
|
||||
to_fixed_variant_branch_type (struct type *var_type0, const gdb_byte *valaddr,
|
||||
@ -7642,7 +7651,7 @@ ada_to_fixed_type_1 (struct type *type, const gdb_byte *valaddr,
|
||||
|
||||
/* If STATIC_TYPE is a tagged type and we know the object's address,
|
||||
then we can determine its tag, and compute the object's actual
|
||||
type from there. Note that we have to use the fixed record
|
||||
type from there. Note that we have to use the fixed record
|
||||
type (the parent part of the record may have dynamic fields
|
||||
and the way the location of _tag is expressed may depend on
|
||||
them). */
|
||||
@ -7690,7 +7699,7 @@ ada_to_fixed_type_1 (struct type *type, const gdb_byte *valaddr,
|
||||
when using this type to create new types targeting it.
|
||||
Indeed, the associated creation routines often check
|
||||
whether the target type is a stub and will try to replace
|
||||
it, thus using a type with the wrong size. This, in turn,
|
||||
it, thus using a type with the wrong size. This, in turn,
|
||||
might cause the new type to have the wrong size too.
|
||||
Consider the case of an array, for instance, where the size
|
||||
of the array is computed from the number of elements in
|
||||
@ -8415,7 +8424,7 @@ ada_value_equal (struct value *arg1, struct value *arg2)
|
||||
|
||||
/* Total number of component associations in the aggregate starting at
|
||||
index PC in EXP. Assumes that index PC is the start of an
|
||||
OP_AGGREGATE. */
|
||||
OP_AGGREGATE. */
|
||||
|
||||
static int
|
||||
num_component_specs (struct expression *exp, int pc)
|
||||
@ -8483,7 +8492,7 @@ assign_component (struct value *container, struct value *lhs, LONGEST index,
|
||||
aggregate. NOSIDE is as for evaluate_subexp. CONTAINER is an
|
||||
lvalue containing LHS (possibly LHS itself). Does not modify
|
||||
the inferior's memory, nor does it modify the contents of
|
||||
LHS (unless == CONTAINER). Returns the modified CONTAINER. */
|
||||
LHS (unless == CONTAINER). Returns the modified CONTAINER. */
|
||||
|
||||
static struct value *
|
||||
assign_aggregate (struct value *container,
|
||||
@ -8574,7 +8583,7 @@ assign_aggregate (struct value *container,
|
||||
the positions are relative to lower bound LOW, where HIGH is the
|
||||
upper bound. Record the position in INDICES[0 .. MAX_INDICES-1]
|
||||
updating *NUM_INDICES as needed. CONTAINER is as for
|
||||
assign_aggregate. */
|
||||
assign_aggregate. */
|
||||
static void
|
||||
aggregate_assign_positional (struct value *container,
|
||||
struct value *lhs, struct expression *exp,
|
||||
@ -8599,7 +8608,7 @@ aggregate_assign_positional (struct value *container,
|
||||
construct at *POS, updating *POS past the construct, given that
|
||||
the allowable indices are LOW..HIGH. Record the indices assigned
|
||||
to in INDICES[0 .. MAX_INDICES-1], updating *NUM_INDICES as
|
||||
needed. CONTAINER is as for assign_aggregate. */
|
||||
needed. CONTAINER is as for assign_aggregate. */
|
||||
static void
|
||||
aggregate_assign_from_choices (struct value *container,
|
||||
struct value *lhs, struct expression *exp,
|
||||
@ -8681,7 +8690,7 @@ aggregate_assign_from_choices (struct value *container,
|
||||
EXP at *POS into the components of LHS indexed from LOW .. HIGH that
|
||||
have not been previously assigned. The index intervals already assigned
|
||||
are in INDICES[0 .. NUM_INDICES-1]. Updates *POS to after the
|
||||
OP_OTHERS clause. CONTAINER is as for assign_aggregate*/
|
||||
OP_OTHERS clause. CONTAINER is as for assign_aggregate. */
|
||||
static void
|
||||
aggregate_assign_others (struct value *container,
|
||||
struct value *lhs, struct expression *exp,
|
||||
@ -9146,7 +9155,8 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
|
||||
if ((ada_is_fixed_point_type (value_type (arg1))
|
||||
|| ada_is_fixed_point_type (value_type (arg2)))
|
||||
&& value_type (arg1) != value_type (arg2))
|
||||
error (_("Operands of fixed-point subtraction must have the same type"));
|
||||
error (_("Operands of fixed-point subtraction "
|
||||
"must have the same type"));
|
||||
/* Do the substraction, and cast the result to the type of the first
|
||||
argument. We cannot cast the result to a reference type, so if
|
||||
ARG1 is a reference type, find its underlying type. */
|
||||
@ -9863,7 +9873,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
|
||||
else
|
||||
error (_("Attempt to take contents of a non-pointer value."));
|
||||
}
|
||||
arg1 = ada_coerce_ref (arg1); /* FIXME: What is this for?? */
|
||||
arg1 = ada_coerce_ref (arg1); /* FIXME: What is this for?? */
|
||||
type = ada_check_typedef (value_type (arg1));
|
||||
|
||||
if (TYPE_CODE (type) == TYPE_CODE_INT)
|
||||
@ -9904,7 +9914,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
|
||||
/* In this case, we assume that the field COULD exist
|
||||
in some extension of the type. Return an object of
|
||||
"type" void, which will match any formal
|
||||
(see ada_type_match). */
|
||||
(see ada_type_match). */
|
||||
return value_zero (builtin_type (exp->gdbarch)->builtin_void,
|
||||
lval_memory);
|
||||
}
|
||||
@ -9946,7 +9956,8 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp,
|
||||
case OP_AGGREGATE:
|
||||
error (_("Aggregates only allowed on the right of an assignment"));
|
||||
default:
|
||||
internal_error (__FILE__, __LINE__, _("aggregate apparently mangled"));
|
||||
internal_error (__FILE__, __LINE__,
|
||||
_("aggregate apparently mangled"));
|
||||
}
|
||||
|
||||
ada_forward_operator_length (exp, pc, &oplen, &nargs);
|
||||
@ -10229,7 +10240,7 @@ to_fixed_range_type (struct type *raw_type, struct value *dval)
|
||||
return raw_type;
|
||||
if (bounds_str[n] == '_')
|
||||
n += 2;
|
||||
else if (bounds_str[n] == '.') /* FIXME? SGI Workshop kludge. */
|
||||
else if (bounds_str[n] == '.') /* FIXME? SGI Workshop kludge. */
|
||||
n += 1;
|
||||
subtype_info += 1;
|
||||
}
|
||||
@ -10500,7 +10511,7 @@ ada_exception_support_info_sniffer (void)
|
||||
|
||||
/* At this point, we know that we are debugging an Ada program and
|
||||
that the inferior has been started, but we still are not able to
|
||||
find the run-time symbols. That can mean that we are in
|
||||
find the run-time symbols. That can mean that we are in
|
||||
configurable run time mode, or that a-except as been optimized
|
||||
out by the linker... In any case, at this point it is not worth
|
||||
supporting this feature. */
|
||||
@ -11128,17 +11139,17 @@ ada_exception_catchpoint_cond_string (const char *exp_string)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* The standard exceptions are a special case. They are defined in
|
||||
/* The standard exceptions are a special case. They are defined in
|
||||
runtime units that have been compiled without debugging info; if
|
||||
EXP_STRING is the not-fully-qualified name of a standard
|
||||
exception (e.g. "constraint_error") then, during the evaluation
|
||||
of the condition expression, the symbol lookup on this name would
|
||||
*not* return this standard exception. The catchpoint condition
|
||||
*not* return this standard exception. The catchpoint condition
|
||||
may then be set only on user-defined exceptions which have the
|
||||
same not-fully-qualified name (e.g. my_package.constraint_error).
|
||||
|
||||
To avoid this unexcepted behavior, these standard exceptions are
|
||||
systematically prefixed by "standard". This means that "catch
|
||||
systematically prefixed by "standard". This means that "catch
|
||||
exception constraint_error" is rewritten into "catch exception
|
||||
standard.constraint_error".
|
||||
|
||||
@ -11805,7 +11816,8 @@ const struct language_defn ada_language_defn = {
|
||||
ada_lookup_symbol_nonlocal, /* Looking up non-local symbols. */
|
||||
basic_lookup_transparent_type, /* lookup_transparent_type */
|
||||
ada_la_decode, /* Language specific symbol demangler */
|
||||
NULL, /* Language specific class_name_from_physname */
|
||||
NULL, /* Language specific
|
||||
class_name_from_physname */
|
||||
ada_op_print_tab, /* expression operators for printing */
|
||||
0, /* c-style arrays */
|
||||
1, /* String lower bound */
|
||||
|
@ -30,7 +30,7 @@ struct frame_info;
|
||||
/* Names of specific files known to be part of the runtime
|
||||
system and that might consider (confusing) debugging information.
|
||||
Each name (a basic regular expression string) is followed by a
|
||||
comma. FIXME: Should be part of a configuration file. */
|
||||
comma. FIXME: Should be part of a configuration file. */
|
||||
#if defined(__alpha__) && defined(__osf__)
|
||||
#define ADA_KNOWN_RUNTIME_FILE_NAME_PATTERNS \
|
||||
"^[agis]-.*\\.ad[bs]$", \
|
||||
@ -48,26 +48,26 @@ struct frame_info;
|
||||
#endif
|
||||
|
||||
/* Names of compiler-generated auxiliary functions probably of no
|
||||
interest to users. Each name (a basic regular expression string)
|
||||
is followed by a comma. */
|
||||
interest to users. Each name (a basic regular expression string)
|
||||
is followed by a comma. */
|
||||
#define ADA_KNOWN_AUXILIARY_FUNCTION_NAME_PATTERNS \
|
||||
"___clean[.$a-zA-Z0-9_]*$", \
|
||||
"___finalizer[.$a-zA-Z0-9_]*$",
|
||||
|
||||
/* The maximum number of frame levels searched for non-local,
|
||||
* non-global symbols. This limit exists as a precaution to prevent
|
||||
* infinite search loops when the stack is screwed up. */
|
||||
* infinite search loops when the stack is screwed up. */
|
||||
#define MAX_ENCLOSING_FRAME_LEVELS 7
|
||||
|
||||
/* Maximum number of steps followed in looking for the ultimate
|
||||
referent of a renaming. This prevents certain infinite loops that
|
||||
can otherwise result. */
|
||||
can otherwise result. */
|
||||
#define MAX_RENAMING_CHAIN_LENGTH 10
|
||||
|
||||
struct block;
|
||||
|
||||
/* Corresponding encoded/decoded names and opcodes for Ada user-definable
|
||||
operators. */
|
||||
operators. */
|
||||
struct ada_opname_map
|
||||
{
|
||||
const char *encoded;
|
||||
@ -75,12 +75,12 @@ struct ada_opname_map
|
||||
enum exp_opcode op;
|
||||
};
|
||||
|
||||
/* Table of Ada operators in encoded and decoded forms. */
|
||||
/* Table of Ada operators in encoded and decoded forms. */
|
||||
/* Defined in ada-lang.c */
|
||||
extern const struct ada_opname_map ada_opname_table[];
|
||||
|
||||
/* A tuple, (symbol, block), representing one instance of a
|
||||
* symbol-lookup operation. */
|
||||
* symbol-lookup operation. */
|
||||
struct ada_symbol_info {
|
||||
struct symbol* sym;
|
||||
struct block* block;
|
||||
@ -141,9 +141,9 @@ struct ada_task_info
|
||||
};
|
||||
|
||||
/* Assuming V points to an array of S objects, make sure that it contains at
|
||||
least M objects, updating V and S as necessary. */
|
||||
least M objects, updating V and S as necessary. */
|
||||
|
||||
#define GROW_VECT(v, s, m) \
|
||||
#define GROW_VECT(v, s, m) \
|
||||
if ((s) < (m)) (v) = grow_vect (v, &(s), m, sizeof *(v));
|
||||
|
||||
extern void *grow_vect (void *, size_t *, size_t, int);
|
||||
|
@ -126,7 +126,7 @@ struct tcb_fieldnos
|
||||
};
|
||||
|
||||
/* The type description for the ATCB record and subrecords, and
|
||||
the associated tcb_fieldnos. For efficiency reasons, these are made
|
||||
the associated tcb_fieldnos. For efficiency reasons, these are made
|
||||
static globals so that we can compute them only once the first time
|
||||
and reuse them later. Set to NULL if the types haven't been computed
|
||||
yet, or if they may be obsolete (for instance after having loaded
|
||||
@ -305,7 +305,7 @@ read_fat_string_value (char *dest, struct value *val, int max_len)
|
||||
|
||||
In order to provide a fast response time, this function caches
|
||||
the Known_Tasks array address after the lookup during the first
|
||||
call. Subsequent calls will simply return this cached address. */
|
||||
call. Subsequent calls will simply return this cached address. */
|
||||
|
||||
static CORE_ADDR
|
||||
get_known_tasks_addr (void)
|
||||
@ -327,21 +327,21 @@ get_known_tasks_addr (void)
|
||||
|
||||
/* FIXME: brobecker 2003-03-05: Here would be a much better place
|
||||
to attach the ada-tasks observers, instead of doing this
|
||||
unconditionaly in _initialize_tasks. This would avoid an
|
||||
unconditionaly in _initialize_tasks. This would avoid an
|
||||
unecessary notification when the inferior does not use tasking
|
||||
or as long as the user does not use the ada-tasks commands.
|
||||
Unfortunately, this is not possible for the moment: the current
|
||||
code resets ada__tasks_check_symbol_table back to 1 whenever
|
||||
symbols for a new program are being loaded. If we place the
|
||||
symbols for a new program are being loaded. If we place the
|
||||
observers intialization here, we will end up adding new observers
|
||||
everytime we do the check for Ada tasking-related symbols
|
||||
above. This would currently have benign effects, but is still
|
||||
undesirable. The cleanest approach is probably to create a new
|
||||
above. This would currently have benign effects, but is still
|
||||
undesirable. The cleanest approach is probably to create a new
|
||||
observer to notify us when the user is debugging a new program.
|
||||
We would then reset ada__tasks_check_symbol_table back to 1
|
||||
during the notification, but also detach all observers.
|
||||
BTW: observers are probably not reentrant, so detaching during
|
||||
a notification may not be the safest thing to do... Sigh...
|
||||
a notification may not be the safest thing to do... Sigh...
|
||||
But creating the new observer would be a good idea in any case,
|
||||
since this allow us to make ada__tasks_check_symbol_table
|
||||
static, which is a good bonus. */
|
||||
@ -380,7 +380,7 @@ get_tcb_types_info (struct type **atcb_type,
|
||||
const char *private_data_name = "system__task_primitives__private_data";
|
||||
const char *entry_call_record_name = "system__tasking__entry_call_record";
|
||||
|
||||
/* ATCB symbols may be found in several compilation units. As we
|
||||
/* ATCB symbols may be found in several compilation units. As we
|
||||
are only interested in one instance, use standard (literal,
|
||||
C-like) lookups to get the first match. */
|
||||
|
||||
@ -521,14 +521,14 @@ read_atcb (CORE_ADDR task_id, struct ada_task_info *task_info)
|
||||
Depending on the GNAT version used, the task image is either a fat
|
||||
string, or a thin array of characters. Older versions of GNAT used
|
||||
to use fat strings, and therefore did not need an extra field in
|
||||
the ATCB to store the string length. For efficiency reasons, newer
|
||||
the ATCB to store the string length. For efficiency reasons, newer
|
||||
versions of GNAT replaced the fat string by a static buffer, but this
|
||||
also required the addition of a new field named "Image_Len" containing
|
||||
the length of the task name. The method used to extract the task name
|
||||
the length of the task name. The method used to extract the task name
|
||||
is selected depending on the existence of this field.
|
||||
|
||||
In some run-time libs (e.g. Ravenscar), the name is not in the ATCB;
|
||||
we may want to get it from the first user frame of the stack. For now,
|
||||
we may want to get it from the first user frame of the stack. For now,
|
||||
we just give a dummy name. */
|
||||
|
||||
if (fieldno.image_len == -1)
|
||||
@ -762,7 +762,7 @@ short_task_info (int taskno)
|
||||
}
|
||||
|
||||
/* Print a list containing a short description of all Ada tasks. */
|
||||
/* FIXME: Shouldn't we be using ui_out??? */
|
||||
/* FIXME: Shouldn't we be using ui_out??? */
|
||||
|
||||
static void
|
||||
info_tasks (int from_tty)
|
||||
|
@ -296,7 +296,7 @@ char_at (const gdb_byte *string, int i, int type_len,
|
||||
return (int) extract_unsigned_integer (string + 2 * i, 2, byte_order);
|
||||
}
|
||||
|
||||
/* Wrapper around memcpy to make it legal argument to ui_file_put */
|
||||
/* Wrapper around memcpy to make it legal argument to ui_file_put. */
|
||||
static void
|
||||
ui_memcpy (void *dest, const char *buffer, long len)
|
||||
{
|
||||
@ -454,8 +454,7 @@ ada_print_scalar (struct type *type, LONGEST val, struct ui_file *stream)
|
||||
Printing stops early if the number hits print_max; repeat counts
|
||||
are printed as appropriate. Print ellipses at the end if we
|
||||
had to stop before printing LENGTH characters, or if
|
||||
FORCE_ELLIPSES. TYPE_LEN is the length (1 or 2) of the character type.
|
||||
*/
|
||||
FORCE_ELLIPSES. TYPE_LEN is the length (1 or 2) of the character type. */
|
||||
|
||||
static void
|
||||
printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string,
|
||||
@ -549,8 +548,9 @@ printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string,
|
||||
}
|
||||
|
||||
void
|
||||
ada_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string,
|
||||
unsigned int length, const char *encoding, int force_ellipses,
|
||||
ada_printstr (struct ui_file *stream, struct type *type,
|
||||
const gdb_byte *string, unsigned int length,
|
||||
const char *encoding, int force_ellipses,
|
||||
const struct value_print_options *options)
|
||||
{
|
||||
printstr (stream, type, string, length, force_ellipses, TYPE_LENGTH (type),
|
||||
@ -761,7 +761,8 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr0,
|
||||
else
|
||||
return ada_val_print_1 (TYPE_TARGET_TYPE (type),
|
||||
valaddr0, embedded_offset,
|
||||
address, stream, recurse, original_value, options);
|
||||
address, stream, recurse,
|
||||
original_value, options);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -909,7 +910,8 @@ static int
|
||||
print_variant_part (struct type *type, int field_num, const gdb_byte *valaddr,
|
||||
struct ui_file *stream, int recurse,
|
||||
const struct value *val,
|
||||
const struct value_print_options *options, int comma_needed,
|
||||
const struct value_print_options *options,
|
||||
int comma_needed,
|
||||
struct type *outer_type, const gdb_byte *outer_valaddr)
|
||||
{
|
||||
struct type *var_type = TYPE_FIELD_TYPE (type, field_num);
|
||||
|
@ -1512,7 +1512,8 @@ store_regs_user_thread (const struct regcache *regcache, pthdb_pthread_t pdtid)
|
||||
|
||||
status = pthdb_pthread_setcontext (pd_session, pdtid, &ctx);
|
||||
if (status != PTHDB_SUCCESS)
|
||||
error (_("aix-thread: store_registers: pthdb_pthread_setcontext returned %s"),
|
||||
error (_("aix-thread: store_registers: "
|
||||
"pthdb_pthread_setcontext returned %s"),
|
||||
pd_status2str (status));
|
||||
}
|
||||
|
||||
@ -1660,7 +1661,8 @@ aix_thread_store_registers (struct target_ops *ops,
|
||||
static LONGEST
|
||||
aix_thread_xfer_partial (struct target_ops *ops, enum target_object object,
|
||||
const char *annex, gdb_byte *readbuf,
|
||||
const gdb_byte *writebuf, ULONGEST offset, LONGEST len)
|
||||
const gdb_byte *writebuf,
|
||||
ULONGEST offset, LONGEST len)
|
||||
{
|
||||
struct cleanup *old_chain = save_inferior_ptid ();
|
||||
LONGEST xfer;
|
||||
@ -1826,9 +1828,11 @@ _initialize_aix_thread (void)
|
||||
observer_attach_new_objfile (new_objfile);
|
||||
|
||||
add_setshow_boolean_cmd ("aix-thread", class_maintenance, &debug_aix_thread,
|
||||
_("Set debugging of AIX thread module."),
|
||||
_("Show debugging of AIX thread module."),
|
||||
_("Enables debugging output (used to debug GDB)."),
|
||||
NULL, NULL, /* FIXME: i18n: Debugging of AIX thread module is \"%d\". */
|
||||
&setdebuglist, &showdebuglist);
|
||||
_("Set debugging of AIX thread module."),
|
||||
_("Show debugging of AIX thread module."),
|
||||
_("Enables debugging output (used to debug GDB)."),
|
||||
NULL, NULL,
|
||||
/* FIXME: i18n: Debugging of AIX thread
|
||||
module is \"%d\". */
|
||||
&setdebuglist, &showdebuglist);
|
||||
}
|
||||
|
@ -34,9 +34,8 @@
|
||||
#define ALPHA_UNIQUE_PTRACE_ADDR 65
|
||||
|
||||
|
||||
/*
|
||||
* See the comment in m68k-tdep.c regarding the utility of these functions.
|
||||
*/
|
||||
/* See the comment in m68k-tdep.c regarding the utility of these
|
||||
functions. */
|
||||
|
||||
void
|
||||
supply_gregset (struct regcache *regcache, const gdb_gregset_t *gregsetp)
|
||||
@ -57,10 +56,8 @@ fill_gregset (const struct regcache *regcache,
|
||||
alpha_fill_int_regs (regcache, regno, regp, regp + 31, regp + 32);
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we do the same thing for floating-point registers.
|
||||
* Again, see the comments in m68k-tdep.c.
|
||||
*/
|
||||
/* Now we do the same thing for floating-point registers.
|
||||
Again, see the comments in m68k-tdep.c. */
|
||||
|
||||
void
|
||||
supply_fpregset (struct regcache *regcache, const gdb_fpregset_t *fpregsetp)
|
||||
|
@ -41,8 +41,7 @@
|
||||
(2) the kernel has changed from using "addq" to "lda" to load the
|
||||
syscall number,
|
||||
(3) there is a "normal" sigreturn and an "rt" sigreturn which
|
||||
has a different stack layout.
|
||||
*/
|
||||
has a different stack layout. */
|
||||
|
||||
static long
|
||||
alpha_linux_sigtramp_offset_1 (struct gdbarch *gdbarch, CORE_ADDR pc)
|
||||
@ -120,8 +119,8 @@ alpha_linux_sigcontext_addr (struct frame_info *this_frame)
|
||||
struct ucontext uc;
|
||||
};
|
||||
|
||||
offsetof (struct rt_sigframe, uc.uc_mcontext);
|
||||
*/
|
||||
offsetof (struct rt_sigframe, uc.uc_mcontext); */
|
||||
|
||||
if (alpha_read_insn (gdbarch, pc - off + 4) == 0x201f015f)
|
||||
return sp + 176;
|
||||
|
||||
|
@ -149,12 +149,13 @@ alpha_mdebug_frameless (struct mdebug_extra_func_info *proc_desc)
|
||||
find the prologue, then return 0. */
|
||||
|
||||
static CORE_ADDR
|
||||
alpha_mdebug_after_prologue (CORE_ADDR pc, struct mdebug_extra_func_info *proc_desc)
|
||||
alpha_mdebug_after_prologue (CORE_ADDR pc,
|
||||
struct mdebug_extra_func_info *proc_desc)
|
||||
{
|
||||
if (proc_desc)
|
||||
{
|
||||
/* If function is frameless, then we need to do it the hard way. I
|
||||
strongly suspect that frameless always means prologueless... */
|
||||
strongly suspect that frameless always means prologueless... */
|
||||
if (alpha_mdebug_frameless (proc_desc))
|
||||
return 0;
|
||||
}
|
||||
@ -166,7 +167,8 @@ alpha_mdebug_after_prologue (CORE_ADDR pc, struct mdebug_extra_func_info *proc_d
|
||||
if we are definitively *not* in a function prologue. */
|
||||
|
||||
static int
|
||||
alpha_mdebug_in_prologue (CORE_ADDR pc, struct mdebug_extra_func_info *proc_desc)
|
||||
alpha_mdebug_in_prologue (CORE_ADDR pc,
|
||||
struct mdebug_extra_func_info *proc_desc)
|
||||
{
|
||||
CORE_ADDR after_prologue_pc = alpha_mdebug_after_prologue (pc, proc_desc);
|
||||
return (after_prologue_pc == 0 || pc < after_prologue_pc);
|
||||
@ -227,7 +229,7 @@ alpha_mdebug_frame_unwind_cache (struct frame_info *this_frame,
|
||||
register number. */
|
||||
if (mask & (1 << returnreg))
|
||||
{
|
||||
/* Clear bit for RA so we don't save it again later. */
|
||||
/* Clear bit for RA so we don't save it again later. */
|
||||
mask &= ~(1 << returnreg);
|
||||
|
||||
info->saved_regs[returnreg].addr = reg_position;
|
||||
|
@ -42,8 +42,7 @@
|
||||
REG_ADDR is the offset from u.u_ar0 to the register values relative to
|
||||
core_reg_sect. This is used with old-fashioned core files to
|
||||
locate the registers in a large upage-plus-stack ".reg" section.
|
||||
Original upage address X is at location core_reg_sect+x+reg_addr.
|
||||
*/
|
||||
Original upage address X is at location core_reg_sect+x+reg_addr. */
|
||||
|
||||
static void
|
||||
fetch_osf_core_registers (struct regcache *regcache,
|
||||
@ -68,10 +67,14 @@ fetch_osf_core_registers (struct regcache *regcache,
|
||||
CF_T7, CF_S0, CF_S1, CF_S2, CF_S3, CF_S4, CF_S5, CF_S6,
|
||||
CF_A0, CF_A1, CF_A2, CF_A3, CF_A4, CF_A5, CF_T8, CF_T9,
|
||||
CF_T10, CF_T11, CF_RA, CF_T12, CF_AT, CF_GP, CF_SP, -1,
|
||||
EFL + 0, EFL + 1, EFL + 2, EFL + 3, EFL + 4, EFL + 5, EFL + 6, EFL + 7,
|
||||
EFL + 8, EFL + 9, EFL + 10, EFL + 11, EFL + 12, EFL + 13, EFL + 14, EFL + 15,
|
||||
EFL + 16, EFL + 17, EFL + 18, EFL + 19, EFL + 20, EFL + 21, EFL + 22, EFL + 23,
|
||||
EFL + 24, EFL + 25, EFL + 26, EFL + 27, EFL + 28, EFL + 29, EFL + 30, EFL + 31,
|
||||
EFL + 0, EFL + 1, EFL + 2, EFL + 3,
|
||||
EFL + 4, EFL + 5, EFL + 6, EFL + 7,
|
||||
EFL + 8, EFL + 9, EFL + 10, EFL + 11,
|
||||
EFL + 12, EFL + 13, EFL + 14, EFL + 15,
|
||||
EFL + 16, EFL + 17, EFL + 18, EFL + 19,
|
||||
EFL + 20, EFL + 21, EFL + 22, EFL + 23,
|
||||
EFL + 24, EFL + 25, EFL + 26, EFL + 27,
|
||||
EFL + 28, EFL + 29, EFL + 30, EFL + 31,
|
||||
CF_PC, -1, -1
|
||||
#else
|
||||
#define EFL (EF_SIZE / 8)
|
||||
@ -79,10 +82,14 @@ fetch_osf_core_registers (struct regcache *regcache,
|
||||
EF_T7, EF_S0, EF_S1, EF_S2, EF_S3, EF_S4, EF_S5, EF_S6,
|
||||
EF_A0, EF_A1, EF_A2, EF_A3, EF_A4, EF_A5, EF_T8, EF_T9,
|
||||
EF_T10, EF_T11, EF_RA, EF_T12, EF_AT, EF_GP, EF_SP, -1,
|
||||
EFL + 0, EFL + 1, EFL + 2, EFL + 3, EFL + 4, EFL + 5, EFL + 6, EFL + 7,
|
||||
EFL + 8, EFL + 9, EFL + 10, EFL + 11, EFL + 12, EFL + 13, EFL + 14, EFL + 15,
|
||||
EFL + 16, EFL + 17, EFL + 18, EFL + 19, EFL + 20, EFL + 21, EFL + 22, EFL + 23,
|
||||
EFL + 24, EFL + 25, EFL + 26, EFL + 27, EFL + 28, EFL + 29, EFL + 30, EFL + 31,
|
||||
EFL + 0, EFL + 1, EFL + 2, EFL + 3,
|
||||
EFL + 4, EFL + 5, EFL + 6, EFL + 7,
|
||||
EFL + 8, EFL + 9, EFL + 10, EFL + 11,
|
||||
EFL + 12, EFL + 13, EFL + 14, EFL + 15,
|
||||
EFL + 16, EFL + 17, EFL + 18, EFL + 19,
|
||||
EFL + 20, EFL + 21, EFL + 22, EFL + 23,
|
||||
EFL + 24, EFL + 25, EFL + 26, EFL + 27,
|
||||
EFL + 28, EFL + 29, EFL + 30, EFL + 31,
|
||||
EF_PC, -1, -1
|
||||
#endif
|
||||
};
|
||||
@ -120,12 +127,11 @@ fetch_osf_core_registers (struct regcache *regcache,
|
||||
|
||||
|
||||
#include <sys/procfs.h>
|
||||
/* Prototypes for supply_gregset etc. */
|
||||
/* Prototypes for supply_gregset etc. */
|
||||
#include "gregset.h"
|
||||
|
||||
/*
|
||||
* See the comment in m68k-tdep.c regarding the utility of these functions.
|
||||
*/
|
||||
/* See the comment in m68k-tdep.c regarding the utility of these
|
||||
functions. */
|
||||
|
||||
void
|
||||
supply_gregset (struct regcache *regcache, const gdb_gregset_t *gregsetp)
|
||||
@ -146,10 +152,8 @@ fill_gregset (const struct regcache *regcache,
|
||||
alpha_fill_int_regs (regcache, regno, regp, regp + 31, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we do the same thing for floating-point registers.
|
||||
* Again, see the comments in m68k-tdep.c.
|
||||
*/
|
||||
/* Now we do the same thing for floating-point registers.
|
||||
Again, see the comments in m68k-tdep.c. */
|
||||
|
||||
void
|
||||
supply_fpregset (struct regcache *regcache, const gdb_fpregset_t *fpregsetp)
|
||||
@ -171,7 +175,7 @@ fill_fpregset (const struct regcache *regcache,
|
||||
}
|
||||
|
||||
|
||||
/* Register that we are able to handle alpha core file formats. */
|
||||
/* Register that we are able to handle alpha core file formats. */
|
||||
|
||||
static struct core_fns alpha_osf_core_fns =
|
||||
{
|
||||
|
@ -58,8 +58,8 @@ alpha_osf1_init_abi (struct gdbarch_info info,
|
||||
alpha_mdebug_init_abi (info, gdbarch);
|
||||
|
||||
/* The next/step support via procfs on OSF1 is broken when running
|
||||
on multi-processor machines. We need to use software single stepping
|
||||
instead. */
|
||||
on multi-processor machines. We need to use software single
|
||||
stepping instead. */
|
||||
set_gdbarch_software_single_step (gdbarch, alpha_software_single_step);
|
||||
|
||||
tdep->sigcontext_addr = alpha_osf1_sigcontext_addr;
|
||||
|
@ -81,7 +81,7 @@ static const int subq_function = 0x29;
|
||||
/* Return the name of the REGNO register.
|
||||
|
||||
An empty name corresponds to a register number that used to
|
||||
be used for a virtual register. That virtual register has
|
||||
be used for a virtual register. That virtual register has
|
||||
been removed, but the index is still reserved to maintain
|
||||
compatibility with existing remote alpha targets. */
|
||||
|
||||
@ -229,10 +229,11 @@ alpha_sts (struct gdbarch *gdbarch, void *out, const void *in)
|
||||
register is a floating point register and memory format is float, as the
|
||||
register format must be double or memory format is an integer with 4
|
||||
bytes or less, as the representation of integers in floating point
|
||||
registers is different. */
|
||||
registers is different. */
|
||||
|
||||
static int
|
||||
alpha_convert_register_p (struct gdbarch *gdbarch, int regno, struct type *type)
|
||||
alpha_convert_register_p (struct gdbarch *gdbarch, int regno,
|
||||
struct type *type)
|
||||
{
|
||||
return (regno >= ALPHA_FP0_REGNUM && regno < ALPHA_FP0_REGNUM + 31
|
||||
&& TYPE_LENGTH (type) != 8);
|
||||
@ -493,7 +494,8 @@ alpha_extract_return_value (struct type *valtype, struct regcache *regcache,
|
||||
break;
|
||||
|
||||
default:
|
||||
internal_error (__FILE__, __LINE__, _("unknown floating point width"));
|
||||
internal_error (__FILE__, __LINE__,
|
||||
_("unknown floating point width"));
|
||||
}
|
||||
break;
|
||||
|
||||
@ -516,7 +518,8 @@ alpha_extract_return_value (struct type *valtype, struct regcache *regcache,
|
||||
break;
|
||||
|
||||
default:
|
||||
internal_error (__FILE__, __LINE__, _("unknown floating point width"));
|
||||
internal_error (__FILE__, __LINE__,
|
||||
_("unknown floating point width"));
|
||||
}
|
||||
break;
|
||||
|
||||
@ -561,7 +564,8 @@ alpha_store_return_value (struct type *valtype, struct regcache *regcache,
|
||||
error (_("Cannot set a 128-bit long double return value."));
|
||||
|
||||
default:
|
||||
internal_error (__FILE__, __LINE__, _("unknown floating point width"));
|
||||
internal_error (__FILE__, __LINE__,
|
||||
_("unknown floating point width"));
|
||||
}
|
||||
break;
|
||||
|
||||
@ -585,7 +589,8 @@ alpha_store_return_value (struct type *valtype, struct regcache *regcache,
|
||||
error (_("Cannot set a 128-bit long double return value."));
|
||||
|
||||
default:
|
||||
internal_error (__FILE__, __LINE__, _("unknown floating point width"));
|
||||
internal_error (__FILE__, __LINE__,
|
||||
_("unknown floating point width"));
|
||||
}
|
||||
break;
|
||||
|
||||
@ -719,7 +724,7 @@ alpha_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
|
||||
/* Can't determine prologue from the symbol table, need to examine
|
||||
instructions. */
|
||||
|
||||
/* Skip the typical prologue instructions. These are the stack adjustment
|
||||
/* Skip the typical prologue instructions. These are the stack adjustment
|
||||
instruction and the instructions that save registers on the stack
|
||||
or in the gcc frame. */
|
||||
for (offset = 0; offset < 100; offset += ALPHA_INSN_SIZE)
|
||||
@ -1059,8 +1064,7 @@ alpha_heuristic_analyze_probing_loop (struct gdbarch *gdbarch, CORE_ADDR *pc,
|
||||
|
||||
If anything different is found, the function returns without
|
||||
changing PC and FRAME_SIZE. Otherwise, PC will point immediately
|
||||
after this sequence, and FRAME_SIZE will be updated.
|
||||
*/
|
||||
after this sequence, and FRAME_SIZE will be updated. */
|
||||
|
||||
/* lda REG_INDEX,NB_OF_ITERATIONS */
|
||||
|
||||
@ -1176,7 +1180,7 @@ alpha_heuristic_frame_unwind_cache (struct frame_info *this_frame,
|
||||
if (word & 0x8000)
|
||||
{
|
||||
/* Consider only the first stack allocation instruction
|
||||
to contain the static size of the frame. */
|
||||
to contain the static size of the frame. */
|
||||
if (frame_size == 0)
|
||||
frame_size = (-word) & 0xffff;
|
||||
}
|
||||
@ -1235,7 +1239,8 @@ alpha_heuristic_frame_unwind_cache (struct frame_info *this_frame,
|
||||
the return address register from it.
|
||||
|
||||
FIXME: Rewriting GDB to access the procedure descriptors,
|
||||
e.g. via the minimal symbol table, might obviate this hack. */
|
||||
e.g. via the minimal symbol table, might obviate this
|
||||
hack. */
|
||||
if (return_reg == -1
|
||||
&& cur_pc < (start_pc + 80)
|
||||
&& (reg == ALPHA_T7_REGNUM
|
||||
@ -1511,7 +1516,7 @@ alpha_next_pc (struct frame_info *frame, CORE_ADDR pc)
|
||||
|
||||
insn = alpha_read_insn (gdbarch, pc);
|
||||
|
||||
/* Opcode is top 6 bits. */
|
||||
/* Opcode is top 6 bits. */
|
||||
op = (insn >> 26) & 0x3f;
|
||||
|
||||
if (op == 0x1a)
|
||||
@ -1674,7 +1679,7 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
||||
tdep->sc_regs_offset = 4 * 8;
|
||||
tdep->sc_fpregs_offset = tdep->sc_regs_offset + 32 * 8 + 8;
|
||||
|
||||
tdep->jb_pc = -1; /* longjmp support not enabled by default */
|
||||
tdep->jb_pc = -1; /* longjmp support not enabled by default. */
|
||||
|
||||
tdep->return_in_memory = alpha_return_in_memory_always;
|
||||
|
||||
@ -1780,6 +1785,7 @@ If you are debugging a stripped executable, GDB needs to search through the\n\
|
||||
program for the start of a function. This command sets the distance of the\n\
|
||||
search. The only need to set it is when debugging a stripped executable."),
|
||||
reinit_frame_cache_sfunc,
|
||||
NULL, /* FIXME: i18n: The distance searched for the start of a function is \"%d\". */
|
||||
NULL, /* FIXME: i18n: The distance searched for
|
||||
the start of a function is \"%d\". */
|
||||
&setlist, &showlist);
|
||||
}
|
||||
|
@ -58,9 +58,9 @@ struct regcache;
|
||||
|
||||
The virtual argument pointer is pointing to the bottom of the argument
|
||||
transfer area, which is located immediately below the virtual frame
|
||||
pointer. Its size is fixed for the native compiler, it is either zero
|
||||
pointer. Its size is fixed for the native compiler, it is either zero
|
||||
(for the no arguments case) or large enough to hold all argument registers.
|
||||
gcc uses a variable sized argument transfer area. As it has
|
||||
gcc uses a variable sized argument transfer area. As it has
|
||||
to stay compatible with the native debugging tools it has to use the same
|
||||
virtual argument pointer and adjust the argument offsets accordingly.
|
||||
|
||||
@ -99,7 +99,7 @@ struct gdbarch_tdep
|
||||
int jb_pc; /* Offset to PC value in jump buffer.
|
||||
If htis is negative, longjmp support
|
||||
will be disabled. */
|
||||
size_t jb_elt_size; /* And the size of each entry in the buf. */
|
||||
size_t jb_elt_size; /* And the size of each entry in the buf. */
|
||||
};
|
||||
|
||||
extern unsigned int alpha_read_insn (struct gdbarch *gdbarch, CORE_ADDR pc);
|
||||
|
@ -66,7 +66,8 @@ supply_fpregset (struct regcache *regcache, const fpregset_t *fpregsetp)
|
||||
}
|
||||
|
||||
void
|
||||
fill_fpregset (const struct regcache *regcache, fpregset_t *fpregsetp, int regno)
|
||||
fill_fpregset (const struct regcache *regcache,
|
||||
fpregset_t *fpregsetp, int regno)
|
||||
{
|
||||
alphabsd_fill_fpreg (regcache, (char *) fpregsetp, regno);
|
||||
}
|
||||
@ -100,7 +101,8 @@ alphabsd_fetch_inferior_registers (struct target_ops *ops,
|
||||
return;
|
||||
}
|
||||
|
||||
if (regno == -1 || regno >= gdbarch_fp0_regnum (get_regcache_arch (regcache)))
|
||||
if (regno == -1
|
||||
|| regno >= gdbarch_fp0_regnum (get_regcache_arch (regcache)))
|
||||
{
|
||||
struct fpreg fpregs;
|
||||
|
||||
@ -136,7 +138,8 @@ alphabsd_store_inferior_registers (struct target_ops *ops,
|
||||
return;
|
||||
}
|
||||
|
||||
if (regno == -1 || regno >= gdbarch_fp0_regnum (get_regcache_arch (regcache)))
|
||||
if (regno == -1
|
||||
|| regno >= gdbarch_fp0_regnum (get_regcache_arch (regcache)))
|
||||
{
|
||||
struct fpreg fpregs;
|
||||
|
||||
|
@ -42,7 +42,8 @@ alphabsd_fill_reg (const struct regcache *regcache, char *regs, int regno)
|
||||
}
|
||||
|
||||
void
|
||||
alphabsd_supply_fpreg (struct regcache *regcache, const char *fpregs, int regno)
|
||||
alphabsd_supply_fpreg (struct regcache *regcache,
|
||||
const char *fpregs, int regno)
|
||||
{
|
||||
/* FPCR is at slot 33; slot 32 unused. */
|
||||
alpha_supply_fp_regs (regcache, regno, fpregs, fpregs + 32 * 8);
|
||||
|
@ -55,7 +55,7 @@ int amd64_darwin_thread_state_reg_offset[] =
|
||||
4 * 8, /* %rdi */
|
||||
6 * 8, /* %rbp */
|
||||
7 * 8, /* %rsp */
|
||||
8 * 8, /* %r8 ... */
|
||||
8 * 8, /* %r8 ... */
|
||||
9 * 8,
|
||||
10 * 8,
|
||||
11 * 8,
|
||||
|
@ -40,7 +40,7 @@
|
||||
<asm/ptrace.h> because the latter redefines FS and GS for no apparent
|
||||
reason, and those definitions don't match the ones that libpthread_db
|
||||
uses, which come from <sys/reg.h>. */
|
||||
/* ezannoni-2003-07-09: I think this is fixed. The extraneous defs have
|
||||
/* ezannoni-2003-07-09: I think this is fixed. The extraneous defs have
|
||||
been removed from ptrace.h in the kernel. However, better safe than
|
||||
sorry. */
|
||||
#include <asm/ptrace.h>
|
||||
|
@ -72,7 +72,7 @@ int amd64_linux_gregset_reg_offset[] =
|
||||
14 * 8, /* %rdi */
|
||||
4 * 8, /* %rbp */
|
||||
19 * 8, /* %rsp */
|
||||
9 * 8, /* %r8 ... */
|
||||
9 * 8, /* %r8 ... */
|
||||
8 * 8,
|
||||
7 * 8,
|
||||
6 * 8,
|
||||
@ -1544,7 +1544,7 @@ _initialize_amd64_linux_tdep (void)
|
||||
gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64,
|
||||
GDB_OSABI_LINUX, amd64_linux_init_abi);
|
||||
|
||||
/* Initialize the Linux target description */
|
||||
/* Initialize the Linux target description. */
|
||||
initialize_tdesc_amd64_linux ();
|
||||
initialize_tdesc_amd64_avx_linux ();
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ static int amd64_sol2_gregset_reg_offset[] = {
|
||||
8 * 8, /* %rdi */
|
||||
10 * 8, /* %rbp */
|
||||
20 * 8, /* %rsp */
|
||||
7 * 8, /* %r8 ... */
|
||||
7 * 8, /* %r8 ... */
|
||||
6 * 8,
|
||||
5 * 8,
|
||||
4 * 8,
|
||||
|
@ -587,7 +587,7 @@ amd64_return_value (struct gdbarch *gdbarch, struct type *func_type,
|
||||
|
||||
/* 2. If the type has class MEMORY, then the caller provides space
|
||||
for the return value and passes the address of this storage in
|
||||
%rdi as if it were the first argument to the function. In effect,
|
||||
%rdi as if it were the first argument to the function. In effect,
|
||||
this address becomes a hidden first argument.
|
||||
|
||||
On return %rax will contain the address that has been passed in
|
||||
@ -1564,7 +1564,7 @@ amd64_relocate_instruction (struct gdbarch *gdbarch,
|
||||
|
||||
/* Where "ret" in the original code will return to. */
|
||||
ret_addr = oldloc + insn_length;
|
||||
push_buf[0] = 0x68; /* pushq $... */
|
||||
push_buf[0] = 0x68; /* pushq $... */
|
||||
memcpy (&push_buf[1], &ret_addr, 4);
|
||||
/* Push the push. */
|
||||
append_insns (to, 5, push_buf);
|
||||
|
@ -68,7 +68,7 @@ static int amd64fbsd_r_reg_offset[] =
|
||||
8 * 8, /* %rdi */
|
||||
10 * 8, /* %rbp */
|
||||
20 * 8, /* %rsp */
|
||||
7 * 8, /* %r8 ... */
|
||||
7 * 8, /* %r8 ... */
|
||||
6 * 8,
|
||||
5 * 8,
|
||||
4 * 8,
|
||||
@ -101,7 +101,7 @@ int amd64fbsd_sc_reg_offset[] =
|
||||
24 + 0 * 8, /* %rdi */
|
||||
24 + 8 * 8, /* %rbp */
|
||||
24 + 22 * 8, /* %rsp */
|
||||
24 + 4 * 8, /* %r8 ... */
|
||||
24 + 4 * 8, /* %r8 ... */
|
||||
24 + 5 * 8,
|
||||
24 + 9 * 8,
|
||||
24 + 10 * 8,
|
||||
@ -130,11 +130,11 @@ static int amd64fbsd_jmp_buf_reg_offset[] =
|
||||
-1, /* %rdi */
|
||||
3 * 8, /* %rbp */
|
||||
2 * 8, /* %rsp */
|
||||
-1, /* %r8 ... */
|
||||
-1, /* %r8 ... */
|
||||
-1,
|
||||
-1,
|
||||
-1, /* ... %r11 */
|
||||
4 * 8, /* %r12 ... */
|
||||
4 * 8, /* %r12 ... */
|
||||
5 * 8,
|
||||
6 * 8,
|
||||
7 * 8, /* ... %r15 */
|
||||
|
@ -78,7 +78,7 @@ int amd64nbsd_r_reg_offset[] =
|
||||
0 * 8, /* %rdi */
|
||||
12 * 8, /* %rbp */
|
||||
24 * 8, /* %rsp */
|
||||
4 * 8, /* %r8 .. */
|
||||
4 * 8, /* %r8 .. */
|
||||
5 * 8,
|
||||
6 * 8,
|
||||
7 * 8,
|
||||
|
@ -167,7 +167,7 @@ int amd64obsd_r_reg_offset[] =
|
||||
0 * 8, /* %rdi */
|
||||
12 * 8, /* %rbp */
|
||||
15 * 8, /* %rsp */
|
||||
4 * 8, /* %r8 .. */
|
||||
4 * 8, /* %r8 .. */
|
||||
5 * 8,
|
||||
6 * 8,
|
||||
7 * 8,
|
||||
@ -196,7 +196,7 @@ static int amd64obsd_sc_reg_offset[] =
|
||||
0 * 8, /* %rdi */
|
||||
12 * 8, /* %rbp */
|
||||
24 * 8, /* %rsp */
|
||||
4 * 8, /* %r8 ... */
|
||||
4 * 8, /* %r8 ... */
|
||||
5 * 8,
|
||||
6 * 8,
|
||||
7 * 8,
|
||||
@ -225,7 +225,7 @@ static int amd64obsd_uthread_reg_offset[] =
|
||||
13 * 8, /* %rdi */
|
||||
15 * 8, /* %rbp */
|
||||
-1, /* %rsp */
|
||||
12 * 8, /* %r8 ... */
|
||||
12 * 8, /* %r8 ... */
|
||||
11 * 8,
|
||||
10 * 8,
|
||||
9 * 8,
|
||||
|
@ -36,7 +36,7 @@
|
||||
#include <sys/utsname.h>
|
||||
#include <sys/procfs.h>
|
||||
|
||||
/* Prototypes for supply_gregset etc. */
|
||||
/* Prototypes for supply_gregset etc. */
|
||||
#include "gregset.h"
|
||||
|
||||
/* Defines ps_err_e, struct ps_prochandle. */
|
||||
@ -72,7 +72,7 @@
|
||||
static int arm_linux_has_wmmx_registers;
|
||||
|
||||
/* The number of 64-bit VFP registers we have (expect this to be 0,
|
||||
16, or 32). */
|
||||
16, or 32). */
|
||||
static int arm_linux_vfp_register_count;
|
||||
|
||||
extern int arm_apcs_32;
|
||||
|
@ -105,7 +105,7 @@ static const char arm_linux_thumb2_le_breakpoint[] = { 0xf0, 0xf7, 0x00, 0xa0 };
|
||||
GOT = global offset table
|
||||
|
||||
As much as possible, ELF dynamic linking defers the resolution of
|
||||
jump/call addresses until the last minute. The technique used is
|
||||
jump/call addresses until the last minute. The technique used is
|
||||
inspired by the i386 ELF design, and is based on the following
|
||||
constraints.
|
||||
|
||||
@ -147,9 +147,9 @@ static const char arm_linux_thumb2_le_breakpoint[] = { 0xf0, 0xf7, 0x00, 0xa0 };
|
||||
|
||||
2) In the PLT:
|
||||
|
||||
The PLT is a synthetic area, created by the linker. It exists in
|
||||
both executables and libraries. It is an array of stubs, one per
|
||||
imported function call. It looks like this:
|
||||
The PLT is a synthetic area, created by the linker. It exists in
|
||||
both executables and libraries. It is an array of stubs, one per
|
||||
imported function call. It looks like this:
|
||||
|
||||
PLT[0]:
|
||||
str lr, [sp, #-4]! @push the return address (lr)
|
||||
@ -171,7 +171,7 @@ static const char arm_linux_thumb2_le_breakpoint[] = { 0xf0, 0xf7, 0x00, 0xa0 };
|
||||
lr = &GOT[0] + 8
|
||||
= &GOT[2]
|
||||
|
||||
NOTE: PLT[0] borrows an offset .word from PLT[1]. This is a little
|
||||
NOTE: PLT[0] borrows an offset .word from PLT[1]. This is a little
|
||||
"tight", but allows us to keep all the PLT entries the same size.
|
||||
|
||||
PLT[n+1]:
|
||||
@ -188,12 +188,12 @@ static const char arm_linux_thumb2_le_breakpoint[] = { 0xf0, 0xf7, 0x00, 0xa0 };
|
||||
3) In the GOT:
|
||||
|
||||
The GOT contains helper pointers for both code (PLT) fixups and
|
||||
data fixups. The first 3 entries of the GOT are special. The next
|
||||
data fixups. The first 3 entries of the GOT are special. The next
|
||||
M entries (where M is the number of entries in the PLT) belong to
|
||||
the PLT fixups. The next D (all remaining) entries belong to
|
||||
various data fixups. The actual size of the GOT is 3 + M + D.
|
||||
the PLT fixups. The next D (all remaining) entries belong to
|
||||
various data fixups. The actual size of the GOT is 3 + M + D.
|
||||
|
||||
The GOT is also a synthetic area, created by the linker. It exists
|
||||
The GOT is also a synthetic area, created by the linker. It exists
|
||||
in both executables and libraries. When the GOT is first
|
||||
initialized , all the GOT entries relating to PLT fixups are
|
||||
pointing to code back at PLT[0].
|
||||
@ -784,11 +784,11 @@ arm_linux_copy_svc (struct gdbarch *gdbarch, uint32_t insn, CORE_ADDR to,
|
||||
|
||||
if (debug_displaced)
|
||||
fprintf_unfiltered (gdb_stdlog, "displaced: found "
|
||||
"sigreturn/rt_sigreturn SVC call. PC in frame = %lx\n",
|
||||
"sigreturn/rt_sigreturn SVC call. PC in frame = %lx\n",
|
||||
(unsigned long) get_frame_pc (frame));
|
||||
|
||||
if (debug_displaced)
|
||||
fprintf_unfiltered (gdb_stdlog, "displaced: unwind pc = %lx. "
|
||||
fprintf_unfiltered (gdb_stdlog, "displaced: unwind pc = %lx. "
|
||||
"Setting momentary breakpoint.\n", (unsigned long) return_to);
|
||||
|
||||
gdb_assert (inferior_thread ()->control.step_resume_breakpoint
|
||||
|
156
gdb/arm-tdep.c
156
gdb/arm-tdep.c
@ -19,7 +19,7 @@
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <ctype.h> /* XXX for isupper () */
|
||||
#include <ctype.h> /* XXX for isupper (). */
|
||||
|
||||
#include "defs.h"
|
||||
#include "frame.h"
|
||||
@ -27,7 +27,7 @@
|
||||
#include "gdbcmd.h"
|
||||
#include "gdbcore.h"
|
||||
#include "gdb_string.h"
|
||||
#include "dis-asm.h" /* For register styles. */
|
||||
#include "dis-asm.h" /* For register styles. */
|
||||
#include "regcache.h"
|
||||
#include "reggroups.h"
|
||||
#include "doublest.h"
|
||||
@ -65,7 +65,7 @@ static int arm_debug;
|
||||
MSYMBOL_SET_SPECIAL Actually sets the "special" bit.
|
||||
MSYMBOL_IS_SPECIAL Tests the "special" bit in a minimal symbol. */
|
||||
|
||||
#define MSYMBOL_SET_SPECIAL(msym) \
|
||||
#define MSYMBOL_SET_SPECIAL(msym) \
|
||||
MSYMBOL_TARGET_FLAG_1 (msym) = 1
|
||||
|
||||
#define MSYMBOL_IS_SPECIAL(msym) \
|
||||
@ -845,7 +845,8 @@ thumb_analyze_prologue (struct gdbarch *gdbarch,
|
||||
break;
|
||||
}
|
||||
|
||||
else if ((insn & 0xffd0) == 0xe900 /* stmdb Rn{!}, { registers } */
|
||||
else if ((insn & 0xffd0) == 0xe900 /* stmdb Rn{!},
|
||||
{ registers } */
|
||||
&& pv_is_register (regs[bits (insn, 0, 3)], ARM_SP_REGNUM))
|
||||
{
|
||||
pv_t addr = regs[bits (insn, 0, 3)];
|
||||
@ -866,7 +867,8 @@ thumb_analyze_prologue (struct gdbarch *gdbarch,
|
||||
regs[bits (insn, 0, 3)] = addr;
|
||||
}
|
||||
|
||||
else if ((insn & 0xff50) == 0xe940 /* strd Rt, Rt2, [Rn, #+/-imm]{!} */
|
||||
else if ((insn & 0xff50) == 0xe940 /* strd Rt, Rt2,
|
||||
[Rn, #+/-imm]{!} */
|
||||
&& pv_is_register (regs[bits (insn, 0, 3)], ARM_SP_REGNUM))
|
||||
{
|
||||
int regno1 = bits (inst2, 12, 15);
|
||||
@ -938,14 +940,16 @@ thumb_analyze_prologue (struct gdbarch *gdbarch,
|
||||
/* Ignore stores of argument registers to the stack. */
|
||||
;
|
||||
|
||||
else if ((insn & 0xffd0) == 0xe890 /* ldmia Rn[!], { registers } */
|
||||
else if ((insn & 0xffd0) == 0xe890 /* ldmia Rn[!],
|
||||
{ registers } */
|
||||
&& (inst2 & 0x8000) == 0x0000
|
||||
&& pv_is_register (regs[bits (insn, 0, 3)], ARM_SP_REGNUM))
|
||||
/* Ignore block loads from the stack, potentially copying
|
||||
parameters from memory. */
|
||||
;
|
||||
|
||||
else if ((insn & 0xffb0) == 0xe950 /* ldrd Rt, Rt2, [Rn, #+/-imm] */
|
||||
else if ((insn & 0xffb0) == 0xe950 /* ldrd Rt, Rt2,
|
||||
[Rn, #+/-imm] */
|
||||
&& pv_is_register (regs[bits (insn, 0, 3)], ARM_SP_REGNUM))
|
||||
/* Similarly ignore dual loads from the stack. */
|
||||
;
|
||||
@ -1223,8 +1227,8 @@ arm_analyze_load_stack_chk_guard(CORE_ADDR pc, struct gdbarch *gdbarch,
|
||||
}
|
||||
|
||||
/* Try to skip a sequence of instructions used for stack protector. If PC
|
||||
points to the first instruction of this sequence, return the address of first
|
||||
instruction after this sequence, otherwise, return original PC.
|
||||
points to the first instruction of this sequence, return the address of
|
||||
first instruction after this sequence, otherwise, return original PC.
|
||||
|
||||
On arm, this sequence of instructions is composed of mainly three steps,
|
||||
Step 1: load symbol __stack_chk_guard,
|
||||
@ -1338,7 +1342,7 @@ arm_skip_stack_protector(CORE_ADDR pc, struct gdbarch *gdbarch)
|
||||
[stfe f6, [sp, #-12]!]
|
||||
[stfe f5, [sp, #-12]!]
|
||||
[stfe f4, [sp, #-12]!]
|
||||
sub fp, ip, #nn @@ nn == 20 or 4 depending on second insn */
|
||||
sub fp, ip, #nn @@ nn == 20 or 4 depending on second insn. */
|
||||
|
||||
static CORE_ADDR
|
||||
arm_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
|
||||
@ -1408,7 +1412,7 @@ arm_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
|
||||
/* Find an upper limit on the function prologue using the debug
|
||||
information. If the debug information could not be used to provide
|
||||
that bound, then use an arbitrary large number as the upper bound. */
|
||||
/* Like arm_scan_prologue, stop no later than pc + 64. */
|
||||
/* Like arm_scan_prologue, stop no later than pc + 64. */
|
||||
limit_pc = skip_prologue_using_sal (gdbarch, pc);
|
||||
if (limit_pc == 0)
|
||||
limit_pc = pc + 64; /* Magic. */
|
||||
@ -1475,7 +1479,7 @@ arm_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
|
||||
break;
|
||||
}
|
||||
|
||||
return skip_pc; /* End of prologue */
|
||||
return skip_pc; /* End of prologue. */
|
||||
}
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
@ -1692,7 +1696,8 @@ arm_analyze_prologue (struct gdbarch *gdbarch,
|
||||
regs[rd] = pv_add_constant (regs[bits (insn, 16, 19)], -imm);
|
||||
continue;
|
||||
}
|
||||
else if ((insn & 0xffff0fff) == 0xe52d0004) /* str Rd, [sp, #-4]! */
|
||||
else if ((insn & 0xffff0fff) == 0xe52d0004) /* str Rd,
|
||||
[sp, #-4]! */
|
||||
{
|
||||
if (pv_area_store_would_trash (stack, regs[ARM_SP_REGNUM]))
|
||||
break;
|
||||
@ -1715,7 +1720,8 @@ arm_analyze_prologue (struct gdbarch *gdbarch,
|
||||
for (regno = ARM_PC_REGNUM; regno >= 0; regno--)
|
||||
if (mask & (1 << regno))
|
||||
{
|
||||
regs[ARM_SP_REGNUM] = pv_add_constant (regs[ARM_SP_REGNUM], -4);
|
||||
regs[ARM_SP_REGNUM]
|
||||
= pv_add_constant (regs[ARM_SP_REGNUM], -4);
|
||||
pv_area_store (stack, regs[ARM_SP_REGNUM], 4, regs[regno]);
|
||||
}
|
||||
}
|
||||
@ -1733,7 +1739,8 @@ arm_analyze_prologue (struct gdbarch *gdbarch,
|
||||
/* No need to add this to saved_regs -- it's just an arg reg. */
|
||||
continue;
|
||||
}
|
||||
else if ((insn & 0xfff00000) == 0xe8800000 /* stm Rn, { registers } */
|
||||
else if ((insn & 0xfff00000) == 0xe8800000 /* stm Rn,
|
||||
{ registers } */
|
||||
&& pv_is_register (regs[bits (insn, 16, 19)], ARM_SP_REGNUM))
|
||||
{
|
||||
/* No need to add this to saved_regs -- it's just arg regs. */
|
||||
@ -1753,7 +1760,8 @@ arm_analyze_prologue (struct gdbarch *gdbarch,
|
||||
imm = (imm >> rot) | (imm << (32 - rot));
|
||||
regs[ARM_SP_REGNUM] = pv_add_constant (regs[ARM_SP_REGNUM], -imm);
|
||||
}
|
||||
else if ((insn & 0xffff7fff) == 0xed6d0103 /* stfe f?, [sp, -#c]! */
|
||||
else if ((insn & 0xffff7fff) == 0xed6d0103 /* stfe f?,
|
||||
[sp, -#c]! */
|
||||
&& gdbarch_tdep (gdbarch)->have_fpa_registers)
|
||||
{
|
||||
if (pv_area_store_would_trash (stack, regs[ARM_SP_REGNUM]))
|
||||
@ -1763,7 +1771,8 @@ arm_analyze_prologue (struct gdbarch *gdbarch,
|
||||
regno = ARM_F0_REGNUM + ((insn >> 12) & 0x07);
|
||||
pv_area_store (stack, regs[ARM_SP_REGNUM], 12, regs[regno]);
|
||||
}
|
||||
else if ((insn & 0xffbf0fff) == 0xec2d0200 /* sfmfd f0, 4, [sp!] */
|
||||
else if ((insn & 0xffbf0fff) == 0xec2d0200 /* sfmfd f0, 4,
|
||||
[sp!] */
|
||||
&& gdbarch_tdep (gdbarch)->have_fpa_registers)
|
||||
{
|
||||
int n_saved_fp_regs;
|
||||
@ -1809,7 +1818,7 @@ arm_analyze_prologue (struct gdbarch *gdbarch,
|
||||
break;
|
||||
}
|
||||
else if ((insn & 0xf0000000) != 0xe0000000)
|
||||
break; /* Condition not true, exit early */
|
||||
break; /* Condition not true, exit early. */
|
||||
else if (arm_instruction_changes_pc (insn))
|
||||
/* Don't scan past anything that might change control flow. */
|
||||
break;
|
||||
@ -2186,7 +2195,8 @@ struct frame_base arm_normal_base = {
|
||||
static struct frame_id
|
||||
arm_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
|
||||
{
|
||||
return frame_id_build (get_frame_register_unsigned (this_frame, ARM_SP_REGNUM),
|
||||
return frame_id_build (get_frame_register_unsigned (this_frame,
|
||||
ARM_SP_REGNUM),
|
||||
get_frame_pc (this_frame));
|
||||
}
|
||||
|
||||
@ -2355,7 +2365,7 @@ thumb_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc)
|
||||
exception of return itself, updates the stack pointer, we need to
|
||||
scan backwards for at most one instruction. Try either a 16-bit or
|
||||
a 32-bit instruction. This is just a heuristic, so we do not worry
|
||||
too much about false positives.*/
|
||||
too much about false positives. */
|
||||
|
||||
if (!found_stack_adjust)
|
||||
{
|
||||
@ -3396,7 +3406,7 @@ bitcount (unsigned long val)
|
||||
{
|
||||
int nbits;
|
||||
for (nbits = 0; val != 0; nbits++)
|
||||
val &= val - 1; /* delete rightmost 1-bit in val */
|
||||
val &= val - 1; /* Delete rightmost 1-bit in val. */
|
||||
return nbits;
|
||||
}
|
||||
|
||||
@ -3441,7 +3451,7 @@ thumb_get_next_pc_raw (struct frame_info *frame, CORE_ADDR pc, int insert_bkpt)
|
||||
enum bfd_endian byte_order_for_code = gdbarch_byte_order_for_code (gdbarch);
|
||||
unsigned long pc_val = ((unsigned long) pc) + 4; /* PC after prefetch */
|
||||
unsigned short inst1;
|
||||
CORE_ADDR nextpc = pc + 2; /* default is next instruction */
|
||||
CORE_ADDR nextpc = pc + 2; /* Default is next instruction. */
|
||||
unsigned long offset;
|
||||
ULONGEST status, itstate;
|
||||
|
||||
@ -3481,7 +3491,8 @@ thumb_get_next_pc_raw (struct frame_info *frame, CORE_ADDR pc, int insert_bkpt)
|
||||
|
||||
while (itstate != 0 && ! condition_true (itstate >> 4, status))
|
||||
{
|
||||
inst1 = read_memory_unsigned_integer (pc, 2, byte_order_for_code);
|
||||
inst1 = read_memory_unsigned_integer (pc, 2,
|
||||
byte_order_for_code);
|
||||
pc += thumb_insn_size (inst1);
|
||||
itstate = thumb_advance_itstate (itstate);
|
||||
}
|
||||
@ -3499,7 +3510,8 @@ thumb_get_next_pc_raw (struct frame_info *frame, CORE_ADDR pc, int insert_bkpt)
|
||||
|
||||
while (itstate != 0 && ! condition_true (itstate >> 4, status))
|
||||
{
|
||||
inst1 = read_memory_unsigned_integer (pc, 2, byte_order_for_code);
|
||||
inst1 = read_memory_unsigned_integer (pc, 2,
|
||||
byte_order_for_code);
|
||||
pc += thumb_insn_size (inst1);
|
||||
itstate = thumb_advance_itstate (itstate);
|
||||
}
|
||||
@ -3540,7 +3552,8 @@ thumb_get_next_pc_raw (struct frame_info *frame, CORE_ADDR pc, int insert_bkpt)
|
||||
the instruction after the IT block. */
|
||||
do
|
||||
{
|
||||
inst1 = read_memory_unsigned_integer (pc, 2, byte_order_for_code);
|
||||
inst1 = read_memory_unsigned_integer (pc, 2,
|
||||
byte_order_for_code);
|
||||
pc += thumb_insn_size (inst1);
|
||||
itstate = thumb_advance_itstate (itstate);
|
||||
}
|
||||
@ -3807,8 +3820,8 @@ thumb_get_next_pc_raw (struct frame_info *frame, CORE_ADDR pc, int insert_bkpt)
|
||||
The value returned has the execution state of the next instruction
|
||||
encoded in it. Use IS_THUMB_ADDR () to see whether the instruction is
|
||||
in Thumb-State, and gdbarch_addr_bits_remove () to get the plain memory
|
||||
address.
|
||||
*/
|
||||
address. */
|
||||
|
||||
static CORE_ADDR
|
||||
arm_get_next_pc_raw (struct frame_info *frame, CORE_ADDR pc, int insert_bkpt)
|
||||
{
|
||||
@ -3879,7 +3892,7 @@ arm_get_next_pc_raw (struct frame_info *frame, CORE_ADDR pc, int insert_bkpt)
|
||||
return nextpc;
|
||||
}
|
||||
|
||||
/* Multiply into PC */
|
||||
/* Multiply into PC. */
|
||||
c = (status & FLAG_C) ? 1 : 0;
|
||||
rn = bits (this_instr, 16, 19);
|
||||
operand1 = (rn == 15) ? pc_val + 8
|
||||
@ -3892,8 +3905,9 @@ arm_get_next_pc_raw (struct frame_info *frame, CORE_ADDR pc, int insert_bkpt)
|
||||
operand2 = ((immval >> rotate) | (immval << (32 - rotate)))
|
||||
& 0xffffffff;
|
||||
}
|
||||
else /* operand 2 is a shifted register */
|
||||
operand2 = shifted_reg_val (frame, this_instr, c, pc_val, status);
|
||||
else /* operand 2 is a shifted register. */
|
||||
operand2 = shifted_reg_val (frame, this_instr, c,
|
||||
pc_val, status);
|
||||
|
||||
switch (bits (this_instr, 21, 24))
|
||||
{
|
||||
@ -4235,7 +4249,8 @@ arm_adjust_breakpoint_address (struct gdbarch *gdbarch, CORE_ADDR bpaddr)
|
||||
known boundary. */
|
||||
if (! definite)
|
||||
{
|
||||
buf = extend_buffer_earlier (buf, bpaddr, buf_len, bpaddr - boundary);
|
||||
buf = extend_buffer_earlier (buf, bpaddr, buf_len,
|
||||
bpaddr - boundary);
|
||||
if (buf == NULL)
|
||||
return bpaddr;
|
||||
buf_len = bpaddr - boundary;
|
||||
@ -4296,7 +4311,7 @@ arm_adjust_breakpoint_address (struct gdbarch *gdbarch, CORE_ADDR bpaddr)
|
||||
arm_process_displaced_insn (called from arm_displaced_step_copy_insn).
|
||||
Depending on the type of instruction, it is then copied to a scratch
|
||||
location, possibly in a modified form. The copy_* set of functions
|
||||
performs such modification, as necessary. A breakpoint is placed after
|
||||
performs such modification, as necessary. A breakpoint is placed after
|
||||
the modified instruction in the scratch space to return control to GDB.
|
||||
Note in particular that instructions which modify the PC will no longer
|
||||
do so after modification.
|
||||
@ -4358,9 +4373,11 @@ branch_write_pc (struct regcache *regs, ULONGEST val)
|
||||
if (displaced_in_arm_mode (regs))
|
||||
/* Note: If bits 0/1 are set, this branch would be unpredictable for
|
||||
architecture versions < 6. */
|
||||
regcache_cooked_write_unsigned (regs, ARM_PC_REGNUM, val & ~(ULONGEST) 0x3);
|
||||
regcache_cooked_write_unsigned (regs, ARM_PC_REGNUM,
|
||||
val & ~(ULONGEST) 0x3);
|
||||
else
|
||||
regcache_cooked_write_unsigned (regs, ARM_PC_REGNUM, val & ~(ULONGEST) 0x1);
|
||||
regcache_cooked_write_unsigned (regs, ARM_PC_REGNUM,
|
||||
val & ~(ULONGEST) 0x1);
|
||||
}
|
||||
|
||||
/* Write to the PC as from a branch-exchange instruction. */
|
||||
@ -4469,9 +4486,9 @@ displaced_write_reg (struct regcache *regs, struct displaced_step_closure *dsc,
|
||||
|
||||
/* This function is used to concisely determine if an instruction INSN
|
||||
references PC. Register fields of interest in INSN should have the
|
||||
corresponding fields of BITMASK set to 0b1111. The function returns return 1
|
||||
if any of these fields in INSN reference the PC (also 0b1111, r15), else it
|
||||
returns 0. */
|
||||
corresponding fields of BITMASK set to 0b1111. The function
|
||||
returns return 1 if any of these fields in INSN reference the PC
|
||||
(also 0b1111, r15), else it returns 0. */
|
||||
|
||||
static int
|
||||
insn_references_pc (uint32_t insn, uint32_t bitmask)
|
||||
@ -4564,7 +4581,8 @@ copy_preload (struct gdbarch *gdbarch, uint32_t insn, struct regcache *regs,
|
||||
/* Preload instructions with register offset. */
|
||||
|
||||
static int
|
||||
copy_preload_reg (struct gdbarch *gdbarch, uint32_t insn, struct regcache *regs,
|
||||
copy_preload_reg (struct gdbarch *gdbarch, uint32_t insn,
|
||||
struct regcache *regs,
|
||||
struct displaced_step_closure *dsc)
|
||||
{
|
||||
unsigned int rn = bits (insn, 16, 19);
|
||||
@ -4741,7 +4759,8 @@ copy_bx_blx_reg (struct gdbarch *gdbarch, uint32_t insn,
|
||||
|
||||
if (debug_displaced)
|
||||
fprintf_unfiltered (gdb_stdlog, "displaced: copying %s register insn "
|
||||
"%.8lx\n", (link) ? "blx" : "bx", (unsigned long) insn);
|
||||
"%.8lx\n", (link) ? "blx" : "bx",
|
||||
(unsigned long) insn);
|
||||
|
||||
/* Implement {BX,BLX}<cond> <reg>" as:
|
||||
|
||||
@ -4764,7 +4783,7 @@ copy_bx_blx_reg (struct gdbarch *gdbarch, uint32_t insn,
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Copy/cleanup arithmetic/logic instruction with immediate RHS. */
|
||||
/* Copy/cleanup arithmetic/logic instruction with immediate RHS. */
|
||||
|
||||
static void
|
||||
cleanup_alu_imm (struct gdbarch *gdbarch,
|
||||
@ -4912,7 +4931,8 @@ cleanup_alu_shifted_reg (struct gdbarch *gdbarch,
|
||||
|
||||
static int
|
||||
copy_alu_shifted_reg (struct gdbarch *gdbarch, uint32_t insn,
|
||||
struct regcache *regs, struct displaced_step_closure *dsc)
|
||||
struct regcache *regs,
|
||||
struct displaced_step_closure *dsc)
|
||||
{
|
||||
unsigned int rn = bits (insn, 16, 19);
|
||||
unsigned int rm = bits (insn, 0, 3);
|
||||
@ -5426,13 +5446,15 @@ copy_block_xfer (struct gdbarch *gdbarch, uint32_t insn, struct regcache *regs,
|
||||
int rn = bits (insn, 16, 19);
|
||||
CORE_ADDR from = dsc->insn_addr;
|
||||
|
||||
/* Block transfers which don't mention PC can be run directly out-of-line. */
|
||||
/* Block transfers which don't mention PC can be run directly
|
||||
out-of-line. */
|
||||
if (rn != 15 && (insn & 0x8000) == 0)
|
||||
return copy_unmodified (gdbarch, insn, "ldm/stm", dsc);
|
||||
|
||||
if (rn == 15)
|
||||
{
|
||||
warning (_("displaced: Unpredictable LDM or STM with base register r15"));
|
||||
warning (_("displaced: Unpredictable LDM or STM with "
|
||||
"base register r15"));
|
||||
return copy_unmodified (gdbarch, insn, "unpredictable ldm/stm", dsc);
|
||||
}
|
||||
|
||||
@ -5578,7 +5600,8 @@ copy_undef (struct gdbarch *gdbarch, uint32_t insn,
|
||||
struct displaced_step_closure *dsc)
|
||||
{
|
||||
if (debug_displaced)
|
||||
fprintf_unfiltered (gdb_stdlog, "displaced: copying undefined insn %.8lx\n",
|
||||
fprintf_unfiltered (gdb_stdlog,
|
||||
"displaced: copying undefined insn %.8lx\n",
|
||||
(unsigned long) insn);
|
||||
|
||||
dsc->modinsn[0] = insn;
|
||||
@ -5665,7 +5688,8 @@ decode_misc_memhint_neon (struct gdbarch *gdbarch, uint32_t insn,
|
||||
|
||||
static int
|
||||
decode_unconditional (struct gdbarch *gdbarch, uint32_t insn,
|
||||
struct regcache *regs, struct displaced_step_closure *dsc)
|
||||
struct regcache *regs,
|
||||
struct displaced_step_closure *dsc)
|
||||
{
|
||||
if (bit (insn, 27) == 0)
|
||||
return decode_misc_memhint_neon (gdbarch, insn, regs, dsc);
|
||||
@ -5749,7 +5773,8 @@ decode_unconditional (struct gdbarch *gdbarch, uint32_t insn,
|
||||
|
||||
static int
|
||||
decode_miscellaneous (struct gdbarch *gdbarch, uint32_t insn,
|
||||
struct regcache *regs, struct displaced_step_closure *dsc)
|
||||
struct regcache *regs,
|
||||
struct displaced_step_closure *dsc)
|
||||
{
|
||||
unsigned int op2 = bits (insn, 4, 6);
|
||||
unsigned int op = bits (insn, 21, 22);
|
||||
@ -5777,7 +5802,8 @@ decode_miscellaneous (struct gdbarch *gdbarch, uint32_t insn,
|
||||
|
||||
case 0x3:
|
||||
if (op == 0x1)
|
||||
return copy_bx_blx_reg (gdbarch, insn, regs, dsc); /* blx register. */
|
||||
return copy_bx_blx_reg (gdbarch, insn,
|
||||
regs, dsc); /* blx register. */
|
||||
else
|
||||
return copy_undef (gdbarch, insn, dsc);
|
||||
|
||||
@ -5947,7 +5973,8 @@ decode_b_bl_ldmstm (struct gdbarch *gdbarch, int32_t insn,
|
||||
|
||||
static int
|
||||
decode_ext_reg_ld_st (struct gdbarch *gdbarch, uint32_t insn,
|
||||
struct regcache *regs, struct displaced_step_closure *dsc)
|
||||
struct regcache *regs,
|
||||
struct displaced_step_closure *dsc)
|
||||
{
|
||||
unsigned int opcode = bits (insn, 20, 24);
|
||||
|
||||
@ -6023,7 +6050,8 @@ decode_svc_copro (struct gdbarch *gdbarch, uint32_t insn, CORE_ADDR to,
|
||||
|
||||
void
|
||||
arm_process_displaced_insn (struct gdbarch *gdbarch, uint32_t insn,
|
||||
CORE_ADDR from, CORE_ADDR to, struct regcache *regs,
|
||||
CORE_ADDR from, CORE_ADDR to,
|
||||
struct regcache *regs,
|
||||
struct displaced_step_closure *dsc)
|
||||
{
|
||||
int err = 0;
|
||||
@ -6205,7 +6233,7 @@ gdb_print_insn_arm (bfd_vma memaddr, disassemble_info *info)
|
||||
1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
|
||||
C C C C 0 1 1 x x x x x x x x x x x x x x x x x x x x 1 x x x x
|
||||
|
||||
Even this may only true if the condition predicate is true. The
|
||||
Even this may only true if the condition predicate is true. The
|
||||
following use a condition predicate of ALWAYS so it is always TRUE.
|
||||
|
||||
There are other ways of forcing a breakpoint. GNU/Linux, RISC iX,
|
||||
@ -6322,9 +6350,9 @@ arm_extract_return_value (struct type *type, struct regcache *regs,
|
||||
break;
|
||||
|
||||
default:
|
||||
internal_error
|
||||
(__FILE__, __LINE__,
|
||||
_("arm_extract_return_value: Floating point model not supported"));
|
||||
internal_error (__FILE__, __LINE__,
|
||||
_("arm_extract_return_value: "
|
||||
"Floating point model not supported"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -6449,7 +6477,8 @@ arm_return_in_memory (struct gdbarch *gdbarch, struct type *type)
|
||||
for (i = 0; i < TYPE_NFIELDS (type); i++)
|
||||
{
|
||||
enum type_code field_type_code;
|
||||
field_type_code = TYPE_CODE (check_typedef (TYPE_FIELD_TYPE (type, i)));
|
||||
field_type_code = TYPE_CODE (check_typedef (TYPE_FIELD_TYPE (type,
|
||||
i)));
|
||||
|
||||
/* Is it a floating point type field? */
|
||||
if (field_type_code == TYPE_CODE_FLT)
|
||||
@ -6841,8 +6870,9 @@ arm_show_fallback_mode (struct ui_file *file, int from_tty,
|
||||
{
|
||||
struct gdbarch_tdep *tdep = gdbarch_tdep (target_gdbarch);
|
||||
|
||||
fprintf_filtered (file, _("\
|
||||
The current execution mode assumed (when symbols are unavailable) is \"%s\".\n"),
|
||||
fprintf_filtered (file,
|
||||
_("The current execution mode assumed "
|
||||
"(when symbols are unavailable) is \"%s\".\n"),
|
||||
arm_fallback_mode_string);
|
||||
}
|
||||
|
||||
@ -6852,8 +6882,9 @@ arm_show_force_mode (struct ui_file *file, int from_tty,
|
||||
{
|
||||
struct gdbarch_tdep *tdep = gdbarch_tdep (target_gdbarch);
|
||||
|
||||
fprintf_filtered (file, _("\
|
||||
The current execution mode assumed (even when symbols are available) is \"%s\".\n"),
|
||||
fprintf_filtered (file,
|
||||
_("The current execution mode assumed "
|
||||
"(even when symbols are available) is \"%s\".\n"),
|
||||
arm_force_mode_string);
|
||||
}
|
||||
|
||||
@ -7333,7 +7364,8 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
||||
not. */
|
||||
attr_arch = bfd_elf_get_obj_attr_int (info.abfd, OBJ_ATTR_PROC,
|
||||
Tag_CPU_arch);
|
||||
attr_profile = bfd_elf_get_obj_attr_int (info.abfd, OBJ_ATTR_PROC,
|
||||
attr_profile = bfd_elf_get_obj_attr_int (info.abfd,
|
||||
OBJ_ATTR_PROC,
|
||||
Tag_CPU_arch_profile);
|
||||
/* GCC specifies the profile for v6-M; RealView only
|
||||
specifies the profile for architectures starting with
|
||||
@ -7875,7 +7907,8 @@ _initialize_arm_tdep (void)
|
||||
_("Show the disassembly style."),
|
||||
helptext,
|
||||
set_disassembly_style_sfunc,
|
||||
NULL, /* FIXME: i18n: The disassembly style is \"%s\". */
|
||||
NULL, /* FIXME: i18n: The disassembly style is
|
||||
\"%s\". */
|
||||
&setarmcmdlist, &showarmcmdlist);
|
||||
|
||||
add_setshow_boolean_cmd ("apcs32", no_class, &arm_apcs_32,
|
||||
@ -7883,7 +7916,8 @@ _initialize_arm_tdep (void)
|
||||
_("Show usage of ARM 32-bit mode."),
|
||||
_("When off, a 26-bit PC will be used."),
|
||||
NULL,
|
||||
NULL, /* FIXME: i18n: Usage of ARM 32-bit mode is %s. */
|
||||
NULL, /* FIXME: i18n: Usage of ARM 32-bit
|
||||
mode is %s. */
|
||||
&setarmcmdlist, &showarmcmdlist);
|
||||
|
||||
/* Add a command to allow the user to force the FPU model. */
|
||||
|
@ -102,7 +102,7 @@ fetch_register (struct regcache *regcache, int regno)
|
||||
break;
|
||||
|
||||
case ARM_PC_REGNUM:
|
||||
/* This is ok: we're running native... */
|
||||
/* This is ok: we're running native... */
|
||||
inferior_registers.r_pc = gdbarch_addr_bits_remove
|
||||
(get_regcache_arch (regcache),
|
||||
inferior_registers.r_pc);
|
||||
|
127
gdb/avr-tdep.c
127
gdb/avr-tdep.c
@ -43,14 +43,14 @@
|
||||
(AVR micros are pure Harvard Architecture processors.)
|
||||
|
||||
The AVR family of microcontrollers have three distinctly different memory
|
||||
spaces: flash, sram and eeprom. The flash is 16 bits wide and is used for
|
||||
the most part to store program instructions. The sram is 8 bits wide and is
|
||||
used for the stack and the heap. Some devices lack sram and some can have
|
||||
spaces: flash, sram and eeprom. The flash is 16 bits wide and is used for
|
||||
the most part to store program instructions. The sram is 8 bits wide and is
|
||||
used for the stack and the heap. Some devices lack sram and some can have
|
||||
an additional external sram added on as a peripheral.
|
||||
|
||||
The eeprom is 8 bits wide and is used to store data when the device is
|
||||
powered down. Eeprom is not directly accessible, it can only be accessed
|
||||
via io-registers using a special algorithm. Accessing eeprom via gdb's
|
||||
powered down. Eeprom is not directly accessible, it can only be accessed
|
||||
via io-registers using a special algorithm. Accessing eeprom via gdb's
|
||||
remote serial protocol ('m' or 'M' packets) looks difficult to do and is
|
||||
not included at this time.
|
||||
|
||||
@ -59,15 +59,15 @@
|
||||
work, the remote target must be able to handle eeprom accesses and perform
|
||||
the address translation.]
|
||||
|
||||
All three memory spaces have physical addresses beginning at 0x0. In
|
||||
All three memory spaces have physical addresses beginning at 0x0. In
|
||||
addition, the flash is addressed by gcc/binutils/gdb with respect to 8 bit
|
||||
bytes instead of the 16 bit wide words used by the real device for the
|
||||
Program Counter.
|
||||
|
||||
In order for remote targets to work correctly, extra bits must be added to
|
||||
addresses before they are send to the target or received from the target
|
||||
via the remote serial protocol. The extra bits are the MSBs and are used to
|
||||
decode which memory space the address is referring to. */
|
||||
via the remote serial protocol. The extra bits are the MSBs and are used to
|
||||
decode which memory space the address is referring to. */
|
||||
|
||||
#undef XMALLOC
|
||||
#define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
|
||||
@ -97,10 +97,10 @@ enum
|
||||
|
||||
AVR_MAX_PROLOGUE_SIZE = 64, /* bytes */
|
||||
|
||||
/* Count of pushed registers. From r2 to r17 (inclusively), r28, r29 */
|
||||
/* Count of pushed registers. From r2 to r17 (inclusively), r28, r29 */
|
||||
AVR_MAX_PUSHES = 18,
|
||||
|
||||
/* Number of the last pushed register. r17 for current avr-gcc */
|
||||
/* Number of the last pushed register. r17 for current avr-gcc */
|
||||
AVR_LAST_PUSHED_REGNUM = 17,
|
||||
|
||||
AVR_ARG1_REGNUM = 24, /* Single byte argument */
|
||||
@ -110,14 +110,14 @@ enum
|
||||
AVR_RETN_REGNUM = 25, /* Multi byte return value */
|
||||
|
||||
/* FIXME: TRoth/2002-01-??: Can we shift all these memory masks left 8
|
||||
bits? Do these have to match the bfd vma values?. It sure would make
|
||||
bits? Do these have to match the bfd vma values? It sure would make
|
||||
things easier in the future if they didn't need to match.
|
||||
|
||||
Note: I chose these values so as to be consistent with bfd vma
|
||||
addresses.
|
||||
|
||||
TRoth/2002-04-08: There is already a conflict with very large programs
|
||||
in the mega128. The mega128 has 128K instruction bytes (64K words),
|
||||
in the mega128. The mega128 has 128K instruction bytes (64K words),
|
||||
thus the Most Significant Bit is 0x10000 which gets masked off my
|
||||
AVR_MEM_MASK.
|
||||
|
||||
@ -126,10 +126,10 @@ enum
|
||||
thus requires a 17-bit address.
|
||||
|
||||
For now, I've just removed the EEPROM mask and changed AVR_MEM_MASK
|
||||
from 0x00ff0000 to 0x00f00000. Eeprom is not accessible from gdb yet,
|
||||
from 0x00ff0000 to 0x00f00000. Eeprom is not accessible from gdb yet,
|
||||
but could be for some remote targets by just adding the correct offset
|
||||
to the address and letting the remote target handle the low-level
|
||||
details of actually accessing the eeprom. */
|
||||
details of actually accessing the eeprom. */
|
||||
|
||||
AVR_IMEM_START = 0x00000000, /* INSN memory */
|
||||
AVR_SMEM_START = 0x00800000, /* SRAM memory */
|
||||
@ -194,7 +194,7 @@ struct gdbarch_tdep
|
||||
struct type *pc_type;
|
||||
};
|
||||
|
||||
/* Lookup the name of a register given it's number. */
|
||||
/* Lookup the name of a register given it's number. */
|
||||
|
||||
static const char *
|
||||
avr_register_name (struct gdbarch *gdbarch, int regnum)
|
||||
@ -229,7 +229,7 @@ avr_register_type (struct gdbarch *gdbarch, int reg_nr)
|
||||
return builtin_type (gdbarch)->builtin_uint8;
|
||||
}
|
||||
|
||||
/* Instruction address checks and convertions. */
|
||||
/* Instruction address checks and convertions. */
|
||||
|
||||
static CORE_ADDR
|
||||
avr_make_iaddr (CORE_ADDR x)
|
||||
@ -237,10 +237,10 @@ avr_make_iaddr (CORE_ADDR x)
|
||||
return ((x) | AVR_IMEM_START);
|
||||
}
|
||||
|
||||
/* FIXME: TRoth: Really need to use a larger mask for instructions. Some
|
||||
/* FIXME: TRoth: Really need to use a larger mask for instructions. Some
|
||||
devices are already up to 128KBytes of flash space.
|
||||
|
||||
TRoth/2002-04-8: See comment above where AVR_IMEM_START is defined. */
|
||||
TRoth/2002-04-8: See comment above where AVR_IMEM_START is defined. */
|
||||
|
||||
static CORE_ADDR
|
||||
avr_convert_iaddr_to_raw (CORE_ADDR x)
|
||||
@ -248,7 +248,7 @@ avr_convert_iaddr_to_raw (CORE_ADDR x)
|
||||
return ((x) & 0xffffffff);
|
||||
}
|
||||
|
||||
/* SRAM address checks and convertions. */
|
||||
/* SRAM address checks and convertions. */
|
||||
|
||||
static CORE_ADDR
|
||||
avr_make_saddr (CORE_ADDR x)
|
||||
@ -266,11 +266,11 @@ avr_convert_saddr_to_raw (CORE_ADDR x)
|
||||
return ((x) & 0xffffffff);
|
||||
}
|
||||
|
||||
/* EEPROM address checks and convertions. I don't know if these will ever
|
||||
actually be used, but I've added them just the same. TRoth */
|
||||
/* EEPROM address checks and convertions. I don't know if these will ever
|
||||
actually be used, but I've added them just the same. TRoth */
|
||||
|
||||
/* TRoth/2002-04-08: Commented out for now to allow fix for problem with large
|
||||
programs in the mega128. */
|
||||
programs in the mega128. */
|
||||
|
||||
/* static CORE_ADDR */
|
||||
/* avr_make_eaddr (CORE_ADDR x) */
|
||||
@ -290,7 +290,7 @@ avr_convert_saddr_to_raw (CORE_ADDR x)
|
||||
/* return ((x) & 0xffffffff); */
|
||||
/* } */
|
||||
|
||||
/* Convert from address to pointer and vice-versa. */
|
||||
/* Convert from address to pointer and vice-versa. */
|
||||
|
||||
static void
|
||||
avr_address_to_pointer (struct gdbarch *gdbarch,
|
||||
@ -476,13 +476,13 @@ avr_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
|
||||
|
||||
/* Not really part of a prologue, but still need to scan for it, is when a
|
||||
function prologue moves values passed via registers as arguments to new
|
||||
registers. In this case, all local variables live in registers, so there
|
||||
may be some register saves. This is what it looks like:
|
||||
registers. In this case, all local variables live in registers, so there
|
||||
may be some register saves. This is what it looks like:
|
||||
movw rMM, rNN
|
||||
...
|
||||
|
||||
There could be multiple movw's. If the target doesn't have a movw insn, it
|
||||
will use two mov insns. This could be done after any of the above prologue
|
||||
There could be multiple movw's. If the target doesn't have a movw insn, it
|
||||
will use two mov insns. This could be done after any of the above prologue
|
||||
types. */
|
||||
|
||||
static CORE_ADDR
|
||||
@ -503,8 +503,8 @@ avr_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc_beg, CORE_ADDR pc_end,
|
||||
len = AVR_MAX_PROLOGUE_SIZE;
|
||||
|
||||
/* FIXME: TRoth/2003-06-11: This could be made more efficient by only
|
||||
reading in the bytes of the prologue. The problem is that the figuring
|
||||
out where the end of the prologue is is a bit difficult. The old code
|
||||
reading in the bytes of the prologue. The problem is that the figuring
|
||||
out where the end of the prologue is is a bit difficult. The old code
|
||||
tried to do that, but failed quite often. */
|
||||
read_memory (pc_beg, prologue, len);
|
||||
|
||||
@ -698,7 +698,7 @@ avr_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc_beg, CORE_ADDR pc_end,
|
||||
insn = extract_unsigned_integer (&prologue[vpc], 2, byte_order);
|
||||
if ((insn & 0xfe0f) == 0x920f) /* push rXX */
|
||||
{
|
||||
/* Bits 4-9 contain a mask for registers R0-R32. */
|
||||
/* Bits 4-9 contain a mask for registers R0-R32. */
|
||||
int regno = (insn & 0x1f0) >> 4;
|
||||
info->size++;
|
||||
info->saved_regs[regno].addr = info->size;
|
||||
@ -750,7 +750,7 @@ avr_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc_beg, CORE_ADDR pc_end,
|
||||
}
|
||||
}
|
||||
|
||||
/* Third stage of the prologue scanning. (Really two stages)
|
||||
/* Third stage of the prologue scanning. (Really two stages).
|
||||
Scan for:
|
||||
sbiw r28,XX or subi r28,lo8(XX)
|
||||
sbci r29,hi8(XX)
|
||||
@ -798,7 +798,7 @@ avr_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc_beg, CORE_ADDR pc_end,
|
||||
else
|
||||
return pc_beg + vpc;
|
||||
|
||||
/* Scan the last part of the prologue. May not be present for interrupt
|
||||
/* Scan the last part of the prologue. May not be present for interrupt
|
||||
or signal handler functions, which is why we set the prologue type
|
||||
when we saw the beginning of the prologue previously. */
|
||||
|
||||
@ -875,17 +875,18 @@ avr_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
|
||||
|
||||
/* Either we didn't find the start of this function (nothing we can do),
|
||||
or there's no line info, or the line after the prologue is after
|
||||
the end of the function (there probably isn't a prologue). */
|
||||
the end of the function (there probably isn't a prologue). */
|
||||
|
||||
return pc;
|
||||
}
|
||||
|
||||
/* Not all avr devices support the BREAK insn. Those that don't should treat
|
||||
it as a NOP. Thus, it should be ok. Since the avr is currently a remote
|
||||
only target, this shouldn't be a problem (I hope). TRoth/2003-05-14 */
|
||||
/* Not all avr devices support the BREAK insn. Those that don't should treat
|
||||
it as a NOP. Thus, it should be ok. Since the avr is currently a remote
|
||||
only target, this shouldn't be a problem (I hope). TRoth/2003-05-14 */
|
||||
|
||||
static const unsigned char *
|
||||
avr_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR * pcptr, int *lenptr)
|
||||
avr_breakpoint_from_pc (struct gdbarch *gdbarch,
|
||||
CORE_ADDR *pcptr, int *lenptr)
|
||||
{
|
||||
static const unsigned char avr_break_insn [] = { 0x98, 0x95 };
|
||||
*lenptr = sizeof (avr_break_insn);
|
||||
@ -944,7 +945,7 @@ avr_return_value (struct gdbarch *gdbarch, struct type *func_type,
|
||||
the saved registers of frame described by FRAME_INFO. This
|
||||
includes special registers such as pc and fp saved in special ways
|
||||
in the stack frame. sp is even more special: the address we return
|
||||
for it IS the sp for the next frame. */
|
||||
for it IS the sp for the next frame. */
|
||||
|
||||
static struct avr_unwind_cache *
|
||||
avr_frame_unwind_cache (struct frame_info *this_frame,
|
||||
@ -1012,7 +1013,7 @@ avr_frame_unwind_cache (struct frame_info *this_frame,
|
||||
info->saved_regs[i].addr = info->prev_sp - info->saved_regs[i].addr;
|
||||
|
||||
/* Except for the main and startup code, the return PC is always saved on
|
||||
the stack and is at the base of the frame. */
|
||||
the stack and is at the base of the frame. */
|
||||
|
||||
if (info->prologue_type != AVR_PROLOGUE_MAIN)
|
||||
info->saved_regs[AVR_PC_REGNUM].addr = info->prev_sp;
|
||||
@ -1098,7 +1099,7 @@ avr_frame_prev_register (struct frame_info *this_frame,
|
||||
|
||||
And to confuse matters even more, the return address stored
|
||||
on the stack is in big endian byte order, even though most
|
||||
everything else about the avr is little endian. Ick! */
|
||||
everything else about the avr is little endian. Ick! */
|
||||
ULONGEST pc;
|
||||
int i;
|
||||
unsigned char buf[3];
|
||||
@ -1163,7 +1164,7 @@ avr_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
|
||||
}
|
||||
|
||||
/* When arguments must be pushed onto the stack, they go on in reverse
|
||||
order. The below implements a FILO (stack) to do this. */
|
||||
order. The below implements a FILO (stack) to do this. */
|
||||
|
||||
struct stack_item
|
||||
{
|
||||
@ -1202,7 +1203,7 @@ pop_stack_item (struct stack_item *si)
|
||||
(depending on size) may go into these registers. The rest go on the stack.
|
||||
|
||||
All arguments are aligned to start in even-numbered registers (odd-sized
|
||||
arguments, including char, have one free register above them). For example,
|
||||
arguments, including char, have one free register above them). For example,
|
||||
an int in arg1 and a char in arg2 would be passed as such:
|
||||
|
||||
arg1 -> r25:r24
|
||||
@ -1210,7 +1211,7 @@ pop_stack_item (struct stack_item *si)
|
||||
|
||||
Arguments that are larger than 2 bytes will be split between two or more
|
||||
registers as available, but will NOT be split between a register and the
|
||||
stack. Arguments that go onto the stack are pushed last arg first (this is
|
||||
stack. Arguments that go onto the stack are pushed last arg first (this is
|
||||
similar to the d10v). */
|
||||
|
||||
/* NOTE: TRoth/2003-06-17: The rest of this comment is old looks to be
|
||||
@ -1232,7 +1233,7 @@ pop_stack_item (struct stack_item *si)
|
||||
must allocate space into which the callee will copy the return value. In
|
||||
this case, a pointer to the return value location is passed into the callee
|
||||
in register R0, which displaces one of the other arguments passed in via
|
||||
registers R0 to R2. */
|
||||
registers R0 to R2. */
|
||||
|
||||
static CORE_ADDR
|
||||
avr_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||
@ -1269,16 +1270,16 @@ avr_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||
const bfd_byte *contents = value_contents (arg);
|
||||
int len = TYPE_LENGTH (type);
|
||||
|
||||
/* Calculate the potential last register needed. */
|
||||
/* Calculate the potential last register needed. */
|
||||
last_regnum = regnum - (len + (len & 1));
|
||||
|
||||
/* If there are registers available, use them. Once we start putting
|
||||
stuff on the stack, all subsequent args go on stack. */
|
||||
/* If there are registers available, use them. Once we start putting
|
||||
stuff on the stack, all subsequent args go on stack. */
|
||||
if ((si == NULL) && (last_regnum >= 8))
|
||||
{
|
||||
ULONGEST val;
|
||||
|
||||
/* Skip a register for odd length args. */
|
||||
/* Skip a register for odd length args. */
|
||||
if (len & 1)
|
||||
regnum--;
|
||||
|
||||
@ -1287,19 +1288,19 @@ avr_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||
regcache_cooked_write_unsigned
|
||||
(regcache, regnum--, val >> (8 * (len - j - 1)));
|
||||
}
|
||||
/* No registers available, push the args onto the stack. */
|
||||
/* No registers available, push the args onto the stack. */
|
||||
else
|
||||
{
|
||||
/* From here on, we don't care about regnum. */
|
||||
/* From here on, we don't care about regnum. */
|
||||
si = push_stack_item (si, contents, len);
|
||||
}
|
||||
}
|
||||
|
||||
/* Push args onto the stack. */
|
||||
/* Push args onto the stack. */
|
||||
while (si)
|
||||
{
|
||||
sp -= si->len;
|
||||
/* Add 1 to sp here to account for post decr nature of pushes. */
|
||||
/* Add 1 to sp here to account for post decr nature of pushes. */
|
||||
write_memory (sp + 1, si->data, si->len);
|
||||
si = pop_stack_item (si);
|
||||
}
|
||||
@ -1314,10 +1315,10 @@ avr_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||
}
|
||||
|
||||
sp -= call_length;
|
||||
/* Use 'sp + 1' since pushes are post decr ops. */
|
||||
/* Use 'sp + 1' since pushes are post decr ops. */
|
||||
write_memory (sp + 1, buf, call_length);
|
||||
|
||||
/* Finally, update the SP register. */
|
||||
/* Finally, update the SP register. */
|
||||
regcache_cooked_write_unsigned (regcache, AVR_SP_REGNUM,
|
||||
avr_convert_saddr_to_raw (sp));
|
||||
|
||||
@ -1341,7 +1342,7 @@ avr_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int reg)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Initialize the gdbarch structure for the AVR's. */
|
||||
/* Initialize the gdbarch structure for the AVR's. */
|
||||
|
||||
static struct gdbarch *
|
||||
avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
||||
@ -1376,7 +1377,7 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
||||
return best_arch->gdbarch;
|
||||
}
|
||||
|
||||
/* None found, create a new architecture from the information provided. */
|
||||
/* None found, create a new architecture from the information provided. */
|
||||
tdep = XMALLOC (struct gdbarch_tdep);
|
||||
gdbarch = gdbarch_alloc (&info, tdep);
|
||||
|
||||
@ -1448,17 +1449,17 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
||||
}
|
||||
|
||||
/* Send a query request to the avr remote target asking for values of the io
|
||||
registers. If args parameter is not NULL, then the user has requested info
|
||||
registers. If args parameter is not NULL, then the user has requested info
|
||||
on a specific io register [This still needs implemented and is ignored for
|
||||
now]. The query string should be one of these forms:
|
||||
now]. The query string should be one of these forms:
|
||||
|
||||
"Ravr.io_reg" -> reply is "NN" number of io registers
|
||||
|
||||
"Ravr.io_reg:addr,len" where addr is first register and len is number of
|
||||
registers to be read. The reply should be "<NAME>,VV;" for each io register
|
||||
registers to be read. The reply should be "<NAME>,VV;" for each io register
|
||||
where, <NAME> is a string, and VV is the hex value of the register.
|
||||
|
||||
All io registers are 8-bit. */
|
||||
All io registers are 8-bit. */
|
||||
|
||||
static void
|
||||
avr_io_reg_read_command (char *args, int from_tty)
|
||||
@ -1471,7 +1472,7 @@ avr_io_reg_read_command (char *args, int from_tty)
|
||||
unsigned int val;
|
||||
int i, j, k, step;
|
||||
|
||||
/* Find out how many io registers the target has. */
|
||||
/* Find out how many io registers the target has. */
|
||||
bufsiz = target_read_alloc (¤t_target, TARGET_OBJECT_AVR,
|
||||
"avr.io_reg", &buf);
|
||||
|
||||
@ -1538,10 +1539,10 @@ _initialize_avr_tdep (void)
|
||||
|
||||
/* Add a new command to allow the user to query the avr remote target for
|
||||
the values of the io space registers in a saner way than just using
|
||||
`x/NNNb ADDR`. */
|
||||
`x/NNNb ADDR`. */
|
||||
|
||||
/* FIXME: TRoth/2002-02-18: This should probably be changed to 'info avr
|
||||
io_registers' to signify it is not available on other platforms. */
|
||||
io_registers' to signify it is not available on other platforms. */
|
||||
|
||||
add_cmd ("io_registers", class_info, avr_io_reg_read_command,
|
||||
_("query remote avr target for io space register values"),
|
||||
|
@ -581,7 +581,8 @@ bfin_reg_to_regnum (struct gdbarch *gdbarch, int reg)
|
||||
the breakpoint should be inserted. */
|
||||
|
||||
static const unsigned char *
|
||||
bfin_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
|
||||
bfin_breakpoint_from_pc (struct gdbarch *gdbarch,
|
||||
CORE_ADDR *pcptr, int *lenptr)
|
||||
{
|
||||
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
||||
unsigned short iw;
|
||||
|
@ -248,7 +248,7 @@ bsd_kvm_fetch_registers (struct target_ops *ops,
|
||||
}
|
||||
#endif
|
||||
|
||||
/* i18n: PCB == "Process Control Block" */
|
||||
/* i18n: PCB == "Process Control Block". */
|
||||
error (_("Cannot find a valid PCB"));
|
||||
}
|
||||
|
||||
@ -297,7 +297,7 @@ static void
|
||||
bsd_kvm_pcb_cmd (char *arg, int fromtty)
|
||||
{
|
||||
if (arg == NULL)
|
||||
/* i18n: PCB == "Process Control Block" */
|
||||
/* i18n: PCB == "Process Control Block". */
|
||||
error_no_arg (_("pcb address"));
|
||||
|
||||
if (core_kd == NULL)
|
||||
@ -370,7 +370,7 @@ Generic command for manipulating the kernel memory interface."),
|
||||
_("Set current context from proc address"), &bsd_kvm_cmdlist);
|
||||
#endif
|
||||
add_cmd ("pcb", class_obscure, bsd_kvm_pcb_cmd,
|
||||
/* i18n: PCB == "Process Control Block" */
|
||||
/* i18n: PCB == "Process Control Block". */
|
||||
_("Set current context from pcb address"), &bsd_kvm_cmdlist);
|
||||
|
||||
/* Some notes on the ptid usage on this target.
|
||||
@ -385,7 +385,7 @@ Generic command for manipulating the kernel memory interface."),
|
||||
ptid (1, 1, 0) -> kvm inferior 1, in kernel
|
||||
ptid (1, 1, 1) -> kvm inferior 1, process 1
|
||||
ptid (1, 1, 2) -> kvm inferior 1, process 2
|
||||
ptid (1, 1, n) -> kvm inferior 1, process n
|
||||
*/
|
||||
ptid (1, 1, n) -> kvm inferior 1, process n */
|
||||
|
||||
bsd_kvm_ptid = ptid_build (1, 1, 0);
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ c_print_type (struct type *type,
|
||||
fputs_filtered (varstring, stream);
|
||||
|
||||
/* For demangled function names, we have the arglist as part of
|
||||
the name, so don't print an additional pair of ()'s */
|
||||
the name, so don't print an additional pair of ()'s. */
|
||||
|
||||
demangled_args = strchr (varstring, '(') != NULL;
|
||||
c_type_print_varspec_suffix (type, stream, show,
|
||||
@ -509,10 +509,10 @@ is_type_conversion_operator (struct type *type, int i, int j)
|
||||
static char *
|
||||
remove_qualifiers (char *qid)
|
||||
{
|
||||
int quoted = 0; /* zero if we're not in quotes;
|
||||
int quoted = 0; /* Zero if we're not in quotes;
|
||||
'"' if we're in a double-quoted string;
|
||||
'\'' if we're in a single-quoted string. */
|
||||
int depth = 0; /* number of unclosed parens we've seen */
|
||||
int depth = 0; /* Number of unclosed parens we've seen. */
|
||||
char *parenstack = (char *) alloca (strlen (qid));
|
||||
char *scan;
|
||||
char *last = 0; /* The character after the rightmost
|
||||
@ -974,7 +974,7 @@ c_type_print_base (struct type *type, struct ui_file *stream,
|
||||
if (real_len > 0 && section_type != s_none)
|
||||
fprintf_filtered (stream, "\n");
|
||||
|
||||
/* C++: print out the methods */
|
||||
/* C++: print out the methods. */
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
struct fn_field *f = TYPE_FN_FIELDLIST1 (type, i);
|
||||
@ -1207,7 +1207,7 @@ c_type_print_base (struct type *type, struct ui_file *stream,
|
||||
break;
|
||||
|
||||
case TYPE_CODE_RANGE:
|
||||
/* This should not occur */
|
||||
/* This should not occur. */
|
||||
fprintf_filtered (stream, _("<range type>"));
|
||||
break;
|
||||
|
||||
|
@ -404,7 +404,7 @@ c_val_print (struct type *type, const gdb_byte *valaddr,
|
||||
}
|
||||
/* Fall through. */
|
||||
case TYPE_CODE_STRUCT:
|
||||
/*FIXME: Abstract this away */
|
||||
/*FIXME: Abstract this away. */
|
||||
if (options->vtblprint && cp_is_vtbl_ptr_type (type))
|
||||
{
|
||||
/* Print the unmangled name if desired. */
|
||||
|
@ -18,7 +18,7 @@
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Contributed by Raoul M. Gough (RaoulGough@yahoo.co.uk). */
|
||||
Contributed by Raoul M. Gough (RaoulGough@yahoo.co.uk). */
|
||||
|
||||
#if !defined (COFF_PE_READ_H)
|
||||
#define COFF_PE_READ_H
|
||||
|
@ -1090,7 +1090,7 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms,
|
||||
else if (strcmp (cs->c_name, ".eb") == 0)
|
||||
{
|
||||
if (context_stack_depth <= 0)
|
||||
{ /* We attempted to pop an empty context stack. */
|
||||
{ /* We attempted to pop an empty context stack. */
|
||||
complaint (&symfile_complaints,
|
||||
_("`.eb' symbol without matching `.bb' "
|
||||
"symbol ignored starting at symnum %d"),
|
||||
@ -1652,7 +1652,7 @@ process_coff_symbol (struct coff_symbol *cs,
|
||||
SYMBOL_CLASS (sym) = LOC_TYPEDEF;
|
||||
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
|
||||
|
||||
/* If type has no name, give it one */
|
||||
/* If type has no name, give it one. */
|
||||
if (TYPE_NAME (SYMBOL_TYPE (sym)) == 0)
|
||||
{
|
||||
if (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_PTR
|
||||
|
@ -70,7 +70,7 @@ enum cris_num_regs
|
||||
ARG1_REGNUM Contains the first parameter to a function.
|
||||
ARG2_REGNUM Contains the second parameter to a function.
|
||||
ARG3_REGNUM Contains the third parameter to a function.
|
||||
ARG4_REGNUM Contains the fourth parameter to a function. Rest on stack.
|
||||
ARG4_REGNUM Contains the fourth parameter to a function. Rest on stack.
|
||||
gdbarch_sp_regnum Contains address of top of stack.
|
||||
gdbarch_pc_regnum Contains address of next instruction.
|
||||
SRP_REGNUM Subroutine return pointer register.
|
||||
@ -94,7 +94,7 @@ enum cris_regnums
|
||||
MOF_REGNUM = 23,
|
||||
SRP_REGNUM = 27,
|
||||
|
||||
/* CRISv10 et. al. specific registers. */
|
||||
/* CRISv10 et al. specific registers. */
|
||||
P0_REGNUM = 16,
|
||||
P4_REGNUM = 20,
|
||||
CCR_REGNUM = 21,
|
||||
@ -1073,7 +1073,7 @@ static const struct frame_base cris_frame_base =
|
||||
move.d r13,rV ; P3
|
||||
move.S [r8+U],rZ ; P4
|
||||
|
||||
if any of the call parameters are stored. The host expects these
|
||||
if any of the call parameters are stored. The host expects these
|
||||
instructions to be executed in order to get the call parameters right. */
|
||||
|
||||
/* Examine the prologue of a function. The variable ip is the address of
|
||||
@ -1135,7 +1135,7 @@ cris_scan_prologue (CORE_ADDR pc, struct frame_info *this_frame,
|
||||
pc += 2;
|
||||
if (insn == 0xE1FC)
|
||||
{
|
||||
/* push <reg> 32 bit instruction */
|
||||
/* push <reg> 32 bit instruction. */
|
||||
insn_next = read_memory_unsigned_integer (pc, 2, byte_order);
|
||||
pc += 2;
|
||||
regno = cris_get_operand2 (insn_next);
|
||||
@ -1465,7 +1465,8 @@ cris_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
|
||||
the breakpoint should be inserted. */
|
||||
|
||||
static const unsigned char *
|
||||
cris_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
|
||||
cris_breakpoint_from_pc (struct gdbarch *gdbarch,
|
||||
CORE_ADDR *pcptr, int *lenptr)
|
||||
{
|
||||
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
||||
static unsigned char break8_insn[] = {0x38, 0xe9};
|
||||
@ -1583,8 +1584,7 @@ cris_cannot_store_register (struct gdbarch *gdbarch, int regno)
|
||||
/* There are three kinds of registers we refuse to write to.
|
||||
1. Those that not implemented.
|
||||
2. Those that are read-only (depends on the processor mode).
|
||||
3. Those registers to which a write has no effect.
|
||||
*/
|
||||
3. Those registers to which a write has no effect. */
|
||||
|
||||
if (regno < 0
|
||||
|| regno >= gdbarch_num_regs (gdbarch)
|
||||
@ -1625,8 +1625,7 @@ crisv32_cannot_store_register (struct gdbarch *gdbarch, int regno)
|
||||
/* There are three kinds of registers we refuse to write to.
|
||||
1. Those that not implemented.
|
||||
2. Those that are read-only (depends on the processor mode).
|
||||
3. Those registers to which a write has no effect.
|
||||
*/
|
||||
3. Those registers to which a write has no effect. */
|
||||
|
||||
if (regno < 0
|
||||
|| regno >= gdbarch_num_regs (gdbarch)
|
||||
@ -1731,8 +1730,8 @@ cris_store_return_value (struct type *type, struct regcache *regcache,
|
||||
error (_("cris_store_return_value: type length too large."));
|
||||
}
|
||||
|
||||
/* Return the name of register regno as a string. Return NULL for an invalid or
|
||||
unimplemented register. */
|
||||
/* Return the name of register regno as a string. Return NULL for an
|
||||
invalid or unimplemented register. */
|
||||
|
||||
static const char *
|
||||
cris_special_register_name (struct gdbarch *gdbarch, int regno)
|
||||
@ -2384,7 +2383,8 @@ sixteen_bit_offset_branch_op (unsigned short inst, inst_env_type *inst_env)
|
||||
}
|
||||
|
||||
/* We have a branch, find out the offset for the branch. */
|
||||
offset = read_memory_integer (inst_env->reg[REG_PC], 2, inst_env->byte_order);
|
||||
offset = read_memory_integer (inst_env->reg[REG_PC], 2,
|
||||
inst_env->byte_order);
|
||||
|
||||
/* The instruction is one word longer than normal, so add one word
|
||||
to the PC. */
|
||||
@ -2487,7 +2487,8 @@ asr_op (unsigned short inst, inst_env_type *inst_env)
|
||||
return;
|
||||
}
|
||||
/* Get the number of bits to shift. */
|
||||
shift_steps = cris_get_asr_shift_steps (inst_env->reg[cris_get_operand1 (inst)]);
|
||||
shift_steps
|
||||
= cris_get_asr_shift_steps (inst_env->reg[cris_get_operand1 (inst)]);
|
||||
value = inst_env->reg[REG_PC];
|
||||
|
||||
/* Find out how many bits the operation should apply to. */
|
||||
@ -3104,7 +3105,8 @@ move_mem_to_reg_movem_op (unsigned short inst, inst_env_type *inst_env)
|
||||
}
|
||||
/* The increment is not depending on the size, instead it's depending
|
||||
on the number of registers loaded from memory. */
|
||||
if ((cris_get_operand1 (inst) == REG_PC) && (cris_get_mode (inst) == AUTOINC_MODE))
|
||||
if ((cris_get_operand1 (inst) == REG_PC)
|
||||
&& (cris_get_mode (inst) == AUTOINC_MODE))
|
||||
{
|
||||
/* It's invalid to change the PC in a delay slot. */
|
||||
if (inst_env->slot_needed)
|
||||
@ -3142,7 +3144,8 @@ move_reg_to_mem_movem_op (unsigned short inst, inst_env_type *inst_env)
|
||||
{
|
||||
/* The increment is not depending on the size, instead it's depending
|
||||
on the number of registers loaded to memory. */
|
||||
if ((cris_get_operand1 (inst) == REG_PC) && (cris_get_mode (inst) == AUTOINC_MODE))
|
||||
if ((cris_get_operand1 (inst) == REG_PC)
|
||||
&& (cris_get_mode (inst) == AUTOINC_MODE))
|
||||
{
|
||||
/* It's invalid to change the PC in a delay slot. */
|
||||
if (inst_env->slot_needed)
|
||||
@ -3414,7 +3417,8 @@ reg_mode_add_sub_cmp_and_or_move_op (unsigned short inst,
|
||||
extend instruction, the size field is changed in instruction. */
|
||||
|
||||
static unsigned long
|
||||
get_data_from_address (unsigned short *inst, CORE_ADDR address, enum bfd_endian byte_order)
|
||||
get_data_from_address (unsigned short *inst, CORE_ADDR address,
|
||||
enum bfd_endian byte_order)
|
||||
{
|
||||
int size = cris_get_size (*inst);
|
||||
unsigned long value;
|
||||
@ -3556,7 +3560,8 @@ handle_inc_and_index_mode_for_aritm_op (unsigned short inst,
|
||||
}
|
||||
/* If this is an autoincrement addressing mode, check if the increment
|
||||
changes the PC. */
|
||||
if ((cris_get_operand1 (inst) == REG_PC) && (cris_get_mode (inst) == AUTOINC_MODE))
|
||||
if ((cris_get_operand1 (inst) == REG_PC)
|
||||
&& (cris_get_mode (inst) == AUTOINC_MODE))
|
||||
{
|
||||
/* Get the size field. */
|
||||
size = cris_get_size (inst);
|
||||
@ -3968,7 +3973,8 @@ _initialize_cris_tdep (void)
|
||||
Set to 10 for CRISv10 or 32 for CRISv32 if autodetection fails.\n\
|
||||
Defaults to 10. "),
|
||||
set_cris_version,
|
||||
NULL, /* FIXME: i18n: Current CRIS version is %s. */
|
||||
NULL, /* FIXME: i18n: Current CRIS version
|
||||
is %s. */
|
||||
&setlist, &showlist);
|
||||
|
||||
add_setshow_enum_cmd ("cris-mode", class_support,
|
||||
@ -3988,7 +3994,8 @@ Makes GDB use the NRP register instead of the ERP register in certain cases."),
|
||||
_("Show the usage of Dwarf-2 CFI for CRIS."),
|
||||
_("Set this to \"off\" if using gcc-cris < R59."),
|
||||
set_cris_dwarf2_cfi,
|
||||
NULL, /* FIXME: i18n: Usage of Dwarf-2 CFI for CRIS is %d. */
|
||||
NULL, /* FIXME: i18n: Usage of Dwarf-2 CFI
|
||||
for CRIS is %d. */
|
||||
&setlist, &showlist);
|
||||
|
||||
deprecated_add_core_fns (&cris_elf_core_fns);
|
||||
@ -4107,11 +4114,13 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
||||
break;
|
||||
|
||||
case BFD_ENDIAN_BIG:
|
||||
internal_error (__FILE__, __LINE__, _("cris_gdbarch_init: big endian byte order in info"));
|
||||
internal_error (__FILE__, __LINE__,
|
||||
_("cris_gdbarch_init: big endian byte order in info"));
|
||||
break;
|
||||
|
||||
default:
|
||||
internal_error (__FILE__, __LINE__, _("cris_gdbarch_init: unknown byte order in info"));
|
||||
internal_error (__FILE__, __LINE__,
|
||||
_("cris_gdbarch_init: unknown byte order in info"));
|
||||
}
|
||||
|
||||
set_gdbarch_return_value (gdbarch, cris_return_value);
|
||||
|
@ -253,7 +253,8 @@ static const struct language_defn d_language_defn =
|
||||
c_printstr, /* Function to print string constant. */
|
||||
c_emit_char, /* Print a single char. */
|
||||
c_print_type, /* Print a type using appropriate syntax. */
|
||||
c_print_typedef, /* Print a typedef using appropriate syntax. */
|
||||
c_print_typedef, /* Print a typedef using appropriate
|
||||
syntax. */
|
||||
d_val_print, /* Print a value using appropriate syntax. */
|
||||
c_value_print, /* Print a top-level value. */
|
||||
NULL, /* Language specific skip_trampoline. */
|
||||
@ -261,7 +262,8 @@ static const struct language_defn d_language_defn =
|
||||
basic_lookup_symbol_nonlocal,
|
||||
basic_lookup_transparent_type,
|
||||
d_demangle, /* Language specific symbol demangler. */
|
||||
NULL, /* Language specific class_name_from_physname. */
|
||||
NULL, /* Language specific
|
||||
class_name_from_physname. */
|
||||
d_op_print_tab, /* Expression operators for printing. */
|
||||
1, /* C-style arrays. */
|
||||
0, /* String lower bound. */
|
||||
|
@ -544,7 +544,7 @@ darwin_debug_regions (task_t task, mach_vm_address_t address, int max)
|
||||
|
||||
address = prev_address + prev_size;
|
||||
|
||||
/* Check to see if address space has wrapped around. */
|
||||
/* Check to see if address space has wrapped around. */
|
||||
if (address == 0)
|
||||
print = done = 1;
|
||||
|
||||
|
@ -129,7 +129,7 @@ mach_port_t darwin_ex_port;
|
||||
/* Port set. */
|
||||
mach_port_t darwin_port_set;
|
||||
|
||||
/* Page size. */
|
||||
/* Page size. */
|
||||
static vm_size_t mach_page_size;
|
||||
|
||||
/* If Set, catch all mach exceptions (before they are converted to signals
|
||||
@ -914,7 +914,7 @@ darwin_decode_message (mach_msg_header_t *hdr,
|
||||
case EXC_BREAKPOINT:
|
||||
/* Many internal GDB routines expect breakpoints to be reported
|
||||
as TARGET_SIGNAL_TRAP, and will report TARGET_EXC_BREAKPOINT
|
||||
as a spurious signal. */
|
||||
as a spurious signal. */
|
||||
status->value.sig = TARGET_SIGNAL_TRAP;
|
||||
break;
|
||||
default:
|
||||
@ -980,7 +980,7 @@ darwin_decode_message (mach_msg_header_t *hdr,
|
||||
static int
|
||||
cancel_breakpoint (ptid_t ptid)
|
||||
{
|
||||
/* Arrange for a breakpoint to be hit again later. We will handle
|
||||
/* Arrange for a breakpoint to be hit again later. We will handle
|
||||
the current event, eventually we will resume this thread, and this
|
||||
breakpoint will trap again.
|
||||
|
||||
@ -1655,7 +1655,7 @@ darwin_read_write_inferior (task_t task, CORE_ADDR addr,
|
||||
inferior_debug (8, _("darwin_read_write_inferior(task=%x, %s, len=%d)\n"),
|
||||
task, core_addr_to_string (addr), length);
|
||||
|
||||
/* Get memory from inferior with page aligned addresses */
|
||||
/* Get memory from inferior with page aligned addresses. */
|
||||
kret = mach_vm_read (task, low_address, aligned_length,
|
||||
&copied, ©_count);
|
||||
if (kret != KERN_SUCCESS)
|
||||
@ -1707,10 +1707,10 @@ darwin_read_write_inferior (task_t task, CORE_ADDR addr,
|
||||
core_addr_to_string (region_start),
|
||||
core_addr_to_string (region_length));
|
||||
|
||||
/* Check for holes in memory */
|
||||
/* Check for holes in memory. */
|
||||
if (region_start > region_address)
|
||||
{
|
||||
warning (_("No memory at %s (vs %s+0x%x). Nothing written"),
|
||||
warning (_("No memory at %s (vs %s+0x%x). Nothing written"),
|
||||
core_addr_to_string (region_address),
|
||||
core_addr_to_string (region_start),
|
||||
(unsigned)region_length);
|
||||
@ -1768,7 +1768,7 @@ out:
|
||||
|
||||
|
||||
/* Return 0 on failure, number of bytes handled otherwise. TARGET
|
||||
is ignored. */
|
||||
is ignored. */
|
||||
static int
|
||||
darwin_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int write,
|
||||
struct mem_attrib *attrib, struct target_ops *target)
|
||||
|
@ -74,10 +74,10 @@ dbug_supply_register (struct regcache *regcache, char *regname,
|
||||
monitor_supply_register (regcache, regno, val);
|
||||
}
|
||||
|
||||
/* This array of registers needs to match the indexes used by GDB. The
|
||||
whole reason this exists is because the various ROM monitors use
|
||||
different names than GDB does, and don't support all the registers
|
||||
either. So, typing "info reg sp" becomes an "A7". */
|
||||
/* This array of registers needs to match the indexes used by GDB.
|
||||
The whole reason this exists is because the various ROM monitors
|
||||
use different names than GDB does, and don't support all the
|
||||
registers either. So, typing "info reg sp" becomes an "A7". */
|
||||
|
||||
static const char *
|
||||
dbug_regname (int index)
|
||||
|
222
gdb/dbxread.c
222
gdb/dbxread.c
@ -61,7 +61,8 @@
|
||||
#include "gdb_string.h"
|
||||
|
||||
#include "aout/aout64.h"
|
||||
#include "aout/stab_gnu.h" /* We always use GNU stabs, not native, now */
|
||||
#include "aout/stab_gnu.h" /* We always use GNU stabs, not
|
||||
native, now. */
|
||||
|
||||
|
||||
/* We put a pointer to this structure in the read_symtab_private field
|
||||
@ -103,7 +104,7 @@ struct symloc
|
||||
#define FILE_STRING_OFFSET(p) (SYMLOC(p)->file_string_offset)
|
||||
|
||||
|
||||
/* Remember what we deduced to be the source language of this psymtab. */
|
||||
/* Remember what we deduced to be the source language of this psymtab. */
|
||||
|
||||
static enum language psymtab_language = language_unknown;
|
||||
|
||||
@ -117,11 +118,11 @@ static bfd *symfile_bfd;
|
||||
|
||||
static unsigned symbol_size;
|
||||
|
||||
/* This is the offset of the symbol table in the executable file. */
|
||||
/* This is the offset of the symbol table in the executable file. */
|
||||
|
||||
static unsigned symbol_table_offset;
|
||||
|
||||
/* This is the offset of the string table in the executable file. */
|
||||
/* This is the offset of the string table in the executable file. */
|
||||
|
||||
static unsigned string_table_offset;
|
||||
|
||||
@ -129,14 +130,14 @@ static unsigned string_table_offset;
|
||||
into the string table. Instead, each .o file has a base offset in
|
||||
the string table, and the associated symbols contain offsets from
|
||||
this base. The following two variables contain the base offset for
|
||||
the current and next .o files. */
|
||||
the current and next .o files. */
|
||||
|
||||
static unsigned int file_string_table_offset;
|
||||
static unsigned int next_file_string_table_offset;
|
||||
|
||||
/* .o and NLM files contain unrelocated addresses which are based at
|
||||
0. When non-zero, this flag disables some of the special cases for
|
||||
Solaris elf+stab text addresses at location 0. */
|
||||
Solaris elf+stab text addresses at location 0. */
|
||||
|
||||
static int symfile_relocatable = 0;
|
||||
|
||||
@ -233,21 +234,21 @@ find_text_range (bfd * sym_bfd, struct objfile *objfile)
|
||||
/* During initial symbol readin, we need to have a structure to keep
|
||||
track of which psymtabs have which bincls in them. This structure
|
||||
is used during readin to setup the list of dependencies within each
|
||||
partial symbol table. */
|
||||
partial symbol table. */
|
||||
|
||||
struct header_file_location
|
||||
{
|
||||
char *name; /* Name of header file */
|
||||
int instance; /* See above */
|
||||
struct partial_symtab *pst; /* Partial symtab that has the
|
||||
BINCL/EINCL defs for this file */
|
||||
BINCL/EINCL defs for this file. */
|
||||
};
|
||||
|
||||
/* The actual list and controling variables */
|
||||
/* The actual list and controling variables. */
|
||||
static struct header_file_location *bincl_list, *next_bincl;
|
||||
static int bincls_allocated;
|
||||
|
||||
/* Local function prototypes */
|
||||
/* Local function prototypes. */
|
||||
|
||||
extern void _initialize_dbxread (void);
|
||||
|
||||
@ -294,7 +295,7 @@ static struct partial_symtab *start_psymtab (struct objfile *, char *,
|
||||
struct partial_symbol **,
|
||||
struct partial_symbol **);
|
||||
|
||||
/* Free up old header file tables */
|
||||
/* Free up old header file tables. */
|
||||
|
||||
void
|
||||
free_header_files (void)
|
||||
@ -307,7 +308,7 @@ free_header_files (void)
|
||||
n_allocated_this_object_header_files = 0;
|
||||
}
|
||||
|
||||
/* Allocate new header file tables */
|
||||
/* Allocate new header file tables. */
|
||||
|
||||
void
|
||||
init_header_files (void)
|
||||
@ -568,7 +569,7 @@ dbx_symfile_read (struct objfile *objfile, int symfile_flags)
|
||||
init_minimal_symbol_collection ();
|
||||
make_cleanup_discard_minimal_symbols ();
|
||||
|
||||
/* Read stabs data from executable file and define symbols. */
|
||||
/* Read stabs data from executable file and define symbols. */
|
||||
|
||||
read_dbx_symtab (objfile);
|
||||
|
||||
@ -577,7 +578,7 @@ dbx_symfile_read (struct objfile *objfile, int symfile_flags)
|
||||
read_dbx_dynamic_symtab (objfile);
|
||||
|
||||
/* Install any minimal symbols that have been collected as the current
|
||||
minimal symbols for this objfile. */
|
||||
minimal symbols for this objfile. */
|
||||
|
||||
install_minimal_symbols (objfile);
|
||||
|
||||
@ -621,7 +622,7 @@ dbx_symfile_init (struct objfile *objfile)
|
||||
asection *text_sect;
|
||||
unsigned char size_temp[DBX_STRINGTAB_SIZE_SIZE];
|
||||
|
||||
/* Allocate struct to keep track of the symfile */
|
||||
/* Allocate struct to keep track of the symfile. */
|
||||
objfile->deprecated_sym_stab_info = (struct dbx_symfile_info *)
|
||||
xmalloc (sizeof (struct dbx_symfile_info));
|
||||
memset (objfile->deprecated_sym_stab_info, 0,
|
||||
@ -631,11 +632,11 @@ dbx_symfile_init (struct objfile *objfile)
|
||||
DBX_DATA_SECTION (objfile) = bfd_get_section_by_name (sym_bfd, ".data");
|
||||
DBX_BSS_SECTION (objfile) = bfd_get_section_by_name (sym_bfd, ".bss");
|
||||
|
||||
/* FIXME POKING INSIDE BFD DATA STRUCTURES */
|
||||
/* FIXME POKING INSIDE BFD DATA STRUCTURES. */
|
||||
#define STRING_TABLE_OFFSET (sym_bfd->origin + obj_str_filepos (sym_bfd))
|
||||
#define SYMBOL_TABLE_OFFSET (sym_bfd->origin + obj_sym_filepos (sym_bfd))
|
||||
|
||||
/* FIXME POKING INSIDE BFD DATA STRUCTURES */
|
||||
/* FIXME POKING INSIDE BFD DATA STRUCTURES. */
|
||||
|
||||
DBX_SYMFILE_INFO (objfile)->stab_section_info = NULL;
|
||||
|
||||
@ -660,13 +661,13 @@ dbx_symfile_init (struct objfile *objfile)
|
||||
however at least check to see if the size is less than the size of
|
||||
the size field itself, or larger than the size of the entire file.
|
||||
Note that all valid string tables have a size greater than zero, since
|
||||
the bytes used to hold the size are included in the count. */
|
||||
the bytes used to hold the size are included in the count. */
|
||||
|
||||
if (STRING_TABLE_OFFSET == 0)
|
||||
{
|
||||
/* It appears that with the existing bfd code, STRING_TABLE_OFFSET
|
||||
will never be zero, even when there is no string table. This
|
||||
would appear to be a bug in bfd. */
|
||||
would appear to be a bug in bfd. */
|
||||
DBX_STRINGTAB_SIZE (objfile) = 0;
|
||||
DBX_STRINGTAB (objfile) = NULL;
|
||||
}
|
||||
@ -686,7 +687,7 @@ dbx_symfile_init (struct objfile *objfile)
|
||||
{
|
||||
/* With the existing bfd code, STRING_TABLE_OFFSET will be set to
|
||||
EOF if there is no string table, and attempting to read the size
|
||||
from EOF will read zero bytes. */
|
||||
from EOF will read zero bytes. */
|
||||
DBX_STRINGTAB_SIZE (objfile) = 0;
|
||||
DBX_STRINGTAB (objfile) = NULL;
|
||||
}
|
||||
@ -698,7 +699,7 @@ dbx_symfile_init (struct objfile *objfile)
|
||||
the minimum is DBX_STRINGTAB_SIZE_SIZE. If we just read some
|
||||
random data that happened to be at STRING_TABLE_OFFSET, because
|
||||
bfd can't tell us there is no string table, the sanity checks may
|
||||
or may not catch this. */
|
||||
or may not catch this. */
|
||||
DBX_STRINGTAB_SIZE (objfile) = bfd_h_get_32 (sym_bfd, size_temp);
|
||||
|
||||
if (DBX_STRINGTAB_SIZE (objfile) < sizeof (size_temp)
|
||||
@ -728,7 +729,7 @@ dbx_symfile_init (struct objfile *objfile)
|
||||
/* Perform any local cleanups required when we are done with a particular
|
||||
objfile. I.E, we are in the process of discarding all symbol information
|
||||
for an objfile, freeing up all memory held for it, and unlinking the
|
||||
objfile struct from the global list of known objfiles. */
|
||||
objfile struct from the global list of known objfiles. */
|
||||
|
||||
static void
|
||||
dbx_symfile_finish (struct objfile *objfile)
|
||||
@ -1154,13 +1155,13 @@ find_stab_function_addr (char *namestring, const char *filename,
|
||||
|
||||
if (msym == NULL && filename != NULL)
|
||||
{
|
||||
/* Try again without the filename. */
|
||||
/* Try again without the filename. */
|
||||
p[n] = 0;
|
||||
msym = lookup_minimal_symbol (p, NULL, objfile);
|
||||
}
|
||||
if (msym == NULL && filename != NULL)
|
||||
{
|
||||
/* And try again for Sun Fortran, but without the filename. */
|
||||
/* And try again for Sun Fortran, but without the filename. */
|
||||
p[n] = '_';
|
||||
p[n + 1] = 0;
|
||||
msym = lookup_minimal_symbol (p, NULL, objfile);
|
||||
@ -1179,13 +1180,13 @@ function_outside_compilation_unit_complaint (const char *arg1)
|
||||
}
|
||||
|
||||
/* Setup partial_symtab's describing each source file for which
|
||||
debugging information is available. */
|
||||
debugging information is available. */
|
||||
|
||||
static void
|
||||
read_dbx_symtab (struct objfile *objfile)
|
||||
{
|
||||
struct gdbarch *gdbarch = get_objfile_arch (objfile);
|
||||
struct external_nlist *bufp = 0; /* =0 avoids gcc -Wall glitch */
|
||||
struct external_nlist *bufp = 0; /* =0 avoids gcc -Wall glitch. */
|
||||
struct internal_nlist nlist;
|
||||
CORE_ADDR text_addr;
|
||||
int text_size;
|
||||
@ -1202,15 +1203,15 @@ read_dbx_symtab (struct objfile *objfile)
|
||||
int textlow_not_set;
|
||||
int data_sect_index;
|
||||
|
||||
/* Current partial symtab */
|
||||
/* Current partial symtab. */
|
||||
struct partial_symtab *pst;
|
||||
|
||||
/* List of current psymtab's include files */
|
||||
/* List of current psymtab's include files. */
|
||||
char **psymtab_include_list;
|
||||
int includes_allocated;
|
||||
int includes_used;
|
||||
|
||||
/* Index within current psymtab dependency list */
|
||||
/* Index within current psymtab dependency list. */
|
||||
struct partial_symtab **dependency_list;
|
||||
int dependencies_used, dependencies_allocated;
|
||||
|
||||
@ -1245,7 +1246,7 @@ read_dbx_symtab (struct objfile *objfile)
|
||||
|
||||
lowest_text_address = (CORE_ADDR) -1;
|
||||
|
||||
symfile_bfd = objfile->obfd; /* For next_text_symbol */
|
||||
symfile_bfd = objfile->obfd; /* For next_text_symbol. */
|
||||
abfd = objfile->obfd;
|
||||
symbuf_end = symbuf_idx = 0;
|
||||
next_symbol_text_func = dbx_next_symbol_text;
|
||||
@ -1286,8 +1287,8 @@ read_dbx_symtab (struct objfile *objfile)
|
||||
|
||||
for (symnum = 0; symnum < DBX_SYMCOUNT (objfile); symnum++)
|
||||
{
|
||||
/* Get the symbol for this run and pull out some info */
|
||||
QUIT; /* allow this to be interruptable */
|
||||
/* Get the symbol for this run and pull out some info. */
|
||||
QUIT; /* Allow this to be interruptable. */
|
||||
if (symbuf_idx == symbuf_end)
|
||||
fill_symbuf (abfd);
|
||||
bufp = &symbuf[symbuf_idx++];
|
||||
@ -1313,8 +1314,7 @@ read_dbx_symtab (struct objfile *objfile)
|
||||
*) The call to strchr.
|
||||
*) The addition of a partial symbol the the two partial
|
||||
symbol lists. This last is a large section of code, so
|
||||
I've imbedded it in the following macro.
|
||||
*/
|
||||
I've imbedded it in the following macro. */
|
||||
|
||||
switch (nlist.n_type)
|
||||
{
|
||||
@ -1351,7 +1351,7 @@ read_dbx_symtab (struct objfile *objfile)
|
||||
nlist.n_type, objfile); /* Always */
|
||||
continue;
|
||||
|
||||
/* Standard, local, non-debugger, symbols */
|
||||
/* Standard, local, non-debugger, symbols. */
|
||||
|
||||
case N_NBTEXT:
|
||||
|
||||
@ -1413,11 +1413,12 @@ read_dbx_symtab (struct objfile *objfile)
|
||||
{
|
||||
continue; /* Error in lookup; ignore symbol for now. */
|
||||
}
|
||||
nlist.n_type ^= (N_BSS ^ N_UNDF); /* Define it as a bss-symbol */
|
||||
nlist.n_type ^= (N_BSS ^ N_UNDF); /* Define it as a
|
||||
bss-symbol. */
|
||||
nlist.n_value = reladdr;
|
||||
goto bss_ext_symbol;
|
||||
}
|
||||
continue; /* Just undefined, not COMMON */
|
||||
continue; /* Just undefined, not COMMON. */
|
||||
|
||||
case N_UNDF:
|
||||
if (processing_acc_compilation && nlist.n_strx == 1)
|
||||
@ -1445,7 +1446,7 @@ read_dbx_symtab (struct objfile *objfile)
|
||||
case N_NBBSS:
|
||||
continue;
|
||||
|
||||
/* Keep going . . . */
|
||||
/* Keep going . . . */
|
||||
|
||||
/*
|
||||
* Special symbol types for GNU
|
||||
@ -1482,7 +1483,7 @@ read_dbx_symtab (struct objfile *objfile)
|
||||
prev_textlow_not_set = textlow_not_set;
|
||||
|
||||
/* A zero value is probably an indication for the SunPRO 3.0
|
||||
compiler. end_psymtab explicitly tests for zero, so
|
||||
compiler. end_psymtab explicitly tests for zero, so
|
||||
don't relocate it. */
|
||||
|
||||
if (nlist.n_value == 0
|
||||
@ -1497,7 +1498,7 @@ read_dbx_symtab (struct objfile *objfile)
|
||||
past_first_source_file = 1;
|
||||
|
||||
if (prev_so_symnum != symnum - 1)
|
||||
{ /* Here if prev stab wasn't N_SO */
|
||||
{ /* Here if prev stab wasn't N_SO. */
|
||||
first_so_symnum = symnum;
|
||||
|
||||
if (pst)
|
||||
@ -1516,24 +1517,24 @@ read_dbx_symtab (struct objfile *objfile)
|
||||
|
||||
prev_so_symnum = symnum;
|
||||
|
||||
/* End the current partial symtab and start a new one */
|
||||
/* End the current partial symtab and start a new one. */
|
||||
|
||||
namestring = set_namestring (objfile, &nlist);
|
||||
|
||||
/* Null name means end of .o file. Don't start a new one. */
|
||||
/* Null name means end of .o file. Don't start a new one. */
|
||||
if (*namestring == '\000')
|
||||
continue;
|
||||
|
||||
/* Some compilers (including gcc) emit a pair of initial N_SOs.
|
||||
The first one is a directory name; the second the file name.
|
||||
If pst exists, is empty, and has a filename ending in '/',
|
||||
we assume the previous N_SO was a directory name. */
|
||||
we assume the previous N_SO was a directory name. */
|
||||
|
||||
p = strrchr (namestring, '/');
|
||||
if (p && *(p + 1) == '\000')
|
||||
{
|
||||
/* Save the directory name SOs locally, then save it into
|
||||
the psymtab when it's created below. */
|
||||
the psymtab when it's created below. */
|
||||
dirname_nso = namestring;
|
||||
continue;
|
||||
}
|
||||
@ -1561,7 +1562,7 @@ read_dbx_symtab (struct objfile *objfile)
|
||||
|
||||
/* Add this bincl to the bincl_list for future EXCLs. No
|
||||
need to save the string; it'll be around until
|
||||
read_dbx_symtab function returns */
|
||||
read_dbx_symtab function returns. */
|
||||
|
||||
namestring = set_namestring (objfile, &nlist);
|
||||
tmp_language = deduce_language_from_filename (namestring);
|
||||
@ -1587,7 +1588,7 @@ read_dbx_symtab (struct objfile *objfile)
|
||||
}
|
||||
add_bincl_to_list (pst, namestring, nlist.n_value);
|
||||
|
||||
/* Mark down an include file in the current psymtab */
|
||||
/* Mark down an include file in the current psymtab. */
|
||||
|
||||
goto record_include_file;
|
||||
}
|
||||
@ -1596,7 +1597,7 @@ read_dbx_symtab (struct objfile *objfile)
|
||||
{
|
||||
enum language tmp_language;
|
||||
|
||||
/* Mark down an include file in the current psymtab */
|
||||
/* Mark down an include file in the current psymtab. */
|
||||
namestring = set_namestring (objfile, &nlist);
|
||||
tmp_language = deduce_language_from_filename (namestring);
|
||||
|
||||
@ -1611,7 +1612,7 @@ read_dbx_symtab (struct objfile *objfile)
|
||||
|
||||
/* In C++, one may expect the same filename to come round many
|
||||
times, when code is coming alternately from the main file
|
||||
and from inline functions in other files. So I check to see
|
||||
and from inline functions in other files. So I check to see
|
||||
if this is a file we've seen before -- either the main
|
||||
source file, or a previously included file.
|
||||
|
||||
@ -1648,8 +1649,8 @@ read_dbx_symtab (struct objfile *objfile)
|
||||
}
|
||||
continue;
|
||||
}
|
||||
case N_LSYM: /* Typedef or automatic variable. */
|
||||
case N_STSYM: /* Data seg var -- static */
|
||||
case N_LSYM: /* Typedef or automatic variable. */
|
||||
case N_STSYM: /* Data seg var -- static. */
|
||||
case N_LCSYM: /* BSS " */
|
||||
case N_ROSYM: /* Read-only data seg var -- static. */
|
||||
case N_NBSTS: /* Gould nobase. */
|
||||
@ -1663,7 +1664,7 @@ read_dbx_symtab (struct objfile *objfile)
|
||||
|
||||
case N_PC: /* I may or may not need this; I
|
||||
suspect not. */
|
||||
case N_M2C: /* I suspect that I can ignore this here. */
|
||||
case N_M2C: /* I suspect that I can ignore this here. */
|
||||
case N_SCOPE: /* Same. */
|
||||
{
|
||||
char *p;
|
||||
@ -1686,7 +1687,7 @@ read_dbx_symtab (struct objfile *objfile)
|
||||
|
||||
p = (char *) strchr (namestring, ':');
|
||||
if (!p)
|
||||
continue; /* Not a debugging symbol. */
|
||||
continue; /* Not a debugging symbol. */
|
||||
|
||||
sym_len = 0;
|
||||
sym_name = NULL; /* pacify "gcc -Werror" */
|
||||
@ -1741,7 +1742,7 @@ read_dbx_symtab (struct objfile *objfile)
|
||||
nlist.n_value += ANOFFSET (objfile->section_offsets,
|
||||
data_sect_index);
|
||||
/* The addresses in these entries are reported to be
|
||||
wrong. See the code that reads 'G's for symtabs. */
|
||||
wrong. See the code that reads 'G's for symtabs. */
|
||||
add_psymbol_to_list (sym_name, sym_len, 1,
|
||||
VAR_DOMAIN, LOC_STATIC,
|
||||
&objfile->global_psymbols,
|
||||
@ -1779,7 +1780,7 @@ read_dbx_symtab (struct objfile *objfile)
|
||||
goto check_enum;
|
||||
|
||||
case 't':
|
||||
if (p != namestring) /* a name is there, not just :T... */
|
||||
if (p != namestring) /* a name is there, not just :T... */
|
||||
{
|
||||
add_psymbol_to_list (sym_name, sym_len, 1,
|
||||
VAR_DOMAIN, LOC_TYPEDEF,
|
||||
@ -1880,10 +1881,10 @@ read_dbx_symtab (struct objfile *objfile)
|
||||
}
|
||||
nlist.n_value += ANOFFSET (objfile->section_offsets,
|
||||
SECT_OFF_TEXT (objfile));
|
||||
/* Kludges for ELF/STABS with Sun ACC */
|
||||
/* Kludges for ELF/STABS with Sun ACC. */
|
||||
last_function_name = namestring;
|
||||
/* Do not fix textlow==0 for .o or NLM files, as 0 is a legit
|
||||
value for the bottom of the text seg in those cases. */
|
||||
value for the bottom of the text seg in those cases. */
|
||||
if (nlist.n_value == ANOFFSET (objfile->section_offsets,
|
||||
SECT_OFF_TEXT (objfile))
|
||||
&& gdbarch_sofun_address_maybe_missing (gdbarch))
|
||||
@ -1897,7 +1898,7 @@ read_dbx_symtab (struct objfile *objfile)
|
||||
symbol wasn't found. (Unfortunately, this might also
|
||||
be a valid address.) Anyway, if it *does* return 0,
|
||||
it is likely that the value was set correctly to begin
|
||||
with... */
|
||||
with... */
|
||||
if (minsym_valu != 0)
|
||||
nlist.n_value = minsym_valu;
|
||||
}
|
||||
@ -1950,10 +1951,10 @@ read_dbx_symtab (struct objfile *objfile)
|
||||
}
|
||||
nlist.n_value += ANOFFSET (objfile->section_offsets,
|
||||
SECT_OFF_TEXT (objfile));
|
||||
/* Kludges for ELF/STABS with Sun ACC */
|
||||
/* Kludges for ELF/STABS with Sun ACC. */
|
||||
last_function_name = namestring;
|
||||
/* Do not fix textlow==0 for .o or NLM files, as 0 is a legit
|
||||
value for the bottom of the text seg in those cases. */
|
||||
value for the bottom of the text seg in those cases. */
|
||||
if (nlist.n_value == ANOFFSET (objfile->section_offsets,
|
||||
SECT_OFF_TEXT (objfile))
|
||||
&& gdbarch_sofun_address_maybe_missing (gdbarch))
|
||||
@ -1967,7 +1968,7 @@ read_dbx_symtab (struct objfile *objfile)
|
||||
symbol wasn't found. (Unfortunately, this might also
|
||||
be a valid address.) Anyway, if it *does* return 0,
|
||||
it is likely that the value was set correctly to begin
|
||||
with... */
|
||||
with... */
|
||||
if (minsym_valu != 0)
|
||||
nlist.n_value = minsym_valu;
|
||||
}
|
||||
@ -2020,7 +2021,7 @@ read_dbx_symtab (struct objfile *objfile)
|
||||
case '8':
|
||||
case '9':
|
||||
case '-':
|
||||
case '#': /* for symbol identification (used in live ranges) */
|
||||
case '#': /* For symbol identification (used in live ranges). */
|
||||
continue;
|
||||
|
||||
case ':':
|
||||
@ -2056,7 +2057,7 @@ read_dbx_symtab (struct objfile *objfile)
|
||||
namestring = set_namestring (objfile, &nlist);
|
||||
|
||||
/* Find the corresponding bincl and mark that psymtab on the
|
||||
psymtab dependency list */
|
||||
psymtab dependency list. */
|
||||
{
|
||||
struct partial_symtab *needed_pst =
|
||||
find_corresponding_bincl_psymtab (namestring, nlist.n_value);
|
||||
@ -2135,10 +2136,10 @@ read_dbx_symtab (struct objfile *objfile)
|
||||
case N_BSLINE:
|
||||
case N_SSYM: /* Claim: Structure or union element.
|
||||
Hopefully, I can ignore this. */
|
||||
case N_ENTRY: /* Alternate entry point; can ignore. */
|
||||
case N_ENTRY: /* Alternate entry point; can ignore. */
|
||||
case N_MAIN: /* Can definitely ignore this. */
|
||||
case N_CATCH: /* These are GNU C++ extensions */
|
||||
case N_EHDECL: /* that can safely be ignored here. */
|
||||
case N_EHDECL: /* that can safely be ignored here. */
|
||||
case N_LENG:
|
||||
case N_BCOMM:
|
||||
case N_ECOMM:
|
||||
@ -2152,11 +2153,10 @@ read_dbx_symtab (struct objfile *objfile)
|
||||
case N_DEFD: /* GNU Modula-2 */
|
||||
case N_ALIAS: /* SunPro F77: alias name, ignore for now. */
|
||||
|
||||
case N_OBJ: /* useless types from Solaris */
|
||||
case N_OBJ: /* Useless types from Solaris. */
|
||||
case N_OPT:
|
||||
case N_PATCH:
|
||||
/* These symbols aren't interesting; don't worry about them */
|
||||
|
||||
/* These symbols aren't interesting; don't worry about them. */
|
||||
continue;
|
||||
|
||||
default:
|
||||
@ -2192,7 +2192,7 @@ read_dbx_symtab (struct objfile *objfile)
|
||||
|
||||
SYMFILE_NAME is the name of the symbol-file we are reading from, and ADDR
|
||||
is the address relative to which its symbols are (incremental) or 0
|
||||
(normal). */
|
||||
(normal). */
|
||||
|
||||
static struct partial_symtab *
|
||||
start_psymtab (struct objfile *objfile, char *filename, CORE_ADDR textlow,
|
||||
@ -2220,7 +2220,7 @@ start_psymtab (struct objfile *objfile, char *filename, CORE_ADDR textlow,
|
||||
elfstab_offset_sections (objfile, result);
|
||||
#endif
|
||||
|
||||
/* Deduce the source language from the filename for this psymtab. */
|
||||
/* Deduce the source language from the filename for this psymtab. */
|
||||
psymtab_language = deduce_language_from_filename (filename);
|
||||
|
||||
return result;
|
||||
@ -2294,7 +2294,7 @@ end_psymtab (struct partial_symtab *pst, char **include_list, int num_includes,
|
||||
|
||||
if (!gdbarch_sofun_address_maybe_missing (gdbarch))
|
||||
;
|
||||
/* this test will be true if the last .o file is only data */
|
||||
/* This test will be true if the last .o file is only data. */
|
||||
else if (textlow_not_set)
|
||||
pst->textlow = pst->texthigh;
|
||||
else
|
||||
@ -2312,7 +2312,8 @@ end_psymtab (struct partial_symtab *pst, char **include_list, int num_includes,
|
||||
if (p1->texthigh == 0 && p1->textlow != 0 && p1 != pst)
|
||||
{
|
||||
p1->texthigh = pst->textlow;
|
||||
/* if this file has only data, then make textlow match texthigh */
|
||||
/* If this file has only data, then make textlow match
|
||||
texthigh. */
|
||||
if (p1->textlow == 0)
|
||||
p1->textlow = p1->texthigh;
|
||||
}
|
||||
@ -2345,7 +2346,7 @@ end_psymtab (struct partial_symtab *pst, char **include_list, int num_includes,
|
||||
struct partial_symtab *subpst =
|
||||
allocate_psymtab (include_list[i], objfile);
|
||||
|
||||
/* Copy the sesction_offsets array from the main psymtab. */
|
||||
/* Copy the sesction_offsets array from the main psymtab. */
|
||||
subpst->section_offsets = pst->section_offsets;
|
||||
subpst->read_symtab_private =
|
||||
obstack_alloc (&objfile->objfile_obstack, sizeof (struct symloc));
|
||||
@ -2407,13 +2408,13 @@ dbx_psymtab_to_symtab_1 (struct partial_symtab *pst)
|
||||
|
||||
if (pst->readin)
|
||||
{
|
||||
fprintf_unfiltered (gdb_stderr, "Psymtab for %s already read in. \
|
||||
Shouldn't happen.\n",
|
||||
fprintf_unfiltered (gdb_stderr, "Psymtab for %s already read in. "
|
||||
"Shouldn't happen.\n",
|
||||
pst->filename);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Read in all partial symtabs on which this one is dependent */
|
||||
/* Read in all partial symtabs on which this one is dependent. */
|
||||
for (i = 0; i < pst->number_of_dependencies; i++)
|
||||
if (!pst->dependencies[i]->readin)
|
||||
{
|
||||
@ -2425,13 +2426,13 @@ Shouldn't happen.\n",
|
||||
fputs_filtered ("and ", gdb_stdout);
|
||||
wrap_here ("");
|
||||
printf_filtered ("%s...", pst->dependencies[i]->filename);
|
||||
wrap_here (""); /* Flush output */
|
||||
wrap_here (""); /* Flush output. */
|
||||
gdb_flush (gdb_stdout);
|
||||
}
|
||||
dbx_psymtab_to_symtab_1 (pst->dependencies[i]);
|
||||
}
|
||||
|
||||
if (LDSYMLEN (pst)) /* Otherwise it's a dummy */
|
||||
if (LDSYMLEN (pst)) /* Otherwise it's a dummy. */
|
||||
{
|
||||
/* Init stuff necessary for reading in symbols */
|
||||
stabsread_init ();
|
||||
@ -2440,7 +2441,7 @@ Shouldn't happen.\n",
|
||||
file_string_table_offset = FILE_STRING_OFFSET (pst);
|
||||
symbol_size = SYMBOL_SIZE (pst);
|
||||
|
||||
/* Read in this file's symbols */
|
||||
/* Read in this file's symbols. */
|
||||
bfd_seek (pst->objfile->obfd, SYMBOL_OFFSET (pst), SEEK_SET);
|
||||
read_ofile_symtab (pst);
|
||||
|
||||
@ -2464,8 +2465,8 @@ dbx_psymtab_to_symtab (struct partial_symtab *pst)
|
||||
|
||||
if (pst->readin)
|
||||
{
|
||||
fprintf_unfiltered (gdb_stderr, "Psymtab for %s already read in. \
|
||||
Shouldn't happen.\n",
|
||||
fprintf_unfiltered (gdb_stderr, "Psymtab for %s already read in. "
|
||||
"Shouldn't happen.\n",
|
||||
pst->filename);
|
||||
return;
|
||||
}
|
||||
@ -2511,7 +2512,7 @@ Shouldn't happen.\n",
|
||||
}
|
||||
}
|
||||
|
||||
/* Read in a defined section of a specific object file's symbols. */
|
||||
/* Read in a defined section of a specific object file's symbols. */
|
||||
|
||||
static void
|
||||
read_ofile_symtab (struct partial_symtab *pst)
|
||||
@ -2537,7 +2538,7 @@ read_ofile_symtab (struct partial_symtab *pst)
|
||||
/* This cannot be simply objfile->section_offsets because of
|
||||
elfstab_offset_sections() which initializes the psymtab section
|
||||
offsets information in a special way, and that is different from
|
||||
objfile->section_offsets. */
|
||||
objfile->section_offsets. */
|
||||
section_offsets = pst->section_offsets;
|
||||
|
||||
current_objfile = objfile;
|
||||
@ -2547,7 +2548,7 @@ read_ofile_symtab (struct partial_symtab *pst)
|
||||
last_source_file = NULL;
|
||||
|
||||
abfd = objfile->obfd;
|
||||
symfile_bfd = objfile->obfd; /* Implicit param to next_text_symbol */
|
||||
symfile_bfd = objfile->obfd; /* Implicit param to next_text_symbol. */
|
||||
symbuf_end = symbuf_idx = 0;
|
||||
symbuf_read = 0;
|
||||
symbuf_left = sym_offset + sym_size;
|
||||
@ -2584,7 +2585,7 @@ read_ofile_symtab (struct partial_symtab *pst)
|
||||
}
|
||||
|
||||
/* Try to select a C++ demangling based on the compilation unit
|
||||
producer. */
|
||||
producer. */
|
||||
|
||||
#if 0
|
||||
/* For now, stay with AUTO_DEMANGLING for g++ output, as we don't
|
||||
@ -2619,7 +2620,7 @@ read_ofile_symtab (struct partial_symtab *pst)
|
||||
symnum < max_symnum;
|
||||
symnum++)
|
||||
{
|
||||
QUIT; /* Allow this to be interruptable */
|
||||
QUIT; /* Allow this to be interruptable. */
|
||||
if (symbuf_idx == symbuf_end)
|
||||
fill_symbuf (abfd);
|
||||
bufp = &symbuf[symbuf_idx++];
|
||||
@ -2649,7 +2650,7 @@ read_ofile_symtab (struct partial_symtab *pst)
|
||||
namestring, section_offsets, objfile);
|
||||
}
|
||||
/* We skip checking for a new .o or -l file; that should never
|
||||
happen in this routine. */
|
||||
happen in this routine. */
|
||||
else if (type == N_TEXT)
|
||||
{
|
||||
/* I don't think this code will ever be executed, because
|
||||
@ -2679,18 +2680,18 @@ read_ofile_symtab (struct partial_symtab *pst)
|
||||
a corresponding symbol. If so, store the value. Remove
|
||||
syms from the chain when their values are stored, but
|
||||
search the whole chain, as there may be several syms from
|
||||
different files with the same name. */
|
||||
different files with the same name. */
|
||||
/* This is probably not true. Since the files will be read
|
||||
in one at a time, each reference to a global symbol will
|
||||
be satisfied in each file as it appears. So we skip this
|
||||
section. */
|
||||
be satisfied in each file as it appears. So we skip this
|
||||
section. */
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
/* In a Solaris elf file, this variable, which comes from the
|
||||
value of the N_SO symbol, will still be 0. Luckily, text_offset,
|
||||
which comes from pst->textlow is correct. */
|
||||
which comes from pst->textlow is correct. */
|
||||
if (last_source_start_addr == 0)
|
||||
last_source_start_addr = text_offset;
|
||||
|
||||
@ -2746,7 +2747,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
|
||||
/* If this is nonzero, we've seen an N_SLINE since the start of the
|
||||
current function. We use this to tell us to move the first sline
|
||||
to the beginning of the function regardless of what its given
|
||||
value is. */
|
||||
value is. */
|
||||
static int sline_found_in_function = 1;
|
||||
|
||||
/* If this is nonzero, we've seen a non-gcc N_OPT symbol for this
|
||||
@ -2949,11 +2950,11 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
|
||||
/* Check if previous symbol was also an N_SO (with some
|
||||
sanity checks). If so, that one was actually the
|
||||
directory name, and the current one is the real file
|
||||
name. Patch things up. */
|
||||
name. Patch things up. */
|
||||
if (previous_stab_code == (unsigned char) N_SO)
|
||||
{
|
||||
patch_subfile_names (current_subfile, name);
|
||||
break; /* Ignore repeated SOs */
|
||||
break; /* Ignore repeated SOs. */
|
||||
}
|
||||
end_symtab (valu, objfile, SECT_OFF_TEXT (objfile));
|
||||
end_stabs ();
|
||||
@ -3268,7 +3269,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
|
||||
objfile it is in; If there is more than one N_MAIN, choose
|
||||
the one in the symfile_objfile; If there is more than one
|
||||
N_MAIN within a given objfile, complain() and choose
|
||||
arbitrarily. (kingdon) */
|
||||
arbitrarily. (kingdon) */
|
||||
if (name != NULL)
|
||||
set_main_name (name);
|
||||
break;
|
||||
@ -3334,7 +3335,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
|
||||
.stabstr section exists.
|
||||
|
||||
This routine is mostly copied from dbx_symfile_init and dbx_symfile_read,
|
||||
adjusted for coff details. */
|
||||
adjusted for coff details. */
|
||||
|
||||
void
|
||||
coffstab_build_psymtabs (struct objfile *objfile,
|
||||
@ -3383,7 +3384,7 @@ coffstab_build_psymtabs (struct objfile *objfile,
|
||||
|
||||
/* In a coff file, we've already installed the minimal symbols that came
|
||||
from the coff (non-stab) symbol table, so always act like an
|
||||
incremental load here. */
|
||||
incremental load here. */
|
||||
if (stabsects->next == NULL)
|
||||
{
|
||||
stabsize = bfd_section_size (sym_bfd, stabsects->section);
|
||||
@ -3425,7 +3426,7 @@ coffstab_build_psymtabs (struct objfile *objfile,
|
||||
.stabstr section exists.
|
||||
|
||||
This routine is mostly copied from dbx_symfile_init and dbx_symfile_read,
|
||||
adjusted for elf details. */
|
||||
adjusted for elf details. */
|
||||
|
||||
void
|
||||
elfstab_build_psymtabs (struct objfile *objfile, asection *stabsect,
|
||||
@ -3506,7 +3507,8 @@ elfstab_build_psymtabs (struct objfile *objfile, asection *stabsect,
|
||||
STAB_NAME is the name of the section that contains the stabs.
|
||||
STABSTR_NAME is the name of the section that contains the stab strings.
|
||||
|
||||
This routine is mostly copied from dbx_symfile_init and dbx_symfile_read. */
|
||||
This routine is mostly copied from dbx_symfile_init and
|
||||
dbx_symfile_read. */
|
||||
|
||||
void
|
||||
stabsect_build_psymtabs (struct objfile *objfile, char *stab_name,
|
||||
@ -3526,8 +3528,8 @@ stabsect_build_psymtabs (struct objfile *objfile, char *stab_name,
|
||||
return;
|
||||
|
||||
if (!stabstrsect)
|
||||
error (_("stabsect_build_psymtabs: Found stabs (%s), but not string \
|
||||
section (%s)"),
|
||||
error (_("stabsect_build_psymtabs: Found stabs (%s), "
|
||||
"but not string section (%s)"),
|
||||
stab_name, stabstr_name);
|
||||
|
||||
objfile->deprecated_sym_stab_info = (struct dbx_symfile_info *)
|
||||
@ -3574,7 +3576,7 @@ section (%s)"),
|
||||
free_header_files ();
|
||||
init_header_files ();
|
||||
|
||||
/* Now, do an incremental load */
|
||||
/* Now, do an incremental load. */
|
||||
|
||||
processing_acc_compilation = 1;
|
||||
dbx_symfile_read (objfile, 0);
|
||||
@ -3583,16 +3585,14 @@ section (%s)"),
|
||||
static const struct sym_fns aout_sym_fns =
|
||||
{
|
||||
bfd_target_aout_flavour,
|
||||
dbx_new_init, /* sym_new_init: init anything gbl to entire symtab */
|
||||
dbx_symfile_init, /* sym_init: read initial info, setup for sym_read() */
|
||||
dbx_symfile_read, /* sym_read: read a symbol file into symtab */
|
||||
dbx_symfile_finish, /* sym_finish: finished with file, cleanup */
|
||||
default_symfile_offsets, /* sym_offsets: parse user's offsets to
|
||||
internal form */
|
||||
default_symfile_segments, /* sym_segments: Get segment information from
|
||||
a file. */
|
||||
NULL, /* sym_read_linetable */
|
||||
default_symfile_relocate, /* sym_relocate: Relocate a debug section. */
|
||||
dbx_new_init, /* init anything gbl to entire symtab */
|
||||
dbx_symfile_init, /* read initial info, setup for sym_read() */
|
||||
dbx_symfile_read, /* read a symbol file into symtab */
|
||||
dbx_symfile_finish, /* finished with file, cleanup */
|
||||
default_symfile_offsets, /* parse user's offsets to internal form */
|
||||
default_symfile_segments, /* Get segment information from a file. */
|
||||
NULL,
|
||||
default_symfile_relocate, /* Relocate a debug section. */
|
||||
&psym_functions
|
||||
};
|
||||
|
||||
|
@ -88,7 +88,7 @@
|
||||
|
||||
struct dcache_block
|
||||
{
|
||||
/* for least-recently-allocated and free lists */
|
||||
/* For least-recently-allocated and free lists. */
|
||||
struct dcache_block *prev;
|
||||
struct dcache_block *next;
|
||||
|
||||
@ -100,7 +100,7 @@ struct dcache_block
|
||||
struct dcache_struct
|
||||
{
|
||||
splay_tree tree;
|
||||
struct dcache_block *oldest; /* least-recently-allocated list */
|
||||
struct dcache_block *oldest; /* least-recently-allocated list. */
|
||||
|
||||
/* The free list is maintained identically to OLDEST to simplify
|
||||
the code: we only need one set of accessors. */
|
||||
@ -134,7 +134,7 @@ show_dcache_enabled_p (struct ui_file *file, int from_tty,
|
||||
fprintf_filtered (file, _("Deprecated remotecache flag is %s.\n"), value);
|
||||
}
|
||||
|
||||
static DCACHE *last_cache; /* Used by info dcache */
|
||||
static DCACHE *last_cache; /* Used by info dcache. */
|
||||
|
||||
/* Add BLOCK to circular block list BLIST, behind the block at *BLIST.
|
||||
*BLIST is not updated (unless it was previously NULL of course).
|
||||
@ -575,7 +575,7 @@ dcache_print_line (int index)
|
||||
{
|
||||
printf_filtered ("%02x ", db->data[j]);
|
||||
|
||||
/* Print a newline every 16 bytes (48 characters) */
|
||||
/* Print a newline every 16 bytes (48 characters). */
|
||||
if ((j % 16 == 15) && (j != LINE_SIZE - 1))
|
||||
printf_filtered ("\n");
|
||||
}
|
||||
|
@ -24,16 +24,16 @@
|
||||
|
||||
typedef struct dcache_struct DCACHE;
|
||||
|
||||
/* Invalidate DCACHE. */
|
||||
/* Invalidate DCACHE. */
|
||||
void dcache_invalidate (DCACHE *dcache);
|
||||
|
||||
/* Initialize DCACHE. */
|
||||
/* Initialize DCACHE. */
|
||||
DCACHE *dcache_init (void);
|
||||
|
||||
/* Free a DCACHE */
|
||||
/* Free a DCACHE. */
|
||||
void dcache_free (DCACHE *);
|
||||
|
||||
/* Simple to call from <remote>_xfer_memory */
|
||||
/* Simple to call from <remote>_xfer_memory. */
|
||||
|
||||
int dcache_xfer_memory (struct target_ops *ops, DCACHE *cache, CORE_ADDR mem,
|
||||
gdb_byte *my, int len, int should_write);
|
||||
|
@ -108,7 +108,7 @@ write_clbk (void *caller_context, void *address, void *buffer,
|
||||
return ESUCCESS;
|
||||
}
|
||||
|
||||
/* Get integer regs */
|
||||
/* Get integer regs. */
|
||||
|
||||
static int
|
||||
get_reg_clbk(void *caller_context, pthreadDebugGetRegRtn_t regs,
|
||||
@ -120,7 +120,7 @@ get_reg_clbk(void *caller_context, pthreadDebugGetRegRtn_t regs,
|
||||
return ESUCCESS;
|
||||
}
|
||||
|
||||
/* Set integer regs */
|
||||
/* Set integer regs. */
|
||||
|
||||
static int
|
||||
set_reg_clbk(void *caller_context, const pthreadDebugRegs_t *regs,
|
||||
@ -256,7 +256,7 @@ enable_dec_thread (void)
|
||||
debug ("enable_dec_thread: Thread support enabled.");
|
||||
}
|
||||
|
||||
/* Deactivate thread support. Do nothing is thread support is
|
||||
/* Deactivate thread support. Do nothing if thread support is
|
||||
already inactive. */
|
||||
|
||||
static void
|
||||
|
75
gdb/defs.h
75
gdb/defs.h
@ -78,9 +78,9 @@
|
||||
|
||||
/* The O_BINARY flag is defined in fcntl.h on some non-Posix platforms.
|
||||
It is used as an access modifier in calls to open(), where it acts
|
||||
similarly to the "b" character in fopen()'s MODE argument. On Posix
|
||||
platforms it should be a no-op, so it is defined as 0 here. This
|
||||
ensures that the symbol may be used freely elsewhere in gdb. */
|
||||
similarly to the "b" character in fopen()'s MODE argument. On Posix
|
||||
platforms it should be a no-op, so it is defined as 0 here. This
|
||||
ensures that the symbol may be used freely elsewhere in gdb. */
|
||||
|
||||
#ifndef O_BINARY
|
||||
#define O_BINARY 0
|
||||
@ -145,10 +145,10 @@ typedef bfd_vma CORE_ADDR;
|
||||
/* Check if a character is one of the commonly used C++ marker characters. */
|
||||
extern int is_cplus_marker (int);
|
||||
|
||||
/* enable xdb commands if set */
|
||||
/* Enable xdb commands if set. */
|
||||
extern int xdb_commands;
|
||||
|
||||
/* enable dbx commands if set */
|
||||
/* Enable dbx commands if set. */
|
||||
extern int dbx_commands;
|
||||
|
||||
/* System root path, used to find libraries etc. */
|
||||
@ -175,7 +175,7 @@ extern void quit (void);
|
||||
marginal. If the overhead of a QUIT function call is proving
|
||||
significant then its calling frequency should probably be reduced
|
||||
[kingdon]. A profile analyzing the current situtation is
|
||||
needed. */
|
||||
needed. */
|
||||
|
||||
#define QUIT { \
|
||||
if (quit_flag) quit (); \
|
||||
@ -185,7 +185,7 @@ extern void quit (void);
|
||||
/* Languages represented in the symbol table and elsewhere.
|
||||
This should probably be in language.h, but since enum's can't
|
||||
be forward declared to satisfy opaque references before their
|
||||
actual definition, needs to be here. */
|
||||
actual definition, needs to be here. */
|
||||
|
||||
enum language
|
||||
{
|
||||
@ -321,10 +321,10 @@ extern void discard_final_cleanups (struct cleanup *);
|
||||
extern void discard_my_cleanups (struct cleanup **, struct cleanup *);
|
||||
|
||||
/* NOTE: cagney/2000-03-04: This typedef is strictly for the
|
||||
make_cleanup function declarations below. Do not use this typedef
|
||||
make_cleanup function declarations below. Do not use this typedef
|
||||
as a cast when passing functions into the make_cleanup() code.
|
||||
Instead either use a bounce function or add a wrapper function.
|
||||
Calling a f(char*) function with f(void*) is non-portable. */
|
||||
Calling a f(char*) function with f(void*) is non-portable. */
|
||||
typedef void (make_cleanup_ftype) (void *);
|
||||
|
||||
extern struct cleanup *make_cleanup (make_cleanup_ftype *, void *);
|
||||
@ -444,13 +444,13 @@ extern struct ui_file *gdb_stdin;
|
||||
extern struct ui_file *gdb_stderr;
|
||||
/* Log/debug/trace messages that should bypass normal stdout/stderr
|
||||
filtering. For moment, always call this stream using
|
||||
*_unfiltered. In the very near future that restriction shall be
|
||||
removed - either call shall be unfiltered. (cagney 1999-06-13). */
|
||||
*_unfiltered. In the very near future that restriction shall be
|
||||
removed - either call shall be unfiltered. (cagney 1999-06-13). */
|
||||
extern struct ui_file *gdb_stdlog;
|
||||
/* Target output that should bypass normal stdout/stderr filtering.
|
||||
For moment, always call this stream using *_unfiltered. In the
|
||||
For moment, always call this stream using *_unfiltered. In the
|
||||
very near future that restriction shall be removed - either call
|
||||
shall be unfiltered. (cagney 1999-07-02). */
|
||||
shall be unfiltered. (cagney 1999-07-02). */
|
||||
extern struct ui_file *gdb_stdtarg;
|
||||
extern struct ui_file *gdb_stdtargerr;
|
||||
extern struct ui_file *gdb_stdtargin;
|
||||
@ -523,7 +523,7 @@ extern void fputstrn_filtered (const char *str, int n, int quotr,
|
||||
extern void fputstrn_unfiltered (const char *str, int n, int quotr,
|
||||
struct ui_file * stream);
|
||||
|
||||
/* Display the host ADDR on STREAM formatted as ``0x%x''. */
|
||||
/* Display the host ADDR on STREAM formatted as ``0x%x''. */
|
||||
extern void gdb_print_host_address (const void *addr, struct ui_file *stream);
|
||||
|
||||
extern const char *host_address_to_string (const void *addr);
|
||||
@ -651,16 +651,16 @@ typedef int (*find_memory_region_ftype) (CORE_ADDR addr, unsigned long size,
|
||||
int read, int write, int exec,
|
||||
void *data);
|
||||
|
||||
/* Take over the 'find_mapped_memory' vector from exec.c. */
|
||||
/* Take over the 'find_mapped_memory' vector from exec.c. */
|
||||
extern void exec_set_find_memory_regions
|
||||
(int (*func) (find_memory_region_ftype func, void *data));
|
||||
|
||||
/* Possible lvalue types. Like enum language, this should be in
|
||||
value.h, but needs to be here for the same reason. */
|
||||
value.h, but needs to be here for the same reason. */
|
||||
|
||||
enum lval_type
|
||||
{
|
||||
/* Not an lval. */
|
||||
/* Not an lval. */
|
||||
not_lval,
|
||||
/* In memory. */
|
||||
lval_memory,
|
||||
@ -708,10 +708,9 @@ struct command_line
|
||||
enum command_control_type control_type;
|
||||
/* The number of elements in body_list. */
|
||||
int body_count;
|
||||
/* For composite commands, the nested lists of
|
||||
commands. For example, for "if" command this
|
||||
will contain the then branch and the else
|
||||
branch, if that is available. */
|
||||
/* For composite commands, the nested lists of commands. For
|
||||
example, for "if" command this will contain the then branch and
|
||||
the else branch, if that is available. */
|
||||
struct command_line **body_list;
|
||||
};
|
||||
|
||||
@ -726,9 +725,9 @@ extern void free_command_lines (struct command_line **);
|
||||
|
||||
/* To continue the execution commands when running gdb asynchronously.
|
||||
A continuation structure contains a pointer to a function to be called
|
||||
to finish the command, once the target has stopped. Such mechanism is
|
||||
to finish the command, once the target has stopped. Such mechanism is
|
||||
used by the finish and until commands, and in the remote protocol
|
||||
when opening an extended-remote connection. */
|
||||
when opening an extended-remote connection. */
|
||||
|
||||
struct continuation;
|
||||
struct thread_info;
|
||||
@ -774,7 +773,7 @@ extern unsigned output_radix;
|
||||
things. Like enum language, this should be in value.h, but needs
|
||||
to be here for the same reason. FIXME: If we can eliminate this
|
||||
as an arg to LA_VAL_PRINT, then we can probably move it back to
|
||||
value.h. */
|
||||
value.h. */
|
||||
|
||||
enum val_prettyprint
|
||||
{
|
||||
@ -841,26 +840,26 @@ typedef struct ptid ptid_t;
|
||||
#endif
|
||||
|
||||
/* Defaults for system-wide constants (if not defined by xm.h, we fake it).
|
||||
FIXME: Assumes 2's complement arithmetic */
|
||||
FIXME: Assumes 2's complement arithmetic. */
|
||||
|
||||
#if !defined (UINT_MAX)
|
||||
#define UINT_MAX ((unsigned int)(~0)) /* 0xFFFFFFFF for 32-bits */
|
||||
#define UINT_MAX ((unsigned int)(~0)) /* 0xFFFFFFFF for 32-bits */
|
||||
#endif
|
||||
|
||||
#if !defined (INT_MAX)
|
||||
#define INT_MAX ((int)(UINT_MAX >> 1)) /* 0x7FFFFFFF for 32-bits */
|
||||
#define INT_MAX ((int)(UINT_MAX >> 1)) /* 0x7FFFFFFF for 32-bits */
|
||||
#endif
|
||||
|
||||
#if !defined (INT_MIN)
|
||||
#define INT_MIN ((int)((int) ~0 ^ INT_MAX)) /* 0x80000000 for 32-bits */
|
||||
#define INT_MIN ((int)((int) ~0 ^ INT_MAX)) /* 0x80000000 for 32-bits */
|
||||
#endif
|
||||
|
||||
#if !defined (ULONG_MAX)
|
||||
#define ULONG_MAX ((unsigned long)(~0L)) /* 0xFFFFFFFF for 32-bits */
|
||||
#define ULONG_MAX ((unsigned long)(~0L)) /* 0xFFFFFFFF for 32-bits */
|
||||
#endif
|
||||
|
||||
#if !defined (LONG_MAX)
|
||||
#define LONG_MAX ((long)(ULONG_MAX >> 1)) /* 0x7FFFFFFF for 32-bits */
|
||||
#define LONG_MAX ((long)(ULONG_MAX >> 1)) /* 0x7FFFFFFF for 32-bits */
|
||||
#endif
|
||||
|
||||
#if !defined (ULONGEST_MAX)
|
||||
@ -883,7 +882,7 @@ extern int longest_to_int (LONGEST);
|
||||
extern char *savestring (const char *, size_t);
|
||||
|
||||
/* xmalloc(), xrealloc() and xcalloc() have already been declared in
|
||||
"libiberty.h". */
|
||||
"libiberty.h". */
|
||||
extern void xfree (void *);
|
||||
|
||||
/* Like xmalloc, but zero the memory. */
|
||||
@ -897,7 +896,7 @@ extern void *xzalloc (size_t);
|
||||
#define XCALLOC(NMEMB, TYPE) ((TYPE*) xcalloc ((NMEMB), sizeof (TYPE)))
|
||||
|
||||
/* Like asprintf/vasprintf but get an internal_error if the call
|
||||
fails. */
|
||||
fails. */
|
||||
extern void xasprintf (char **ret, const char *format, ...)
|
||||
ATTRIBUTE_PRINTF (2, 3);
|
||||
extern void xvasprintf (char **ret, const char *format, va_list ap)
|
||||
@ -1041,7 +1040,7 @@ extern void *alloca ();
|
||||
#endif /* Not GNU C */
|
||||
#endif /* alloca not defined */
|
||||
|
||||
/* Dynamic target-system-dependent parameters for GDB. */
|
||||
/* Dynamic target-system-dependent parameters for GDB. */
|
||||
#include "gdbarch.h"
|
||||
|
||||
/* Maximum size of a register. Something small, but large enough for
|
||||
@ -1049,7 +1048,7 @@ extern void *alloca ();
|
||||
|
||||
enum { MAX_REGISTER_SIZE = 64 };
|
||||
|
||||
/* Static target-system-dependent parameters for GDB. */
|
||||
/* Static target-system-dependent parameters for GDB. */
|
||||
|
||||
/* Number of bits in a char or unsigned char for the target machine.
|
||||
Just like CHAR_BIT in <limits.h> but describes the target machine. */
|
||||
@ -1060,7 +1059,7 @@ enum { MAX_REGISTER_SIZE = 64 };
|
||||
/* If we picked up a copy of CHAR_BIT from a configuration file
|
||||
(which may get it by including <limits.h>) then use it to set
|
||||
the number of bits in a host char. If not, use the same size
|
||||
as the target. */
|
||||
as the target. */
|
||||
|
||||
#if defined (CHAR_BIT)
|
||||
#define HOST_CHAR_BIT CHAR_BIT
|
||||
@ -1098,14 +1097,14 @@ extern int watchdog;
|
||||
|
||||
/* Hooks for alternate command interfaces. */
|
||||
|
||||
/* The name of the interpreter if specified on the command line. */
|
||||
/* The name of the interpreter if specified on the command line. */
|
||||
extern char *interpreter_p;
|
||||
|
||||
/* If a given interpreter matches INTERPRETER_P then it should update
|
||||
deprecated_command_loop_hook and deprecated_init_ui_hook with the
|
||||
per-interpreter implementation. */
|
||||
/* FIXME: deprecated_command_loop_hook and deprecated_init_ui_hook
|
||||
should be moved here. */
|
||||
should be moved here. */
|
||||
|
||||
struct target_waitstatus;
|
||||
struct cmd_list_element;
|
||||
@ -1154,7 +1153,7 @@ extern int (*deprecated_ui_load_progress_hook) (const char *section,
|
||||
unsigned long num);
|
||||
|
||||
|
||||
/* Inhibit window interface if non-zero. */
|
||||
/* Inhibit window interface if non-zero. */
|
||||
|
||||
extern int use_windows;
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
|
||||
/* This file contains support code for C++ demangling that is common
|
||||
to a styles of demangling, and GDB specific. */
|
||||
to a styles of demangling, and GDB specific. */
|
||||
|
||||
#include "defs.h"
|
||||
#include "command.h"
|
||||
@ -36,7 +36,7 @@
|
||||
"lucid", "arm", "hp", etc.) in which case gdb will never attempt to do auto
|
||||
selection of the style unless you do an explicit "set demangle auto".
|
||||
To select one of these as the default, set DEFAULT_DEMANGLING_STYLE in
|
||||
the appropriate target configuration file. */
|
||||
the appropriate target configuration file. */
|
||||
|
||||
#ifndef DEFAULT_DEMANGLING_STYLE
|
||||
#define DEFAULT_DEMANGLING_STYLE AUTO_DEMANGLING_STYLE_STRING
|
||||
@ -46,7 +46,7 @@ extern void _initialize_demangler (void);
|
||||
|
||||
/* String name for the current demangling style. Set by the
|
||||
"set demangle-style" command, printed as part of the output by the
|
||||
"show demangle-style" command. */
|
||||
"show demangle-style" command. */
|
||||
|
||||
static char *current_demangling_style_string;
|
||||
|
||||
@ -79,7 +79,7 @@ static void set_demangling_command (char *, int, struct cmd_list_element *);
|
||||
enum value.
|
||||
|
||||
Note: Assumes that current_demangling_style_string always points to
|
||||
a malloc'd string, even if it is a null-string. */
|
||||
a malloc'd string, even if it is a null-string. */
|
||||
|
||||
static void
|
||||
set_demangling_command (char *ignore, int from_tty, struct cmd_list_element *c)
|
||||
@ -89,7 +89,7 @@ set_demangling_command (char *ignore, int from_tty, struct cmd_list_element *c)
|
||||
/* First just try to match whatever style name the user supplied with
|
||||
one of the known ones. Don't bother special casing for an empty
|
||||
name, we just treat it as any other style name that doesn't match.
|
||||
If we match, update the current demangling style enum. */
|
||||
If we match, update the current demangling style enum. */
|
||||
|
||||
for (dem = libiberty_demanglers;
|
||||
dem->demangling_style != unknown_demangling;
|
||||
@ -104,8 +104,8 @@ set_demangling_command (char *ignore, int from_tty, struct cmd_list_element *c)
|
||||
}
|
||||
|
||||
/* Check to see if we found a match. If not, gripe about any non-empty
|
||||
style name and supply a list of valid ones. FIXME: This should
|
||||
probably be done with some sort of completion and with help. */
|
||||
style name and supply a list of valid ones. FIXME: This should
|
||||
probably be done with some sort of completion and with help. */
|
||||
|
||||
if (dem->demangling_style == unknown_demangling)
|
||||
{
|
||||
@ -132,7 +132,7 @@ set_demangling_command (char *ignore, int from_tty, struct cmd_list_element *c)
|
||||
{
|
||||
/* This can happen during initialization if gdb is compiled with
|
||||
a DEMANGLING_STYLE value that is unknown, so pick the first
|
||||
one as the default. */
|
||||
one as the default. */
|
||||
current_demangling_style = libiberty_demanglers[0].demangling_style;
|
||||
current_demangling_style_string =
|
||||
xstrdup (libiberty_demanglers[0].demangling_style_name);
|
||||
@ -142,7 +142,7 @@ set_demangling_command (char *ignore, int from_tty, struct cmd_list_element *c)
|
||||
}
|
||||
}
|
||||
|
||||
/* Fake a "set demangle-style" command. */
|
||||
/* Fake a "set demangle-style" command. */
|
||||
|
||||
void
|
||||
set_demangling_style (char *style)
|
||||
@ -205,6 +205,6 @@ Use `set demangle-style' without arguments for a list of demangling styles."),
|
||||
show_demangling_style_names,
|
||||
&setlist, &showlist);
|
||||
|
||||
/* Set the default demangling style chosen at compilation time. */
|
||||
/* Set the default demangling style chosen at compilation time. */
|
||||
set_demangling_style (DEFAULT_DEMANGLING_STYLE);
|
||||
}
|
||||
|
@ -81,7 +81,8 @@ dicos_load_module_p (bfd *abfd, int header_size)
|
||||
storage_needed = bfd_get_symtab_upper_bound (abfd);
|
||||
if (storage_needed < 0)
|
||||
{
|
||||
warning (_("Can't read elf symbols from %s: %s"), bfd_get_filename (abfd),
|
||||
warning (_("Can't read elf symbols from %s: %s"),
|
||||
bfd_get_filename (abfd),
|
||||
bfd_errmsg (bfd_get_error ()));
|
||||
return 0;
|
||||
}
|
||||
|
@ -83,9 +83,7 @@
|
||||
|
||||
* Define a function dict_<op> that looks up <op> in the dict_vector
|
||||
and calls the appropriate function. Add a declaration for
|
||||
dict_<op> to dictionary.h.
|
||||
|
||||
*/
|
||||
dict_<op> to dictionary.h. */
|
||||
|
||||
/* An enum representing the various implementations of dictionaries.
|
||||
Used only for debugging. */
|
||||
|
@ -153,7 +153,7 @@ extern struct symbol *dict_iter_match_first (const struct dictionary *dict,
|
||||
dict_iter_match_first), or NULL if there are no more such symbols.
|
||||
Don't call this if you've previously received NULL from
|
||||
dict_iterator_match_first or dict_iterator_match_next on this
|
||||
iteration. And don't call it unless ITERATOR was created by a
|
||||
iteration. And don't call it unless ITERATOR was created by a
|
||||
previous call to dict_iter_match_first with the same NAME and COMPARE. */
|
||||
|
||||
extern struct symbol *dict_iter_match_next (const char *name,
|
||||
|
@ -96,10 +96,10 @@ dink32_supply_register (struct regcache *regcache, char *regname,
|
||||
monitor_supply_register (regcache, regno, val);
|
||||
}
|
||||
|
||||
/* This array of registers needs to match the indexes used by GDB. The
|
||||
whole reason this exists is because the various ROM monitors use
|
||||
different names than GDB does, and don't support all the registers
|
||||
either. */
|
||||
/* This array of registers needs to match the indexes used by GDB.
|
||||
The whole reason this exists is because the various ROM monitors
|
||||
use different names than GDB does, and don't support all the
|
||||
registers either. */
|
||||
|
||||
static char *dink32_regnames[] =
|
||||
{
|
||||
@ -134,13 +134,17 @@ extern initialize_file_ftype _initialize_dink32_rom; /* -Wmissing-prototypes */
|
||||
void
|
||||
_initialize_dink32_rom (void)
|
||||
{
|
||||
dink32_cmds.flags = MO_HEX_PREFIX | MO_GETMEM_NEEDS_RANGE | MO_FILL_USES_ADDR | MO_HANDLE_NL | MO_32_REGS_PAIRED | MO_SETREG_INTERACTIVE | MO_SETMEM_INTERACTIVE | MO_GETMEM_16_BOUNDARY | MO_CLR_BREAK_1_BASED | MO_SREC_ACK | MO_SREC_ACK_ROTATE;
|
||||
dink32_cmds.flags = MO_HEX_PREFIX | MO_GETMEM_NEEDS_RANGE
|
||||
| MO_FILL_USES_ADDR | MO_HANDLE_NL | MO_32_REGS_PAIRED
|
||||
| MO_SETREG_INTERACTIVE | MO_SETMEM_INTERACTIVE
|
||||
| MO_GETMEM_16_BOUNDARY | MO_CLR_BREAK_1_BASED | MO_SREC_ACK
|
||||
| MO_SREC_ACK_ROTATE;
|
||||
dink32_cmds.init = dink32_inits;
|
||||
dink32_cmds.cont = "go +\r";
|
||||
dink32_cmds.step = "tr +\r";
|
||||
dink32_cmds.set_break = "bp 0x%x\r";
|
||||
dink32_cmds.clr_break = "bp %d\r";
|
||||
#if 0 /* Would need to follow strict alignment rules.. */
|
||||
#if 0 /* Would need to follow strict alignment rules.. */
|
||||
dink32_cmds.fill = "mf %x %x %x\r";
|
||||
#endif
|
||||
dink32_cmds.setmem.cmdb = "mm -b %x\r";
|
||||
|
19
gdb/disasm.c
19
gdb/disasm.c
@ -29,7 +29,7 @@
|
||||
|
||||
/* Disassemble functions.
|
||||
FIXME: We should get rid of all the duplicate code in gdb that does
|
||||
the same thing: disassemble_command() and the gdbtk variation. */
|
||||
the same thing: disassemble_command() and the gdbtk variation. */
|
||||
|
||||
/* This Structure is used to store line number information.
|
||||
We need a different sort of line table from the normal one cuz we can't
|
||||
@ -121,7 +121,7 @@ dump_insns (struct gdbarch *gdbarch, struct ui_out *uiout,
|
||||
&line, &unmapped))
|
||||
{
|
||||
/* We don't care now about line, filename and
|
||||
unmapped. But we might in the future. */
|
||||
unmapped. But we might in the future. */
|
||||
ui_out_text (uiout, " <");
|
||||
if ((flags & DISASSEMBLY_OMIT_FNAME) == 0)
|
||||
ui_out_field_string (uiout, "func-name", name);
|
||||
@ -168,6 +168,7 @@ dump_insns (struct gdbarch *gdbarch, struct ui_out *uiout,
|
||||
function to the user. This means that things are presented
|
||||
in source order, with (possibly) out of order assembly
|
||||
immediately following. */
|
||||
|
||||
static void
|
||||
do_mixed_source_and_assembly (struct gdbarch *gdbarch, struct ui_out *uiout,
|
||||
struct disassemble_info *di, int nlines,
|
||||
@ -203,7 +204,7 @@ do_mixed_source_and_assembly (struct gdbarch *gdbarch, struct ui_out *uiout,
|
||||
for (; i < nlines - 1 && le[i].pc < high; i++)
|
||||
{
|
||||
if (le[i].line == le[i + 1].line && le[i].pc == le[i + 1].pc)
|
||||
continue; /* Ignore duplicates */
|
||||
continue; /* Ignore duplicates. */
|
||||
|
||||
/* Skip any end-of-function markers. */
|
||||
if (le[i].line == 0)
|
||||
@ -230,7 +231,7 @@ do_mixed_source_and_assembly (struct gdbarch *gdbarch, struct ui_out *uiout,
|
||||
}
|
||||
|
||||
/* Now, sort mle by line #s (and, then by addresses within
|
||||
lines). */
|
||||
lines). */
|
||||
|
||||
if (out_of_order)
|
||||
qsort (mle, newlines, sizeof (struct dis_line_entry), compare_lines);
|
||||
@ -248,7 +249,7 @@ do_mixed_source_and_assembly (struct gdbarch *gdbarch, struct ui_out *uiout,
|
||||
{
|
||||
if (next_line != 0)
|
||||
{
|
||||
/* Just one line to print. */
|
||||
/* Just one line to print. */
|
||||
if (next_line == mle[i].line)
|
||||
{
|
||||
ui_out_tuple_chain
|
||||
@ -258,7 +259,7 @@ do_mixed_source_and_assembly (struct gdbarch *gdbarch, struct ui_out *uiout,
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Several source lines w/o asm instructions associated. */
|
||||
/* Several source lines w/o asm instructions associated. */
|
||||
for (; next_line < mle[i].line; next_line++)
|
||||
{
|
||||
struct cleanup *ui_out_list_chain_line;
|
||||
@ -276,7 +277,7 @@ do_mixed_source_and_assembly (struct gdbarch *gdbarch, struct ui_out *uiout,
|
||||
do_cleanups (ui_out_tuple_chain_line);
|
||||
}
|
||||
/* Print the last line and leave list open for
|
||||
asm instructions to be added. */
|
||||
asm instructions to be added. */
|
||||
ui_out_tuple_chain
|
||||
= make_cleanup_ui_out_tuple_begin_end (uiout,
|
||||
"src_and_asm_line");
|
||||
@ -384,12 +385,12 @@ gdb_disassembly (struct gdbarch *gdbarch, struct ui_out *uiout,
|
||||
struct ui_stream *stb = ui_out_stream_new (uiout);
|
||||
struct cleanup *cleanups = make_cleanup_ui_out_stream_delete (stb);
|
||||
struct disassemble_info di = gdb_disassemble_info (gdbarch, stb->stream);
|
||||
/* To collect the instruction outputted from opcodes. */
|
||||
/* To collect the instruction outputted from opcodes. */
|
||||
struct symtab *symtab = NULL;
|
||||
struct linetable_entry *le = NULL;
|
||||
int nlines = -1;
|
||||
|
||||
/* Assume symtab is valid for whole PC range */
|
||||
/* Assume symtab is valid for whole PC range. */
|
||||
symtab = find_pc_symtab (low);
|
||||
|
||||
if (symtab != NULL && symtab->linetable != NULL)
|
||||
|
@ -64,7 +64,7 @@ get_field (const bfd_byte *data, enum floatformat_byteorders order,
|
||||
I.e, we need to properly handle the case where total_len is
|
||||
not evenly divisible by 8. So we compute ``excess'' which
|
||||
represents the number of bits from the end of our starting
|
||||
byte needed to get to bit 0. */
|
||||
byte needed to get to bit 0. */
|
||||
int excess = FLOATFORMAT_CHAR_BIT - (total_len % FLOATFORMAT_CHAR_BIT);
|
||||
|
||||
cur_byte = (total_len / FLOATFORMAT_CHAR_BIT)
|
||||
@ -104,7 +104,7 @@ get_field (const bfd_byte *data, enum floatformat_byteorders order,
|
||||
}
|
||||
}
|
||||
if (len < sizeof(result) * FLOATFORMAT_CHAR_BIT)
|
||||
/* Mask out bits which are not part of the field */
|
||||
/* Mask out bits which are not part of the field. */
|
||||
result &= ((1UL << len) - 1);
|
||||
return result;
|
||||
}
|
||||
@ -176,7 +176,7 @@ convert_floatformat_to_doublest (const struct floatformat *fmt,
|
||||
unsigned long mant;
|
||||
unsigned int mant_bits, mant_off;
|
||||
int mant_bits_left;
|
||||
int special_exponent; /* It's a NaN, denorm or zero */
|
||||
int special_exponent; /* It's a NaN, denorm or zero. */
|
||||
enum floatformat_byteorders order;
|
||||
unsigned char newfrom[FLOATFORMAT_LARGEST_BYTES];
|
||||
enum float_kind kind;
|
||||
@ -233,17 +233,17 @@ convert_floatformat_to_doublest (const struct floatformat *fmt,
|
||||
|
||||
special_exponent = exponent == 0 || exponent == fmt->exp_nan;
|
||||
|
||||
/* Don't bias NaNs. Use minimum exponent for denorms. For simplicity,
|
||||
we don't check for zero as the exponent doesn't matter. Note the cast
|
||||
to int; exp_bias is unsigned, so it's important to make sure the
|
||||
operation is done in signed arithmetic. */
|
||||
/* Don't bias NaNs. Use minimum exponent for denorms. For
|
||||
simplicity, we don't check for zero as the exponent doesn't matter.
|
||||
Note the cast to int; exp_bias is unsigned, so it's important to
|
||||
make sure the operation is done in signed arithmetic. */
|
||||
if (!special_exponent)
|
||||
exponent -= fmt->exp_bias;
|
||||
else if (exponent == 0)
|
||||
exponent = 1 - fmt->exp_bias;
|
||||
|
||||
/* Build the result algebraically. Might go infinite, underflow, etc;
|
||||
who cares. */
|
||||
who cares. */
|
||||
|
||||
/* If this format uses a hidden bit, explicitly add it in now. Otherwise,
|
||||
increment the exponent by one to account for the integer bit. */
|
||||
@ -447,7 +447,7 @@ convert_doublest_to_floatformat (CONST struct floatformat *fmt,
|
||||
/* From is NaN */
|
||||
put_field (uto, order, fmt->totalsize, fmt->exp_start,
|
||||
fmt->exp_len, fmt->exp_nan);
|
||||
/* Be sure it's not infinity, but NaN value is irrel */
|
||||
/* Be sure it's not infinity, but NaN value is irrel. */
|
||||
put_field (uto, order, fmt->totalsize, fmt->man_start,
|
||||
32, 1);
|
||||
goto finalize_byteorder;
|
||||
@ -460,7 +460,7 @@ convert_doublest_to_floatformat (CONST struct floatformat *fmt,
|
||||
dfrom = -dfrom;
|
||||
}
|
||||
|
||||
if (dfrom + dfrom == dfrom && dfrom != 0.0) /* Result is Infinity */
|
||||
if (dfrom + dfrom == dfrom && dfrom != 0.0) /* Result is Infinity. */
|
||||
{
|
||||
/* Infinity exponent is same as NaN's. */
|
||||
put_field (uto, order, fmt->totalsize, fmt->exp_start,
|
||||
|
16
gdb/dsrec.c
16
gdb/dsrec.c
@ -97,7 +97,7 @@ load_srec (struct serial *desc, const char *file, bfd_vma load_offset,
|
||||
/* Both GDB and BFD have mechanisms for printing addresses.
|
||||
In the below, GDB's is used so that the address is
|
||||
consistent with the rest of GDB. BFD's printf_vma() could
|
||||
have also been used. cagney 1999-09-01 */
|
||||
have also been used. cagney 1999-09-01 */
|
||||
printf_filtered ("%s\t: %s .. %s ",
|
||||
section_name,
|
||||
paddress (target_gdbarch, addr),
|
||||
@ -135,7 +135,7 @@ load_srec (struct serial *desc, const char *file, bfd_vma load_offset,
|
||||
putchar_unfiltered ('#');
|
||||
gdb_flush (gdb_stdout);
|
||||
}
|
||||
} /* Per-packet (or S-record) loop */
|
||||
} /* Per-packet (or S-record) loop. */
|
||||
|
||||
if (deprecated_ui_load_progress_hook)
|
||||
if (deprecated_ui_load_progress_hook (section_name,
|
||||
@ -173,7 +173,7 @@ load_srec (struct serial *desc, const char *file, bfd_vma load_offset,
|
||||
}
|
||||
|
||||
/*
|
||||
* make_srec -- make an srecord. This writes each line, one at a
|
||||
* make_srec -- make an srecord. This writes each line, one at a
|
||||
* time, each with it's own header and trailer line.
|
||||
* An srecord looks like this:
|
||||
*
|
||||
@ -190,9 +190,9 @@ load_srec (struct serial *desc, const char *file, bfd_vma load_offset,
|
||||
*
|
||||
* Where
|
||||
* - length
|
||||
* is the number of bytes following upto the checksum. Note that
|
||||
* this is not the number of chars following, since it takes two
|
||||
* chars to represent a byte.
|
||||
* is the number of bytes following upto the checksum. Note
|
||||
* that this is not the number of chars following, since it
|
||||
* takes two chars to represent a byte.
|
||||
* - type
|
||||
* is one of:
|
||||
* 0) header record
|
||||
@ -267,7 +267,7 @@ make_srec (char *srec, CORE_ADDR targ_addr, bfd *abfd, asection *sect,
|
||||
bfd_get_section_contents (abfd, sect, binbuf, sectoff, payload_size);
|
||||
}
|
||||
else
|
||||
payload_size = 0; /* Term or header packets have no payload */
|
||||
payload_size = 0; /* Term or header packets have no payload. */
|
||||
|
||||
/* Output the header. */
|
||||
snprintf (srec, (*maxrecsize) + 1, "S%c%02X%0*X",
|
||||
@ -282,7 +282,7 @@ make_srec (char *srec, CORE_ADDR targ_addr, bfd *abfd, asection *sect,
|
||||
checksum = 0;
|
||||
|
||||
checksum += (payload_size + addr_size + 1 /* Packet length */
|
||||
+ (targ_addr & 0xff) /* Address... */
|
||||
+ (targ_addr & 0xff) /* Address... */
|
||||
+ ((targ_addr >> 8) & 0xff)
|
||||
+ ((targ_addr >> 16) & 0xff)
|
||||
+ ((targ_addr >> 24) & 0xff));
|
||||
|
@ -121,7 +121,7 @@ pop_dummy_frame (struct dummy_frame **dummy_ptr)
|
||||
restore_infcall_suspend_state ((*dummy_ptr)->caller_state);
|
||||
|
||||
/* restore_infcall_control_state frees inf_state,
|
||||
all that remains is to pop *dummy_ptr */
|
||||
all that remains is to pop *dummy_ptr. */
|
||||
dummy = *dummy_ptr;
|
||||
*dummy_ptr = dummy->next;
|
||||
xfree (dummy);
|
||||
|
@ -77,7 +77,7 @@ struct dwarf2_cie
|
||||
/* Target address size in bytes. */
|
||||
int addr_size;
|
||||
|
||||
/* Target pointer size in bytes. */
|
||||
/* Target pointer size in bytes. */
|
||||
int ptr_size;
|
||||
|
||||
/* True if a 'z' augmentation existed. */
|
||||
@ -1697,7 +1697,7 @@ decode_frame_entry_1 (struct comp_unit *unit, gdb_byte *start, int eh_frame_p,
|
||||
buf += bytes_read;
|
||||
end = buf + length;
|
||||
|
||||
/* Are we still within the section? */
|
||||
/* Are we still within the section? */
|
||||
if (end > unit->dwarf_frame_buffer + unit->dwarf_frame_size)
|
||||
return NULL;
|
||||
|
||||
@ -1796,7 +1796,7 @@ decode_frame_entry_1 (struct comp_unit *unit, gdb_byte *start, int eh_frame_p,
|
||||
/* Address values in .eh_frame sections are defined to have the
|
||||
target's pointer size. Watchout: This breaks frame info for
|
||||
targets with pointer size < address size, unless a .debug_frame
|
||||
section exists as well. */
|
||||
section exists as well. */
|
||||
if (eh_frame_p)
|
||||
cie->ptr_size = gdbarch_ptr_bit (gdbarch) / TARGET_CHAR_BIT;
|
||||
else
|
||||
|
@ -652,7 +652,7 @@ execute_stack_op (struct dwarf_expr_context *ctx,
|
||||
|
||||
if (ctx->stack_len < 2)
|
||||
error (_("Not enough elements for "
|
||||
"DW_OP_swap. Need 2, have %d."),
|
||||
"DW_OP_swap. Need 2, have %d."),
|
||||
ctx->stack_len);
|
||||
t1 = ctx->stack[ctx->stack_len - 1];
|
||||
t2 = ctx->stack[ctx->stack_len - 2];
|
||||
@ -671,7 +671,8 @@ execute_stack_op (struct dwarf_expr_context *ctx,
|
||||
struct dwarf_stack_value t1, t2, t3;
|
||||
|
||||
if (ctx->stack_len < 3)
|
||||
error (_("Not enough elements for DW_OP_rot. Need 3, have %d."),
|
||||
error (_("Not enough elements for "
|
||||
"DW_OP_rot. Need 3, have %d."),
|
||||
ctx->stack_len);
|
||||
t1 = ctx->stack[ctx->stack_len - 1];
|
||||
t2 = ctx->stack[ctx->stack_len - 2];
|
||||
@ -821,7 +822,7 @@ execute_stack_op (struct dwarf_expr_context *ctx,
|
||||
case DW_OP_GNU_push_tls_address:
|
||||
/* Variable is at a constant offset in the thread-local
|
||||
storage block into the objfile for the current thread and
|
||||
the dynamic linker module containing this expression. Here
|
||||
the dynamic linker module containing this expression. Here
|
||||
we return returns the offset from that base. The top of the
|
||||
stack has the offset from the beginning of the thread
|
||||
control block at which the variable is located. Nothing
|
||||
|
@ -2237,9 +2237,9 @@ locexpr_describe_location_piece (struct symbol *symbol, struct ui_file *stream,
|
||||
as the size of an address on the target machine (here is 8
|
||||
bytes). Note that more recent version of GCC emit DW_OP_const4u
|
||||
or DW_OP_const8u, depending on address size, rather than
|
||||
DW_OP_addr. 0xe0 is the encoding for
|
||||
DW_OP_GNU_push_tls_address. The operand represents the offset at
|
||||
which the variable is within the thread local storage. */
|
||||
DW_OP_addr. 0xe0 is the encoding for DW_OP_GNU_push_tls_address.
|
||||
The operand represents the offset at which the variable is within
|
||||
the thread local storage. */
|
||||
|
||||
else if (data + 1 + addr_size < end
|
||||
&& (data[0] == DW_OP_addr
|
||||
|
126
gdb/dwarf2read.c
126
gdb/dwarf2read.c
@ -253,7 +253,7 @@ static struct dwarf2_per_objfile *dwarf2_per_objfile;
|
||||
|
||||
/* local data types */
|
||||
|
||||
/* We hold several abbreviation tables in memory at the same time. */
|
||||
/* We hold several abbreviation tables in memory at the same time. */
|
||||
#ifndef ABBREV_HASH_SIZE
|
||||
#define ABBREV_HASH_SIZE 121
|
||||
#endif
|
||||
@ -464,11 +464,11 @@ struct signatured_type
|
||||
struct dwarf2_per_cu_data per_cu;
|
||||
};
|
||||
|
||||
/* Struct used to pass misc. parameters to read_die_and_children, et. al.
|
||||
which are used for both .debug_info and .debug_types dies.
|
||||
All parameters here are unchanging for the life of the call.
|
||||
This struct exists to abstract away the constant parameters of
|
||||
die reading. */
|
||||
/* Struct used to pass misc. parameters to read_die_and_children, et
|
||||
al. which are used for both .debug_info and .debug_types dies.
|
||||
All parameters here are unchanging for the life of the call. This
|
||||
struct exists to abstract away the constant parameters of die
|
||||
reading. */
|
||||
|
||||
struct die_reader_specs
|
||||
{
|
||||
@ -531,7 +531,7 @@ struct line_header
|
||||
};
|
||||
|
||||
/* When we construct a partial symbol table entry we only
|
||||
need this much information. */
|
||||
need this much information. */
|
||||
struct partial_die_info
|
||||
{
|
||||
/* Offset of this DIE. */
|
||||
@ -596,7 +596,7 @@ struct partial_die_info
|
||||
struct partial_die_info *die_parent, *die_child, *die_sibling;
|
||||
};
|
||||
|
||||
/* This data structure holds the information of an abbrev. */
|
||||
/* This data structure holds the information of an abbrev. */
|
||||
struct abbrev_info
|
||||
{
|
||||
unsigned int number; /* number identifying abbrev */
|
||||
@ -613,7 +613,7 @@ struct attr_abbrev
|
||||
ENUM_BITFIELD(dwarf_form) form : 16;
|
||||
};
|
||||
|
||||
/* Attributes have a name and a value */
|
||||
/* Attributes have a name and a value. */
|
||||
struct attribute
|
||||
{
|
||||
ENUM_BITFIELD(dwarf_attribute) name : 16;
|
||||
@ -636,7 +636,7 @@ struct attribute
|
||||
u;
|
||||
};
|
||||
|
||||
/* This data structure holds a complete die structure. */
|
||||
/* This data structure holds a complete die structure. */
|
||||
struct die_info
|
||||
{
|
||||
/* DWARF-2 tag for this DIE. */
|
||||
@ -677,7 +677,7 @@ struct function_range
|
||||
struct function_range *next;
|
||||
};
|
||||
|
||||
/* Get at parts of an attribute structure */
|
||||
/* Get at parts of an attribute structure. */
|
||||
|
||||
#define DW_STRING(attr) ((attr)->u.str)
|
||||
#define DW_STRING_IS_CANONICAL(attr) ((attr)->string_is_canonical)
|
||||
@ -687,7 +687,7 @@ struct function_range
|
||||
#define DW_ADDR(attr) ((attr)->u.addr)
|
||||
#define DW_SIGNATURED_TYPE(attr) ((attr)->u.signatured_type)
|
||||
|
||||
/* Blocks are a bunch of untyped bytes. */
|
||||
/* Blocks are a bunch of untyped bytes. */
|
||||
struct dwarf_block
|
||||
{
|
||||
unsigned int size;
|
||||
@ -713,7 +713,7 @@ static int bits_per_byte = 8;
|
||||
in an instance of a field_info structure, as defined below. */
|
||||
struct field_info
|
||||
{
|
||||
/* List of data member and baseclasses fields. */
|
||||
/* List of data member and baseclasses fields. */
|
||||
struct nextfield
|
||||
{
|
||||
struct nextfield *next;
|
||||
@ -793,7 +793,7 @@ show_dwarf2_max_cache_age (struct ui_file *file, int from_tty,
|
||||
}
|
||||
|
||||
|
||||
/* Various complaints about symbol reading that don't abort the process */
|
||||
/* Various complaints about symbol reading that don't abort the process. */
|
||||
|
||||
static void
|
||||
dwarf2_statement_list_fits_in_line_number_section_complaint (void)
|
||||
@ -1593,7 +1593,7 @@ dwarf2_read_section (struct objfile *objfile, struct dwarf2_section_info *info)
|
||||
}
|
||||
|
||||
/* Fill in SECTP, BUFP and SIZEP with section info, given OBJFILE and
|
||||
SECTION_NAME. */
|
||||
SECTION_NAME. */
|
||||
|
||||
void
|
||||
dwarf2_get_section_info (struct objfile *objfile, const char *section_name,
|
||||
@ -3241,7 +3241,7 @@ process_psymtab_comp_unit (struct objfile *objfile,
|
||||
|
||||
baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
|
||||
|
||||
/* Store the function that reads in the rest of the symbol table */
|
||||
/* Store the function that reads in the rest of the symbol table. */
|
||||
pst->read_symtab = dwarf2_psymtab_to_symtab;
|
||||
|
||||
this_cu->v.psymtab = pst;
|
||||
@ -3261,7 +3261,7 @@ process_psymtab_comp_unit (struct objfile *objfile,
|
||||
|
||||
/* Check if comp unit has_children.
|
||||
If so, read the rest of the partial symbols from this comp unit.
|
||||
If not, there's no more debug_info for this comp unit. */
|
||||
If not, there's no more debug_info for this comp unit. */
|
||||
if (has_children)
|
||||
{
|
||||
struct partial_die_info *first_die;
|
||||
@ -3495,7 +3495,7 @@ load_partial_comp_unit (struct dwarf2_per_cu_data *this_cu,
|
||||
|
||||
/* Check if comp unit has_children.
|
||||
If so, read the rest of the partial symbols from this comp unit.
|
||||
If not, there's no more debug_info for this comp unit. */
|
||||
If not, there's no more debug_info for this comp unit. */
|
||||
if (has_children)
|
||||
load_partial_dies (abfd, dwarf2_per_objfile->info.buffer, info_ptr, 0, cu);
|
||||
|
||||
@ -3886,7 +3886,7 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu)
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Static Variable. Skip symbols without location descriptors. */
|
||||
/* Static Variable. Skip symbols without location descriptors. */
|
||||
if (pdi->locdesc == NULL)
|
||||
{
|
||||
if (built_actual_name)
|
||||
@ -4409,7 +4409,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst)
|
||||
fputs_filtered ("and ", gdb_stdout);
|
||||
wrap_here ("");
|
||||
printf_filtered ("%s...", pst->dependencies[i]->filename);
|
||||
wrap_here (""); /* Flush output */
|
||||
wrap_here (""); /* Flush output. */
|
||||
gdb_flush (gdb_stdout);
|
||||
}
|
||||
psymtab_to_symtab_1 (pst->dependencies[i]);
|
||||
@ -4968,7 +4968,7 @@ dwarf2_compute_name (char *name, struct die_info *die, struct dwarf2_cu *cu,
|
||||
if (cu->language == language_java)
|
||||
{
|
||||
/* For java, we must append the return type to method
|
||||
names. */
|
||||
names. */
|
||||
if (die->tag == DW_TAG_subprogram)
|
||||
java_print_type (TYPE_TARGET_TYPE (type), "", buf,
|
||||
0, 0);
|
||||
@ -5014,7 +5014,7 @@ dwarf2_compute_name (char *name, struct die_info *die, struct dwarf2_cu *cu,
|
||||
not have a name. NAME may either be from a previous call to
|
||||
dwarf2_name or NULL.
|
||||
|
||||
The output string will be canonicalized (if C++/Java). */
|
||||
The output string will be canonicalized (if C++/Java). */
|
||||
|
||||
static const char *
|
||||
dwarf2_full_name (char *name, struct die_info *die, struct dwarf2_cu *cu)
|
||||
@ -5238,7 +5238,7 @@ read_file_scope (struct die_info *die, struct dwarf2_cu *cu)
|
||||
if (cu->producer && strstr (cu->producer, "IBM XL C for OpenCL") != NULL)
|
||||
cu->language = language_opencl;
|
||||
|
||||
/* We assume that we're processing GCC output. */
|
||||
/* We assume that we're processing GCC output. */
|
||||
processing_gcc_compilation = 2;
|
||||
|
||||
processing_has_namespace_info = 0;
|
||||
@ -5341,7 +5341,7 @@ read_type_unit_scope (struct die_info *die, struct dwarf2_cu *cu)
|
||||
if (attr)
|
||||
cu->producer = DW_STRING (attr);
|
||||
|
||||
/* We assume that we're processing GCC output. */
|
||||
/* We assume that we're processing GCC output. */
|
||||
processing_gcc_compilation = 2;
|
||||
|
||||
processing_has_namespace_info = 0;
|
||||
@ -6046,7 +6046,7 @@ get_scope_pc_bounds (struct die_info *die,
|
||||
}
|
||||
break;
|
||||
default:
|
||||
/* Ignore. */
|
||||
/* Ignore. */
|
||||
break;
|
||||
}
|
||||
|
||||
@ -6557,7 +6557,7 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die,
|
||||
}
|
||||
|
||||
/* Create a new member function field and chain it to the field list
|
||||
entry. */
|
||||
entry. */
|
||||
new_fnfield = (struct nextfnfield *) xmalloc (sizeof (struct nextfnfield));
|
||||
make_cleanup (xfree, new_fnfield);
|
||||
memset (new_fnfield, 0, sizeof (struct nextfnfield));
|
||||
@ -6596,10 +6596,10 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die,
|
||||
|
||||
/* Handle static member functions.
|
||||
Dwarf2 has no clean way to discern C++ static and non-static
|
||||
member functions. G++ helps GDB by marking the first
|
||||
parameter for non-static member functions (which is the
|
||||
this pointer) as artificial. We obtain this information
|
||||
from read_subroutine_type via TYPE_FIELD_ARTIFICIAL. */
|
||||
member functions. G++ helps GDB by marking the first
|
||||
parameter for non-static member functions (which is the this
|
||||
pointer) as artificial. We obtain this information from
|
||||
read_subroutine_type via TYPE_FIELD_ARTIFICIAL. */
|
||||
if (nparams == 0 || TYPE_FIELD_ARTIFICIAL (this_type, 0) == 0)
|
||||
fnp->voffset = VOFFSET_STATIC;
|
||||
}
|
||||
@ -6914,7 +6914,7 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu)
|
||||
|
||||
/* We need to add the type field to the die immediately so we don't
|
||||
infinitely recurse when dealing with pointers to the structure
|
||||
type within the structure itself. */
|
||||
type within the structure itself. */
|
||||
set_die_type (die, type, cu);
|
||||
|
||||
/* set_die_type should be already done. */
|
||||
@ -6962,7 +6962,7 @@ process_structure_scope (struct die_info *die, struct dwarf2_cu *cu)
|
||||
}
|
||||
else if (child_die->tag == DW_TAG_subprogram)
|
||||
{
|
||||
/* C++ member function. */
|
||||
/* C++ member function. */
|
||||
dwarf2_add_member_fn (&fi, child_die, type, cu);
|
||||
}
|
||||
else if (child_die->tag == DW_TAG_inheritance)
|
||||
@ -7307,8 +7307,8 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu)
|
||||
|
||||
if (child_type != NULL)
|
||||
{
|
||||
/* The range type was succesfully read. Save it for
|
||||
the array type creation. */
|
||||
/* The range type was succesfully read. Save it for the
|
||||
array type creation. */
|
||||
if ((ndim % DW_FIELD_ALLOC_CHUNK) == 0)
|
||||
{
|
||||
range_types = (struct type **)
|
||||
@ -7369,7 +7369,7 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu)
|
||||
if (name)
|
||||
TYPE_NAME (type) = name;
|
||||
|
||||
/* Install the type in the die. */
|
||||
/* Install the type in the die. */
|
||||
set_die_type (die, type, cu);
|
||||
|
||||
/* set_die_type should be already done. */
|
||||
@ -7389,14 +7389,12 @@ read_array_order (struct die_info *die, struct dwarf2_cu *cu)
|
||||
|
||||
if (attr) return DW_SND (attr);
|
||||
|
||||
/*
|
||||
GNU F77 is a special case, as at 08/2004 array type info is the
|
||||
opposite order to the dwarf2 specification, but data is still
|
||||
laid out as per normal fortran.
|
||||
/* GNU F77 is a special case, as at 08/2004 array type info is the
|
||||
opposite order to the dwarf2 specification, but data is still
|
||||
laid out as per normal fortran.
|
||||
|
||||
FIXME: dsl/2004-8-20: If G77 is ever fixed, this will also need
|
||||
version checking.
|
||||
*/
|
||||
FIXME: dsl/2004-8-20: If G77 is ever fixed, this will also need
|
||||
version checking. */
|
||||
|
||||
if (cu->language == language_fortran
|
||||
&& cu->producer && strstr (cu->producer, "GNU F77"))
|
||||
@ -7415,7 +7413,7 @@ read_array_order (struct die_info *die, struct dwarf2_cu *cu)
|
||||
}
|
||||
|
||||
/* Extract all information from a DW_TAG_set_type DIE and put it in
|
||||
the DIE's type field. */
|
||||
the DIE's type field. */
|
||||
|
||||
static struct type *
|
||||
read_set_type (struct die_info *die, struct dwarf2_cu *cu)
|
||||
@ -7452,7 +7450,7 @@ read_common_block (struct die_info *die, struct dwarf2_cu *cu)
|
||||
attr = dwarf2_attr (die, DW_AT_location, cu);
|
||||
if (attr)
|
||||
{
|
||||
/* Support the .debug_loc offsets */
|
||||
/* Support the .debug_loc offsets. */
|
||||
if (attr_form_is_block (attr))
|
||||
{
|
||||
base = decode_locdesc (DW_BLOCK (attr), cu);
|
||||
@ -7844,7 +7842,7 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu)
|
||||
}
|
||||
else
|
||||
{
|
||||
/* check for the DW_AT_byte_size attribute */
|
||||
/* Check for the DW_AT_byte_size attribute. */
|
||||
attr = dwarf2_attr (die, DW_AT_byte_size, cu);
|
||||
if (attr)
|
||||
{
|
||||
@ -7872,14 +7870,13 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu)
|
||||
int b;
|
||||
};
|
||||
|
||||
('funcp' generates a DW_TAG_subroutine_type DIE)
|
||||
*/
|
||||
('funcp' generates a DW_TAG_subroutine_type DIE). */
|
||||
|
||||
static struct type *
|
||||
read_subroutine_type (struct die_info *die, struct dwarf2_cu *cu)
|
||||
{
|
||||
struct type *type; /* Type that this function returns */
|
||||
struct type *ftype; /* Function that returns above type */
|
||||
struct type *type; /* Type that this function returns. */
|
||||
struct type *ftype; /* Function that returns above type. */
|
||||
struct attribute *attr;
|
||||
|
||||
type = die_type (die, cu);
|
||||
@ -7913,7 +7910,7 @@ read_subroutine_type (struct die_info *die, struct dwarf2_cu *cu)
|
||||
|
||||
/* We need to add the subroutine type to the die immediately so
|
||||
we don't infinitely recurse when dealing with parameters
|
||||
declared as the same subroutine type. */
|
||||
declared as the same subroutine type. */
|
||||
set_die_type (die, ftype, cu);
|
||||
|
||||
if (die->child != NULL)
|
||||
@ -8208,8 +8205,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
|
||||
For the following C code: `extern char gdb_int [];'
|
||||
GCC produces an empty range DIE.
|
||||
FIXME: muller/2010-05-28: Possible references to object for low bound,
|
||||
high bound or count are not yet handled by this code.
|
||||
*/
|
||||
high bound or count are not yet handled by this code. */
|
||||
if (TYPE_CODE (base_type) == TYPE_CODE_VOID)
|
||||
{
|
||||
struct objfile *objfile = cu->objfile;
|
||||
@ -8506,7 +8502,7 @@ dwarf2_read_abbrevs (bfd *abfd, struct dwarf2_cu *cu)
|
||||
struct attr_abbrev *cur_attrs;
|
||||
unsigned int allocated_attrs;
|
||||
|
||||
/* Initialize dwarf2 abbrevs */
|
||||
/* Initialize dwarf2 abbrevs. */
|
||||
obstack_init (&cu->abbrev_obstack);
|
||||
cu->dwarf2_abbrevs = obstack_alloc (&cu->abbrev_obstack,
|
||||
(ABBREV_HASH_SIZE
|
||||
@ -8523,7 +8519,7 @@ dwarf2_read_abbrevs (bfd *abfd, struct dwarf2_cu *cu)
|
||||
allocated_attrs = ATTR_ALLOC_CHUNK;
|
||||
cur_attrs = xmalloc (allocated_attrs * sizeof (struct attr_abbrev));
|
||||
|
||||
/* loop until we reach an abbrev number of 0 */
|
||||
/* Loop until we reach an abbrev number of 0. */
|
||||
while (abbrev_number)
|
||||
{
|
||||
cur_abbrev = dwarf_alloc_abbrev (cu);
|
||||
@ -8996,7 +8992,7 @@ read_partial_die (struct partial_die_info *part_die,
|
||||
part_die->highpc = DW_ADDR (&attr);
|
||||
break;
|
||||
case DW_AT_location:
|
||||
/* Support the .debug_loc offsets */
|
||||
/* Support the .debug_loc offsets. */
|
||||
if (attr_form_is_block (&attr))
|
||||
{
|
||||
part_die->locdesc = DW_BLOCK (&attr);
|
||||
@ -9459,7 +9455,7 @@ read_attribute (struct attribute *attr, struct attr_abbrev *abbrev,
|
||||
return read_attribute_value (attr, abbrev->form, abfd, info_ptr, cu);
|
||||
}
|
||||
|
||||
/* read dwarf information from a buffer */
|
||||
/* Read dwarf information from a buffer. */
|
||||
|
||||
static unsigned int
|
||||
read_1_byte (bfd *abfd, gdb_byte *buf)
|
||||
@ -10864,9 +10860,9 @@ new_symbol_full (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
|
||||
case DW_TAG_constant:
|
||||
case DW_TAG_variable:
|
||||
case DW_TAG_member:
|
||||
/* Compilation with minimal debug info may result in variables
|
||||
with missing type entries. Change the misleading `void' type
|
||||
to something sensible. */
|
||||
/* Compilation with minimal debug info may result in
|
||||
variables with missing type entries. Change the
|
||||
misleading `void' type to something sensible. */
|
||||
if (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_VOID)
|
||||
SYMBOL_TYPE (sym)
|
||||
= objfile_type (objfile)->nodebug_data_symbol;
|
||||
@ -11075,7 +11071,7 @@ new_symbol_full (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
|
||||
/* Not a tag we recognize. Hopefully we aren't processing
|
||||
trash data, but since we must specifically ignore things
|
||||
we don't recognize, there is nothing else we should do at
|
||||
this point. */
|
||||
this point. */
|
||||
complaint (&symfile_complaints, _("unsupported tag: '%s'"),
|
||||
dwarf_tag_name (die->tag));
|
||||
break;
|
||||
@ -12835,7 +12831,7 @@ dwarf_type_encoding_name (unsigned enc)
|
||||
}
|
||||
}
|
||||
|
||||
/* Convert a DWARF call frame info operation to its string name. */
|
||||
/* Convert a DWARF call frame info operation to its string name. */
|
||||
|
||||
#if 0
|
||||
static char *
|
||||
@ -13003,8 +12999,8 @@ dump_die_shallow (struct ui_file *f, int indent, struct die_info *die)
|
||||
fprintf_unfiltered (f, "flag: TRUE");
|
||||
break;
|
||||
case DW_FORM_indirect:
|
||||
/* the reader will have reduced the indirect form to
|
||||
the "base form" so this form should not occur */
|
||||
/* The reader will have reduced the indirect form to
|
||||
the "base form" so this form should not occur. */
|
||||
fprintf_unfiltered (f,
|
||||
"unexpected attribute form: DW_FORM_indirect");
|
||||
break;
|
||||
@ -14273,7 +14269,7 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset,
|
||||
}
|
||||
|
||||
/* Check if the attribute's form is a DW_FORM_block*
|
||||
if so return true else false. */
|
||||
if so return true else false. */
|
||||
static int
|
||||
attr_form_is_block (struct attribute *attr)
|
||||
{
|
||||
@ -15344,7 +15340,7 @@ struct addrmap_index_data
|
||||
int previous_valid;
|
||||
/* Index of the CU in the table of all CUs in the index file. */
|
||||
unsigned int previous_cu_index;
|
||||
/* Start address of the CU. */
|
||||
/* Start address of the CU. */
|
||||
CORE_ADDR previous_cu_start;
|
||||
};
|
||||
|
||||
|
@ -152,7 +152,7 @@ elf_symfile_segments (bfd *abfd)
|
||||
|
||||
FIXME: The section names should not be hardwired strings (what
|
||||
should they be? I don't think most object file formats have enough
|
||||
section flags to specify what kind of debug section it is
|
||||
section flags to specify what kind of debug section it is.
|
||||
-kingdon). */
|
||||
|
||||
static void
|
||||
@ -249,7 +249,7 @@ elf_symtab_read (struct objfile *objfile, int type,
|
||||
if (sym->name == NULL || *sym->name == '\0')
|
||||
{
|
||||
/* Skip names that don't exist (shouldn't happen), or names
|
||||
that are null strings (may happen). */
|
||||
that are null strings (may happen). */
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -278,7 +278,7 @@ elf_symtab_read (struct objfile *objfile, int type,
|
||||
of the corresponding entry in the procedure linkage table,
|
||||
plus the desired section offset.
|
||||
If its value is zero then the dynamic linker has to resolve
|
||||
the symbol. We are unable to find any meaningful address
|
||||
the symbol. We are unable to find any meaningful address
|
||||
for this symbol in the executable file, so we skip it. */
|
||||
symaddr = sym->value;
|
||||
if (symaddr == 0)
|
||||
@ -339,8 +339,8 @@ elf_symtab_read (struct objfile *objfile, int type,
|
||||
|
||||
/* Select global/local/weak symbols. Note that bfd puts abs
|
||||
symbols in their own section, so all symbols we are
|
||||
interested in will have a section. */
|
||||
/* Bfd symbols are section relative. */
|
||||
interested in will have a section. */
|
||||
/* Bfd symbols are section relative. */
|
||||
symaddr = sym->value + sym->section->vma;
|
||||
/* Relocate all non-absolute and non-TLS symbols by the
|
||||
section offset. */
|
||||
@ -351,7 +351,7 @@ elf_symtab_read (struct objfile *objfile, int type,
|
||||
}
|
||||
/* For non-absolute symbols, use the type of the section
|
||||
they are relative to, to intuit text/data. Bfd provides
|
||||
no way of figuring this out for absolute symbols. */
|
||||
no way of figuring this out for absolute symbols. */
|
||||
if (sym->section == &bfd_abs_section)
|
||||
{
|
||||
/* This is a hack to get the minimal symbol type
|
||||
@ -379,7 +379,7 @@ elf_symtab_read (struct objfile *objfile, int type,
|
||||
}
|
||||
|
||||
/* If it is an Irix dynamic symbol, skip section name
|
||||
symbols, relocate all others by section offset. */
|
||||
symbols, relocate all others by section offset. */
|
||||
if (ms_type != mst_abs)
|
||||
{
|
||||
if (sym->name[0] == '.')
|
||||
@ -518,7 +518,7 @@ elf_symtab_read (struct objfile *objfile, int type,
|
||||
hob with actions like finding what function the PC
|
||||
is in. Ignore them if they aren't text, data, or bss. */
|
||||
/* ms_type = mst_unknown; */
|
||||
continue; /* Skip this symbol. */
|
||||
continue; /* Skip this symbol. */
|
||||
}
|
||||
msym = record_minimal_symbol
|
||||
(sym->name, strlen (sym->name), copy_names, symaddr,
|
||||
@ -759,7 +759,7 @@ elf_symfile_read (struct objfile *objfile, int symfile_flags)
|
||||
|
||||
memset ((char *) &ei, 0, sizeof (ei));
|
||||
|
||||
/* Allocate struct to keep track of the symfile */
|
||||
/* Allocate struct to keep track of the symfile. */
|
||||
objfile->deprecated_sym_stab_info = (struct dbx_symfile_info *)
|
||||
xmalloc (sizeof (struct dbx_symfile_info));
|
||||
memset ((char *) objfile->deprecated_sym_stab_info,
|
||||
@ -845,9 +845,9 @@ elf_symfile_read (struct objfile *objfile, int symfile_flags)
|
||||
do_cleanups (back_to);
|
||||
|
||||
/* Now process debugging information, which is contained in
|
||||
special ELF sections. */
|
||||
special ELF sections. */
|
||||
|
||||
/* We first have to find them... */
|
||||
/* We first have to find them... */
|
||||
bfd_map_over_sections (abfd, elf_locate_sections, (void *) & ei);
|
||||
|
||||
/* ELF debugging information is inserted into the psymtab in the
|
||||
@ -860,7 +860,7 @@ elf_symfile_read (struct objfile *objfile, int symfile_flags)
|
||||
and .debug_info (DWARF2) sections then .mdebug is inserted first
|
||||
(searched last) and DWARF2 is inserted last (searched first). If
|
||||
we don't do this then the XCOFF info is found first - for code in
|
||||
an included file XCOFF info is useless. */
|
||||
an included file XCOFF info is useless. */
|
||||
|
||||
if (ei.mdebugsect)
|
||||
{
|
||||
@ -954,7 +954,7 @@ elf_new_init (struct objfile *ignore)
|
||||
/* Perform any local cleanups required when we are done with a particular
|
||||
objfile. I.E, we are in the process of discarding all symbol information
|
||||
for an objfile, freeing up all memory held for it, and unlinking the
|
||||
objfile struct from the global list of known objfiles. */
|
||||
objfile struct from the global list of known objfiles. */
|
||||
|
||||
static void
|
||||
elf_symfile_finish (struct objfile *objfile)
|
||||
@ -974,7 +974,7 @@ elf_symfile_finish (struct objfile *objfile)
|
||||
a pointer to "private data" which we can fill with goodies.
|
||||
|
||||
For now at least, we have nothing in particular to do, so this function is
|
||||
just a stub. */
|
||||
just a stub. */
|
||||
|
||||
static void
|
||||
elf_symfile_init (struct objfile *objfile)
|
||||
@ -1010,7 +1010,7 @@ elfstab_offset_sections (struct objfile *objfile, struct partial_symtab *pst)
|
||||
|
||||
/* FIXME: This linear search could speed up significantly
|
||||
if it was chained in the right order to match how we search it,
|
||||
and if we unchained when we found a match. */
|
||||
and if we unchained when we found a match. */
|
||||
for (; maybe; maybe = maybe->next)
|
||||
{
|
||||
if (filename[0] == maybe->filename[0]
|
||||
|
@ -175,7 +175,7 @@ unset_in_environ (struct gdb_environ *e, char *var)
|
||||
xfree (s);
|
||||
/* Walk through the vector, shuffling args down by one, including
|
||||
the NULL terminator. Can't use memcpy() here since the regions
|
||||
overlap, and memmove() might not be available. */
|
||||
overlap, and memmove() might not be available. */
|
||||
while ((vector[0] = vector[1]) != NULL)
|
||||
{
|
||||
vector++;
|
||||
|
158
gdb/eval.c
158
gdb/eval.c
@ -27,8 +27,8 @@
|
||||
#include "expression.h"
|
||||
#include "target.h"
|
||||
#include "frame.h"
|
||||
#include "language.h" /* For CAST_IS_CONVERSION */
|
||||
#include "f-lang.h" /* for array bound stuff */
|
||||
#include "language.h" /* For CAST_IS_CONVERSION. */
|
||||
#include "f-lang.h" /* For array bound stuff. */
|
||||
#include "cp-abi.h"
|
||||
#include "infcall.h"
|
||||
#include "objc-lang.h"
|
||||
@ -52,7 +52,7 @@
|
||||
/* This is defined in valops.c */
|
||||
extern int overload_resolution;
|
||||
|
||||
/* Prototypes for local functions. */
|
||||
/* Prototypes for local functions. */
|
||||
|
||||
static struct value *evaluate_subexp_for_sizeof (struct expression *, int *);
|
||||
|
||||
@ -110,7 +110,7 @@ parse_and_eval_address_1 (char **expptr)
|
||||
}
|
||||
|
||||
/* Like parse_and_eval_address, but treats the value of the expression
|
||||
as an integer, not an address, returns a LONGEST, not a CORE_ADDR */
|
||||
as an integer, not an address, returns a LONGEST, not a CORE_ADDR. */
|
||||
LONGEST
|
||||
parse_and_eval_long (char *exp)
|
||||
{
|
||||
@ -288,7 +288,7 @@ extract_field_op (struct expression *exp, int *subexp)
|
||||
}
|
||||
|
||||
/* If the next expression is an OP_LABELED, skips past it,
|
||||
returning the label. Otherwise, does nothing and returns NULL. */
|
||||
returning the label. Otherwise, does nothing and returns NULL. */
|
||||
|
||||
static char *
|
||||
get_label (struct expression *exp, int *pos)
|
||||
@ -329,7 +329,7 @@ evaluate_struct_tuple (struct value *struct_val,
|
||||
int bitpos, bitsize;
|
||||
bfd_byte *addr;
|
||||
|
||||
/* Skip past the labels, and count them. */
|
||||
/* Skip past the labels, and count them. */
|
||||
while (get_label (exp, pos) != NULL)
|
||||
nlabels++;
|
||||
|
||||
@ -390,7 +390,7 @@ evaluate_struct_tuple (struct value *struct_val,
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Unlabelled tuple element - go to next field. */
|
||||
/* Unlabelled tuple element - go to next field. */
|
||||
if (variantno >= 0)
|
||||
{
|
||||
subfieldno++;
|
||||
@ -425,15 +425,15 @@ evaluate_struct_tuple (struct value *struct_val,
|
||||
The value fieldno is the index of the top-level (normal or
|
||||
anonymous union) field in struct_field, while the value
|
||||
subfieldno is the index of the actual real (named inner) field
|
||||
in substruct_type. */
|
||||
in substruct_type. */
|
||||
|
||||
field_type = TYPE_FIELD_TYPE (substruct_type, subfieldno);
|
||||
if (val == 0)
|
||||
val = evaluate_subexp (field_type, exp, pos, noside);
|
||||
|
||||
/* Now actually set the field in struct_val. */
|
||||
/* Now actually set the field in struct_val. */
|
||||
|
||||
/* Assign val to field fieldno. */
|
||||
/* Assign val to field fieldno. */
|
||||
if (value_type (val) != field_type)
|
||||
val = value_cast (field_type, val);
|
||||
|
||||
@ -852,7 +852,7 @@ evaluate_subexp_standard (struct type *expect_type,
|
||||
We need a full value object returned here for whatis_exp ()
|
||||
to call evaluate_type () and then pass the full value to
|
||||
value_rtti_target_type () if we are dealing with a pointer
|
||||
or reference to a base class and print object is on. */
|
||||
or reference to a base class and print object is on. */
|
||||
|
||||
{
|
||||
volatile struct gdb_exception except;
|
||||
@ -1004,7 +1004,7 @@ evaluate_subexp_standard (struct type *expect_type,
|
||||
else
|
||||
{
|
||||
if (index > high_bound)
|
||||
/* to avoid memory corruption */
|
||||
/* To avoid memory corruption. */
|
||||
error (_("Too many array elements"));
|
||||
memcpy (value_contents_raw (array)
|
||||
+ (index - low_bound) * element_size,
|
||||
@ -1025,7 +1025,7 @@ evaluate_subexp_standard (struct type *expect_type,
|
||||
struct type *check_type = element_type;
|
||||
LONGEST low_bound, high_bound;
|
||||
|
||||
/* get targettype of elementtype */
|
||||
/* Get targettype of elementtype. */
|
||||
while (TYPE_CODE (check_type) == TYPE_CODE_RANGE
|
||||
|| TYPE_CODE (check_type) == TYPE_CODE_TYPEDEF)
|
||||
check_type = TYPE_TARGET_TYPE (check_type);
|
||||
@ -1055,9 +1055,9 @@ evaluate_subexp_standard (struct type *expect_type,
|
||||
range_low_type = range_high_type = value_type (elem_val);
|
||||
range_low = range_high = value_as_long (elem_val);
|
||||
}
|
||||
/* check types of elements to avoid mixture of elements from
|
||||
/* Check types of elements to avoid mixture of elements from
|
||||
different types. Also check if type of element is "compatible"
|
||||
with element type of powerset */
|
||||
with element type of powerset. */
|
||||
if (TYPE_CODE (range_low_type) == TYPE_CODE_RANGE)
|
||||
range_low_type = TYPE_TARGET_TYPE (range_low_type);
|
||||
if (TYPE_CODE (range_high_type) == TYPE_CODE_RANGE)
|
||||
@ -1065,7 +1065,7 @@ evaluate_subexp_standard (struct type *expect_type,
|
||||
if ((TYPE_CODE (range_low_type) != TYPE_CODE (range_high_type))
|
||||
|| (TYPE_CODE (range_low_type) == TYPE_CODE_ENUM
|
||||
&& (range_low_type != range_high_type)))
|
||||
/* different element modes */
|
||||
/* different element modes. */
|
||||
error (_("POWERSET tuple elements of different mode"));
|
||||
if ((TYPE_CODE (check_type) != TYPE_CODE (range_low_type))
|
||||
|| (TYPE_CODE (check_type) == TYPE_CODE_ENUM
|
||||
@ -1096,7 +1096,8 @@ evaluate_subexp_standard (struct type *expect_type,
|
||||
argvec = (struct value **) alloca (sizeof (struct value *) * nargs);
|
||||
for (tem = 0; tem < nargs; tem++)
|
||||
{
|
||||
/* Ensure that array expressions are coerced into pointer objects. */
|
||||
/* Ensure that array expressions are coerced into pointer
|
||||
objects. */
|
||||
argvec[tem] = evaluate_subexp_with_coercion (exp, pos, noside);
|
||||
}
|
||||
if (noside == EVAL_SKIP)
|
||||
@ -1213,7 +1214,7 @@ evaluate_subexp_standard (struct type *expect_type,
|
||||
to lookup the symbol information for the method. If we
|
||||
can't find any symbol information, then we'll use these to
|
||||
call the method, otherwise we can call the method
|
||||
directly. The msg_send_stret function is used in the special
|
||||
directly. The msg_send_stret function is used in the special
|
||||
case of a method that returns a structure (Apple runtime
|
||||
only). */
|
||||
if (gnu_runtime)
|
||||
@ -1236,15 +1237,15 @@ evaluate_subexp_standard (struct type *expect_type,
|
||||
else
|
||||
{
|
||||
msg_send = find_function_in_inferior ("objc_msgSend", NULL);
|
||||
/* Special dispatcher for methods returning structs */
|
||||
/* Special dispatcher for methods returning structs. */
|
||||
msg_send_stret
|
||||
= find_function_in_inferior ("objc_msgSend_stret", NULL);
|
||||
}
|
||||
|
||||
/* Verify the target object responds to this method. The
|
||||
/* Verify the target object responds to this method. The
|
||||
standard top-level 'Object' class uses a different name for
|
||||
the verification method than the non-standard, but more
|
||||
often used, 'NSObject' class. Make sure we check for both. */
|
||||
often used, 'NSObject' class. Make sure we check for both. */
|
||||
|
||||
responds_selector
|
||||
= lookup_child_selector (exp->gdbarch, "respondsToSelector:");
|
||||
@ -1265,7 +1266,7 @@ evaluate_subexp_standard (struct type *expect_type,
|
||||
error (_("no 'methodFor:' or 'methodForSelector:' method"));
|
||||
|
||||
/* Call the verification method, to make sure that the target
|
||||
class implements the desired method. */
|
||||
class implements the desired method. */
|
||||
|
||||
argvec[0] = msg_send;
|
||||
argvec[1] = target;
|
||||
@ -1287,7 +1288,7 @@ evaluate_subexp_standard (struct type *expect_type,
|
||||
function method that implements this selector for this
|
||||
class. If we can find a symbol at that address, then we
|
||||
know the return type, parameter types etc. (that's a good
|
||||
thing). */
|
||||
thing). */
|
||||
|
||||
argvec[0] = msg_send;
|
||||
argvec[1] = target;
|
||||
@ -1401,11 +1402,11 @@ evaluate_subexp_standard (struct type *expect_type,
|
||||
{
|
||||
/* If the return type doesn't look like a function type,
|
||||
call an error. This can happen if somebody tries to
|
||||
turn a variable into a function call. This is here
|
||||
turn a variable into a function call. This is here
|
||||
because people often want to call, eg, strcmp, which
|
||||
gdb doesn't know is a function. If gdb isn't asked for
|
||||
it's opinion (ie. through "whatis"), it won't offer
|
||||
it. */
|
||||
it. */
|
||||
|
||||
struct type *type = value_type (called_method);
|
||||
|
||||
@ -1456,13 +1457,13 @@ evaluate_subexp_standard (struct type *expect_type,
|
||||
op = exp->elts[*pos].opcode;
|
||||
nargs = longest_to_int (exp->elts[pc + 1].longconst);
|
||||
/* Allocate arg vector, including space for the function to be
|
||||
called in argvec[0] and a terminating NULL */
|
||||
called in argvec[0] and a terminating NULL. */
|
||||
argvec = (struct value **)
|
||||
alloca (sizeof (struct value *) * (nargs + 3));
|
||||
if (op == STRUCTOP_MEMBER || op == STRUCTOP_MPTR)
|
||||
{
|
||||
nargs++;
|
||||
/* First, evaluate the structure into arg2 */
|
||||
/* First, evaluate the structure into arg2. */
|
||||
pc2 = (*pos)++;
|
||||
|
||||
if (noside == EVAL_SKIP)
|
||||
@ -1499,16 +1500,16 @@ evaluate_subexp_standard (struct type *expect_type,
|
||||
else
|
||||
arg1 = cplus_method_ptr_to_value (&arg2, arg1);
|
||||
|
||||
/* Now, say which argument to start evaluating from */
|
||||
/* Now, say which argument to start evaluating from. */
|
||||
tem = 2;
|
||||
}
|
||||
else if (op == STRUCTOP_STRUCT || op == STRUCTOP_PTR)
|
||||
{
|
||||
/* Hair for method invocations */
|
||||
/* Hair for method invocations. */
|
||||
int tem2;
|
||||
|
||||
nargs++;
|
||||
/* First, evaluate the structure into arg2 */
|
||||
/* First, evaluate the structure into arg2. */
|
||||
pc2 = (*pos)++;
|
||||
tem2 = longest_to_int (exp->elts[pc2 + 1].longconst);
|
||||
*pos += 3 + BYTES_TO_EXP_ELEM (tem2 + 1);
|
||||
@ -1560,7 +1561,7 @@ evaluate_subexp_standard (struct type *expect_type,
|
||||
arg2 = value;
|
||||
}
|
||||
}
|
||||
/* Now, say which argument to start evaluating from */
|
||||
/* Now, say which argument to start evaluating from. */
|
||||
tem = 2;
|
||||
}
|
||||
else if (op == OP_SCOPE
|
||||
@ -1617,7 +1618,7 @@ evaluate_subexp_standard (struct type *expect_type,
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Non-method function call */
|
||||
/* Non-method function call. */
|
||||
save_pos1 = *pos;
|
||||
tem = 1;
|
||||
|
||||
@ -1647,14 +1648,15 @@ evaluate_subexp_standard (struct type *expect_type,
|
||||
}
|
||||
}
|
||||
|
||||
/* Evaluate arguments */
|
||||
/* Evaluate arguments. */
|
||||
for (; tem <= nargs; tem++)
|
||||
{
|
||||
/* Ensure that array expressions are coerced into pointer objects. */
|
||||
/* Ensure that array expressions are coerced into pointer
|
||||
objects. */
|
||||
argvec[tem] = evaluate_subexp_with_coercion (exp, pos, noside);
|
||||
}
|
||||
|
||||
/* signal end of arglist */
|
||||
/* Signal end of arglist. */
|
||||
argvec[tem] = 0;
|
||||
if (op == OP_ADL_FUNC)
|
||||
{
|
||||
@ -1668,7 +1670,7 @@ evaluate_subexp_standard (struct type *expect_type,
|
||||
func_name = (char *) alloca (name_len + 1);
|
||||
strcpy (func_name, &exp->elts[string_pc + 1].string);
|
||||
|
||||
/* Prepare list of argument types for overload resolution */
|
||||
/* Prepare list of argument types for overload resolution. */
|
||||
arg_types = (struct type **)
|
||||
alloca (nargs * (sizeof (struct type *)));
|
||||
for (ix = 1; ix <= nargs; ix++)
|
||||
@ -1692,12 +1694,12 @@ evaluate_subexp_standard (struct type *expect_type,
|
||||
int static_memfuncp;
|
||||
char *tstr;
|
||||
|
||||
/* Method invocation : stuff "this" as first parameter */
|
||||
/* Method invocation : stuff "this" as first parameter. */
|
||||
argvec[1] = arg2;
|
||||
|
||||
if (op != OP_SCOPE)
|
||||
{
|
||||
/* Name of method from expression */
|
||||
/* Name of method from expression. */
|
||||
tstr = &exp->elts[pc2 + 2].string;
|
||||
}
|
||||
else
|
||||
@ -1707,10 +1709,10 @@ evaluate_subexp_standard (struct type *expect_type,
|
||||
== language_cplus))
|
||||
{
|
||||
/* Language is C++, do some overload resolution before
|
||||
evaluation */
|
||||
evaluation. */
|
||||
struct value *valp = NULL;
|
||||
|
||||
/* Prepare list of argument types for overload resolution */
|
||||
/* Prepare list of argument types for overload resolution. */
|
||||
arg_types = (struct type **)
|
||||
alloca (nargs * (sizeof (struct type *)));
|
||||
for (ix = 1; ix <= nargs; ix++)
|
||||
@ -1731,11 +1733,11 @@ evaluate_subexp_standard (struct type *expect_type,
|
||||
function_name);
|
||||
}
|
||||
argvec[1] = arg2; /* the ``this'' pointer */
|
||||
argvec[0] = valp; /* use the method found after overload
|
||||
resolution */
|
||||
argvec[0] = valp; /* Use the method found after overload
|
||||
resolution. */
|
||||
}
|
||||
else
|
||||
/* Non-C++ case -- or no overload resolution */
|
||||
/* Non-C++ case -- or no overload resolution. */
|
||||
{
|
||||
struct value *temp = arg2;
|
||||
|
||||
@ -1767,16 +1769,16 @@ evaluate_subexp_standard (struct type *expect_type,
|
||||
}
|
||||
else if (op == OP_VAR_VALUE || (op == OP_SCOPE && function != NULL))
|
||||
{
|
||||
/* Non-member function being called */
|
||||
/* Non-member function being called. */
|
||||
/* fn: This can only be done for C++ functions. A C-style function
|
||||
in a C++ program, for instance, does not have the fields that
|
||||
are expected here */
|
||||
are expected here. */
|
||||
|
||||
if (overload_resolution && (exp->language_defn->la_language
|
||||
== language_cplus))
|
||||
{
|
||||
/* Language is C++, do some overload resolution before
|
||||
evaluation */
|
||||
evaluation. */
|
||||
struct symbol *symp;
|
||||
int no_adl = 0;
|
||||
|
||||
@ -1787,7 +1789,7 @@ evaluate_subexp_standard (struct type *expect_type,
|
||||
if (op == OP_VAR_VALUE)
|
||||
function = exp->elts[save_pos1+2].symbol;
|
||||
|
||||
/* Prepare list of argument types for overload resolution */
|
||||
/* Prepare list of argument types for overload resolution. */
|
||||
arg_types = (struct type **)
|
||||
alloca (nargs * (sizeof (struct type *)));
|
||||
for (ix = 1; ix <= nargs; ix++)
|
||||
@ -1802,7 +1804,7 @@ evaluate_subexp_standard (struct type *expect_type,
|
||||
|
||||
if (op == OP_VAR_VALUE)
|
||||
{
|
||||
/* Now fix the expression being evaluated */
|
||||
/* Now fix the expression being evaluated. */
|
||||
exp->elts[save_pos1+2].symbol = symp;
|
||||
argvec[0] = evaluate_subexp_with_coercion (exp, &save_pos1,
|
||||
noside);
|
||||
@ -1812,14 +1814,14 @@ evaluate_subexp_standard (struct type *expect_type,
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Not C++, or no overload resolution allowed */
|
||||
/* nothing to be done; argvec already correctly set up */
|
||||
/* Not C++, or no overload resolution allowed. */
|
||||
/* Nothing to be done; argvec already correctly set up. */
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* It is probably a C-style function */
|
||||
/* nothing to be done; argvec already correctly set up */
|
||||
/* It is probably a C-style function. */
|
||||
/* Nothing to be done; argvec already correctly set up. */
|
||||
}
|
||||
|
||||
do_call_it:
|
||||
@ -1832,10 +1834,10 @@ evaluate_subexp_standard (struct type *expect_type,
|
||||
{
|
||||
/* If the return type doesn't look like a function type, call an
|
||||
error. This can happen if somebody tries to turn a variable into
|
||||
a function call. This is here because people often want to
|
||||
a function call. This is here because people often want to
|
||||
call, eg, strcmp, which gdb doesn't know is a function. If
|
||||
gdb isn't asked for it's opinion (ie. through "whatis"),
|
||||
it won't offer it. */
|
||||
it won't offer it. */
|
||||
|
||||
struct type *ftype = value_type (argvec[0]);
|
||||
|
||||
@ -1868,7 +1870,7 @@ evaluate_subexp_standard (struct type *expect_type,
|
||||
at parse time. We have made all array subscript operations,
|
||||
substring operations as well as function calls come here
|
||||
and we now have to discover what the heck this thing actually was.
|
||||
If it is a function, we process just as if we got an OP_FUNCALL. */
|
||||
If it is a function, we process just as if we got an OP_FUNCALL. */
|
||||
|
||||
nargs = longest_to_int (exp->elts[pc + 1].longconst);
|
||||
(*pos) += 2;
|
||||
@ -1915,9 +1917,9 @@ evaluate_subexp_standard (struct type *expect_type,
|
||||
|
||||
case TYPE_CODE_PTR:
|
||||
case TYPE_CODE_FUNC:
|
||||
/* It's a function call. */
|
||||
/* It's a function call. */
|
||||
/* Allocate arg vector, including space for the function to be
|
||||
called in argvec[0] and a terminating NULL */
|
||||
called in argvec[0] and a terminating NULL. */
|
||||
argvec = (struct value **)
|
||||
alloca (sizeof (struct value *) * (nargs + 2));
|
||||
argvec[0] = arg1;
|
||||
@ -1933,7 +1935,7 @@ evaluate_subexp_standard (struct type *expect_type,
|
||||
|
||||
case OP_COMPLEX:
|
||||
/* We have a complex number, There should be 2 floating
|
||||
point numbers that compose it */
|
||||
point numbers that compose it. */
|
||||
(*pos) += 2;
|
||||
arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
|
||||
arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
|
||||
@ -1989,7 +1991,7 @@ evaluate_subexp_standard (struct type *expect_type,
|
||||
|
||||
/* JYG: if print object is on we need to replace the base type
|
||||
with rtti type in order to continue on with successful
|
||||
lookup of member / method only available in the rtti type. */
|
||||
lookup of member / method only available in the rtti type. */
|
||||
{
|
||||
struct type *type = value_type (arg1);
|
||||
struct type *real_type;
|
||||
@ -2248,7 +2250,7 @@ evaluate_subexp_standard (struct type *expect_type,
|
||||
{
|
||||
/* If the user attempts to subscript something that is not an
|
||||
array or pointer type (like a plain int variable for example),
|
||||
then report this as an error. */
|
||||
then report this as an error. */
|
||||
|
||||
arg1 = coerce_ref (arg1);
|
||||
type = check_typedef (value_type (arg1));
|
||||
@ -2283,7 +2285,7 @@ evaluate_subexp_standard (struct type *expect_type,
|
||||
while (nargs-- > 0)
|
||||
{
|
||||
arg2 = evaluate_subexp_with_coercion (exp, pos, noside);
|
||||
/* FIXME: EVAL_SKIP handling may not be correct. */
|
||||
/* FIXME: EVAL_SKIP handling may not be correct. */
|
||||
if (noside == EVAL_SKIP)
|
||||
{
|
||||
if (nargs > 0)
|
||||
@ -2295,12 +2297,12 @@ evaluate_subexp_standard (struct type *expect_type,
|
||||
goto nosideret;
|
||||
}
|
||||
}
|
||||
/* FIXME: EVAL_AVOID_SIDE_EFFECTS handling may not be correct. */
|
||||
/* FIXME: EVAL_AVOID_SIDE_EFFECTS handling may not be correct. */
|
||||
if (noside == EVAL_AVOID_SIDE_EFFECTS)
|
||||
{
|
||||
/* If the user attempts to subscript something that has no target
|
||||
type (like a plain int variable for example), then report this
|
||||
as an error. */
|
||||
as an error. */
|
||||
|
||||
type = TYPE_TARGET_TYPE (check_typedef (value_type (arg1)));
|
||||
if (type != NULL)
|
||||
@ -2356,7 +2358,7 @@ evaluate_subexp_standard (struct type *expect_type,
|
||||
int array_size_array[MAX_FORTRAN_DIMS];
|
||||
int ndimensions = 1, i;
|
||||
struct type *tmp_type;
|
||||
int offset_item; /* The array offset where the item lives */
|
||||
int offset_item; /* The array offset where the item lives. */
|
||||
|
||||
if (nargs > MAX_FORTRAN_DIMS)
|
||||
error (_("Too many subscripts for F77 (%d Max)"), MAX_FORTRAN_DIMS);
|
||||
@ -2370,21 +2372,21 @@ evaluate_subexp_standard (struct type *expect_type,
|
||||
gdb_assert (nargs > 0);
|
||||
|
||||
/* Now that we know we have a legal array subscript expression
|
||||
let us actually find out where this element exists in the array. */
|
||||
let us actually find out where this element exists in the array. */
|
||||
|
||||
offset_item = 0;
|
||||
/* Take array indices left to right */
|
||||
/* Take array indices left to right. */
|
||||
for (i = 0; i < nargs; i++)
|
||||
{
|
||||
/* Evaluate each subscript, It must be a legal integer in F77 */
|
||||
/* Evaluate each subscript; it must be a legal integer in F77. */
|
||||
arg2 = evaluate_subexp_with_coercion (exp, pos, noside);
|
||||
|
||||
/* Fill in the subscript and array size arrays */
|
||||
/* Fill in the subscript and array size arrays. */
|
||||
|
||||
subscript_array[i] = value_as_long (arg2);
|
||||
}
|
||||
|
||||
/* Internal type of array is arranged right to left */
|
||||
/* Internal type of array is arranged right to left. */
|
||||
for (i = 0; i < nargs; i++)
|
||||
{
|
||||
upper = f77_get_upperbound (tmp_type);
|
||||
@ -2392,23 +2394,23 @@ evaluate_subexp_standard (struct type *expect_type,
|
||||
|
||||
array_size_array[nargs - i - 1] = upper - lower + 1;
|
||||
|
||||
/* Zero-normalize subscripts so that offsetting will work. */
|
||||
/* Zero-normalize subscripts so that offsetting will work. */
|
||||
|
||||
subscript_array[nargs - i - 1] -= lower;
|
||||
|
||||
/* If we are at the bottom of a multidimensional
|
||||
array type then keep a ptr to the last ARRAY
|
||||
type around for use when calling value_subscript()
|
||||
below. This is done because we pretend to value_subscript
|
||||
below. This is done because we pretend to value_subscript
|
||||
that we actually have a one-dimensional array
|
||||
of base element type that we apply a simple
|
||||
offset to. */
|
||||
offset to. */
|
||||
|
||||
if (i < nargs - 1)
|
||||
tmp_type = check_typedef (TYPE_TARGET_TYPE (tmp_type));
|
||||
}
|
||||
|
||||
/* Now let us calculate the offset for this item */
|
||||
/* Now let us calculate the offset for this item. */
|
||||
|
||||
offset_item = subscript_array[ndimensions - 1];
|
||||
|
||||
@ -2421,7 +2423,7 @@ evaluate_subexp_standard (struct type *expect_type,
|
||||
of the multidimensional array-set and pretend
|
||||
that it is actually a array of the final element
|
||||
type, this will ensure that value_subscript()
|
||||
returns the correct type value */
|
||||
returns the correct type value. */
|
||||
|
||||
deprecated_set_value_type (arg1, tmp_type);
|
||||
return value_subscripted_rvalue (arg1, offset_item, 0);
|
||||
@ -2967,7 +2969,7 @@ evaluate_subexp_for_address (struct expression *exp, int *pos,
|
||||
var = exp->elts[pc + 2].symbol;
|
||||
|
||||
/* C++: The "address" of a reference should yield the address
|
||||
* of the object pointed to. Let value_addr() deal with it. */
|
||||
* of the object pointed to. Let value_addr() deal with it. */
|
||||
if (TYPE_CODE (SYMBOL_TYPE (var)) == TYPE_CODE_REF)
|
||||
goto default_case;
|
||||
|
||||
@ -3030,9 +3032,7 @@ evaluate_subexp_for_address (struct expression *exp, int *pos,
|
||||
Note that we currently only do the coercion for C expressions, where
|
||||
arrays are zero based and the coercion is correct. For other languages,
|
||||
with nonzero based arrays, coercion loses. Use CAST_IS_CONVERSION
|
||||
to decide if coercion is appropriate.
|
||||
|
||||
*/
|
||||
to decide if coercion is appropriate. */
|
||||
|
||||
struct value *
|
||||
evaluate_subexp_with_coercion (struct expression *exp,
|
||||
@ -3120,7 +3120,7 @@ evaluate_subexp_for_sizeof (struct expression *exp, int *pos)
|
||||
}
|
||||
}
|
||||
|
||||
/* Parse a type expression in the string [P..P+LENGTH). */
|
||||
/* Parse a type expression in the string [P..P+LENGTH). */
|
||||
|
||||
struct type *
|
||||
parse_and_eval_type (char *p, int length)
|
||||
|
@ -89,7 +89,7 @@ exceptions_state_mc_init (struct ui_out *func_uiout,
|
||||
uiout = func_uiout;
|
||||
|
||||
/* Prevent error/quit during FUNC from calling cleanups established
|
||||
prior to here. */
|
||||
prior to here. */
|
||||
new_catcher->saved_cleanup_chain = save_cleanups ();
|
||||
|
||||
/* Push this new catcher on the top. */
|
||||
@ -108,7 +108,7 @@ catcher_pop (void)
|
||||
current_catcher = old_catcher->prev;
|
||||
|
||||
/* Restore the cleanup chain, the error/quit messages, and the uiout
|
||||
builder, to their original states. */
|
||||
builder, to their original states. */
|
||||
|
||||
restore_cleanups (old_catcher->saved_cleanup_chain);
|
||||
|
||||
@ -186,7 +186,7 @@ exceptions_state_mc (enum catcher_action action)
|
||||
}
|
||||
/* The caller didn't request that the event be caught,
|
||||
relay the event to the next containing
|
||||
catch_errors(). */
|
||||
catch_errors(). */
|
||||
catcher_pop ();
|
||||
throw_exception (exception);
|
||||
}
|
||||
@ -227,7 +227,7 @@ throw_exception (struct gdb_exception exception)
|
||||
I can think of a reason why that is vital, though). */
|
||||
if (tp != NULL)
|
||||
{
|
||||
/* Clear queued breakpoint commands */
|
||||
/* Clear queued breakpoint commands. */
|
||||
bpstat_clear_actions (tp->control.stop_bpstat);
|
||||
}
|
||||
|
||||
@ -236,7 +236,7 @@ throw_exception (struct gdb_exception exception)
|
||||
|
||||
/* Jump to the containing catch_errors() call, communicating REASON
|
||||
to that call via setjmp's return value. Note that REASON can't
|
||||
be zero, by definition in defs.h. */
|
||||
be zero, by definition in defs.h. */
|
||||
exceptions_state_mc (CATCH_THROWING);
|
||||
*current_catcher->exception = exception;
|
||||
EXCEPTIONS_SIGLONGJMP (current_catcher->buf, exception.reason);
|
||||
@ -370,7 +370,7 @@ print_any_exception (struct ui_file *file, const char *prefix,
|
||||
if (e.reason < 0 && e.message != NULL)
|
||||
{
|
||||
target_terminal_ours ();
|
||||
wrap_here (""); /* Force out any buffered output */
|
||||
wrap_here (""); /* Force out any buffered output. */
|
||||
gdb_flush (gdb_stdout);
|
||||
annotate_error_begin ();
|
||||
|
||||
@ -442,12 +442,12 @@ throw_error (enum errors error, const char *fmt, ...)
|
||||
be replaced by judicious use of QUIT. */
|
||||
|
||||
/* MAYBE: cagney/1999-11-05: catch_errors() in conjunction with
|
||||
error() et.al. could maintain a set of flags that indicate the the
|
||||
error() et al. could maintain a set of flags that indicate the the
|
||||
current state of each of the longjmp buffers. This would give the
|
||||
longjmp code the chance to detect a longjmp botch (before it gets
|
||||
to longjmperror()). Prior to 1999-11-05 this wasn't possible as
|
||||
code also randomly used a SET_TOP_LEVEL macro that directly
|
||||
initialize the longjmp buffers. */
|
||||
initialized the longjmp buffers. */
|
||||
|
||||
int
|
||||
catch_exceptions (struct ui_out *uiout,
|
||||
|
@ -149,7 +149,7 @@ int exceptions_state_mc_action_iter_1 (void);
|
||||
|
||||
|
||||
/* If E is an exception, print it's error message on the specified
|
||||
stream. for _fprintf, prefix the message with PREFIX... */
|
||||
stream. For _fprintf, prefix the message with PREFIX... */
|
||||
extern void exception_print (struct ui_file *file, struct gdb_exception e);
|
||||
extern void exception_fprintf (struct ui_file *file, struct gdb_exception e,
|
||||
const char *prefix,
|
||||
@ -236,9 +236,9 @@ extern struct gdb_exception catch_exception (struct ui_out *uiout,
|
||||
return_mask mask);
|
||||
|
||||
/* If CATCH_ERRORS_FTYPE throws an error, catch_errors() returns zero
|
||||
otherwize the result from CATCH_ERRORS_FTYPE is returned. It is
|
||||
otherwize the result from CATCH_ERRORS_FTYPE is returned. It is
|
||||
probably useful for CATCH_ERRORS_FTYPE to always return a non-zero
|
||||
value. It's unfortunate that, catch_errors() does not return an
|
||||
value. It's unfortunate that, catch_errors() does not return an
|
||||
indication of the exact exception that it caught - quit_flag might
|
||||
help.
|
||||
|
||||
@ -248,7 +248,7 @@ typedef int (catch_errors_ftype) (void *);
|
||||
extern int catch_errors (catch_errors_ftype *, void *, char *, return_mask);
|
||||
|
||||
/* Template to catch_errors() that wraps calls to command
|
||||
functions. */
|
||||
functions. */
|
||||
|
||||
typedef void (catch_command_errors_ftype) (char *, int);
|
||||
extern int catch_command_errors (catch_command_errors_ftype *func,
|
||||
|
22
gdb/exec.c
22
gdb/exec.c
@ -130,7 +130,7 @@ exec_close_1 (int quitting)
|
||||
nxt = vp->nxt;
|
||||
|
||||
/* if there is an objfile associated with this bfd,
|
||||
free_objfile() will do proper cleanup of objfile *and* bfd. */
|
||||
free_objfile() will do proper cleanup of objfile *and* bfd. */
|
||||
|
||||
if (vp->objfile)
|
||||
{
|
||||
@ -247,7 +247,7 @@ exec_file_attach (char *filename, int from_tty)
|
||||
/* At this point, scratch_pathname and exec_bfd->name both point to the
|
||||
same malloc'd string. However exec_close() will attempt to free it
|
||||
via the exec_bfd->name pointer, so we need to make another copy and
|
||||
leave exec_bfd as the new owner of the original copy. */
|
||||
leave exec_bfd as the new owner of the original copy. */
|
||||
scratch_pathname = xstrdup (scratch_pathname);
|
||||
cleanups = make_cleanup (xfree, scratch_pathname);
|
||||
|
||||
@ -264,7 +264,7 @@ exec_file_attach (char *filename, int from_tty)
|
||||
/* FIXME - This should only be run for RS6000, but the ifdef is a poor
|
||||
way to accomplish. */
|
||||
#ifdef DEPRECATED_IBM6000_TARGET
|
||||
/* Setup initial vmap. */
|
||||
/* Setup initial vmap. */
|
||||
|
||||
map_vmap (exec_bfd, 0);
|
||||
if (vmap == NULL)
|
||||
@ -314,7 +314,7 @@ exec_file_attach (char *filename, int from_tty)
|
||||
be called from file_command(), which also calls symbol_file_command()
|
||||
which can take multiple args.
|
||||
|
||||
If ARGS is NULL, we just want to close the exec file. */
|
||||
If ARGS is NULL, we just want to close the exec file. */
|
||||
|
||||
static void
|
||||
exec_file_command (char *args, int from_tty)
|
||||
@ -540,7 +540,7 @@ bfdsec_to_vmap (struct bfd *abfd, struct bfd_section *sect, void *arg3)
|
||||
vp->dend = vp->dstart + bfd_section_size (abfd, sect);
|
||||
vp->dvma = bfd_section_vma (abfd, sect);
|
||||
}
|
||||
/* Silently ignore other types of sections. (FIXME?) */
|
||||
/* Silently ignore other types of sections. (FIXME?) */
|
||||
}
|
||||
|
||||
/* Make a vmap for ABFD which might be a member of the archive ARCH.
|
||||
@ -563,7 +563,7 @@ map_vmap (bfd *abfd, bfd *arch)
|
||||
vmap_bfd.pvmap = vp;
|
||||
bfd_map_over_sections (abfd, bfdsec_to_vmap, &vmap_bfd);
|
||||
|
||||
/* Find the end of the list and append. */
|
||||
/* Find the end of the list and append. */
|
||||
for (vpp = &vmap; *vpp; vpp = &(*vpp)->nxt)
|
||||
;
|
||||
*vpp = vp;
|
||||
@ -591,7 +591,7 @@ section_table_xfer_memory_partial (gdb_byte *readbuf, const gdb_byte *writebuf,
|
||||
for (p = sections; p < sections_end; p++)
|
||||
{
|
||||
if (section_name && strcmp (section_name, p->the_bfd_section->name) != 0)
|
||||
continue; /* not the section we need */
|
||||
continue; /* not the section we need. */
|
||||
if (memaddr >= p->addr)
|
||||
{
|
||||
if (memend <= p->endaddr)
|
||||
@ -629,7 +629,7 @@ section_table_xfer_memory_partial (gdb_byte *readbuf, const gdb_byte *writebuf,
|
||||
}
|
||||
}
|
||||
|
||||
return 0; /* We can't help */
|
||||
return 0; /* We can't help. */
|
||||
}
|
||||
|
||||
struct target_section_table *
|
||||
@ -768,11 +768,11 @@ set_section_command (char *args, int from_tty)
|
||||
if (args == 0)
|
||||
error (_("Must specify section name and its virtual address"));
|
||||
|
||||
/* Parse out section name */
|
||||
/* Parse out section name. */
|
||||
for (secname = args; !isspace (*args); args++);
|
||||
seclen = args - secname;
|
||||
|
||||
/* Parse out new virtual address */
|
||||
/* Parse out new virtual address. */
|
||||
secaddr = parse_and_eval_address (args);
|
||||
|
||||
table = current_target_sections;
|
||||
@ -837,7 +837,7 @@ exec_has_memory (struct target_ops *ops)
|
||||
!= current_target_sections->sections_end);
|
||||
}
|
||||
|
||||
/* Find mapped memory. */
|
||||
/* Find mapped memory. */
|
||||
|
||||
extern void
|
||||
exec_set_find_memory_regions (int (*func) (find_memory_region_ftype, void *))
|
||||
|
@ -255,7 +255,7 @@ print_subexp_standard (struct expression *exp, int *pos,
|
||||
fprintf_unfiltered (stream, " %s", selector);
|
||||
}
|
||||
fprintf_unfiltered (stream, "]");
|
||||
/* "selector" was malloc'd by target_read_string. Free it. */
|
||||
/* "selector" was malloc'd by target_read_string. Free it. */
|
||||
xfree (selector);
|
||||
return;
|
||||
}
|
||||
@ -277,7 +277,7 @@ print_subexp_standard (struct expression *exp, int *pos,
|
||||
does not match our expection of what we should find for
|
||||
a simple string, revert back to array printing. Note that
|
||||
the last expression element is an explicit null terminator
|
||||
byte, which doesn't get printed. */
|
||||
byte, which doesn't get printed. */
|
||||
tempstr = alloca (nargs);
|
||||
pc += 4;
|
||||
while (tem < nargs)
|
||||
@ -286,7 +286,8 @@ print_subexp_standard (struct expression *exp, int *pos,
|
||||
|| exp->elts[pc + 1].type
|
||||
!= builtin_type (exp->gdbarch)->builtin_char)
|
||||
{
|
||||
/* Not a simple array of char, use regular array printing. */
|
||||
/* Not a simple array of char, use regular array
|
||||
printing. */
|
||||
tem = 0;
|
||||
break;
|
||||
}
|
||||
@ -371,7 +372,7 @@ print_subexp_standard (struct expression *exp, int *pos,
|
||||
fputs_filtered (&exp->elts[pc + 2].string, stream);
|
||||
return;
|
||||
|
||||
/* Will not occur for Modula-2 */
|
||||
/* Will not occur for Modula-2. */
|
||||
case STRUCTOP_PTR:
|
||||
tem = longest_to_int (exp->elts[pc + 1].longconst);
|
||||
(*pos) += 3 + BYTES_TO_EXP_ELEM (tem + 1);
|
||||
@ -552,7 +553,7 @@ print_subexp_standard (struct expression *exp, int *pos,
|
||||
error (_("Invalid expression"));
|
||||
}
|
||||
|
||||
/* Note that PREC_BUILTIN will always emit parentheses. */
|
||||
/* Note that PREC_BUILTIN will always emit parentheses. */
|
||||
if ((int) myprec < (int) prec)
|
||||
fputs_filtered ("(", stream);
|
||||
if ((int) opcode > (int) BINOP_END)
|
||||
@ -622,7 +623,7 @@ op_string (enum exp_opcode op)
|
||||
static char *op_name (struct expression *, enum exp_opcode);
|
||||
static int dump_subexp_body (struct expression *exp, struct ui_file *, int);
|
||||
|
||||
/* Name for OPCODE, when it appears in expression EXP. */
|
||||
/* Name for OPCODE, when it appears in expression EXP. */
|
||||
|
||||
static char *
|
||||
op_name (struct expression *exp, enum exp_opcode opcode)
|
||||
|
@ -22,7 +22,7 @@
|
||||
#define EXPRESSION_H 1
|
||||
|
||||
|
||||
#include "symtab.h" /* Needed for "struct block" type. */
|
||||
#include "symtab.h" /* Needed for "struct block" type. */
|
||||
#include "doublest.h" /* Needed for DOUBLEST. */
|
||||
|
||||
|
||||
@ -81,7 +81,7 @@ enum exp_opcode
|
||||
BINOP_MAX, /* >? */
|
||||
|
||||
/* STRUCTOP_MEMBER is used for pointer-to-member constructs.
|
||||
X . * Y translates into X STRUCTOP_MEMBER Y. */
|
||||
X . * Y translates into X STRUCTOP_MEMBER Y. */
|
||||
STRUCTOP_MEMBER,
|
||||
|
||||
/* STRUCTOP_MPTR is used for pointer-to-member constructs
|
||||
@ -92,12 +92,12 @@ enum exp_opcode
|
||||
type instantiation for overloaded methods/functions.
|
||||
|
||||
The format is:
|
||||
TYPE_INSTANCE num_types type0 ... typeN num_types TYPE_INSTANCE */
|
||||
TYPE_INSTANCE num_types type0 ... typeN num_types TYPE_INSTANCE. */
|
||||
TYPE_INSTANCE,
|
||||
|
||||
/* end of C++. */
|
||||
|
||||
/* For Modula-2 integer division DIV */
|
||||
/* For Modula-2 integer division DIV. */
|
||||
BINOP_INTDIV,
|
||||
|
||||
BINOP_ASSIGN_MODIFY, /* +=, -=, *=, and so on.
|
||||
@ -106,19 +106,19 @@ enum exp_opcode
|
||||
Then comes another BINOP_ASSIGN_MODIFY,
|
||||
making three exp_elements in total. */
|
||||
|
||||
/* Modula-2 standard (binary) procedures */
|
||||
/* Modula-2 standard (binary) procedures. */
|
||||
BINOP_VAL,
|
||||
|
||||
/* Concatenate two operands, such as character strings or bitstrings.
|
||||
If the first operand is a integer expression, then it means concatenate
|
||||
the second operand with itself that many times. */
|
||||
the second operand with itself that many times. */
|
||||
BINOP_CONCAT,
|
||||
|
||||
/* For (the deleted) Chill and Pascal. */
|
||||
BINOP_IN, /* Returns 1 iff ARG1 IN ARG2. */
|
||||
/* For (the deleted) Chill and Pascal. */
|
||||
BINOP_IN, /* Returns 1 iff ARG1 IN ARG2. */
|
||||
|
||||
/* This is the "colon operator" used various places in (the
|
||||
deleted) Chill. */
|
||||
deleted) Chill. */
|
||||
BINOP_RANGE,
|
||||
|
||||
/* This must be the highest BINOP_ value, for expprint.c. */
|
||||
@ -133,14 +133,14 @@ enum exp_opcode
|
||||
|
||||
/* A sub-string/sub-array. (The deleted) Chill syntax: OP1(OP2 UP
|
||||
OP3). Return OP3 elements of OP1, starting with element
|
||||
OP2. */
|
||||
OP2. */
|
||||
TERNOP_SLICE_COUNT,
|
||||
|
||||
/* Multidimensional subscript operator, such as Modula-2 x[a,b,...].
|
||||
The dimensionality is encoded in the operator, like the number of
|
||||
function arguments in OP_FUNCALL, I.E. <OP><dimension><OP>.
|
||||
The value of the first following subexpression is subscripted
|
||||
by each of the next following subexpressions, one per dimension. */
|
||||
by each of the next following subexpressions, one per dimension. */
|
||||
MULTI_SUBSCRIPT,
|
||||
|
||||
/* The OP_... series take immediate following arguments.
|
||||
@ -192,19 +192,20 @@ enum exp_opcode
|
||||
and then an integer. The string is the selector string. The
|
||||
integer is the number of arguments to the message call. That
|
||||
many plus one values are used, the first one being the object
|
||||
pointer. This is an Objective C message */
|
||||
pointer. This is an Objective C message. */
|
||||
OP_OBJC_MSGCALL,
|
||||
|
||||
/* This is EXACTLY like OP_FUNCALL but is semantically different.
|
||||
In F77, array subscript expressions, substring expressions
|
||||
and function calls are all exactly the same syntactically. They may
|
||||
only be disambiguated at runtime. Thus this operator, which
|
||||
indicates that we have found something of the form <name> ( <stuff> ) */
|
||||
In F77, array subscript expressions, substring expressions and
|
||||
function calls are all exactly the same syntactically. They
|
||||
may only be disambiguated at runtime. Thus this operator,
|
||||
which indicates that we have found something of the form
|
||||
<name> ( <stuff> ). */
|
||||
OP_F77_UNDETERMINED_ARGLIST,
|
||||
|
||||
/* OP_COMPLEX takes a type in the following element, followed by another
|
||||
OP_COMPLEX, making three exp_elements. It is followed by two double
|
||||
args, and converts them into a complex number of the given type. */
|
||||
args, and converts them into a complex number of the given type. */
|
||||
OP_COMPLEX,
|
||||
|
||||
/* OP_STRING represents a string constant.
|
||||
@ -227,7 +228,7 @@ enum exp_opcode
|
||||
The bounds are used to compute the number of following subexpressions
|
||||
to consume, as well as setting the bounds in the created array constant.
|
||||
The type of the elements is taken from the type of the first subexp,
|
||||
and they must all match. */
|
||||
and they must all match. */
|
||||
OP_ARRAY,
|
||||
|
||||
/* UNOP_CAST is followed by a type pointer in the next exp_element.
|
||||
@ -307,7 +308,7 @@ enum exp_opcode
|
||||
OP_OBJC_SELF) pair. */
|
||||
OP_OBJC_SELF,
|
||||
|
||||
/* Objective C: "@selector" pseudo-operator */
|
||||
/* Objective C: "@selector" pseudo-operator. */
|
||||
OP_OBJC_SELECTOR,
|
||||
|
||||
/* OP_SCOPE surrounds a type name and a field name. The type
|
||||
@ -325,18 +326,18 @@ enum exp_opcode
|
||||
represented as if it were .NAME1:(.NAME2:VALUE) (though that is
|
||||
not valid (the deleted) Chill syntax).
|
||||
|
||||
The NAME is represented as for STRUCTOP_STRUCT; VALUE follows. */
|
||||
The NAME is represented as for STRUCTOP_STRUCT; VALUE follows. */
|
||||
OP_LABELED,
|
||||
|
||||
/* OP_TYPE is for parsing types, and used with the "ptype" command
|
||||
so we can look up types that are qualified by scope, either with
|
||||
the GDB "::" operator, or the Modula-2 '.' operator. */
|
||||
the GDB "::" operator, or the Modula-2 '.' operator. */
|
||||
OP_TYPE,
|
||||
|
||||
/* An un-looked-up identifier. */
|
||||
/* An un-looked-up identifier. */
|
||||
OP_NAME,
|
||||
|
||||
/* An Objective C Foundation Class NSString constant */
|
||||
/* An Objective C Foundation Class NSString constant. */
|
||||
OP_OBJC_NSSTRING,
|
||||
|
||||
/* A F90 array range operator (for "exp:exp", "exp:", ":exp" and ":"). */
|
||||
@ -360,13 +361,13 @@ enum exp_opcode
|
||||
OP_EXTENDED0,
|
||||
|
||||
/* Last possible extension operator. Defined to provide an
|
||||
explicit and finite number of extended operators. */
|
||||
explicit and finite number of extended operators. */
|
||||
OP_EXTENDED_LAST = 0xff,
|
||||
/* NOTE: Eventually, we expect to convert to an object-oriented
|
||||
formulation for expression operators that does away with the
|
||||
need for these extension operators, and indeed for this
|
||||
entire enumeration type. Therefore, consider the OP_EXTENDED
|
||||
definitions to be a temporary measure. */
|
||||
definitions to be a temporary measure. */
|
||||
|
||||
/* Each language specific set of operators starts at OP_EXTENDED0. */
|
||||
#include "ada-operator.inc"
|
||||
@ -394,14 +395,14 @@ union exp_element
|
||||
struct expression
|
||||
{
|
||||
const struct language_defn *language_defn; /* language it was
|
||||
entered in */
|
||||
struct gdbarch *gdbarch; /* architecture it was parsed in */
|
||||
entered in. */
|
||||
struct gdbarch *gdbarch; /* architecture it was parsed in. */
|
||||
int nelts;
|
||||
union exp_element elts[1];
|
||||
};
|
||||
|
||||
/* Macros for converting between number of expression elements and bytes
|
||||
to store that many expression elements. */
|
||||
to store that many expression elements. */
|
||||
|
||||
#define EXP_ELEM_TO_BYTES(elements) \
|
||||
((elements) * sizeof (union exp_element))
|
||||
|
18
gdb/f-exp.y
18
gdb/f-exp.y
@ -64,7 +64,7 @@
|
||||
yacc generated parsers in gdb. Note that these are only the variables
|
||||
produced by yacc. If other parser generators (bison, byacc, etc) produce
|
||||
additional global names that conflict at link time, then those parser
|
||||
generators need to be fixed instead of adding those names to this list. */
|
||||
generators need to be fixed instead of adding those names to this list. */
|
||||
|
||||
#define yymaxdepth f_maxdepth
|
||||
#define yyparse f_parse
|
||||
@ -794,7 +794,7 @@ parse_number (p, len, parsed_float, putithere)
|
||||
putithere->typed_val.val = n;
|
||||
|
||||
/* If the high bit of the worked out type is set then this number
|
||||
has to be unsigned. */
|
||||
has to be unsigned. */
|
||||
|
||||
if (unsigned_p || (n & high_bit))
|
||||
putithere->typed_val.type = unsigned_type;
|
||||
@ -875,7 +875,7 @@ static const struct token f77_keywords[] =
|
||||
|
||||
/* Implementation of a dynamically expandable buffer for processing input
|
||||
characters acquired through lexptr and building a value to return in
|
||||
yylval. Ripped off from ch-exp.y */
|
||||
yylval. Ripped off from ch-exp.y */
|
||||
|
||||
static char *tempbuf; /* Current buffer contents */
|
||||
static int tempbufsize; /* Size of allocated buffer */
|
||||
@ -892,8 +892,8 @@ static int tempbufindex; /* Current index into buffer */
|
||||
} while (0);
|
||||
|
||||
|
||||
/* Grow the static temp buffer if necessary, including allocating the first one
|
||||
on demand. */
|
||||
/* Grow the static temp buffer if necessary, including allocating the
|
||||
first one on demand. */
|
||||
|
||||
static void
|
||||
growbuf_by_size (count)
|
||||
@ -984,7 +984,8 @@ yylex ()
|
||||
/* See if it is a special .foo. operator. */
|
||||
|
||||
for (i = 0; dot_ops[i].operator != NULL; i++)
|
||||
if (strncmp (tokstart, dot_ops[i].operator, strlen (dot_ops[i].operator)) == 0)
|
||||
if (strncmp (tokstart, dot_ops[i].operator,
|
||||
strlen (dot_ops[i].operator)) == 0)
|
||||
{
|
||||
lexptr += strlen (dot_ops[i].operator);
|
||||
yylval.opcode = dot_ops[i].opcode;
|
||||
@ -1038,7 +1039,7 @@ yylex ()
|
||||
case '.':
|
||||
/* Might be a floating point number. */
|
||||
if (lexptr[1] < '0' || lexptr[1] > '9')
|
||||
goto symbol; /* Nope, must be a symbol. */
|
||||
goto symbol; /* Nope, must be a symbol. */
|
||||
/* FALL THRU into number case. */
|
||||
|
||||
case '0':
|
||||
@ -1062,7 +1063,8 @@ yylex ()
|
||||
p += 2;
|
||||
hex = 1;
|
||||
}
|
||||
else if (c == '0' && (p[1]=='t' || p[1]=='T' || p[1]=='d' || p[1]=='D'))
|
||||
else if (c == '0' && (p[1]=='t' || p[1]=='T'
|
||||
|| p[1]=='d' || p[1]=='D'))
|
||||
{
|
||||
p += 2;
|
||||
hex = 0;
|
||||
|
40
gdb/f-lang.c
40
gdb/f-lang.c
@ -34,11 +34,11 @@
|
||||
#include "cp-support.h"
|
||||
|
||||
|
||||
/* Following is dubious stuff that had been in the xcoff reader. */
|
||||
/* Following is dubious stuff that had been in the xcoff reader. */
|
||||
|
||||
struct saved_fcn
|
||||
{
|
||||
long line_offset; /* Line offset for function */
|
||||
long line_offset; /* Line offset for function. */
|
||||
struct saved_fcn *next;
|
||||
};
|
||||
|
||||
@ -85,7 +85,7 @@ static void f_emit_char (int c, struct type *type,
|
||||
static void
|
||||
f_emit_char (int c, struct type *type, struct ui_file *stream, int quoter)
|
||||
{
|
||||
c &= 0xFF; /* Avoid sign bit follies */
|
||||
c &= 0xFF; /* Avoid sign bit follies. */
|
||||
|
||||
if (PRINT_LITERAL_FORM (c))
|
||||
{
|
||||
@ -126,7 +126,7 @@ f_emit_char (int c, struct type *type, struct ui_file *stream, int quoter)
|
||||
}
|
||||
|
||||
/* FIXME: This is a copy of the same function from c-exp.y. It should
|
||||
be replaced with a true F77version. */
|
||||
be replaced with a true F77version. */
|
||||
|
||||
static void
|
||||
f_printchar (int c, struct type *type, struct ui_file *stream)
|
||||
@ -141,7 +141,7 @@ f_printchar (int c, struct type *type, struct ui_file *stream)
|
||||
are printed as appropriate. Print ellipses at the end if we
|
||||
had to stop before printing LENGTH characters, or if FORCE_ELLIPSES.
|
||||
FIXME: This is a copy of the same function from c-exp.y. It should
|
||||
be replaced with a true F77 version. */
|
||||
be replaced with a true F77 version. */
|
||||
|
||||
static void
|
||||
f_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string,
|
||||
@ -344,7 +344,7 @@ f_make_symbol_completion_list (char *text, char *word)
|
||||
}
|
||||
|
||||
/* This is declared in c-lang.h but it is silly to import that file for what
|
||||
is already just a hack. */
|
||||
is already just a hack. */
|
||||
extern int c_value_print (struct value *, struct ui_file *,
|
||||
const struct value_print_options *);
|
||||
|
||||
@ -511,10 +511,10 @@ static SAVED_BF_PTR current_head_bf_list = NULL; /* Current head of
|
||||
above list. */
|
||||
|
||||
static SAVED_BF_PTR tmp_bf_ptr; /* Generic temporary for use
|
||||
in macros */
|
||||
in macros. */
|
||||
|
||||
/* The following function simply enters a given common block onto
|
||||
the global common block chain */
|
||||
the global common block chain. */
|
||||
|
||||
static void
|
||||
add_common_block (char *name, CORE_ADDR offset, int secnum, char *func_stab)
|
||||
@ -525,7 +525,7 @@ add_common_block (char *name, CORE_ADDR offset, int secnum, char *func_stab)
|
||||
/* If the COMMON block we are trying to add has a blank
|
||||
name (i.e. "#BLNK_COM") then we set it to __BLANK
|
||||
because the darn "#" character makes GDB's input
|
||||
parser have fits. */
|
||||
parser have fits. */
|
||||
|
||||
|
||||
if (strcmp (name, BLANK_COMMON_NAME_ORIGINAL) == 0
|
||||
@ -545,7 +545,7 @@ add_common_block (char *name, CORE_ADDR offset, int secnum, char *func_stab)
|
||||
tmp->name = xmalloc (strlen (name) + 1);
|
||||
|
||||
/* local_copy_func_stab is a stabstring, let us first extract the
|
||||
function name from the stab by NULLing out the ':' character. */
|
||||
function name from the stab by NULLing out the ':' character. */
|
||||
|
||||
|
||||
c = NULL;
|
||||
@ -582,7 +582,7 @@ add_common_block (char *name, CORE_ADDR offset, int secnum, char *func_stab)
|
||||
#endif
|
||||
|
||||
/* The following function simply enters a given common entry onto
|
||||
the "current_common" block that has been saved away. */
|
||||
the "current_common" block that has been saved away. */
|
||||
|
||||
#if 0
|
||||
static void
|
||||
@ -594,7 +594,7 @@ add_common_entry (struct symbol *entry_sym_ptr)
|
||||
|
||||
/* The order of this list is important, since
|
||||
we expect the entries to appear in decl.
|
||||
order when we later issue "info common" calls */
|
||||
order when we later issue "info common" calls. */
|
||||
|
||||
tmp = allocate_common_entry_node ();
|
||||
|
||||
@ -619,7 +619,7 @@ add_common_entry (struct symbol *entry_sym_ptr)
|
||||
}
|
||||
#endif
|
||||
|
||||
/* This routine finds the first encountred COMMON block named "name" */
|
||||
/* This routine finds the first encountred COMMON block named "name". */
|
||||
|
||||
#if 0
|
||||
static SAVED_F77_COMMON_PTR
|
||||
@ -642,7 +642,7 @@ find_first_common_named (char *name)
|
||||
#endif
|
||||
|
||||
/* This routine finds the first encountred COMMON block named "name"
|
||||
that belongs to function funcname */
|
||||
that belongs to function funcname. */
|
||||
|
||||
SAVED_F77_COMMON_PTR
|
||||
find_common_for_function (char *name, char *funcname)
|
||||
@ -675,7 +675,7 @@ patch_common_entries (SAVED_F77_COMMON_PTR blk, CORE_ADDR offset, int secnum)
|
||||
{
|
||||
COMMON_ENTRY_PTR entry;
|
||||
|
||||
blk->offset = offset; /* Keep this around for future use. */
|
||||
blk->offset = offset; /* Keep this around for future use. */
|
||||
|
||||
entry = blk->entries;
|
||||
|
||||
@ -693,7 +693,7 @@ patch_common_entries (SAVED_F77_COMMON_PTR blk, CORE_ADDR offset, int secnum)
|
||||
blocks occur with relative infrequency, we simply do a linear scan on
|
||||
the name. Eventually, the best way to do this will be a
|
||||
hashed-lookup. Secnum is the section number for the .bss section
|
||||
(which is where common data lives). */
|
||||
(which is where common data lives). */
|
||||
|
||||
static void
|
||||
patch_all_commons_by_name (char *name, CORE_ADDR offset, int secnum)
|
||||
@ -731,7 +731,7 @@ patch_all_commons_by_name (char *name, CORE_ADDR offset, int secnum)
|
||||
#line pragmas sometimes cause line ranges to get messed up
|
||||
we simply create a linear list. This list can then be searched
|
||||
first by a queueing algorithm and upon failure fall back to
|
||||
a linear scan. */
|
||||
a linear scan. */
|
||||
|
||||
#if 0
|
||||
#define ADD_BF_SYMNUM(bf_sym,fcn_sym) \
|
||||
@ -760,7 +760,7 @@ else \
|
||||
}
|
||||
#endif
|
||||
|
||||
/* This function frees the entire (.bf,function) list */
|
||||
/* This function frees the entire (.bf,function) list. */
|
||||
|
||||
#if 0
|
||||
static void
|
||||
@ -791,7 +791,7 @@ get_bf_for_fcn (long the_function)
|
||||
int nprobes = 0;
|
||||
|
||||
/* First use a simple queuing algorithm (i.e. look and see if the
|
||||
item at the head of the queue is the one you want) */
|
||||
item at the head of the queue is the one you want). */
|
||||
|
||||
if (saved_bf_list == NULL)
|
||||
internal_error (__FILE__, __LINE__,
|
||||
@ -810,7 +810,7 @@ get_bf_for_fcn (long the_function)
|
||||
|
||||
/* If the above did not work (probably because #line directives were
|
||||
used in the sourcefile and they messed up our internal tables) we now do
|
||||
the ugly linear scan */
|
||||
the ugly linear scan. */
|
||||
|
||||
if (global_remote_debug)
|
||||
fprintf_unfiltered (gdb_stderr, "\ndefaulting to linear scan\n");
|
||||
|
@ -87,13 +87,13 @@ extern SAVED_F77_COMMON_PTR find_common_for_function (char *, char *);
|
||||
/* When reasonable array bounds cannot be fetched, such as when
|
||||
you ask to 'mt print symbols' and there is no stack frame and
|
||||
therefore no way of knowing the bounds of stack-based arrays,
|
||||
we have to assign default bounds, these are as good as any... */
|
||||
we have to assign default bounds, these are as good as any... */
|
||||
|
||||
#define DEFAULT_UPPER_BOUND 999999
|
||||
#define DEFAULT_LOWER_BOUND -999999
|
||||
|
||||
extern char *real_main_name; /* Name of main function */
|
||||
extern int real_main_c_value; /* C_value field of main function */
|
||||
extern char *real_main_name; /* Name of main function. */
|
||||
extern int real_main_c_value; /* C_value field of main function. */
|
||||
|
||||
extern int f77_get_upperbound (struct type *);
|
||||
|
||||
|
@ -36,7 +36,7 @@
|
||||
#include "gdb_string.h"
|
||||
#include <errno.h>
|
||||
|
||||
#if 0 /* Currently unused */
|
||||
#if 0 /* Currently unused. */
|
||||
static void f_type_print_args (struct type *, struct ui_file *);
|
||||
#endif
|
||||
|
||||
@ -76,7 +76,7 @@ f_print_type (struct type *type, const char *varstring, struct ui_file *stream,
|
||||
fputs_filtered (varstring, stream);
|
||||
|
||||
/* For demangled function names, we have the arglist as part of the name,
|
||||
so don't print an additional pair of ()'s */
|
||||
so don't print an additional pair of ()'s. */
|
||||
|
||||
demangled_args = varstring[strlen (varstring) - 1] == ')';
|
||||
f_type_print_varspec_suffix (type, stream, show, 0, demangled_args, 0);
|
||||
@ -182,7 +182,7 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
|
||||
fprintf_filtered (stream, "%d:", lower_bound);
|
||||
|
||||
/* Make sure that, if we have an assumed size array, we
|
||||
print out a warning and print the upperbound as '*' */
|
||||
print out a warning and print the upperbound as '*'. */
|
||||
|
||||
if (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type))
|
||||
fprintf_filtered (stream, "*");
|
||||
@ -271,7 +271,7 @@ f_type_print_base (struct type *type, struct ui_file *stream, int show,
|
||||
}
|
||||
|
||||
/* When SHOW is zero or less, and there is a valid type name, then always
|
||||
just print the type name directly from the type. */
|
||||
just print the type name directly from the type. */
|
||||
|
||||
if ((show <= 0) && (TYPE_NAME (type) != NULL))
|
||||
{
|
||||
@ -316,12 +316,12 @@ f_type_print_base (struct type *type, struct ui_file *stream, int show,
|
||||
break;
|
||||
|
||||
case TYPE_CODE_RANGE:
|
||||
/* This should not occur */
|
||||
/* This should not occur. */
|
||||
fprintfi_filtered (level, stream, "<range type>");
|
||||
break;
|
||||
|
||||
case TYPE_CODE_CHAR:
|
||||
/* Override name "char" and make it "character" */
|
||||
/* Override name "char" and make it "character". */
|
||||
fprintfi_filtered (level, stream, "character");
|
||||
break;
|
||||
|
||||
@ -337,7 +337,7 @@ f_type_print_base (struct type *type, struct ui_file *stream, int show,
|
||||
break;
|
||||
|
||||
case TYPE_CODE_STRING:
|
||||
/* Strings may have dynamic upperbounds (lengths) like arrays. */
|
||||
/* Strings may have dynamic upperbounds (lengths) like arrays. */
|
||||
|
||||
if (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type))
|
||||
fprintfi_filtered (level, stream, "character*(*)");
|
||||
@ -379,7 +379,7 @@ f_type_print_base (struct type *type, struct ui_file *stream, int show,
|
||||
/* Handle types not explicitly handled by the other cases,
|
||||
such as fundamental types. For these, just print whatever
|
||||
the type name is, as recorded in the type itself. If there
|
||||
is no type name, then complain. */
|
||||
is no type name, then complain. */
|
||||
if (TYPE_NAME (type) != NULL)
|
||||
fprintfi_filtered (level, stream, "%s", TYPE_NAME (type));
|
||||
else
|
||||
|
@ -49,14 +49,14 @@ static void f77_get_dynamic_length_of_aggregate (struct type *);
|
||||
int f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2];
|
||||
|
||||
/* Array which holds offsets to be applied to get a row's elements
|
||||
for a given array. Array also holds the size of each subarray. */
|
||||
for a given array. Array also holds the size of each subarray. */
|
||||
|
||||
/* The following macro gives us the size of the nth dimension, Where
|
||||
n is 1 based. */
|
||||
n is 1 based. */
|
||||
|
||||
#define F77_DIM_SIZE(n) (f77_array_offset_tbl[n][1])
|
||||
|
||||
/* The following gives us the offset for row n where n is 1-based. */
|
||||
/* The following gives us the offset for row n where n is 1-based. */
|
||||
|
||||
#define F77_DIM_OFFSET(n) (f77_array_offset_tbl[n][0])
|
||||
|
||||
@ -85,7 +85,7 @@ f77_get_upperbound (struct type *type)
|
||||
return TYPE_ARRAY_UPPER_BOUND_VALUE (type);
|
||||
}
|
||||
|
||||
/* Obtain F77 adjustable array dimensions */
|
||||
/* Obtain F77 adjustable array dimensions. */
|
||||
|
||||
static void
|
||||
f77_get_dynamic_length_of_aggregate (struct type *type)
|
||||
@ -110,7 +110,7 @@ f77_get_dynamic_length_of_aggregate (struct type *type)
|
||||
lower_bound = f77_get_lowerbound (type);
|
||||
upper_bound = f77_get_upperbound (type);
|
||||
|
||||
/* Patch in a valid length value. */
|
||||
/* Patch in a valid length value. */
|
||||
|
||||
TYPE_LENGTH (type) =
|
||||
(upper_bound - lower_bound + 1)
|
||||
@ -144,7 +144,7 @@ f77_create_arrayprint_offset_tbl (struct type *type, struct ui_file *stream)
|
||||
/* Now we multiply eltlen by all the offsets, so that later we
|
||||
can print out array elements correctly. Up till now we
|
||||
know an offset to apply to get the item but we also
|
||||
have to know how much to add to get to the next item */
|
||||
have to know how much to add to get to the next item. */
|
||||
|
||||
ndimen--;
|
||||
eltlen = TYPE_LENGTH (tmp_type);
|
||||
@ -209,7 +209,7 @@ f77_print_array_1 (int nss, int ndimensions, struct type *type,
|
||||
}
|
||||
|
||||
/* This function gets called to print an F77 array, we set up some
|
||||
stuff and then immediately call f77_print_array_1() */
|
||||
stuff and then immediately call f77_print_array_1(). */
|
||||
|
||||
static void
|
||||
f77_print_array (struct type *type, const gdb_byte *valaddr,
|
||||
@ -229,8 +229,8 @@ Type node corrupt! F77 arrays cannot have %d subscripts (%d Max)"),
|
||||
ndimensions, MAX_FORTRAN_DIMS);
|
||||
|
||||
/* Since F77 arrays are stored column-major, we set up an
|
||||
offset table to get at the various row's elements. The
|
||||
offset table contains entries for both offset and subarray size. */
|
||||
offset table to get at the various row's elements. The
|
||||
offset table contains entries for both offset and subarray size. */
|
||||
|
||||
f77_create_arrayprint_offset_tbl (type, stream);
|
||||
|
||||
@ -254,7 +254,7 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
|
||||
{
|
||||
struct gdbarch *gdbarch = get_type_arch (type);
|
||||
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
||||
unsigned int i = 0; /* Number of characters printed */
|
||||
unsigned int i = 0; /* Number of characters printed. */
|
||||
struct type *elttype;
|
||||
LONGEST val;
|
||||
CORE_ADDR addr;
|
||||
@ -374,7 +374,7 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
|
||||
/* C and C++ has no single byte int type, char is used instead.
|
||||
Since we don't know whether the value is really intended to
|
||||
be used as an integer or a character, print the character
|
||||
equivalent as well. */
|
||||
equivalent as well. */
|
||||
if (TYPE_LENGTH (type) == 1)
|
||||
{
|
||||
fputs_filtered (" ", stream);
|
||||
@ -435,7 +435,7 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
|
||||
TYPE_CODE (type) = TYPE_CODE_INT;
|
||||
val_print (type, valaddr, 0, address, stream, recurse,
|
||||
original_value, options, current_language);
|
||||
/* Restore the type code so later uses work as intended. */
|
||||
/* Restore the type code so later uses work as intended. */
|
||||
TYPE_CODE (type) = TYPE_CODE_BOOL;
|
||||
}
|
||||
}
|
||||
@ -501,8 +501,8 @@ list_all_visible_commons (char *funname)
|
||||
}
|
||||
|
||||
/* This function is used to print out the values in a given COMMON
|
||||
block. It will always use the most local common block of the
|
||||
given name */
|
||||
block. It will always use the most local common block of the
|
||||
given name. */
|
||||
|
||||
static void
|
||||
info_common_command (char *comname, int from_tty)
|
||||
@ -516,12 +516,12 @@ info_common_command (char *comname, int from_tty)
|
||||
/* We have been told to display the contents of F77 COMMON
|
||||
block supposedly visible in this function. Let us
|
||||
first make sure that it is visible and if so, let
|
||||
us display its contents */
|
||||
us display its contents. */
|
||||
|
||||
fi = get_selected_frame (_("No frame selected"));
|
||||
|
||||
/* The following is generally ripped off from stack.c's routine
|
||||
print_frame_info() */
|
||||
print_frame_info(). */
|
||||
|
||||
func = find_pc_function (get_frame_pc (fi));
|
||||
if (func)
|
||||
@ -538,7 +538,7 @@ info_common_command (char *comname, int from_tty)
|
||||
up with a larger address for the function use that instead.
|
||||
I don't think this can ever cause any problems; there shouldn't
|
||||
be any minimal symbols in the middle of a function.
|
||||
FIXME: (Not necessarily true. What about text labels) */
|
||||
FIXME: (Not necessarily true. What about text labels?) */
|
||||
|
||||
struct minimal_symbol *msymbol =
|
||||
lookup_minimal_symbol_by_pc (get_frame_pc (fi));
|
||||
@ -562,7 +562,7 @@ info_common_command (char *comname, int from_tty)
|
||||
}
|
||||
|
||||
/* If comname is NULL, we assume the user wishes to see the
|
||||
which COMMON blocks are visible here and then return */
|
||||
which COMMON blocks are visible here and then return. */
|
||||
|
||||
if (comname == 0)
|
||||
{
|
||||
@ -594,7 +594,7 @@ info_common_command (char *comname, int from_tty)
|
||||
}
|
||||
|
||||
/* This function is used to determine whether there is a
|
||||
F77 common block visible at the current scope called 'comname'. */
|
||||
F77 common block visible at the current scope called 'comname'. */
|
||||
|
||||
#if 0
|
||||
static int
|
||||
@ -611,7 +611,7 @@ there_is_a_visible_common_named (char *comname)
|
||||
fi = get_selected_frame (_("No frame selected"));
|
||||
|
||||
/* The following is generally ripped off from stack.c's routine
|
||||
print_frame_info() */
|
||||
print_frame_info(). */
|
||||
|
||||
func = find_pc_function (fi->pc);
|
||||
if (func)
|
||||
@ -628,7 +628,7 @@ there_is_a_visible_common_named (char *comname)
|
||||
up with a larger address for the function use that instead.
|
||||
I don't think this can ever cause any problems; there shouldn't
|
||||
be any minimal symbols in the middle of a function.
|
||||
FIXME: (Not necessarily true. What about text labels) */
|
||||
FIXME: (Not necessarily true. What about text labels?) */
|
||||
|
||||
struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (fi->pc);
|
||||
|
||||
|
@ -132,7 +132,7 @@ fbsd_find_memory_regions (find_memory_region_ftype func, void *obfd)
|
||||
exec ? 'x' : '-');
|
||||
}
|
||||
|
||||
/* Invoke the callback function to create the corefile segment. */
|
||||
/* Invoke the callback function to create the corefile segment. /
|
||||
func (start, size, read, write, exec, obfd);
|
||||
}
|
||||
|
||||
|
@ -129,7 +129,7 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env,
|
||||
char *shell_command;
|
||||
static char default_shell_file[] = SHELL_FILE;
|
||||
int len;
|
||||
/* Set debug_fork then attach to the child while it sleeps, to debug. */
|
||||
/* Set debug_fork then attach to the child while it sleeps, to debug. */
|
||||
static int debug_fork = 0;
|
||||
/* This is set to the result of setpgrp, which if vforked, will be visible
|
||||
to you in the parent process. It's only used by humans for debugging. */
|
||||
@ -273,7 +273,7 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env,
|
||||
|
||||
/* It is generally good practice to flush any possible pending stdio
|
||||
output prior to doing a fork, to avoid the possibility of both
|
||||
the parent and child flushing the same data after the fork. */
|
||||
the parent and child flushing the same data after the fork. */
|
||||
gdb_flush (gdb_stdout);
|
||||
gdb_flush (gdb_stderr);
|
||||
|
||||
@ -329,7 +329,7 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env,
|
||||
initialize_signals for how we get the right signal handlers
|
||||
for the inferior. */
|
||||
|
||||
/* "Trace me, Dr. Memory!" */
|
||||
/* "Trace me, Dr. Memory!" */
|
||||
(*traceme_fun) ();
|
||||
|
||||
/* The call above set this process (the "child") as debuggable
|
||||
|
12
gdb/frame.c
12
gdb/frame.c
@ -499,7 +499,7 @@ frame_id_eq (struct frame_id l, struct frame_id r)
|
||||
to sigaltstack).
|
||||
|
||||
However, it can be used as safety net to discover invalid frame
|
||||
IDs in certain circumstances. Assuming that NEXT is the immediate
|
||||
IDs in certain circumstances. Assuming that NEXT is the immediate
|
||||
inner frame to THIS and that NEXT and THIS are both NORMAL frames:
|
||||
|
||||
* The stack address of NEXT must be inner-than-or-equal to the stack
|
||||
@ -519,7 +519,7 @@ frame_id_eq (struct frame_id l, struct frame_id r)
|
||||
is involved, because signal handlers might be executed on a different
|
||||
stack than the stack used by the routine that caused the signal
|
||||
to be raised. This can happen for instance when a thread exceeds
|
||||
its maximum stack size. In this case, certain compilers implement
|
||||
its maximum stack size. In this case, certain compilers implement
|
||||
a stack overflow strategy that cause the handler to be run on a
|
||||
different stack. */
|
||||
|
||||
@ -1123,7 +1123,7 @@ create_sentinel_frame (struct program_space *pspace, struct regcache *regcache)
|
||||
return frame;
|
||||
}
|
||||
|
||||
/* Info about the innermost stack frame (contents of FP register) */
|
||||
/* Info about the innermost stack frame (contents of FP register). */
|
||||
|
||||
static struct frame_info *current_frame;
|
||||
|
||||
@ -1279,7 +1279,7 @@ select_frame (struct frame_info *fi)
|
||||
|
||||
Once we have frame-parameterized frame (and frame-related) commands,
|
||||
the event notification can be moved here, since this function will only
|
||||
be called when the user's selected frame is being changed. */
|
||||
be called when the user's selected frame is being changed. */
|
||||
|
||||
/* Ensure that symbols for this frame are read in. Also, determine the
|
||||
source language of this frame, and switch to it if desired. */
|
||||
@ -1387,7 +1387,7 @@ reinit_frame_cache (void)
|
||||
fi->base->unwind->dealloc_cache (fi, fi->base_cache);
|
||||
}
|
||||
|
||||
/* Since we can't really be sure what the first object allocated was */
|
||||
/* Since we can't really be sure what the first object allocated was. */
|
||||
obstack_free (&frame_cache_obstack, 0);
|
||||
obstack_init (&frame_cache_obstack);
|
||||
|
||||
@ -2287,7 +2287,7 @@ Zero is unlimited."),
|
||||
&set_backtrace_cmdlist,
|
||||
&show_backtrace_cmdlist);
|
||||
|
||||
/* Debug this files internals. */
|
||||
/* Debug this files internals. */
|
||||
add_setshow_zinteger_cmd ("frame", class_maintenance, &frame_debug, _("\
|
||||
Set frame debugging."), _("\
|
||||
Show frame debugging."), _("\
|
||||
|
10
gdb/frame.h
10
gdb/frame.h
@ -164,7 +164,7 @@ extern struct frame_id frame_id_build (CORE_ADDR stack_addr,
|
||||
/* Construct a special frame ID. The first parameter is the frame's constant
|
||||
stack address (typically the outer-bound), the second is the
|
||||
frame's constant code address (typically the entry point),
|
||||
and the third parameter is the frame's special identifier address. */
|
||||
and the third parameter is the frame's special identifier address. */
|
||||
extern struct frame_id frame_id_build_special (CORE_ADDR stack_addr,
|
||||
CORE_ADDR code_addr,
|
||||
CORE_ADDR special_addr);
|
||||
@ -574,14 +574,14 @@ extern struct gdbarch *frame_unwind_caller_arch (struct frame_info *frame);
|
||||
/* Values for the source flag to be used in print_frame_info_base(). */
|
||||
enum print_what
|
||||
{
|
||||
/* Print only the source line, like in stepi. */
|
||||
/* Print only the source line, like in stepi. */
|
||||
SRC_LINE = -1,
|
||||
/* Print only the location, i.e. level, address (sometimes)
|
||||
function, args, file, line, line num. */
|
||||
function, args, file, line, line num. */
|
||||
LOCATION,
|
||||
/* Print both of the above. */
|
||||
/* Print both of the above. */
|
||||
SRC_AND_LOC,
|
||||
/* Print location only, but always include the address. */
|
||||
/* Print location only, but always include the address. */
|
||||
LOC_AND_ADDRESS
|
||||
};
|
||||
|
||||
|
@ -205,7 +205,7 @@ frv_linux_sigcontext_reg_addr (struct frame_info *this_frame, int regno,
|
||||
uc_mcontext within struct ucontext is derived as follows:
|
||||
stack_t is a 12-byte struct and struct sigcontext is
|
||||
8-byte aligned. This gives an offset of 8 + 12 + 4 (for
|
||||
padding) = 24.) */
|
||||
padding) = 24.) */
|
||||
if (target_read_memory (sp + 12, buf, sizeof buf) != 0)
|
||||
{
|
||||
warning (_("Can't read realtime sigtramp frame."));
|
||||
@ -240,7 +240,7 @@ frv_linux_sigcontext_reg_addr (struct frame_info *this_frame, int regno,
|
||||
sc_addr + 32 is syscallno, the syscall number or -1.
|
||||
sc_addr + 36 is orig_gr8, the original syscall arg #1.
|
||||
sc_addr + 40 is gner[0].
|
||||
sc_addr + 44 is gner[1]. */
|
||||
sc_addr + 44 is gner[1]. */
|
||||
case iacc0h_regnum :
|
||||
return sc_addr + 48;
|
||||
case iacc0l_regnum :
|
||||
@ -251,14 +251,15 @@ frv_linux_sigcontext_reg_addr (struct frame_info *this_frame, int regno,
|
||||
else if (first_fpr_regnum <= regno && regno <= last_fpr_regnum)
|
||||
return sc_addr + 312 + 4 * (regno - first_fpr_regnum);
|
||||
else
|
||||
return -1; /* not saved. */
|
||||
return -1; /* not saved. */
|
||||
}
|
||||
}
|
||||
|
||||
/* Signal trampolines. */
|
||||
|
||||
static struct trad_frame_cache *
|
||||
frv_linux_sigtramp_frame_cache (struct frame_info *this_frame, void **this_cache)
|
||||
frv_linux_sigtramp_frame_cache (struct frame_info *this_frame,
|
||||
void **this_cache)
|
||||
{
|
||||
struct gdbarch *gdbarch = get_frame_arch (this_frame);
|
||||
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
|
||||
@ -297,11 +298,12 @@ frv_linux_sigtramp_frame_cache (struct frame_info *this_frame, void **this_cache
|
||||
}
|
||||
|
||||
static void
|
||||
frv_linux_sigtramp_frame_this_id (struct frame_info *this_frame, void **this_cache,
|
||||
struct frame_id *this_id)
|
||||
frv_linux_sigtramp_frame_this_id (struct frame_info *this_frame,
|
||||
void **this_cache,
|
||||
struct frame_id *this_id)
|
||||
{
|
||||
struct trad_frame_cache *cache =
|
||||
frv_linux_sigtramp_frame_cache (this_frame, this_cache);
|
||||
struct trad_frame_cache *cache
|
||||
= frv_linux_sigtramp_frame_cache (this_frame, this_cache);
|
||||
trad_frame_get_id (cache, this_id);
|
||||
}
|
||||
|
||||
@ -310,8 +312,8 @@ frv_linux_sigtramp_frame_prev_register (struct frame_info *this_frame,
|
||||
void **this_cache, int regnum)
|
||||
{
|
||||
/* Make sure we've initialized the cache. */
|
||||
struct trad_frame_cache *cache =
|
||||
frv_linux_sigtramp_frame_cache (this_frame, this_cache);
|
||||
struct trad_frame_cache *cache
|
||||
= frv_linux_sigtramp_frame_cache (this_frame, this_cache);
|
||||
return trad_frame_get_register (cache, this_frame, regnum);
|
||||
}
|
||||
|
||||
@ -372,7 +374,7 @@ typedef struct
|
||||
#define FRV_PT_IACC0L 13
|
||||
|
||||
/* Note: Only 32 of the GRs will be found in the corefile. */
|
||||
#define FRV_PT_GR(j) ( 14 + (j)) /* GRj for 0<=j<=63. */
|
||||
#define FRV_PT_GR(j) ( 14 + (j)) /* GRj for 0<=j<=63. */
|
||||
|
||||
#define FRV_PT_TBR FRV_PT_GR(0) /* gr0 is always 0, so TBR is stuffed
|
||||
there. */
|
||||
@ -412,7 +414,8 @@ frv_linux_supply_gregset (const struct regset *regset,
|
||||
regcache_raw_supply (regcache, regi, zerobuf);
|
||||
else
|
||||
regcache_raw_supply (regcache, regi,
|
||||
gregsetp->reg[FRV_PT_GR (regi - first_gpr_regnum)]);
|
||||
gregsetp->reg[FRV_PT_GR (regi
|
||||
- first_gpr_regnum)]);
|
||||
}
|
||||
|
||||
regcache_raw_supply (regcache, pc_regnum, gregsetp->reg[FRV_PT_PC]);
|
||||
@ -441,7 +444,8 @@ frv_linux_supply_fpregset (const struct regset *regset,
|
||||
const frv_elf_fpregset_t *fpregsetp = gregs;
|
||||
|
||||
for (regi = first_fpr_regnum; regi <= last_fpr_regnum; regi++)
|
||||
regcache_raw_supply (regcache, regi, fpregsetp->fr[regi - first_fpr_regnum]);
|
||||
regcache_raw_supply (regcache, regi,
|
||||
fpregsetp->fr[regi - first_fpr_regnum]);
|
||||
|
||||
regcache_raw_supply (regcache, fner0_regnum, fpregsetp->fner[0]);
|
||||
regcache_raw_supply (regcache, fner1_regnum, fpregsetp->fner[1]);
|
||||
@ -522,7 +526,8 @@ void _initialize_frv_linux_tdep (void);
|
||||
void
|
||||
_initialize_frv_linux_tdep (void)
|
||||
{
|
||||
gdbarch_register_osabi (bfd_arch_frv, 0, GDB_OSABI_LINUX, frv_linux_init_abi);
|
||||
gdbarch_register_osabi (bfd_arch_frv, 0, GDB_OSABI_LINUX,
|
||||
frv_linux_init_abi);
|
||||
gdbarch_register_osabi_sniffer (bfd_arch_frv,
|
||||
bfd_target_elf_flavour,
|
||||
frv_linux_elf_osabi_sniffer);
|
||||
|
@ -264,7 +264,8 @@ set_variant_abi_fdpic (struct gdbarch_tdep *var)
|
||||
{
|
||||
var->frv_abi = FRV_ABI_FDPIC;
|
||||
var->register_names[fdpic_loadmap_exec_regnum] = xstrdup ("loadmap_exec");
|
||||
var->register_names[fdpic_loadmap_interp_regnum] = xstrdup ("loadmap_interp");
|
||||
var->register_names[fdpic_loadmap_interp_regnum]
|
||||
= xstrdup ("loadmap_interp");
|
||||
}
|
||||
|
||||
static void
|
||||
@ -443,7 +444,7 @@ frv_adjust_breakpoint_address (struct gdbarch *gdbarch, CORE_ADDR bpaddr)
|
||||
|
||||
/* Find the end of the previous packing sequence. This will be indicated
|
||||
by either attempting to access some inaccessible memory or by finding
|
||||
an instruction word whose packing bit is set to one. */
|
||||
an instruction word whose packing bit is set to one. */
|
||||
while (count-- > 0 && addr >= func_start)
|
||||
{
|
||||
char instr[frv_instr_size];
|
||||
@ -536,7 +537,7 @@ frv_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc,
|
||||
the stack pointer to frame pointer: fp = sp + fp_offset. */
|
||||
int fp_offset = 0;
|
||||
|
||||
/* Total size of frame prior to any alloca operations. */
|
||||
/* Total size of frame prior to any alloca operations. */
|
||||
int framesize = 0;
|
||||
|
||||
/* Flag indicating if lr has been saved on the stack. */
|
||||
@ -559,7 +560,7 @@ frv_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc,
|
||||
/* The address of the most recently scanned prologue instruction. */
|
||||
CORE_ADDR last_prologue_pc;
|
||||
|
||||
/* The address of the next instruction. */
|
||||
/* The address of the next instruction. */
|
||||
CORE_ADDR next_pc;
|
||||
|
||||
/* The upper bound to of the pc values to scan. */
|
||||
@ -954,7 +955,8 @@ frv_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc,
|
||||
|
||||
/* If LR was saved on the stack, record its location. */
|
||||
if (lr_saved_on_stack)
|
||||
info->saved_regs[lr_regnum].addr = this_base - fp_offset + lr_sp_offset;
|
||||
info->saved_regs[lr_regnum].addr
|
||||
= this_base - fp_offset + lr_sp_offset;
|
||||
|
||||
/* The call instruction moves the caller's PC in the callee's LR.
|
||||
Since this is an unwind, do the reverse. Copy the location of LR
|
||||
@ -1122,13 +1124,15 @@ frv_extract_return_value (struct type *type, struct regcache *regcache,
|
||||
else if (len == 8)
|
||||
{
|
||||
ULONGEST regval;
|
||||
|
||||
regcache_cooked_read_unsigned (regcache, 8, ®val);
|
||||
store_unsigned_integer (valbuf, 4, byte_order, regval);
|
||||
regcache_cooked_read_unsigned (regcache, 9, ®val);
|
||||
store_unsigned_integer ((bfd_byte *) valbuf + 4, 4, byte_order, regval);
|
||||
}
|
||||
else
|
||||
internal_error (__FILE__, __LINE__, _("Illegal return value length: %d"), len);
|
||||
internal_error (__FILE__, __LINE__,
|
||||
_("Illegal return value length: %d"), len);
|
||||
}
|
||||
|
||||
static CORE_ADDR
|
||||
@ -1220,7 +1224,7 @@ frv_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||
if (stack_space > 0)
|
||||
sp -= stack_space;
|
||||
|
||||
/* Make sure stack is dword aligned. */
|
||||
/* Make sure stack is dword aligned. */
|
||||
sp = align_down (sp, 8);
|
||||
|
||||
stack_offset = 0;
|
||||
@ -1284,7 +1288,8 @@ frv_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||
{
|
||||
#if 0
|
||||
printf(" Argnum %d data %x -> offset %d (%x)\n",
|
||||
argnum, *((int *)val), stack_offset, (int) (sp + stack_offset));
|
||||
argnum, *((int *)val), stack_offset,
|
||||
(int) (sp + stack_offset));
|
||||
#endif
|
||||
write_memory (sp + stack_offset, val, partial_len);
|
||||
stack_offset += align_up (partial_len, 4);
|
||||
|
@ -427,7 +427,7 @@ gcore_create_callback (CORE_ADDR vaddr, unsigned long size,
|
||||
&& !(bfd_get_file_flags (abfd) & BFD_IN_MEMORY))
|
||||
{
|
||||
flags &= ~(SEC_LOAD | SEC_HAS_CONTENTS);
|
||||
goto keep; /* break out of two nested for loops */
|
||||
goto keep; /* Break out of two nested for loops. */
|
||||
}
|
||||
}
|
||||
|
||||
@ -498,7 +498,7 @@ objfile_find_memory_regions (find_memory_region_ftype func, void *obfd)
|
||||
0, /* Stack section will not be executable. */
|
||||
obfd);
|
||||
|
||||
/* Make a heap segment. */
|
||||
/* Make a heap segment. */
|
||||
if (derive_heap_segment (exec_bfd, &temp_bottom, &temp_top))
|
||||
(*func) (temp_bottom, temp_top - temp_bottom,
|
||||
1, /* Heap section will be readable. */
|
||||
|
@ -36,7 +36,7 @@ struct stab_section_info
|
||||
{
|
||||
char *filename;
|
||||
struct stab_section_info *next;
|
||||
int found; /* Count of times it's found in searching */
|
||||
int found; /* Count of times it's found in searching. */
|
||||
size_t num_sections;
|
||||
CORE_ADDR sections[1];
|
||||
};
|
||||
@ -58,7 +58,7 @@ struct dbx_symfile_info
|
||||
of the original .o files
|
||||
before linking. */
|
||||
|
||||
/* See stabsread.h for the use of the following. */
|
||||
/* See stabsread.h for the use of the following. */
|
||||
struct header_file *header_files;
|
||||
int n_header_files;
|
||||
int n_allocated_header_files;
|
||||
|
@ -23,7 +23,7 @@
|
||||
/* PRAGMATICS: "gdb_assert.h":gdb_assert() is a lower case (rather
|
||||
than upper case) macro since that provides the closest fit to the
|
||||
existing lower case macro <assert.h>:assert() that it is
|
||||
replacing. */
|
||||
replacing. */
|
||||
|
||||
#define gdb_assert(expr) \
|
||||
((void) ((expr) ? 0 : \
|
||||
|
@ -24,7 +24,7 @@
|
||||
#ifdef STDC_HEADERS
|
||||
#include <string.h>
|
||||
#ifdef HAVE_STRINGS_H
|
||||
#include <strings.h> /* strcasecmp etc.. */
|
||||
#include <strings.h> /* strcasecmp etc.. */
|
||||
#endif
|
||||
#else
|
||||
#ifdef HAVE_STRING_H
|
||||
|
@ -111,17 +111,18 @@ typedef struct td_thrhandle
|
||||
|
||||
|
||||
#define TD_EVENTSIZE 2
|
||||
#define BT_UISHIFT 5 /* log base 2 of BT_NBIPUI, to extract word index */
|
||||
#define BT_NBIPUI (1 << BT_UISHIFT) /* n bits per uint */
|
||||
#define BT_UIMASK (BT_NBIPUI - 1) /* to extract bit index */
|
||||
#define BT_UISHIFT 5 /* log base 2 of BT_NBIPUI, to
|
||||
extract word index. */
|
||||
#define BT_NBIPUI (1 << BT_UISHIFT) /* n bits per uint. */
|
||||
#define BT_UIMASK (BT_NBIPUI - 1) /* to extract bit index. */
|
||||
|
||||
/* Bitmask of enabled events. */
|
||||
/* Bitmask of enabled events. */
|
||||
typedef struct td_thr_events
|
||||
{
|
||||
uint32_t event_bits[TD_EVENTSIZE];
|
||||
} td_thr_events_t;
|
||||
|
||||
/* Event set manipulation macros. */
|
||||
/* Event set manipulation macros. */
|
||||
#define __td_eventmask(n) \
|
||||
(UINT32_C (1) << (((n) - 1) & BT_UIMASK))
|
||||
#define __td_eventword(n) \
|
||||
@ -159,7 +160,7 @@ typedef enum
|
||||
{
|
||||
TD_ALL_EVENTS, /* Pseudo-event number. */
|
||||
TD_EVENT_NONE = TD_ALL_EVENTS, /* Depends on context. */
|
||||
TD_READY, /* Is executable now. */
|
||||
TD_READY, /* Is executable now. */
|
||||
TD_SLEEP, /* Blocked in a synchronization obj. */
|
||||
TD_SWITCHTO, /* Now assigned to a process. */
|
||||
TD_SWITCHFROM, /* Not anymore assigned to a process. */
|
||||
@ -181,7 +182,8 @@ typedef enum
|
||||
/* Values representing the different ways events are reported. */
|
||||
typedef enum
|
||||
{
|
||||
NOTIFY_BPT, /* User must insert breakpoint at u.bptaddr. */
|
||||
NOTIFY_BPT, /* User must insert breakpoint at
|
||||
u.bptaddr. */
|
||||
NOTIFY_AUTOBPT, /* Breakpoint at u.bptaddr is automatically
|
||||
inserted. */
|
||||
NOTIFY_SYSCALL /* System call u.syscallno will be invoked. */
|
||||
@ -284,7 +286,8 @@ typedef struct td_thrinfo
|
||||
psaddr_t ti_ro_area; /* Unused. */
|
||||
int ti_ro_size; /* Unused. */
|
||||
td_thr_state_e ti_state; /* Thread state. */
|
||||
unsigned char ti_db_suspended; /* Nonzero if suspended by debugger. */
|
||||
unsigned char ti_db_suspended; /* Nonzero if suspended by
|
||||
debugger. */
|
||||
td_thr_type_e ti_type; /* Type of the thread (system vs
|
||||
user thread). */
|
||||
intptr_t ti_pc; /* Unused. */
|
||||
|
@ -55,7 +55,7 @@
|
||||
/* Unfortunately, the above comment (about being compatible in all Unix
|
||||
systems) is not quite correct for AIX, sigh. And AIX 3.2 can generate
|
||||
status words like 0x57c (sigtrap received after load), and gdb would
|
||||
choke on it. */
|
||||
choke on it. */
|
||||
|
||||
#define WIFSTOPPED(w) ((w)&0x40)
|
||||
|
||||
|
140
gdb/gdbarch.c
140
gdb/gdbarch.c
@ -30,7 +30,7 @@
|
||||
If editing this file, please also run gdbarch.sh and merge any
|
||||
changes into that script. Conversely, when making sweeping changes
|
||||
to this file, modifying gdbarch.sh and using its output may prove
|
||||
easier. */
|
||||
easier. */
|
||||
|
||||
|
||||
#include "defs.h"
|
||||
@ -86,7 +86,7 @@ pstring (const char *string)
|
||||
}
|
||||
|
||||
|
||||
/* Maintain the struct gdbarch object */
|
||||
/* Maintain the struct gdbarch object. */
|
||||
|
||||
struct gdbarch
|
||||
{
|
||||
@ -96,22 +96,22 @@ struct gdbarch
|
||||
/* An obstack bound to the lifetime of the architecture. */
|
||||
struct obstack *obstack;
|
||||
|
||||
/* basic architectural information */
|
||||
/* basic architectural information. */
|
||||
const struct bfd_arch_info * bfd_arch_info;
|
||||
int byte_order;
|
||||
int byte_order_for_code;
|
||||
enum gdb_osabi osabi;
|
||||
const struct target_desc * target_desc;
|
||||
|
||||
/* target specific vector. */
|
||||
/* target specific vector. */
|
||||
struct gdbarch_tdep *tdep;
|
||||
gdbarch_dump_tdep_ftype *dump_tdep;
|
||||
|
||||
/* per-architecture data-pointers */
|
||||
/* per-architecture data-pointers. */
|
||||
unsigned nr_data;
|
||||
void **data;
|
||||
|
||||
/* per-architecture swap-regions */
|
||||
/* per-architecture swap-regions. */
|
||||
struct gdbarch_swap *swap;
|
||||
|
||||
/* Multi-arch values.
|
||||
@ -273,7 +273,7 @@ struct gdbarch
|
||||
|
||||
|
||||
/* The default architecture uses host values (for want of a better
|
||||
choice). */
|
||||
choice). */
|
||||
|
||||
extern const struct bfd_arch_info bfd_default_arch_struct;
|
||||
|
||||
@ -281,15 +281,15 @@ struct gdbarch startup_gdbarch =
|
||||
{
|
||||
1, /* Always initialized. */
|
||||
NULL, /* The obstack. */
|
||||
/* basic architecture information */
|
||||
/* basic architecture information. */
|
||||
&bfd_default_arch_struct, /* bfd_arch_info */
|
||||
BFD_ENDIAN_BIG, /* byte_order */
|
||||
BFD_ENDIAN_BIG, /* byte_order_for_code */
|
||||
GDB_OSABI_UNKNOWN, /* osabi */
|
||||
0, /* target_desc */
|
||||
/* target specific vector and its dump routine */
|
||||
/* target specific vector and its dump routine. */
|
||||
NULL, NULL,
|
||||
/*per-architecture data-pointers and swap regions */
|
||||
/*per-architecture data-pointers and swap regions. */
|
||||
0, NULL, NULL,
|
||||
/* Multi-arch values */
|
||||
1, /* bits_big_endian */
|
||||
@ -427,7 +427,7 @@ struct gdbarch startup_gdbarch =
|
||||
struct gdbarch *target_gdbarch = &startup_gdbarch;
|
||||
|
||||
/* Create a new ``struct gdbarch'' based on information provided by
|
||||
``struct gdbarch_info''. */
|
||||
``struct gdbarch_info''. */
|
||||
|
||||
struct gdbarch *
|
||||
gdbarch_alloc (const struct gdbarch_info *info,
|
||||
@ -453,7 +453,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
|
||||
gdbarch->osabi = info->osabi;
|
||||
gdbarch->target_desc = info->target_desc;
|
||||
|
||||
/* Force the explicit initialization of these. */
|
||||
/* Force the explicit initialization of these. */
|
||||
gdbarch->bits_big_endian = (gdbarch->byte_order == BFD_ENDIAN_BIG);
|
||||
gdbarch->short_bit = 2*TARGET_CHAR_BIT;
|
||||
gdbarch->int_bit = 4*TARGET_CHAR_BIT;
|
||||
@ -565,7 +565,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
|
||||
fprintf_unfiltered (log, "\n\tbyte-order");
|
||||
if (gdbarch->bfd_arch_info == NULL)
|
||||
fprintf_unfiltered (log, "\n\tbfd_arch_info");
|
||||
/* Check those that need to be defined for the given multi-arch level. */
|
||||
/* Check those that need to be defined for the given multi-arch level. */
|
||||
/* Skip verify of bits_big_endian, invalid_p == 0 */
|
||||
/* Skip verify of short_bit, invalid_p == 0 */
|
||||
/* Skip verify of int_bit, invalid_p == 0 */
|
||||
@ -590,16 +590,16 @@ verify_gdbarch (struct gdbarch *gdbarch)
|
||||
gdbarch->dwarf2_addr_size = gdbarch_ptr_bit (gdbarch) / TARGET_CHAR_BIT;
|
||||
if (gdbarch->char_signed == -1)
|
||||
gdbarch->char_signed = 1;
|
||||
/* Skip verify of read_pc, has predicate */
|
||||
/* Skip verify of write_pc, has predicate */
|
||||
/* Skip verify of read_pc, has predicate. */
|
||||
/* Skip verify of write_pc, has predicate. */
|
||||
/* Skip verify of virtual_frame_pointer, invalid_p == 0 */
|
||||
/* Skip verify of pseudo_register_read, has predicate */
|
||||
/* Skip verify of pseudo_register_write, has predicate */
|
||||
/* Skip verify of pseudo_register_read, has predicate. */
|
||||
/* Skip verify of pseudo_register_write, has predicate. */
|
||||
if (gdbarch->num_regs == -1)
|
||||
fprintf_unfiltered (log, "\n\tnum_regs");
|
||||
/* Skip verify of num_pseudo_regs, invalid_p == 0 */
|
||||
/* Skip verify of ax_pseudo_register_collect, has predicate */
|
||||
/* Skip verify of ax_pseudo_register_push_stack, has predicate */
|
||||
/* Skip verify of ax_pseudo_register_collect, has predicate. */
|
||||
/* Skip verify of ax_pseudo_register_push_stack, has predicate. */
|
||||
/* Skip verify of sp_regnum, invalid_p == 0 */
|
||||
/* Skip verify of pc_regnum, invalid_p == 0 */
|
||||
/* Skip verify of ps_regnum, invalid_p == 0 */
|
||||
@ -610,51 +610,51 @@ verify_gdbarch (struct gdbarch *gdbarch)
|
||||
/* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
|
||||
if (gdbarch->register_name == 0)
|
||||
fprintf_unfiltered (log, "\n\tregister_name");
|
||||
/* Skip verify of register_type, has predicate */
|
||||
/* Skip verify of dummy_id, has predicate */
|
||||
/* Skip verify of register_type, has predicate. */
|
||||
/* Skip verify of dummy_id, has predicate. */
|
||||
/* Skip verify of deprecated_fp_regnum, invalid_p == 0 */
|
||||
/* Skip verify of push_dummy_call, has predicate */
|
||||
/* Skip verify of push_dummy_call, has predicate. */
|
||||
/* Skip verify of call_dummy_location, invalid_p == 0 */
|
||||
/* Skip verify of push_dummy_code, has predicate */
|
||||
/* Skip verify of push_dummy_code, has predicate. */
|
||||
/* Skip verify of print_registers_info, invalid_p == 0 */
|
||||
/* Skip verify of print_float_info, has predicate */
|
||||
/* Skip verify of print_vector_info, has predicate */
|
||||
/* Skip verify of print_float_info, has predicate. */
|
||||
/* Skip verify of print_vector_info, has predicate. */
|
||||
/* Skip verify of register_sim_regno, invalid_p == 0 */
|
||||
/* Skip verify of cannot_fetch_register, invalid_p == 0 */
|
||||
/* Skip verify of cannot_store_register, invalid_p == 0 */
|
||||
/* Skip verify of get_longjmp_target, has predicate */
|
||||
/* Skip verify of get_longjmp_target, has predicate. */
|
||||
/* Skip verify of convert_register_p, invalid_p == 0 */
|
||||
/* Skip verify of value_from_register, invalid_p == 0 */
|
||||
/* Skip verify of pointer_to_address, invalid_p == 0 */
|
||||
/* Skip verify of address_to_pointer, invalid_p == 0 */
|
||||
/* Skip verify of integer_to_address, has predicate */
|
||||
/* Skip verify of return_value, has predicate */
|
||||
/* Skip verify of integer_to_address, has predicate. */
|
||||
/* Skip verify of return_value, has predicate. */
|
||||
if (gdbarch->skip_prologue == 0)
|
||||
fprintf_unfiltered (log, "\n\tskip_prologue");
|
||||
/* Skip verify of skip_main_prologue, has predicate */
|
||||
/* Skip verify of skip_main_prologue, has predicate. */
|
||||
if (gdbarch->inner_than == 0)
|
||||
fprintf_unfiltered (log, "\n\tinner_than");
|
||||
if (gdbarch->breakpoint_from_pc == 0)
|
||||
fprintf_unfiltered (log, "\n\tbreakpoint_from_pc");
|
||||
/* Skip verify of remote_breakpoint_from_pc, invalid_p == 0 */
|
||||
/* Skip verify of adjust_breakpoint_address, has predicate */
|
||||
/* Skip verify of adjust_breakpoint_address, has predicate. */
|
||||
/* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
|
||||
/* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
|
||||
/* Skip verify of decr_pc_after_break, invalid_p == 0 */
|
||||
/* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
|
||||
/* Skip verify of remote_register_number, invalid_p == 0 */
|
||||
/* Skip verify of fetch_tls_load_module_address, has predicate */
|
||||
/* Skip verify of fetch_tls_load_module_address, has predicate. */
|
||||
/* Skip verify of frame_args_skip, invalid_p == 0 */
|
||||
/* Skip verify of unwind_pc, has predicate */
|
||||
/* Skip verify of unwind_sp, has predicate */
|
||||
/* Skip verify of frame_num_args, has predicate */
|
||||
/* Skip verify of frame_align, has predicate */
|
||||
/* Skip verify of unwind_pc, has predicate. */
|
||||
/* Skip verify of unwind_sp, has predicate. */
|
||||
/* Skip verify of frame_num_args, has predicate. */
|
||||
/* Skip verify of frame_align, has predicate. */
|
||||
/* Skip verify of stabs_argument_has_addr, invalid_p == 0 */
|
||||
/* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
|
||||
/* Skip verify of addr_bits_remove, invalid_p == 0 */
|
||||
/* Skip verify of smash_text_address, invalid_p == 0 */
|
||||
/* Skip verify of software_single_step, has predicate */
|
||||
/* Skip verify of single_step_through_delay, has predicate */
|
||||
/* Skip verify of software_single_step, has predicate. */
|
||||
/* Skip verify of single_step_through_delay, has predicate. */
|
||||
if (gdbarch->print_insn == 0)
|
||||
fprintf_unfiltered (log, "\n\tprint_insn");
|
||||
/* Skip verify of skip_trampoline_code, invalid_p == 0 */
|
||||
@ -665,38 +665,38 @@ verify_gdbarch (struct gdbarch *gdbarch)
|
||||
/* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
|
||||
/* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
|
||||
/* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
|
||||
/* Skip verify of address_class_type_flags, has predicate */
|
||||
/* Skip verify of address_class_type_flags_to_name, has predicate */
|
||||
/* Skip verify of address_class_name_to_type_flags, has predicate */
|
||||
/* Skip verify of address_class_type_flags, has predicate. */
|
||||
/* Skip verify of address_class_type_flags_to_name, has predicate. */
|
||||
/* Skip verify of address_class_name_to_type_flags, has predicate. */
|
||||
/* Skip verify of register_reggroup_p, invalid_p == 0 */
|
||||
/* Skip verify of fetch_pointer_argument, has predicate */
|
||||
/* Skip verify of regset_from_core_section, has predicate */
|
||||
/* Skip verify of core_xfer_shared_libraries, has predicate */
|
||||
/* Skip verify of core_pid_to_str, has predicate */
|
||||
/* Skip verify of gcore_bfd_target, has predicate */
|
||||
/* Skip verify of fetch_pointer_argument, has predicate. */
|
||||
/* Skip verify of regset_from_core_section, has predicate. */
|
||||
/* Skip verify of core_xfer_shared_libraries, has predicate. */
|
||||
/* Skip verify of core_pid_to_str, has predicate. */
|
||||
/* Skip verify of gcore_bfd_target, has predicate. */
|
||||
/* Skip verify of vtable_function_descriptors, invalid_p == 0 */
|
||||
/* Skip verify of vbit_in_delta, invalid_p == 0 */
|
||||
/* Skip verify of skip_permanent_breakpoint, has predicate */
|
||||
/* Skip verify of max_insn_length, has predicate */
|
||||
/* Skip verify of displaced_step_copy_insn, has predicate */
|
||||
/* Skip verify of skip_permanent_breakpoint, has predicate. */
|
||||
/* Skip verify of max_insn_length, has predicate. */
|
||||
/* Skip verify of displaced_step_copy_insn, has predicate. */
|
||||
/* Skip verify of displaced_step_hw_singlestep, invalid_p == 0 */
|
||||
/* Skip verify of displaced_step_fixup, has predicate */
|
||||
/* Skip verify of displaced_step_fixup, has predicate. */
|
||||
if ((! gdbarch->displaced_step_free_closure) != (! gdbarch->displaced_step_copy_insn))
|
||||
fprintf_unfiltered (log, "\n\tdisplaced_step_free_closure");
|
||||
if ((! gdbarch->displaced_step_location) != (! gdbarch->displaced_step_copy_insn))
|
||||
fprintf_unfiltered (log, "\n\tdisplaced_step_location");
|
||||
/* Skip verify of relocate_instruction, has predicate */
|
||||
/* Skip verify of overlay_update, has predicate */
|
||||
/* Skip verify of core_read_description, has predicate */
|
||||
/* Skip verify of static_transform_name, has predicate */
|
||||
/* Skip verify of relocate_instruction, has predicate. */
|
||||
/* Skip verify of overlay_update, has predicate. */
|
||||
/* Skip verify of core_read_description, has predicate. */
|
||||
/* Skip verify of static_transform_name, has predicate. */
|
||||
/* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
|
||||
/* Skip verify of process_record, has predicate */
|
||||
/* Skip verify of process_record_signal, has predicate */
|
||||
/* Skip verify of process_record, has predicate. */
|
||||
/* Skip verify of process_record_signal, has predicate. */
|
||||
/* Skip verify of target_signal_from_host, invalid_p == 0 */
|
||||
/* Skip verify of target_signal_to_host, invalid_p == 0 */
|
||||
/* Skip verify of get_siginfo_type, has predicate */
|
||||
/* Skip verify of record_special_symbol, has predicate */
|
||||
/* Skip verify of get_syscall_number, has predicate */
|
||||
/* Skip verify of get_siginfo_type, has predicate. */
|
||||
/* Skip verify of record_special_symbol, has predicate. */
|
||||
/* Skip verify of get_syscall_number, has predicate. */
|
||||
/* Skip verify of has_global_solist, invalid_p == 0 */
|
||||
/* Skip verify of has_global_breakpoints, invalid_p == 0 */
|
||||
/* Skip verify of has_shared_address_space, invalid_p == 0 */
|
||||
@ -714,7 +714,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
|
||||
}
|
||||
|
||||
|
||||
/* Print out the details of the current architecture. */
|
||||
/* Print out the details of the current architecture. */
|
||||
|
||||
void
|
||||
gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
|
||||
@ -3832,7 +3832,7 @@ set_gdbarch_has_dos_based_file_system (struct gdbarch *gdbarch,
|
||||
|
||||
|
||||
/* Keep a registry of per-architecture data-pointers required by GDB
|
||||
modules. */
|
||||
modules. */
|
||||
|
||||
struct gdbarch_data
|
||||
{
|
||||
@ -3891,7 +3891,7 @@ gdbarch_data_register_post_init (gdbarch_data_post_init_ftype *post_init)
|
||||
return gdbarch_data_register (NULL, post_init);
|
||||
}
|
||||
|
||||
/* Create/delete the gdbarch data vector. */
|
||||
/* Create/delete the gdbarch data vector. */
|
||||
|
||||
static void
|
||||
alloc_gdbarch_data (struct gdbarch *gdbarch)
|
||||
@ -3902,7 +3902,7 @@ alloc_gdbarch_data (struct gdbarch *gdbarch)
|
||||
}
|
||||
|
||||
/* Initialize the current value of the specified per-architecture
|
||||
data-pointer. */
|
||||
data-pointer. */
|
||||
|
||||
void
|
||||
deprecated_set_gdbarch_data (struct gdbarch *gdbarch,
|
||||
@ -3916,7 +3916,7 @@ deprecated_set_gdbarch_data (struct gdbarch *gdbarch,
|
||||
}
|
||||
|
||||
/* Return the current value of the specified per-architecture
|
||||
data-pointer. */
|
||||
data-pointer. */
|
||||
|
||||
void *
|
||||
gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *data)
|
||||
@ -3955,7 +3955,7 @@ gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *data)
|
||||
}
|
||||
|
||||
|
||||
/* Keep a registry of the architectures known by GDB. */
|
||||
/* Keep a registry of the architectures known by GDB. */
|
||||
|
||||
struct gdbarch_registration
|
||||
{
|
||||
@ -3980,7 +3980,7 @@ const char **
|
||||
gdbarch_printable_names (void)
|
||||
{
|
||||
/* Accumulate a list of names based on the registed list of
|
||||
architectures. */
|
||||
architectures. */
|
||||
int nr_arches = 0;
|
||||
const char **arches = NULL;
|
||||
struct gdbarch_registration *rego;
|
||||
@ -4019,17 +4019,19 @@ gdbarch_register (enum bfd_architecture bfd_architecture,
|
||||
if (bfd_arch_info == NULL)
|
||||
{
|
||||
internal_error (__FILE__, __LINE__,
|
||||
_("gdbarch: Attempt to register unknown architecture (%d)"),
|
||||
_("gdbarch: Attempt to register "
|
||||
"unknown architecture (%d)"),
|
||||
bfd_architecture);
|
||||
}
|
||||
/* Check that we haven't seen this architecture before */
|
||||
/* Check that we haven't seen this architecture before. */
|
||||
for (curr = &gdbarch_registry;
|
||||
(*curr) != NULL;
|
||||
curr = &(*curr)->next)
|
||||
{
|
||||
if (bfd_architecture == (*curr)->bfd_architecture)
|
||||
internal_error (__FILE__, __LINE__,
|
||||
_("gdbarch: Duplicate registraration of architecture (%s)"),
|
||||
_("gdbarch: Duplicate registraration "
|
||||
"of architecture (%s)"),
|
||||
bfd_arch_info->printable_name);
|
||||
}
|
||||
/* log it */
|
||||
@ -4090,7 +4092,7 @@ gdbarch_find_by_info (struct gdbarch_info info)
|
||||
defaults. */
|
||||
gdbarch_info_fill (&info);
|
||||
|
||||
/* Must have found some sort of architecture. */
|
||||
/* Must have found some sort of architecture. */
|
||||
gdb_assert (info.bfd_arch_info != NULL);
|
||||
|
||||
if (gdbarch_debug)
|
||||
|
@ -30,7 +30,7 @@
|
||||
If editing this file, please also run gdbarch.sh and merge any
|
||||
changes into that script. Conversely, when making sweeping changes
|
||||
to this file, modifying gdbarch.sh and using its output may prove
|
||||
easier. */
|
||||
easier. */
|
||||
|
||||
#ifndef GDBARCH_H
|
||||
#define GDBARCH_H
|
||||
@ -68,25 +68,25 @@ struct agent_expr;
|
||||
extern struct gdbarch *target_gdbarch;
|
||||
|
||||
|
||||
/* The following are pre-initialized by GDBARCH. */
|
||||
/* The following are pre-initialized by GDBARCH. */
|
||||
|
||||
extern const struct bfd_arch_info * gdbarch_bfd_arch_info (struct gdbarch *gdbarch);
|
||||
/* set_gdbarch_bfd_arch_info() - not applicable - pre-initialized. */
|
||||
/* set_gdbarch_bfd_arch_info() - not applicable - pre-initialized. */
|
||||
|
||||
extern int gdbarch_byte_order (struct gdbarch *gdbarch);
|
||||
/* set_gdbarch_byte_order() - not applicable - pre-initialized. */
|
||||
/* set_gdbarch_byte_order() - not applicable - pre-initialized. */
|
||||
|
||||
extern int gdbarch_byte_order_for_code (struct gdbarch *gdbarch);
|
||||
/* set_gdbarch_byte_order_for_code() - not applicable - pre-initialized. */
|
||||
/* set_gdbarch_byte_order_for_code() - not applicable - pre-initialized. */
|
||||
|
||||
extern enum gdb_osabi gdbarch_osabi (struct gdbarch *gdbarch);
|
||||
/* set_gdbarch_osabi() - not applicable - pre-initialized. */
|
||||
/* set_gdbarch_osabi() - not applicable - pre-initialized. */
|
||||
|
||||
extern const struct target_desc * gdbarch_target_desc (struct gdbarch *gdbarch);
|
||||
/* set_gdbarch_target_desc() - not applicable - pre-initialized. */
|
||||
/* set_gdbarch_target_desc() - not applicable - pre-initialized. */
|
||||
|
||||
|
||||
/* The following are initialized by the target dependent code. */
|
||||
/* The following are initialized by the target dependent code. */
|
||||
|
||||
/* The bit byte-order has to do just with numbering of bits in debugging symbols
|
||||
and such. Conceptually, it's quite separate from byte/word byte order. */
|
||||
@ -1030,7 +1030,7 @@ extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
|
||||
data for all the various GDB components was also considered. Since
|
||||
GDB is built from a variable number of (fairly independent)
|
||||
components it was determined that the global aproach was not
|
||||
applicable. */
|
||||
applicable. */
|
||||
|
||||
|
||||
/* Register a new architectural family with GDB.
|
||||
@ -1064,7 +1064,7 @@ extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
|
||||
|
||||
The DUMP_TDEP function shall print out all target specific values.
|
||||
Care should be taken to ensure that the function works in both the
|
||||
multi-arch and non- multi-arch cases. */
|
||||
multi-arch and non- multi-arch cases. */
|
||||
|
||||
struct gdbarch_list
|
||||
{
|
||||
@ -1074,7 +1074,7 @@ struct gdbarch_list
|
||||
|
||||
struct gdbarch_info
|
||||
{
|
||||
/* Use default: NULL (ZERO). */
|
||||
/* Use default: NULL (ZERO). */
|
||||
const struct bfd_arch_info *bfd_arch_info;
|
||||
|
||||
/* Use default: BFD_ENDIAN_UNKNOWN (NB: is not ZERO). */
|
||||
@ -1082,10 +1082,10 @@ struct gdbarch_info
|
||||
|
||||
int byte_order_for_code;
|
||||
|
||||
/* Use default: NULL (ZERO). */
|
||||
/* Use default: NULL (ZERO). */
|
||||
bfd *abfd;
|
||||
|
||||
/* Use default: NULL (ZERO). */
|
||||
/* Use default: NULL (ZERO). */
|
||||
struct gdbarch_tdep_info *tdep_info;
|
||||
|
||||
/* Use default: GDB_OSABI_UNINITIALIZED (-1). */
|
||||
@ -1109,13 +1109,13 @@ extern void gdbarch_register (enum bfd_architecture architecture,
|
||||
/* Return a freshly allocated, NULL terminated, array of the valid
|
||||
architecture names. Since architectures are registered during the
|
||||
_initialize phase this function only returns useful information
|
||||
once initialization has been completed. */
|
||||
once initialization has been completed. */
|
||||
|
||||
extern const char **gdbarch_printable_names (void);
|
||||
|
||||
|
||||
/* Helper function. Search the list of ARCHES for a GDBARCH that
|
||||
matches the information provided by INFO. */
|
||||
matches the information provided by INFO. */
|
||||
|
||||
extern struct gdbarch_list *gdbarch_list_lookup_by_info (struct gdbarch_list *arches, const struct gdbarch_info *info);
|
||||
|
||||
@ -1123,14 +1123,14 @@ extern struct gdbarch_list *gdbarch_list_lookup_by_info (struct gdbarch_list *ar
|
||||
/* Helper function. Create a preliminary ``struct gdbarch''. Perform
|
||||
basic initialization using values obtained from the INFO and TDEP
|
||||
parameters. set_gdbarch_*() functions are called to complete the
|
||||
initialization of the object. */
|
||||
initialization of the object. */
|
||||
|
||||
extern struct gdbarch *gdbarch_alloc (const struct gdbarch_info *info, struct gdbarch_tdep *tdep);
|
||||
|
||||
|
||||
/* Helper function. Free a partially-constructed ``struct gdbarch''.
|
||||
It is assumed that the caller freeds the ``struct
|
||||
gdbarch_tdep''. */
|
||||
gdbarch_tdep''. */
|
||||
|
||||
extern void gdbarch_free (struct gdbarch *);
|
||||
|
||||
@ -1144,14 +1144,14 @@ extern void *gdbarch_obstack_zalloc (struct gdbarch *gdbarch, long size);
|
||||
#define GDBARCH_OBSTACK_ZALLOC(GDBARCH, TYPE) ((TYPE *) gdbarch_obstack_zalloc ((GDBARCH), sizeof (TYPE)))
|
||||
|
||||
|
||||
/* Helper function. Force an update of the current architecture.
|
||||
/* Helper function. Force an update of the current architecture.
|
||||
|
||||
The actual architecture selected is determined by INFO, ``(gdb) set
|
||||
architecture'' et.al., the existing architecture and BFD's default
|
||||
architecture. INFO should be initialized to zero and then selected
|
||||
fields should be updated.
|
||||
|
||||
Returns non-zero if the update succeeds */
|
||||
Returns non-zero if the update succeeds. */
|
||||
|
||||
extern int gdbarch_update_p (struct gdbarch_info info);
|
||||
|
||||
@ -1209,7 +1209,7 @@ extern void *gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *);
|
||||
|
||||
|
||||
/* Set the dynamic target-system-dependent parameters (architecture,
|
||||
byte-order, ...) using information found in the BFD */
|
||||
byte-order, ...) using information found in the BFD. */
|
||||
|
||||
extern void set_gdbarch_from_file (bfd *);
|
||||
|
||||
|
@ -895,7 +895,7 @@ cat <<EOF
|
||||
If editing this file, please also run gdbarch.sh and merge any
|
||||
changes into that script. Conversely, when making sweeping changes
|
||||
to this file, modifying gdbarch.sh and using its output may prove
|
||||
easier. */
|
||||
easier. */
|
||||
|
||||
EOF
|
||||
}
|
||||
@ -946,21 +946,21 @@ EOF
|
||||
# function typedef's
|
||||
printf "\n"
|
||||
printf "\n"
|
||||
printf "/* The following are pre-initialized by GDBARCH. */\n"
|
||||
printf "/* The following are pre-initialized by GDBARCH. */\n"
|
||||
function_list | while do_read
|
||||
do
|
||||
if class_is_info_p
|
||||
then
|
||||
printf "\n"
|
||||
printf "extern ${returntype} gdbarch_${function} (struct gdbarch *gdbarch);\n"
|
||||
printf "/* set_gdbarch_${function}() - not applicable - pre-initialized. */\n"
|
||||
printf "/* set_gdbarch_${function}() - not applicable - pre-initialized. */\n"
|
||||
fi
|
||||
done
|
||||
|
||||
# function typedef's
|
||||
printf "\n"
|
||||
printf "\n"
|
||||
printf "/* The following are initialized by the target dependent code. */\n"
|
||||
printf "/* The following are initialized by the target dependent code. */\n"
|
||||
function_list | while do_read
|
||||
do
|
||||
if [ -n "${comment}" ]
|
||||
@ -1034,7 +1034,7 @@ extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
|
||||
data for all the various GDB components was also considered. Since
|
||||
GDB is built from a variable number of (fairly independent)
|
||||
components it was determined that the global aproach was not
|
||||
applicable. */
|
||||
applicable. */
|
||||
|
||||
|
||||
/* Register a new architectural family with GDB.
|
||||
@ -1068,7 +1068,7 @@ extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
|
||||
|
||||
The DUMP_TDEP function shall print out all target specific values.
|
||||
Care should be taken to ensure that the function works in both the
|
||||
multi-arch and non- multi-arch cases. */
|
||||
multi-arch and non- multi-arch cases. */
|
||||
|
||||
struct gdbarch_list
|
||||
{
|
||||
@ -1078,7 +1078,7 @@ struct gdbarch_list
|
||||
|
||||
struct gdbarch_info
|
||||
{
|
||||
/* Use default: NULL (ZERO). */
|
||||
/* Use default: NULL (ZERO). */
|
||||
const struct bfd_arch_info *bfd_arch_info;
|
||||
|
||||
/* Use default: BFD_ENDIAN_UNKNOWN (NB: is not ZERO). */
|
||||
@ -1086,10 +1086,10 @@ struct gdbarch_info
|
||||
|
||||
int byte_order_for_code;
|
||||
|
||||
/* Use default: NULL (ZERO). */
|
||||
/* Use default: NULL (ZERO). */
|
||||
bfd *abfd;
|
||||
|
||||
/* Use default: NULL (ZERO). */
|
||||
/* Use default: NULL (ZERO). */
|
||||
struct gdbarch_tdep_info *tdep_info;
|
||||
|
||||
/* Use default: GDB_OSABI_UNINITIALIZED (-1). */
|
||||
@ -1113,13 +1113,13 @@ extern void gdbarch_register (enum bfd_architecture architecture,
|
||||
/* Return a freshly allocated, NULL terminated, array of the valid
|
||||
architecture names. Since architectures are registered during the
|
||||
_initialize phase this function only returns useful information
|
||||
once initialization has been completed. */
|
||||
once initialization has been completed. */
|
||||
|
||||
extern const char **gdbarch_printable_names (void);
|
||||
|
||||
|
||||
/* Helper function. Search the list of ARCHES for a GDBARCH that
|
||||
matches the information provided by INFO. */
|
||||
matches the information provided by INFO. */
|
||||
|
||||
extern struct gdbarch_list *gdbarch_list_lookup_by_info (struct gdbarch_list *arches, const struct gdbarch_info *info);
|
||||
|
||||
@ -1127,14 +1127,14 @@ extern struct gdbarch_list *gdbarch_list_lookup_by_info (struct gdbarch_list *ar
|
||||
/* Helper function. Create a preliminary \`\`struct gdbarch''. Perform
|
||||
basic initialization using values obtained from the INFO and TDEP
|
||||
parameters. set_gdbarch_*() functions are called to complete the
|
||||
initialization of the object. */
|
||||
initialization of the object. */
|
||||
|
||||
extern struct gdbarch *gdbarch_alloc (const struct gdbarch_info *info, struct gdbarch_tdep *tdep);
|
||||
|
||||
|
||||
/* Helper function. Free a partially-constructed \`\`struct gdbarch''.
|
||||
It is assumed that the caller freeds the \`\`struct
|
||||
gdbarch_tdep''. */
|
||||
gdbarch_tdep''. */
|
||||
|
||||
extern void gdbarch_free (struct gdbarch *);
|
||||
|
||||
@ -1148,14 +1148,14 @@ extern void *gdbarch_obstack_zalloc (struct gdbarch *gdbarch, long size);
|
||||
#define GDBARCH_OBSTACK_ZALLOC(GDBARCH, TYPE) ((TYPE *) gdbarch_obstack_zalloc ((GDBARCH), sizeof (TYPE)))
|
||||
|
||||
|
||||
/* Helper function. Force an update of the current architecture.
|
||||
/* Helper function. Force an update of the current architecture.
|
||||
|
||||
The actual architecture selected is determined by INFO, \`\`(gdb) set
|
||||
architecture'' et.al., the existing architecture and BFD's default
|
||||
architecture. INFO should be initialized to zero and then selected
|
||||
fields should be updated.
|
||||
|
||||
Returns non-zero if the update succeeds */
|
||||
Returns non-zero if the update succeeds. */
|
||||
|
||||
extern int gdbarch_update_p (struct gdbarch_info info);
|
||||
|
||||
@ -1213,7 +1213,7 @@ extern void *gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *);
|
||||
|
||||
|
||||
/* Set the dynamic target-system-dependent parameters (architecture,
|
||||
byte-order, ...) using information found in the BFD */
|
||||
byte-order, ...) using information found in the BFD. */
|
||||
|
||||
extern void set_gdbarch_from_file (bfd *);
|
||||
|
||||
@ -1299,7 +1299,7 @@ EOF
|
||||
|
||||
# gdbarch open the gdbarch object
|
||||
printf "\n"
|
||||
printf "/* Maintain the struct gdbarch object */\n"
|
||||
printf "/* Maintain the struct gdbarch object. */\n"
|
||||
printf "\n"
|
||||
printf "struct gdbarch\n"
|
||||
printf "{\n"
|
||||
@ -1309,7 +1309,7 @@ printf "\n"
|
||||
printf " /* An obstack bound to the lifetime of the architecture. */\n"
|
||||
printf " struct obstack *obstack;\n"
|
||||
printf "\n"
|
||||
printf " /* basic architectural information */\n"
|
||||
printf " /* basic architectural information. */\n"
|
||||
function_list | while do_read
|
||||
do
|
||||
if class_is_info_p
|
||||
@ -1318,15 +1318,15 @@ do
|
||||
fi
|
||||
done
|
||||
printf "\n"
|
||||
printf " /* target specific vector. */\n"
|
||||
printf " /* target specific vector. */\n"
|
||||
printf " struct gdbarch_tdep *tdep;\n"
|
||||
printf " gdbarch_dump_tdep_ftype *dump_tdep;\n"
|
||||
printf "\n"
|
||||
printf " /* per-architecture data-pointers */\n"
|
||||
printf " /* per-architecture data-pointers. */\n"
|
||||
printf " unsigned nr_data;\n"
|
||||
printf " void **data;\n"
|
||||
printf "\n"
|
||||
printf " /* per-architecture swap-regions */\n"
|
||||
printf " /* per-architecture swap-regions. */\n"
|
||||
printf " struct gdbarch_swap *swap;\n"
|
||||
printf "\n"
|
||||
cat <<EOF
|
||||
@ -1374,7 +1374,7 @@ printf "\n"
|
||||
printf "\n"
|
||||
cat <<EOF
|
||||
/* The default architecture uses host values (for want of a better
|
||||
choice). */
|
||||
choice). */
|
||||
EOF
|
||||
printf "\n"
|
||||
printf "extern const struct bfd_arch_info bfd_default_arch_struct;\n"
|
||||
@ -1383,7 +1383,7 @@ printf "struct gdbarch startup_gdbarch =\n"
|
||||
printf "{\n"
|
||||
printf " 1, /* Always initialized. */\n"
|
||||
printf " NULL, /* The obstack. */\n"
|
||||
printf " /* basic architecture information */\n"
|
||||
printf " /* basic architecture information. */\n"
|
||||
function_list | while do_read
|
||||
do
|
||||
if class_is_info_p
|
||||
@ -1392,9 +1392,9 @@ do
|
||||
fi
|
||||
done
|
||||
cat <<EOF
|
||||
/* target specific vector and its dump routine */
|
||||
/* target specific vector and its dump routine. */
|
||||
NULL, NULL,
|
||||
/*per-architecture data-pointers and swap regions */
|
||||
/*per-architecture data-pointers and swap regions. */
|
||||
0, NULL, NULL,
|
||||
/* Multi-arch values */
|
||||
EOF
|
||||
@ -1416,7 +1416,7 @@ EOF
|
||||
cat <<EOF
|
||||
|
||||
/* Create a new \`\`struct gdbarch'' based on information provided by
|
||||
\`\`struct gdbarch_info''. */
|
||||
\`\`struct gdbarch_info''. */
|
||||
EOF
|
||||
printf "\n"
|
||||
cat <<EOF
|
||||
@ -1447,7 +1447,7 @@ do
|
||||
fi
|
||||
done
|
||||
printf "\n"
|
||||
printf " /* Force the explicit initialization of these. */\n"
|
||||
printf " /* Force the explicit initialization of these. */\n"
|
||||
function_list | while do_read
|
||||
do
|
||||
if class_is_function_p || class_is_variable_p
|
||||
@ -1521,7 +1521,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
|
||||
fprintf_unfiltered (log, "\n\tbyte-order");
|
||||
if (gdbarch->bfd_arch_info == NULL)
|
||||
fprintf_unfiltered (log, "\n\tbfd_arch_info");
|
||||
/* Check those that need to be defined for the given multi-arch level. */
|
||||
/* Check those that need to be defined for the given multi-arch level. */
|
||||
EOF
|
||||
function_list | while do_read
|
||||
do
|
||||
@ -1532,7 +1532,7 @@ do
|
||||
printf " /* Skip verify of ${function}, invalid_p == 0 */\n"
|
||||
elif class_is_predicate_p
|
||||
then
|
||||
printf " /* Skip verify of ${function}, has predicate */\n"
|
||||
printf " /* Skip verify of ${function}, has predicate. */\n"
|
||||
# FIXME: See do_read for potential simplification
|
||||
elif [ -n "${invalid_p}" -a -n "${postdefault}" ]
|
||||
then
|
||||
@ -1572,7 +1572,7 @@ EOF
|
||||
printf "\n"
|
||||
printf "\n"
|
||||
cat <<EOF
|
||||
/* Print out the details of the current architecture. */
|
||||
/* Print out the details of the current architecture. */
|
||||
|
||||
void
|
||||
gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
|
||||
@ -1751,7 +1751,7 @@ cat <<EOF
|
||||
|
||||
|
||||
/* Keep a registry of per-architecture data-pointers required by GDB
|
||||
modules. */
|
||||
modules. */
|
||||
|
||||
struct gdbarch_data
|
||||
{
|
||||
@ -1810,7 +1810,7 @@ gdbarch_data_register_post_init (gdbarch_data_post_init_ftype *post_init)
|
||||
return gdbarch_data_register (NULL, post_init);
|
||||
}
|
||||
|
||||
/* Create/delete the gdbarch data vector. */
|
||||
/* Create/delete the gdbarch data vector. */
|
||||
|
||||
static void
|
||||
alloc_gdbarch_data (struct gdbarch *gdbarch)
|
||||
@ -1821,7 +1821,7 @@ alloc_gdbarch_data (struct gdbarch *gdbarch)
|
||||
}
|
||||
|
||||
/* Initialize the current value of the specified per-architecture
|
||||
data-pointer. */
|
||||
data-pointer. */
|
||||
|
||||
void
|
||||
deprecated_set_gdbarch_data (struct gdbarch *gdbarch,
|
||||
@ -1835,7 +1835,7 @@ deprecated_set_gdbarch_data (struct gdbarch *gdbarch,
|
||||
}
|
||||
|
||||
/* Return the current value of the specified per-architecture
|
||||
data-pointer. */
|
||||
data-pointer. */
|
||||
|
||||
void *
|
||||
gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *data)
|
||||
@ -1874,7 +1874,7 @@ gdbarch_data (struct gdbarch *gdbarch, struct gdbarch_data *data)
|
||||
}
|
||||
|
||||
|
||||
/* Keep a registry of the architectures known by GDB. */
|
||||
/* Keep a registry of the architectures known by GDB. */
|
||||
|
||||
struct gdbarch_registration
|
||||
{
|
||||
@ -1899,7 +1899,7 @@ const char **
|
||||
gdbarch_printable_names (void)
|
||||
{
|
||||
/* Accumulate a list of names based on the registed list of
|
||||
architectures. */
|
||||
architectures. */
|
||||
int nr_arches = 0;
|
||||
const char **arches = NULL;
|
||||
struct gdbarch_registration *rego;
|
||||
@ -1938,17 +1938,19 @@ gdbarch_register (enum bfd_architecture bfd_architecture,
|
||||
if (bfd_arch_info == NULL)
|
||||
{
|
||||
internal_error (__FILE__, __LINE__,
|
||||
_("gdbarch: Attempt to register unknown architecture (%d)"),
|
||||
_("gdbarch: Attempt to register "
|
||||
"unknown architecture (%d)"),
|
||||
bfd_architecture);
|
||||
}
|
||||
/* Check that we haven't seen this architecture before */
|
||||
/* Check that we haven't seen this architecture before. */
|
||||
for (curr = &gdbarch_registry;
|
||||
(*curr) != NULL;
|
||||
curr = &(*curr)->next)
|
||||
{
|
||||
if (bfd_architecture == (*curr)->bfd_architecture)
|
||||
internal_error (__FILE__, __LINE__,
|
||||
_("gdbarch: Duplicate registraration of architecture (%s)"),
|
||||
_("gdbarch: Duplicate registraration "
|
||||
"of architecture (%s)"),
|
||||
bfd_arch_info->printable_name);
|
||||
}
|
||||
/* log it */
|
||||
@ -2009,7 +2011,7 @@ gdbarch_find_by_info (struct gdbarch_info info)
|
||||
defaults. */
|
||||
gdbarch_info_fill (&info);
|
||||
|
||||
/* Must have found some sort of architecture. */
|
||||
/* Must have found some sort of architecture. */
|
||||
gdb_assert (info.bfd_arch_info != NULL);
|
||||
|
||||
if (gdbarch_debug)
|
||||
|
@ -68,13 +68,14 @@ extern ULONGEST read_memory_unsigned_integer (CORE_ADDR memaddr,
|
||||
int len,
|
||||
enum bfd_endian byte_order);
|
||||
|
||||
/* Read a null-terminated string from the debuggee's memory, given address,
|
||||
* a buffer into which to place the string, and the maximum available space */
|
||||
/* Read a null-terminated string from the debuggee's memory, given
|
||||
address, a buffer into which to place the string, and the maximum
|
||||
available space. */
|
||||
|
||||
extern void read_memory_string (CORE_ADDR, char *, int);
|
||||
|
||||
/* Read the pointer of type TYPE at ADDR, and return the address it
|
||||
represents. */
|
||||
represents. */
|
||||
|
||||
CORE_ADDR read_memory_typed_address (CORE_ADDR addr, struct type *type);
|
||||
|
||||
@ -139,7 +140,7 @@ struct core_fns
|
||||
/* BFD flavour that a core file handler is prepared to read. This
|
||||
can be used by the handler's core tasting function as a first
|
||||
level filter to reject BFD's that don't have the right
|
||||
flavour. */
|
||||
flavour. */
|
||||
|
||||
enum bfd_flavour core_flavour;
|
||||
|
||||
@ -148,13 +149,13 @@ struct core_fns
|
||||
into the BFD model, or may require other resources to identify
|
||||
them, that simply aren't available to BFD (such as symbols from
|
||||
another file). Returns nonzero if the handler recognizes the
|
||||
format, zero otherwise. */
|
||||
format, zero otherwise. */
|
||||
|
||||
int (*check_format) (bfd *);
|
||||
|
||||
/* Core file handler function to call to ask if it can handle a
|
||||
given core file format or not. Returns zero if it can't,
|
||||
nonzero otherwise. */
|
||||
nonzero otherwise. */
|
||||
|
||||
int (*core_sniffer) (struct core_fns *, bfd *);
|
||||
|
||||
@ -177,7 +178,7 @@ struct core_fns
|
||||
REG_ADDR is the offset from u.u_ar0 to the register values relative to
|
||||
core_reg_sect. This is used with old-fashioned core files to locate the
|
||||
registers in a large upage-plus-stack ".reg" section. Original upage
|
||||
address X is at location core_reg_sect+x+reg_addr. */
|
||||
address X is at location core_reg_sect+x+reg_addr. */
|
||||
|
||||
void (*core_read_registers) (struct regcache *regcache,
|
||||
char *core_reg_sect,
|
||||
|
@ -52,7 +52,7 @@ struct thread_control_state
|
||||
step for a single instruction (FIXME: it might clean up
|
||||
wait_for_inferior in a minor way if this were changed to the
|
||||
address of the instruction and that address plus one. But maybe
|
||||
not.). */
|
||||
not). */
|
||||
CORE_ADDR step_range_start; /* Inclusive */
|
||||
CORE_ADDR step_range_end; /* Exclusive */
|
||||
|
||||
@ -247,10 +247,10 @@ extern void delete_thread (ptid_t);
|
||||
exited, for example. */
|
||||
extern void delete_thread_silent (ptid_t);
|
||||
|
||||
/* Delete a step_resume_breakpoint from the thread database. */
|
||||
/* Delete a step_resume_breakpoint from the thread database. */
|
||||
extern void delete_step_resume_breakpoint (struct thread_info *);
|
||||
|
||||
/* Delete an exception_resume_breakpoint from the thread database. */
|
||||
/* Delete an exception_resume_breakpoint from the thread database. */
|
||||
extern void delete_exception_resume_breakpoint (struct thread_info *);
|
||||
|
||||
/* Translate the integer thread id (GDB's homegrown id, not the system's)
|
||||
|
@ -773,7 +773,7 @@ get_discrete_bounds (struct type *type, LONGEST *lowp, LONGEST *highp)
|
||||
if (TYPE_NFIELDS (type) > 0)
|
||||
{
|
||||
/* The enums may not be sorted by value, so search all
|
||||
entries */
|
||||
entries. */
|
||||
int i;
|
||||
|
||||
*lowp = *highp = TYPE_FIELD_BITPOS (type, 0);
|
||||
@ -828,7 +828,7 @@ get_discrete_bounds (struct type *type, LONGEST *lowp, LONGEST *highp)
|
||||
and lower bound. Save the low bound into LOW_BOUND if not NULL.
|
||||
Save the high bound into HIGH_BOUND if not NULL.
|
||||
|
||||
Return 1 if the operation was successful. Return zero otherwise,
|
||||
Return 1 if the operation was successful. Return zero otherwise,
|
||||
in which case the values of LOW_BOUND and HIGH_BOUNDS are unmodified.
|
||||
|
||||
We now simply use get_discrete_bounds call to get the values
|
||||
@ -908,7 +908,7 @@ create_array_type (struct type *result_type,
|
||||
TYPE_INDEX_TYPE (result_type) = range_type;
|
||||
TYPE_VPTR_FIELDNO (result_type) = -1;
|
||||
|
||||
/* TYPE_FLAG_TARGET_STUB will take care of zero length arrays */
|
||||
/* TYPE_FLAG_TARGET_STUB will take care of zero length arrays. */
|
||||
if (TYPE_LENGTH (result_type) == 0)
|
||||
TYPE_TARGET_STUB (result_type) = 1;
|
||||
|
||||
@ -1246,7 +1246,7 @@ lookup_template_type (char *name, struct type *type,
|
||||
strcpy (nam, name);
|
||||
strcat (nam, "<");
|
||||
strcat (nam, TYPE_NAME (type));
|
||||
strcat (nam, " >"); /* FIXME, extra space still introduced in gcc? */
|
||||
strcat (nam, " >"); /* FIXME, extra space still introduced in gcc? */
|
||||
|
||||
sym = lookup_symbol (nam, block, VAR_DOMAIN, 0);
|
||||
|
||||
@ -1300,7 +1300,7 @@ lookup_struct_elt_type (struct type *type, char *name, int noerr)
|
||||
#if 0
|
||||
/* FIXME: This change put in by Michael seems incorrect for the case
|
||||
where the structure tag name is the same as the member name.
|
||||
I.E. when doing "ptype bell->bar" for "struct foo { int bar; int
|
||||
I.e. when doing "ptype bell->bar" for "struct foo { int bar; int
|
||||
foo; } bell;" Disabled by fnf. */
|
||||
{
|
||||
char *typename;
|
||||
@ -1384,7 +1384,7 @@ get_vptr_fieldno (struct type *type, struct type **basetypep)
|
||||
if (fieldno >= 0)
|
||||
{
|
||||
/* If the type comes from a different objfile we can't cache
|
||||
it, it may have a different lifetime. PR 2384 */
|
||||
it, it may have a different lifetime. PR 2384 */
|
||||
if (TYPE_OBJFILE (type) == TYPE_OBJFILE (basetype))
|
||||
{
|
||||
TYPE_VPTR_FIELDNO (type) = fieldno;
|
||||
@ -1430,7 +1430,7 @@ stub_noname_complaint (void)
|
||||
the target type.
|
||||
|
||||
If this is a stubbed struct (i.e. declared as struct foo *), see if
|
||||
we can find a full definition in some other file. If so, copy this
|
||||
we can find a full definition in some other file. If so, copy this
|
||||
definition, so we can use it in future. There used to be a comment
|
||||
(but not any code) that if we don't find a full definition, we'd
|
||||
set a flag so we don't spend time in the future checking the same
|
||||
@ -1592,7 +1592,7 @@ check_typedef (struct type *type)
|
||||
/* Now recompute the length of the array type, based on its
|
||||
number of elements and the target type's length.
|
||||
Watch out for Ada null Ada arrays where the high bound
|
||||
is smaller than the low bound. */
|
||||
is smaller than the low bound. */
|
||||
const LONGEST low_bound = TYPE_LOW_BOUND (range_type);
|
||||
const LONGEST high_bound = TYPE_HIGH_BOUND (range_type);
|
||||
ULONGEST len;
|
||||
@ -1606,12 +1606,12 @@ check_typedef (struct type *type)
|
||||
that for x < 0, (ULONGEST) x == -x + ULONGEST_MAX + 1,
|
||||
which is technically not guaranteed by C, but is usually true
|
||||
(because it would be true if x were unsigned with its
|
||||
high-order bit on). It uses the fact that
|
||||
high-order bit on). It uses the fact that
|
||||
high_bound-low_bound is always representable in
|
||||
ULONGEST and that if high_bound-low_bound+1 overflows,
|
||||
it overflows to 0. We must change these tests if we
|
||||
decide to increase the representation of TYPE_LENGTH
|
||||
from unsigned int to ULONGEST. */
|
||||
from unsigned int to ULONGEST. */
|
||||
ULONGEST ulow = low_bound, uhigh = high_bound;
|
||||
ULONGEST tlen = TYPE_LENGTH (target_type);
|
||||
|
||||
@ -1736,7 +1736,7 @@ check_stub_method (struct type *type, int method_id, int signature_id)
|
||||
argcount = 1;
|
||||
}
|
||||
|
||||
if (*p != ')') /* () means no args, skip while */
|
||||
if (*p != ')') /* () means no args, skip while. */
|
||||
{
|
||||
depth = 0;
|
||||
while (*p)
|
||||
@ -1986,7 +1986,7 @@ class_types_same_p (const struct type *a, const struct type *b)
|
||||
of DCLASS.
|
||||
Eg:
|
||||
|
||||
distance_to_ancestor (A, D, 1) = -1 */
|
||||
distance_to_ancestor (A, D, 1) = -1. */
|
||||
|
||||
static int
|
||||
distance_to_ancestor (struct type *base, struct type *dclass, int public)
|
||||
@ -2128,11 +2128,11 @@ compare_ranks (struct rank a, struct rank b)
|
||||
if (a.rank < b.rank)
|
||||
return 1;
|
||||
|
||||
/* a.rank > b.rank */
|
||||
/* a.rank > b.rank */
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Functions for overload resolution begin here */
|
||||
/* Functions for overload resolution begin here. */
|
||||
|
||||
/* Compare two badness vectors A and B and return the result.
|
||||
0 => A and B are identical
|
||||
@ -2193,7 +2193,7 @@ rank_function (struct type **parms, int nparms,
|
||||
int min_len = nparms < nargs ? nparms : nargs;
|
||||
|
||||
bv = xmalloc (sizeof (struct badness_vector));
|
||||
bv->length = nargs + 1; /* add 1 for the length-match rank */
|
||||
bv->length = nargs + 1; /* add 1 for the length-match rank. */
|
||||
bv->rank = xmalloc ((nargs + 1) * sizeof (int));
|
||||
|
||||
/* First compare the lengths of the supplied lists.
|
||||
@ -2207,11 +2207,11 @@ rank_function (struct type **parms, int nparms,
|
||||
? LENGTH_MISMATCH_BADNESS
|
||||
: EXACT_MATCH_BADNESS;
|
||||
|
||||
/* Now rank all the parameters of the candidate function */
|
||||
/* Now rank all the parameters of the candidate function. */
|
||||
for (i = 1; i <= min_len; i++)
|
||||
bv->rank[i] = rank_one_type (parms[i-1], args[i-1]);
|
||||
|
||||
/* If more arguments than parameters, add dummy entries */
|
||||
/* If more arguments than parameters, add dummy entries. */
|
||||
for (i = min_len + 1; i <= nargs; i++)
|
||||
bv->rank[i] = TOO_FEW_PARAMS_BADNESS;
|
||||
|
||||
@ -2288,12 +2288,10 @@ types_equal (struct type *a, struct type *b)
|
||||
return types_equal (TYPE_TARGET_TYPE (a),
|
||||
TYPE_TARGET_TYPE (b));
|
||||
|
||||
/*
|
||||
Well, damnit, if the names are exactly the same, I'll say they
|
||||
/* Well, damnit, if the names are exactly the same, I'll say they
|
||||
are exactly the same. This happens when we generate method
|
||||
stubs. The types won't point to the same address, but they
|
||||
really are the same.
|
||||
*/
|
||||
really are the same. */
|
||||
|
||||
if (TYPE_NAME (a) && TYPE_NAME (b)
|
||||
&& strcmp (TYPE_NAME (a), TYPE_NAME (b)) == 0)
|
||||
@ -2345,7 +2343,7 @@ rank_one_type (struct type *parm, struct type *arg)
|
||||
TYPE_NAME (arg), TYPE_CODE (arg),
|
||||
TYPE_NAME (parm), TYPE_CODE (parm));
|
||||
|
||||
/* x -> y means arg of type x being supplied for parameter of type y */
|
||||
/* x -> y means arg of type x being supplied for parameter of type y. */
|
||||
|
||||
switch (TYPE_CODE (parm))
|
||||
{
|
||||
@ -2411,7 +2409,7 @@ rank_one_type (struct type *parm, struct type *arg)
|
||||
signed and unsigned ints. */
|
||||
if (TYPE_NOSIGN (parm))
|
||||
{
|
||||
/* This case only for character types */
|
||||
/* This case only for character types. */
|
||||
if (TYPE_NOSIGN (arg))
|
||||
return EXACT_MATCH_BADNESS; /* plain char -> plain char */
|
||||
else /* signed/unsigned char -> plain char */
|
||||
@ -2602,7 +2600,7 @@ rank_one_type (struct type *parm, struct type *arg)
|
||||
}
|
||||
break;
|
||||
case TYPE_CODE_STRUCT:
|
||||
/* currently same as TYPE_CODE_CLASS */
|
||||
/* currently same as TYPE_CODE_CLASS. */
|
||||
switch (TYPE_CODE (arg))
|
||||
{
|
||||
case TYPE_CODE_STRUCT:
|
||||
@ -2665,7 +2663,7 @@ rank_one_type (struct type *parm, struct type *arg)
|
||||
}
|
||||
|
||||
|
||||
/* End of functions for overload resolution */
|
||||
/* End of functions for overload resolution. */
|
||||
|
||||
static void
|
||||
print_bit_vector (B_TYPE *bits, int nbits)
|
||||
@ -3303,7 +3301,7 @@ copy_type_recursive (struct objfile *objfile,
|
||||
}
|
||||
}
|
||||
|
||||
/* For range types, copy the bounds information. */
|
||||
/* For range types, copy the bounds information. */
|
||||
if (TYPE_CODE (type) == TYPE_CODE_RANGE)
|
||||
{
|
||||
TYPE_RANGE_DATA (new_type) = xmalloc (sizeof (struct range_bounds));
|
||||
|
113
gdb/gdbtypes.h
113
gdb/gdbtypes.h
@ -87,7 +87,7 @@ enum type_code
|
||||
TYPE_CODE_VOID,
|
||||
|
||||
TYPE_CODE_SET, /* Pascal sets */
|
||||
TYPE_CODE_RANGE, /* Range (integers within spec'd bounds) */
|
||||
TYPE_CODE_RANGE, /* Range (integers within spec'd bounds). */
|
||||
|
||||
/* A string type which is like an array of character but prints
|
||||
differently (at least for (the deleted) CHILL). It does not
|
||||
@ -190,13 +190,13 @@ enum type_instance_flag_value
|
||||
};
|
||||
|
||||
/* Unsigned integer type. If this is not set for a TYPE_CODE_INT, the
|
||||
type is signed (unless TYPE_FLAG_NOSIGN (below) is set). */
|
||||
type is signed (unless TYPE_FLAG_NOSIGN (below) is set). */
|
||||
|
||||
#define TYPE_UNSIGNED(t) (TYPE_MAIN_TYPE (t)->flag_unsigned)
|
||||
|
||||
/* No sign for this type. In C++, "char", "signed char", and "unsigned
|
||||
char" are distinct types; so we need an extra flag to indicate the
|
||||
absence of a sign! */
|
||||
absence of a sign! */
|
||||
|
||||
#define TYPE_NOSIGN(t) (TYPE_MAIN_TYPE (t)->flag_nosign)
|
||||
|
||||
@ -210,21 +210,21 @@ enum type_instance_flag_value
|
||||
be updated if it gets un-stubbed in check_typedef.
|
||||
Used for arrays and ranges, in which TYPE_LENGTH of the array/range
|
||||
gets set based on the TYPE_LENGTH of the target type.
|
||||
Also, set for TYPE_CODE_TYPEDEF. */
|
||||
Also, set for TYPE_CODE_TYPEDEF. */
|
||||
|
||||
#define TYPE_TARGET_STUB(t) (TYPE_MAIN_TYPE (t)->flag_target_stub)
|
||||
|
||||
/* Static type. If this is set, the corresponding type had
|
||||
* a static modifier.
|
||||
* Note: This may be unnecessary, since static data members
|
||||
* are indicated by other means (bitpos == -1)
|
||||
*/
|
||||
a static modifier.
|
||||
Note: This may be unnecessary, since static data members
|
||||
are indicated by other means (bitpos == -1). */
|
||||
|
||||
#define TYPE_STATIC(t) (TYPE_MAIN_TYPE (t)->flag_static)
|
||||
|
||||
/* This is a function type which appears to have a prototype. We need this
|
||||
for function calls in order to tell us if it's necessary to coerce the args,
|
||||
or to just do the standard conversions. This is used with a short field. */
|
||||
/* This is a function type which appears to have a prototype. We need
|
||||
this for function calls in order to tell us if it's necessary to
|
||||
coerce the args, or to just do the standard conversions. This is
|
||||
used with a short field. */
|
||||
|
||||
#define TYPE_PROTOTYPED(t) (TYPE_MAIN_TYPE (t)->flag_prototyped)
|
||||
|
||||
@ -234,7 +234,7 @@ enum type_instance_flag_value
|
||||
(Mostly intended for HP platforms, where class methods, for
|
||||
instance, can be encountered before their classes in the debug
|
||||
info; the incomplete type has to be marked so that the class and
|
||||
the method can be assigned correct types.) */
|
||||
the method can be assigned correct types.) */
|
||||
|
||||
#define TYPE_INCOMPLETE(t) (TYPE_MAIN_TYPE (t)->flag_incomplete)
|
||||
|
||||
@ -255,7 +255,7 @@ enum type_instance_flag_value
|
||||
connected by naming conventions. This flag indicates that the
|
||||
type is an ordinary (unencoded) GDB type that has been created from
|
||||
the necessary run-time information, and does not need further
|
||||
interpretation. Optionally marks ordinary, fixed-size GDB type. */
|
||||
interpretation. Optionally marks ordinary, fixed-size GDB type. */
|
||||
|
||||
#define TYPE_FIXED_INSTANCE(t) (TYPE_MAIN_TYPE (t)->flag_fixed_instance)
|
||||
|
||||
@ -286,14 +286,12 @@ enum type_instance_flag_value
|
||||
#define TYPE_DECLARED_CLASS(t) (TYPE_MAIN_TYPE (t)->flag_declared_class)
|
||||
|
||||
/* Constant type. If this is set, the corresponding type has a
|
||||
* const modifier.
|
||||
*/
|
||||
const modifier. */
|
||||
|
||||
#define TYPE_CONST(t) (TYPE_INSTANCE_FLAGS (t) & TYPE_INSTANCE_FLAG_CONST)
|
||||
|
||||
/* Volatile type. If this is set, the corresponding type has a
|
||||
* volatile modifier.
|
||||
*/
|
||||
volatile modifier. */
|
||||
|
||||
#define TYPE_VOLATILE(t) \
|
||||
(TYPE_INSTANCE_FLAGS (t) & TYPE_INSTANCE_FLAG_VOLATILE)
|
||||
@ -371,7 +369,7 @@ enum type_specific_kind
|
||||
|
||||
struct main_type
|
||||
{
|
||||
/* Code for kind of type */
|
||||
/* Code for kind of type. */
|
||||
|
||||
ENUM_BITFIELD(type_code) code : 8;
|
||||
|
||||
@ -447,7 +445,7 @@ struct main_type
|
||||
existing type, but to do this we need a backpointer to the objfile
|
||||
from the existing type. Yes this is somewhat ugly, but without
|
||||
major overhaul of the internal type system, it can't be avoided
|
||||
for now. */
|
||||
for now. */
|
||||
|
||||
union type_owner
|
||||
{
|
||||
@ -494,13 +492,13 @@ struct main_type
|
||||
targets, it is the bit offset to the MSB. For
|
||||
gdbarch_bits_big_endian=0 targets, it is the bit offset to
|
||||
the LSB. For a range bound or enum value, this is the
|
||||
value itself. */
|
||||
value itself. */
|
||||
|
||||
int bitpos;
|
||||
|
||||
/* For a static field, if TYPE_FIELD_STATIC_HAS_ADDR then physaddr
|
||||
is the location (in the target) of the static field.
|
||||
Otherwise, physname is the mangled label of the static field. */
|
||||
Otherwise, physname is the mangled label of the static field. */
|
||||
|
||||
CORE_ADDR physaddr;
|
||||
char *physname;
|
||||
@ -537,15 +535,15 @@ struct main_type
|
||||
char *name;
|
||||
} *fields;
|
||||
|
||||
/* Union member used for range types. */
|
||||
/* Union member used for range types. */
|
||||
|
||||
struct range_bounds
|
||||
{
|
||||
/* Low bound of range. */
|
||||
/* Low bound of range. */
|
||||
|
||||
LONGEST low;
|
||||
|
||||
/* High bound of range. */
|
||||
/* High bound of range. */
|
||||
|
||||
LONGEST high;
|
||||
|
||||
@ -580,7 +578,7 @@ struct main_type
|
||||
{
|
||||
/* CPLUS_STUFF is for TYPE_CODE_STRUCT. It is initialized to point to
|
||||
cplus_struct_default, a default static instance of a struct
|
||||
cplus_struct_type. */
|
||||
cplus_struct_type. */
|
||||
|
||||
struct cplus_struct_type *cplus_stuff;
|
||||
|
||||
@ -680,7 +678,7 @@ struct cplus_struct_type
|
||||
short n_baseclasses;
|
||||
|
||||
/* Number of methods with unique names. All overloaded methods with
|
||||
the same name count only once. */
|
||||
the same name count only once. */
|
||||
|
||||
short nfn_fields;
|
||||
|
||||
@ -710,26 +708,26 @@ struct cplus_struct_type
|
||||
class C : public B, public virtual A {};
|
||||
|
||||
B is a baseclass of C; A is a virtual baseclass for C.
|
||||
This is a C++ 2.0 language feature. */
|
||||
This is a C++ 2.0 language feature. */
|
||||
|
||||
B_TYPE *virtual_field_bits;
|
||||
|
||||
/* For classes with private fields, the number of fields is given by
|
||||
nfields and private_field_bits is a bit vector containing one bit
|
||||
per field.
|
||||
If the field is private, the corresponding bit will be set. */
|
||||
If the field is private, the corresponding bit will be set. */
|
||||
|
||||
B_TYPE *private_field_bits;
|
||||
|
||||
/* For classes with protected fields, the number of fields is given by
|
||||
nfields and protected_field_bits is a bit vector containing one bit
|
||||
per field.
|
||||
If the field is private, the corresponding bit will be set. */
|
||||
If the field is private, the corresponding bit will be set. */
|
||||
|
||||
B_TYPE *protected_field_bits;
|
||||
|
||||
/* for classes with fields to be ignored, either this is optimized out
|
||||
or this field has length 0 */
|
||||
/* For classes with fields to be ignored, either this is optimized out
|
||||
or this field has length 0. */
|
||||
|
||||
B_TYPE *ignore_field_bits;
|
||||
|
||||
@ -738,7 +736,7 @@ struct cplus_struct_type
|
||||
arguments that the method expects, and then the name after it
|
||||
has been renamed to make it distinct.
|
||||
|
||||
fn_fieldlists points to an array of nfn_fields of these. */
|
||||
fn_fieldlists points to an array of nfn_fields of these. */
|
||||
|
||||
struct fn_fieldlist
|
||||
{
|
||||
@ -771,18 +769,18 @@ struct cplus_struct_type
|
||||
|
||||
/* The function type for the method.
|
||||
(This comment used to say "The return value of the method",
|
||||
but that's wrong. The function type
|
||||
but that's wrong. The function type
|
||||
is expected here, i.e. something with TYPE_CODE_FUNC,
|
||||
and *not* the return-value type). */
|
||||
and *not* the return-value type). */
|
||||
|
||||
struct type *type;
|
||||
|
||||
/* For virtual functions.
|
||||
First baseclass that defines this virtual function. */
|
||||
First baseclass that defines this virtual function. */
|
||||
|
||||
struct type *fcontext;
|
||||
|
||||
/* Attributes. */
|
||||
/* Attributes. */
|
||||
|
||||
unsigned int is_const:1;
|
||||
unsigned int is_volatile:1;
|
||||
@ -817,8 +815,7 @@ struct cplus_struct_type
|
||||
*fn_fieldlists;
|
||||
|
||||
/* Pointer to information about enclosing scope, if this is a
|
||||
* local type. If it is not a local type, this is NULL
|
||||
*/
|
||||
local type. If it is not a local type, this is NULL. */
|
||||
struct local_type_info
|
||||
{
|
||||
char *file;
|
||||
@ -845,7 +842,7 @@ struct cplus_struct_type
|
||||
struct symbol **template_arguments;
|
||||
};
|
||||
|
||||
/* Struct used in computing virtual base list */
|
||||
/* Struct used in computing virtual base list. */
|
||||
struct vbase
|
||||
{
|
||||
struct type *vbasetype; /* pointer to virtual base */
|
||||
@ -861,12 +858,12 @@ struct rank
|
||||
rank, subrank is used to differentiate the two.
|
||||
Eg: Two derived-class-pointer to base-class-pointer conversions would
|
||||
both have base pointer conversion rank, but the conversion with the
|
||||
shorter distance to the ancestor is preferable. 'subrank' would be used
|
||||
shorter distance to the ancestor is preferable. 'subrank' would be used
|
||||
to reflect that. */
|
||||
short subrank;
|
||||
};
|
||||
|
||||
/* Struct used for ranking a function for overload resolution */
|
||||
/* Struct used for ranking a function for overload resolution. */
|
||||
struct badness_vector
|
||||
{
|
||||
int length;
|
||||
@ -883,7 +880,7 @@ struct gnat_aux_type
|
||||
};
|
||||
|
||||
/* The default value of TYPE_CPLUS_SPECIFIC(T) points to the
|
||||
this shared static structure. */
|
||||
this shared static structure. */
|
||||
|
||||
extern const struct cplus_struct_type cplus_struct_default;
|
||||
|
||||
@ -927,7 +924,7 @@ extern void allocate_gnat_aux_type (struct type *);
|
||||
calls check_typedef, TYPE_LENGTH (VALUE_TYPE (X)) is safe. */
|
||||
#define TYPE_LENGTH(thistype) (thistype)->length
|
||||
/* Note that TYPE_CODE can be TYPE_CODE_TYPEDEF, so if you want the real
|
||||
type, you need to do TYPE_CODE (check_type (this_type)). */
|
||||
type, you need to do TYPE_CODE (check_type (this_type)). */
|
||||
#define TYPE_CODE(thistype) TYPE_MAIN_TYPE(thistype)->code
|
||||
#define TYPE_NFIELDS(thistype) TYPE_MAIN_TYPE(thistype)->nfields
|
||||
#define TYPE_FIELDS(thistype) TYPE_MAIN_TYPE(thistype)->flds_bnds.fields
|
||||
@ -941,7 +938,7 @@ extern void allocate_gnat_aux_type (struct type *);
|
||||
#define TYPE_HIGH_BOUND_UNDEFINED(range_type) \
|
||||
TYPE_RANGE_DATA(range_type)->high_undefined
|
||||
|
||||
/* Moto-specific stuff for FORTRAN arrays */
|
||||
/* Moto-specific stuff for FORTRAN arrays. */
|
||||
|
||||
#define TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED(arraytype) \
|
||||
TYPE_HIGH_BOUND_UNDEFINED(TYPE_INDEX_TYPE(arraytype))
|
||||
@ -1247,12 +1244,12 @@ extern const struct floatformat *floatformats_ibm_long_double[BFD_ENDIAN_UNKNOWN
|
||||
|
||||
/* Allocate space for storing data associated with a particular type.
|
||||
We ensure that the space is allocated using the same mechanism that
|
||||
was used to allocate the space for the type structure itself. I.E.
|
||||
was used to allocate the space for the type structure itself. I.e.
|
||||
if the type is on an objfile's objfile_obstack, then the space for data
|
||||
associated with that type will also be allocated on the objfile_obstack.
|
||||
If the type is not associated with any particular objfile (such as
|
||||
builtin types), then the data space will be allocated with xmalloc,
|
||||
the same as for the type structure. */
|
||||
the same as for the type structure. */
|
||||
|
||||
#define TYPE_ALLOC(t,size) \
|
||||
(TYPE_OBJFILE_OWNED (t) \
|
||||
@ -1417,41 +1414,41 @@ extern int is_unique_ancestor (struct type *, struct value *);
|
||||
|
||||
#define LENGTH_MATCH(bv) ((bv)->rank[0])
|
||||
|
||||
/* Badness if parameter list length doesn't match arg list length */
|
||||
/* Badness if parameter list length doesn't match arg list length. */
|
||||
extern const struct rank LENGTH_MISMATCH_BADNESS;
|
||||
|
||||
/* Dummy badness value for nonexistent parameter positions */
|
||||
/* Dummy badness value for nonexistent parameter positions. */
|
||||
extern const struct rank TOO_FEW_PARAMS_BADNESS;
|
||||
/* Badness if no conversion among types */
|
||||
/* Badness if no conversion among types. */
|
||||
extern const struct rank INCOMPATIBLE_TYPE_BADNESS;
|
||||
|
||||
/* Badness of an exact match. */
|
||||
extern const struct rank EXACT_MATCH_BADNESS;
|
||||
|
||||
/* Badness of integral promotion */
|
||||
/* Badness of integral promotion. */
|
||||
extern const struct rank INTEGER_PROMOTION_BADNESS;
|
||||
/* Badness of floating promotion */
|
||||
/* Badness of floating promotion. */
|
||||
extern const struct rank FLOAT_PROMOTION_BADNESS;
|
||||
/* Badness of converting a derived class pointer
|
||||
to a base class pointer. */
|
||||
extern const struct rank BASE_PTR_CONVERSION_BADNESS;
|
||||
/* Badness of integral conversion */
|
||||
/* Badness of integral conversion. */
|
||||
extern const struct rank INTEGER_CONVERSION_BADNESS;
|
||||
/* Badness of floating conversion */
|
||||
/* Badness of floating conversion. */
|
||||
extern const struct rank FLOAT_CONVERSION_BADNESS;
|
||||
/* Badness of integer<->floating conversions */
|
||||
/* Badness of integer<->floating conversions. */
|
||||
extern const struct rank INT_FLOAT_CONVERSION_BADNESS;
|
||||
/* Badness of conversion of pointer to void pointer */
|
||||
/* Badness of conversion of pointer to void pointer. */
|
||||
extern const struct rank VOID_PTR_CONVERSION_BADNESS;
|
||||
/* Badness of conversion of pointer to boolean. */
|
||||
extern const struct rank BOOL_PTR_CONVERSION_BADNESS;
|
||||
/* Badness of converting derived to base class */
|
||||
/* Badness of converting derived to base class. */
|
||||
extern const struct rank BASE_CONVERSION_BADNESS;
|
||||
/* Badness of converting from non-reference to reference */
|
||||
/* Badness of converting from non-reference to reference. */
|
||||
extern const struct rank REFERENCE_CONVERSION_BADNESS;
|
||||
|
||||
/* Non-standard conversions allowed by the debugger */
|
||||
/* Converting a pointer to an int is usually OK */
|
||||
/* Converting a pointer to an int is usually OK. */
|
||||
extern const struct rank NS_POINTER_CONVERSION_BADNESS;
|
||||
|
||||
|
||||
|
170
gdb/gnu-nat.c
170
gdb/gnu-nat.c
@ -150,17 +150,17 @@ int proc_trace (struct proc *proc, int set);
|
||||
/* The state passed by an exception message. */
|
||||
struct exc_state
|
||||
{
|
||||
int exception; /* The exception code */
|
||||
int exception; /* The exception code. */
|
||||
int code, subcode;
|
||||
mach_port_t handler; /* The real exception port to handle this. */
|
||||
mach_port_t reply; /* The reply port from the exception call. */
|
||||
mach_port_t handler; /* The real exception port to handle this. */
|
||||
mach_port_t reply; /* The reply port from the exception call. */
|
||||
};
|
||||
|
||||
/* The results of the last wait an inf did. */
|
||||
/* The results of the last wait an inf did. */
|
||||
struct inf_wait
|
||||
{
|
||||
struct target_waitstatus status; /* The status returned to gdb. */
|
||||
struct exc_state exc; /* The exception that caused us to return. */
|
||||
struct exc_state exc; /* The exception that caused us to return. */
|
||||
struct proc *thread; /* The thread in question. */
|
||||
int suppress; /* Something trivial happened. */
|
||||
};
|
||||
@ -173,17 +173,18 @@ struct inf
|
||||
struct proc *task; /* The mach task. */
|
||||
struct proc *threads; /* A linked list of all threads in TASK. */
|
||||
|
||||
/* True if THREADS needn't be validated by querying the task. We assume that
|
||||
we and the task in question are the only ones frobbing the thread list,
|
||||
so as long as we don't let any code run, we don't have to worry about
|
||||
THREADS changing. */
|
||||
/* True if THREADS needn't be validated by querying the task. We
|
||||
assume that we and the task in question are the only ones
|
||||
frobbing the thread list, so as long as we don't let any code
|
||||
run, we don't have to worry about THREADS changing. */
|
||||
int threads_up_to_date;
|
||||
|
||||
pid_t pid; /* The real system PID. */
|
||||
pid_t pid; /* The real system PID. */
|
||||
|
||||
struct inf_wait wait; /* What to return from target_wait. */
|
||||
|
||||
/* One thread proc in INF may be in `single-stepping mode'. This is it. */
|
||||
/* One thread proc in INF may be in `single-stepping mode'. This
|
||||
is it. */
|
||||
struct proc *step_thread;
|
||||
|
||||
/* The thread we think is the signal thread. */
|
||||
@ -215,7 +216,7 @@ struct inf
|
||||
expect to happen. */
|
||||
unsigned pending_execs;
|
||||
|
||||
/* Fields describing global state */
|
||||
/* Fields describing global state. */
|
||||
|
||||
/* The task suspend count used when gdb has control. This is normally 1 to
|
||||
make things easier for us, but sometimes (like when attaching to vital
|
||||
@ -263,7 +264,7 @@ proc_update_sc (struct proc *proc)
|
||||
proc_debug (proc, "sc: %d --> %d", proc->cur_sc, proc->sc);
|
||||
|
||||
if (proc->sc == 0 && proc->state_changed)
|
||||
/* Since PROC may start running, we must write back any state changes. */
|
||||
/* Since PROC may start running, we must write back any state changes. */
|
||||
{
|
||||
gdb_assert (proc_is_thread (proc));
|
||||
proc_debug (proc, "storing back changed thread state");
|
||||
@ -433,8 +434,9 @@ _proc_get_exc_port (struct proc *proc)
|
||||
return exc_port;
|
||||
}
|
||||
|
||||
/* Replace PROC's exception port with EXC_PORT, unless it's already been
|
||||
done. Stash away any existing exception port so we can restore it later. */
|
||||
/* Replace PROC's exception port with EXC_PORT, unless it's already
|
||||
been done. Stash away any existing exception port so we can
|
||||
restore it later. */
|
||||
void
|
||||
proc_steal_exc_port (struct proc *proc, mach_port_t exc_port)
|
||||
{
|
||||
@ -458,7 +460,7 @@ proc_steal_exc_port (struct proc *proc, mach_port_t exc_port)
|
||||
mach_port_deallocate (mach_task_self (), cur_exc_port);
|
||||
}
|
||||
else
|
||||
/* Keep a copy of PROC's old exception port so it can be restored. */
|
||||
/* Keep a copy of PROC's old exception port so it can be restored. */
|
||||
{
|
||||
if (proc->saved_exc_port)
|
||||
mach_port_deallocate (mach_task_self (), proc->saved_exc_port);
|
||||
@ -514,14 +516,14 @@ proc_trace (struct proc *proc, int set)
|
||||
thread_state_t state = proc_get_state (proc, 1);
|
||||
|
||||
if (!state)
|
||||
return 0; /* the thread must be dead. */
|
||||
return 0; /* The thread must be dead. */
|
||||
|
||||
proc_debug (proc, "tracing %s", set ? "on" : "off");
|
||||
|
||||
if (set)
|
||||
{
|
||||
/* XXX We don't get the exception unless the thread has its own
|
||||
exception port???? */
|
||||
exception port???? */
|
||||
if (proc->exc_port == MACH_PORT_NULL)
|
||||
proc_steal_exc_port (proc, proc->inf->event_port);
|
||||
THREAD_STATE_SET_TRACED (state);
|
||||
@ -752,7 +754,8 @@ inf_set_pid (struct inf *inf, pid_t pid)
|
||||
error_t err = proc_pid2task (proc_server, pid, &task_port);
|
||||
|
||||
if (err)
|
||||
error (_("Error getting task for pid %d: %s"), pid, safe_strerror (err));
|
||||
error (_("Error getting task for pid %d: %s"),
|
||||
pid, safe_strerror (err));
|
||||
}
|
||||
|
||||
inf_debug (inf, "setting task: %d", task_port);
|
||||
@ -763,8 +766,8 @@ inf_set_pid (struct inf *inf, pid_t pid)
|
||||
if (task && task->port != task_port)
|
||||
{
|
||||
inf->task = 0;
|
||||
inf_validate_procs (inf); /* Trash all the threads. */
|
||||
_proc_free (task); /* And the task. */
|
||||
inf_validate_procs (inf); /* Trash all the threads. */
|
||||
_proc_free (task); /* And the task. */
|
||||
}
|
||||
|
||||
if (task_port != MACH_PORT_NULL)
|
||||
@ -907,7 +910,7 @@ inf_set_traced (struct inf *inf, int on)
|
||||
/* Makes all the real suspend count deltas of all the procs in INF
|
||||
match the desired values. Careful to always do thread/task suspend
|
||||
counts in the safe order. Returns true if at least one thread is
|
||||
thought to be running. */
|
||||
thought to be running. */
|
||||
int
|
||||
inf_update_suspends (struct inf *inf)
|
||||
{
|
||||
@ -1027,7 +1030,7 @@ inf_validate_procs (struct inf *inf)
|
||||
struct proc *matched[num_threads + 1];
|
||||
/* The last thread in INF->threads, so we can add to the end. */
|
||||
struct proc *last = 0;
|
||||
/* The current thread we're considering. */
|
||||
/* The current thread we're considering. */
|
||||
struct proc *thread = inf->threads;
|
||||
|
||||
memset (matched, 0, sizeof (matched));
|
||||
@ -1283,7 +1286,7 @@ inf_attach (struct inf *inf, int pid)
|
||||
}
|
||||
|
||||
|
||||
/* Makes sure that we've got our exception ports entrenched in the process. */
|
||||
/* Makes sure that we've got our exception ports entrenched in the process. */
|
||||
void
|
||||
inf_steal_exc_ports (struct inf *inf)
|
||||
{
|
||||
@ -1291,7 +1294,7 @@ inf_steal_exc_ports (struct inf *inf)
|
||||
|
||||
inf_debug (inf, "stealing exception ports");
|
||||
|
||||
inf_set_step_thread (inf, 0); /* The step thread is special. */
|
||||
inf_set_step_thread (inf, 0); /* The step thread is special. */
|
||||
|
||||
proc_steal_exc_port (inf->task, inf->event_port);
|
||||
for (thread = inf->threads; thread; thread = thread->next)
|
||||
@ -1306,7 +1309,7 @@ inf_restore_exc_ports (struct inf *inf)
|
||||
|
||||
inf_debug (inf, "restoring exception ports");
|
||||
|
||||
inf_set_step_thread (inf, 0); /* The step thread is special. */
|
||||
inf_set_step_thread (inf, 0); /* The step thread is special. */
|
||||
|
||||
proc_restore_exc_port (inf->task);
|
||||
for (thread = inf->threads; thread; thread = thread->next)
|
||||
@ -1383,7 +1386,7 @@ inf_signal (struct inf *inf, enum target_signal sig)
|
||||
run, and wait for it to get into a reasonable state before we
|
||||
can continue the rest of the process. When we finally resume the
|
||||
process the signal we request will be the very first thing that
|
||||
happens. */
|
||||
happens. */
|
||||
{
|
||||
inf_debug (inf, "sending %s to unstopped process"
|
||||
" (so resuming signal thread)", NAME);
|
||||
@ -1394,7 +1397,7 @@ inf_signal (struct inf *inf, enum target_signal sig)
|
||||
}
|
||||
|
||||
if (err == EIEIO)
|
||||
/* Can't do too much... */
|
||||
/* Can't do too much... */
|
||||
warning (_("Can't deliver signal %s: No signal thread."), NAME);
|
||||
else if (err)
|
||||
warning (_("Delivering signal %s: %s"), NAME, safe_strerror (err));
|
||||
@ -1439,7 +1442,7 @@ struct inf *gnu_current_inf = 0;
|
||||
multi-threaded, we don't bother to lock this. */
|
||||
struct inf *waiting_inf;
|
||||
|
||||
/* Wait for something to happen in the inferior, returning what in STATUS. */
|
||||
/* Wait for something to happen in the inferior, returning what in STATUS. */
|
||||
static ptid_t
|
||||
gnu_wait (struct target_ops *ops,
|
||||
ptid_t ptid, struct target_waitstatus *status, int options)
|
||||
@ -1483,7 +1486,7 @@ rewait:
|
||||
|
||||
if (proc_wait_pid)
|
||||
/* The proc server is single-threaded, and only allows a single
|
||||
outstanding wait request, so we have to cancel the previous one. */
|
||||
outstanding wait request, so we have to cancel the previous one. */
|
||||
{
|
||||
inf_debug (inf, "cancelling previous wait on pid %d", proc_wait_pid);
|
||||
interrupt_operation (proc_server, 0);
|
||||
@ -1501,7 +1504,7 @@ rewait:
|
||||
get any other replies, because it was either from a
|
||||
different INF, or a different process attached to INF --
|
||||
and the event port, which is the wait reply port, changes
|
||||
when you switch processes. */
|
||||
when you switch processes. */
|
||||
proc_waits_pending = 1;
|
||||
}
|
||||
}
|
||||
@ -1578,9 +1581,11 @@ rewait:
|
||||
if (--inf->pending_execs == 0)
|
||||
/* We're done! */
|
||||
{
|
||||
#if 0 /* do we need this? */
|
||||
prune_threads (1); /* Get rid of the old shell threads */
|
||||
renumber_threads (0); /* Give our threads reasonable names. */
|
||||
#if 0 /* do we need this? */
|
||||
prune_threads (1); /* Get rid of the old shell
|
||||
threads. */
|
||||
renumber_threads (0); /* Give our threads reasonable
|
||||
names. */
|
||||
#endif
|
||||
}
|
||||
inf_debug (inf, "pending exec completed, pending_execs => %d",
|
||||
@ -1619,7 +1624,9 @@ rewait:
|
||||
{
|
||||
/* TID is dead; try and find a new thread. */
|
||||
if (inf_update_procs (inf) && inf->threads)
|
||||
ptid = ptid_build (inf->pid, 0, inf->threads->tid); /* The first available thread. */
|
||||
ptid = ptid_build (inf->pid, 0, inf->threads->tid); /* The first
|
||||
available
|
||||
thread. */
|
||||
else
|
||||
ptid = inferior_ptid; /* let wait_for_inferior handle exit case */
|
||||
}
|
||||
@ -1707,7 +1714,7 @@ S_exception_raise_request (mach_port_t port, mach_port_t reply_port,
|
||||
gdb_assert (inf->task->exc_port == port);
|
||||
}
|
||||
if (inf->wait.exc.handler != MACH_PORT_NULL)
|
||||
/* Add a reference to the exception handler. */
|
||||
/* Add a reference to the exception handler. */
|
||||
mach_port_mod_refs (mach_task_self (),
|
||||
inf->wait.exc.handler, MACH_PORT_RIGHT_SEND,
|
||||
1);
|
||||
@ -1717,8 +1724,9 @@ S_exception_raise_request (mach_port_t port, mach_port_t reply_port,
|
||||
inf->wait.exc.subcode = subcode;
|
||||
inf->wait.exc.reply = reply_port;
|
||||
|
||||
/* Exceptions are encoded in the signal space by putting them after
|
||||
_NSIG; this assumes they're positive (and not extremely large)! */
|
||||
/* Exceptions are encoded in the signal space by putting
|
||||
them after _NSIG; this assumes they're positive (and not
|
||||
extremely large)! */
|
||||
inf->wait.status.value.sig =
|
||||
target_signal_from_host (_NSIG + exception);
|
||||
}
|
||||
@ -1739,7 +1747,8 @@ S_exception_raise_request (mach_port_t port, mach_port_t reply_port,
|
||||
void
|
||||
inf_task_died_status (struct inf *inf)
|
||||
{
|
||||
warning (_("Pid %d died with unknown exit status, using SIGKILL."), inf->pid);
|
||||
warning (_("Pid %d died with unknown exit status, using SIGKILL."),
|
||||
inf->pid);
|
||||
inf->wait.status.kind = TARGET_WAITKIND_SIGNALLED;
|
||||
inf->wait.status.value.sig = TARGET_SIGNAL_KILL;
|
||||
}
|
||||
@ -1781,7 +1790,7 @@ do_mach_notify_dead_name (mach_port_t notify, mach_port_t dead_port)
|
||||
}
|
||||
|
||||
mach_port_deallocate (mach_task_self (), dead_port);
|
||||
inf->threads_up_to_date = 0; /* Just in case */
|
||||
inf->threads_up_to_date = 0; /* Just in case. */
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -1855,7 +1864,8 @@ S_proc_wait_reply (mach_port_t reply, error_t err,
|
||||
{
|
||||
if (err != EINTR)
|
||||
{
|
||||
warning (_("Can't wait for pid %d: %s"), inf->pid, safe_strerror (err));
|
||||
warning (_("Can't wait for pid %d: %s"),
|
||||
inf->pid, safe_strerror (err));
|
||||
inf->no_wait = 1;
|
||||
|
||||
/* Since we can't see the inferior's signals, don't trap them. */
|
||||
@ -1961,8 +1971,8 @@ port_msgs_queued (mach_port_t port)
|
||||
|
||||
Note that a resume may not `take' if there are pending exceptions/&c
|
||||
still unprocessed from the last resume we did (any given resume may result
|
||||
in multiple events returned by wait).
|
||||
*/
|
||||
in multiple events returned by wait). */
|
||||
|
||||
static void
|
||||
gnu_resume (struct target_ops *ops,
|
||||
ptid_t ptid, int step, enum target_signal sig)
|
||||
@ -1995,7 +2005,7 @@ gnu_resume (struct target_ops *ops,
|
||||
|
||||
if (port_msgs_queued (inf->event_port))
|
||||
/* If there are still messages in our event queue, don't bother resuming
|
||||
the process, as we're just going to stop it right away anyway. */
|
||||
the process, as we're just going to stop it right away anyway. */
|
||||
return;
|
||||
|
||||
inf_update_procs (inf);
|
||||
@ -2007,7 +2017,7 @@ gnu_resume (struct target_ops *ops,
|
||||
/* Allow all threads to run, except perhaps single-stepping one. */
|
||||
{
|
||||
inf_debug (inf, "running all threads; tid = %d", PIDGET (inferior_ptid));
|
||||
ptid = inferior_ptid; /* What to step. */
|
||||
ptid = inferior_ptid; /* What to step. */
|
||||
inf_set_threads_resume_sc (inf, 0, 1);
|
||||
}
|
||||
else
|
||||
@ -2118,7 +2128,7 @@ gnu_create_inferior (struct target_ops *ops,
|
||||
inf->traced = 1;
|
||||
|
||||
/* Now let the child run again, knowing that it will stop
|
||||
immediately because of the ptrace. */
|
||||
immediately because of the ptrace. */
|
||||
inf_resume (inf);
|
||||
|
||||
/* We now have thread info. */
|
||||
@ -2193,8 +2203,8 @@ gnu_attach (struct target_ops *ops, char *args, int from_tty)
|
||||
inf_update_signal_thread (inf);
|
||||
inf_set_traced (inf, inf->want_signals);
|
||||
|
||||
#if 0 /* Do we need this? */
|
||||
renumber_threads (0); /* Give our threads reasonable names. */
|
||||
#if 0 /* Do we need this? */
|
||||
renumber_threads (0); /* Give our threads reasonable names. */
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -2230,7 +2240,7 @@ gnu_detach (struct target_ops *ops, char *args, int from_tty)
|
||||
inferior_ptid = null_ptid;
|
||||
detach_inferior (pid);
|
||||
|
||||
unpush_target (ops); /* Pop out of handling an inferior */
|
||||
unpush_target (ops); /* Pop out of handling an inferior. */
|
||||
}
|
||||
|
||||
static void
|
||||
@ -2268,12 +2278,13 @@ gnu_read_inferior (task_t task, CORE_ADDR addr, char *myaddr, int length)
|
||||
pointer_t copied;
|
||||
int copy_count;
|
||||
|
||||
/* Get memory from inferior with page aligned addresses */
|
||||
/* Get memory from inferior with page aligned addresses. */
|
||||
err = vm_read (task, low_address, aligned_length, &copied, ©_count);
|
||||
if (err)
|
||||
return 0;
|
||||
|
||||
err = hurd_safe_copyin (myaddr, (void *) (addr - low_address + copied), length);
|
||||
err = hurd_safe_copyin (myaddr, (void *) (addr - low_address + copied),
|
||||
length);
|
||||
if (err)
|
||||
{
|
||||
warning (_("Read from inferior faulted: %s"), safe_strerror (err));
|
||||
@ -2282,7 +2293,8 @@ gnu_read_inferior (task_t task, CORE_ADDR addr, char *myaddr, int length)
|
||||
|
||||
err = vm_deallocate (mach_task_self (), copied, copy_count);
|
||||
if (err)
|
||||
warning (_("gnu_read_inferior vm_deallocate failed: %s"), safe_strerror (err));
|
||||
warning (_("gnu_read_inferior vm_deallocate failed: %s"),
|
||||
safe_strerror (err));
|
||||
|
||||
return length;
|
||||
}
|
||||
@ -2318,7 +2330,7 @@ gnu_write_inferior (task_t task, CORE_ADDR addr, char *myaddr, int length)
|
||||
struct vm_region_list *region_element;
|
||||
struct vm_region_list *region_head = (struct vm_region_list *) NULL;
|
||||
|
||||
/* Get memory from inferior with page aligned addresses */
|
||||
/* Get memory from inferior with page aligned addresses. */
|
||||
err = vm_read (task,
|
||||
low_address,
|
||||
aligned_length,
|
||||
@ -2364,7 +2376,7 @@ gnu_write_inferior (task_t task, CORE_ADDR addr, char *myaddr, int length)
|
||||
&offset);
|
||||
CHK_GOTO_OUT ("vm_region failed", err);
|
||||
|
||||
/* Check for holes in memory */
|
||||
/* Check for holes in memory. */
|
||||
if (old_address != region_address)
|
||||
{
|
||||
warning (_("No memory at 0x%x. Nothing written"),
|
||||
@ -2376,14 +2388,15 @@ gnu_write_inferior (task_t task, CORE_ADDR addr, char *myaddr, int length)
|
||||
|
||||
if (!(max_protection & VM_PROT_WRITE))
|
||||
{
|
||||
warning (_("Memory at address 0x%x is unwritable. Nothing written"),
|
||||
warning (_("Memory at address 0x%x is unwritable. "
|
||||
"Nothing written"),
|
||||
old_address);
|
||||
err = KERN_SUCCESS;
|
||||
length = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* Chain the regions for later use */
|
||||
/* Chain the regions for later use. */
|
||||
region_element =
|
||||
(struct vm_region_list *)
|
||||
obstack_alloc (®ion_obstack, sizeof (struct vm_region_list));
|
||||
@ -2392,7 +2405,7 @@ gnu_write_inferior (task_t task, CORE_ADDR addr, char *myaddr, int length)
|
||||
region_element->start = region_address;
|
||||
region_element->length = region_length;
|
||||
|
||||
/* Chain the regions along with protections */
|
||||
/* Chain the regions along with protections. */
|
||||
region_element->next = region_head;
|
||||
region_head = region_element;
|
||||
|
||||
@ -2403,7 +2416,7 @@ gnu_write_inferior (task_t task, CORE_ADDR addr, char *myaddr, int length)
|
||||
/* If things fail after this, we give up.
|
||||
Somebody is messing up inferior_task's mappings. */
|
||||
|
||||
/* Enable writes to the chained vm regions */
|
||||
/* Enable writes to the chained vm regions. */
|
||||
for (scan = region_head; scan; scan = scan->next)
|
||||
{
|
||||
if (!(scan->protection & VM_PROT_WRITE))
|
||||
@ -2423,7 +2436,7 @@ gnu_write_inferior (task_t task, CORE_ADDR addr, char *myaddr, int length)
|
||||
aligned_length);
|
||||
CHK_GOTO_OUT ("vm_write failed", err);
|
||||
|
||||
/* Set up the original region protections, if they were changed */
|
||||
/* Set up the original region protections, if they were changed. */
|
||||
for (scan = region_head; scan; scan = scan->next)
|
||||
{
|
||||
if (!(scan->protection & VM_PROT_WRITE))
|
||||
@ -2459,7 +2472,7 @@ out:
|
||||
|
||||
|
||||
/* Return 0 on failure, number of bytes handled otherwise. TARGET
|
||||
is ignored. */
|
||||
is ignored. */
|
||||
static int
|
||||
gnu_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int write,
|
||||
struct mem_attrib *attrib,
|
||||
@ -2645,25 +2658,29 @@ struct cmd_list_element *show_thread_default_cmd_list = NULL;
|
||||
static void
|
||||
set_thread_cmd (char *args, int from_tty)
|
||||
{
|
||||
printf_unfiltered ("\"set thread\" must be followed by the name of a thread property, or \"default\".\n");
|
||||
printf_unfiltered ("\"set thread\" must be followed by the "
|
||||
"name of a thread property, or \"default\".\n");
|
||||
}
|
||||
|
||||
static void
|
||||
show_thread_cmd (char *args, int from_tty)
|
||||
{
|
||||
printf_unfiltered ("\"show thread\" must be followed by the name of a thread property, or \"default\".\n");
|
||||
printf_unfiltered ("\"show thread\" must be followed by the "
|
||||
"name of a thread property, or \"default\".\n");
|
||||
}
|
||||
|
||||
static void
|
||||
set_thread_default_cmd (char *args, int from_tty)
|
||||
{
|
||||
printf_unfiltered ("\"set thread default\" must be followed by the name of a thread property.\n");
|
||||
printf_unfiltered ("\"set thread default\" must be followed "
|
||||
"by the name of a thread property.\n");
|
||||
}
|
||||
|
||||
static void
|
||||
show_thread_default_cmd (char *args, int from_tty)
|
||||
{
|
||||
printf_unfiltered ("\"show thread default\" must be followed by the name of a thread property.\n");
|
||||
printf_unfiltered ("\"show thread default\" must be followed "
|
||||
"by the name of a thread property.\n");
|
||||
}
|
||||
|
||||
static int
|
||||
@ -2677,7 +2694,8 @@ parse_int_arg (char *args, char *cmd_prefix)
|
||||
if (*args && *arg_end == '\0')
|
||||
return val;
|
||||
}
|
||||
error (_("Illegal argument for \"%s\" command, should be an integer."), cmd_prefix);
|
||||
error (_("Illegal argument for \"%s\" command, should be an integer."),
|
||||
cmd_prefix);
|
||||
}
|
||||
|
||||
static int
|
||||
@ -2688,7 +2706,8 @@ _parse_bool_arg (char *args, char *t_val, char *f_val, char *cmd_prefix)
|
||||
else if (strcmp (args, f_val) == 0)
|
||||
return 0;
|
||||
else
|
||||
error (_("Illegal argument for \"%s\" command, should be \"%s\" or \"%s\"."),
|
||||
error (_("Illegal argument for \"%s\" command, "
|
||||
"should be \"%s\" or \"%s\"."),
|
||||
cmd_prefix, t_val, f_val);
|
||||
}
|
||||
|
||||
@ -2755,14 +2774,16 @@ show_task_pause_cmd (char *args, int from_tty)
|
||||
static void
|
||||
set_task_detach_sc_cmd (char *args, int from_tty)
|
||||
{
|
||||
cur_inf ()->detach_sc = parse_int_arg (args, "set task detach-suspend-count");
|
||||
cur_inf ()->detach_sc = parse_int_arg (args,
|
||||
"set task detach-suspend-count");
|
||||
}
|
||||
|
||||
static void
|
||||
show_task_detach_sc_cmd (char *args, int from_tty)
|
||||
{
|
||||
check_empty (args, "show task detach-suspend-count");
|
||||
printf_unfiltered ("The inferior task will be left with a suspend count of %d when detaching.\n",
|
||||
printf_unfiltered ("The inferior task will be left with a "
|
||||
"suspend count of %d when detaching.\n",
|
||||
cur_inf ()->detach_sc);
|
||||
}
|
||||
|
||||
@ -2849,8 +2870,9 @@ steal_exc_port (struct proc *proc, mach_port_t name)
|
||||
proc->saved_exc_port = port;
|
||||
|
||||
if (!proc->exc_port)
|
||||
/* If PROC is a thread, we may not have set its exception port before.
|
||||
We can't use proc_steal_exc_port because it also sets saved_exc_port. */
|
||||
/* If PROC is a thread, we may not have set its exception port
|
||||
before. We can't use proc_steal_exc_port because it also sets
|
||||
saved_exc_port. */
|
||||
{
|
||||
proc->exc_port = proc->inf->event_port;
|
||||
err = proc_set_exception_port (proc, proc->exc_port);
|
||||
@ -2901,7 +2923,8 @@ set_sig_thread_cmd (char *args, int from_tty)
|
||||
int tid = ptid_get_tid (thread_id_to_pid (atoi (args)));
|
||||
|
||||
if (tid < 0)
|
||||
error (_("Thread ID %s not known. Use the \"info threads\" command to\n"
|
||||
error (_("Thread ID %s not known. "
|
||||
"Use the \"info threads\" command to\n"
|
||||
"see the IDs of currently known threads."), args);
|
||||
inf->signal_thread = inf_tid_to_thread (inf, tid);
|
||||
}
|
||||
@ -3171,7 +3194,8 @@ used to pause individual threads by default instead."),
|
||||
_("Set the suspend count will leave on the thread when detaching."),
|
||||
&set_task_cmd_list);
|
||||
add_cmd ("detach-suspend-count", no_class, show_task_detach_sc_cmd,
|
||||
_("Show the suspend count will leave on the thread when detaching."),
|
||||
_("Show the suspend count will leave "
|
||||
"on the thread when detaching."),
|
||||
&show_task_cmd_list);
|
||||
|
||||
add_cmd ("exception-port", no_class, set_task_exc_port_cmd, _("\
|
||||
@ -3409,7 +3433,7 @@ _initialize_gnu_nat (void)
|
||||
/* When over-writing code on some machines the I-Cache must be flushed
|
||||
explicitly, because it is not kept coherent by the lazy hardware.
|
||||
This definitely includes breakpoints, for instance, or else we
|
||||
end up looping in mysterious Bpt traps */
|
||||
end up looping in mysterious Bpt traps. */
|
||||
|
||||
void
|
||||
flush_inferior_icache (CORE_ADDR pc, int amount)
|
||||
|
@ -46,18 +46,18 @@ struct proc
|
||||
|
||||
int sc; /* Desired suspend count. */
|
||||
int cur_sc; /* Implemented suspend count. */
|
||||
int run_sc; /* Default sc when the program is running. */
|
||||
int pause_sc; /* Default sc when gdb has control. */
|
||||
int resume_sc; /* Sc resulting from the last resume. */
|
||||
int run_sc; /* Default sc when the program is running. */
|
||||
int pause_sc; /* Default sc when gdb has control. */
|
||||
int resume_sc; /* Sc resulting from the last resume. */
|
||||
int detach_sc; /* SC to leave around when detaching
|
||||
from program. */
|
||||
from program. */
|
||||
|
||||
thread_state_data_t state; /* Registers, &c. */
|
||||
int state_valid:1; /* True if STATE is up to date. */
|
||||
thread_state_data_t state; /* Registers, &c. */
|
||||
int state_valid:1; /* True if STATE is up to date. */
|
||||
int state_changed:1;
|
||||
|
||||
int aborted:1; /* True if thread_abort has been called. */
|
||||
int dead:1; /* We happen to know it's actually dead. */
|
||||
int dead:1; /* We happen to know it's actually dead. */
|
||||
|
||||
/* Bit mask of registers fetched by gdb. This is used when we re-fetch
|
||||
STATE after aborting the thread, to detect that gdb may have out-of-date
|
||||
@ -96,7 +96,8 @@ extern int gnu_debug_flag;
|
||||
|
||||
#define debug(msg, args...) \
|
||||
do { if (gnu_debug_flag) \
|
||||
fprintf_unfiltered (gdb_stdlog, "%s:%d: " msg "\r\n", __FILE__ , __LINE__ , ##args); } while (0)
|
||||
fprintf_unfiltered (gdb_stdlog, "%s:%d: " msg "\r\n", \
|
||||
__FILE__ , __LINE__ , ##args); } while (0)
|
||||
|
||||
/* Create a prototype generic GNU/Hurd target. The client can
|
||||
override it with local methods. */
|
||||
|
@ -133,12 +133,12 @@ gnuv2_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j,
|
||||
context_vptr_basetype);
|
||||
|
||||
/* With older versions of g++, the vtbl field pointed to an array
|
||||
of structures. Nowadays it points directly to the structure. */
|
||||
of structures. Nowadays it points directly to the structure. */
|
||||
if (TYPE_CODE (value_type (vtbl)) == TYPE_CODE_PTR
|
||||
&& TYPE_CODE (TYPE_TARGET_TYPE (value_type (vtbl))) == TYPE_CODE_ARRAY)
|
||||
{
|
||||
/* Handle the case where the vtbl field points to an
|
||||
array of structures. */
|
||||
array of structures. */
|
||||
vtbl = value_ind (vtbl);
|
||||
|
||||
/* Index into the virtual function table. This is hard-coded because
|
||||
@ -149,7 +149,8 @@ gnuv2_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j,
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Handle the case where the vtbl field points directly to a structure. */
|
||||
/* Handle the case where the vtbl field points directly to a
|
||||
structure. */
|
||||
vtbl = value_ptradd (vtbl, vi);
|
||||
entry = value_ind (vtbl);
|
||||
}
|
||||
@ -158,8 +159,9 @@ gnuv2_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j,
|
||||
|
||||
if (TYPE_CODE (entry_type) == TYPE_CODE_STRUCT)
|
||||
{
|
||||
/* Move the `this' pointer according to the virtual function table. */
|
||||
set_value_offset (arg1, value_offset (arg1) + value_as_long (value_field (entry, 0)));
|
||||
/* Move the `this' pointer according to the virtual function table. */
|
||||
set_value_offset (arg1, value_offset (arg1)
|
||||
+ value_as_long (value_field (entry, 0)));
|
||||
|
||||
if (!value_lazy (arg1))
|
||||
{
|
||||
@ -174,7 +176,8 @@ gnuv2_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j,
|
||||
else
|
||||
error (_("I'm confused: virtual function table has bad type"));
|
||||
/* Reinstantiate the function pointer with the correct type. */
|
||||
deprecated_set_value_type (vfn, lookup_pointer_type (TYPE_FN_FIELD_TYPE (f, j)));
|
||||
deprecated_set_value_type (vfn,
|
||||
lookup_pointer_type (TYPE_FN_FIELD_TYPE (f, j)));
|
||||
|
||||
*arg1p = arg1;
|
||||
return vfn;
|
||||
@ -200,10 +203,10 @@ gnuv2_value_rtti_type (struct value *v, int *full, int *top, int *using_enc)
|
||||
if (using_enc)
|
||||
*using_enc = 0;
|
||||
|
||||
/* Get declared type */
|
||||
/* Get declared type. */
|
||||
known_type = value_type (v);
|
||||
CHECK_TYPEDEF (known_type);
|
||||
/* RTTI works only or class objects */
|
||||
/* RTTI works only or class objects. */
|
||||
if (TYPE_CODE (known_type) != TYPE_CODE_CLASS)
|
||||
return NULL;
|
||||
|
||||
@ -221,8 +224,7 @@ gnuv2_value_rtti_type (struct value *v, int *full, int *top, int *using_enc)
|
||||
return NULL;
|
||||
|
||||
/* Make sure our basetype and known type match, otherwise, cast
|
||||
so we can get at the vtable properly.
|
||||
*/
|
||||
so we can get at the vtable properly. */
|
||||
btype = known_type_vptr_basetype;
|
||||
CHECK_TYPEDEF (btype);
|
||||
if (btype != known_type )
|
||||
@ -231,31 +233,29 @@ gnuv2_value_rtti_type (struct value *v, int *full, int *top, int *using_enc)
|
||||
if (using_enc)
|
||||
*using_enc=1;
|
||||
}
|
||||
/*
|
||||
We can't use value_ind here, because it would want to use RTTI, and
|
||||
we'd waste a bunch of time figuring out we already know the type.
|
||||
Besides, we don't care about the type, just the actual pointer
|
||||
*/
|
||||
/* We can't use value_ind here, because it would want to use RTTI, and
|
||||
we'd waste a bunch of time figuring out we already know the type.
|
||||
Besides, we don't care about the type, just the actual pointer. */
|
||||
if (value_address (value_field (v, known_type_vptr_fieldno)) == 0)
|
||||
return NULL;
|
||||
|
||||
vtbl = value_as_address (value_field (v, known_type_vptr_fieldno));
|
||||
|
||||
/* Try to find a symbol that is the vtable */
|
||||
/* Try to find a symbol that is the vtable. */
|
||||
minsym=lookup_minimal_symbol_by_pc(vtbl);
|
||||
if (minsym==NULL
|
||||
|| (demangled_name=SYMBOL_LINKAGE_NAME (minsym))==NULL
|
||||
|| !is_vtable_name (demangled_name))
|
||||
return NULL;
|
||||
|
||||
/* If we just skip the prefix, we get screwed by namespaces */
|
||||
/* If we just skip the prefix, we get screwed by namespaces. */
|
||||
demangled_name=cplus_demangle(demangled_name,DMGL_PARAMS|DMGL_ANSI);
|
||||
p = strchr (demangled_name, ' ');
|
||||
if (p)
|
||||
*p = '\0';
|
||||
|
||||
/* Lookup the type for the name */
|
||||
/* FIXME: chastain/2003-11-26: block=NULL is bogus. See pr gdb/1465. */
|
||||
/* Lookup the type for the name. */
|
||||
/* FIXME: chastain/2003-11-26: block=NULL is bogus. See pr gdb/1465. */
|
||||
rtti_type = cp_lookup_rtti_type (demangled_name, NULL);
|
||||
if (rtti_type == NULL)
|
||||
return NULL;
|
||||
@ -263,7 +263,8 @@ gnuv2_value_rtti_type (struct value *v, int *full, int *top, int *using_enc)
|
||||
if (TYPE_N_BASECLASSES(rtti_type) > 1 && full && (*full) != 1)
|
||||
{
|
||||
if (top)
|
||||
*top=TYPE_BASECLASS_BITPOS(rtti_type,TYPE_VPTR_FIELDNO(rtti_type))/8;
|
||||
*top = TYPE_BASECLASS_BITPOS (rtti_type,
|
||||
TYPE_VPTR_FIELDNO(rtti_type)) / 8;
|
||||
if (top && ((*top) >0))
|
||||
{
|
||||
if (TYPE_LENGTH(rtti_type) > TYPE_LENGTH(known_type))
|
||||
@ -339,7 +340,7 @@ vb_match (struct type *type, int index, struct type *basetype)
|
||||
The result is the offset of the baseclass value relative
|
||||
to (the address of)(ARG) + OFFSET.
|
||||
|
||||
-1 is returned on error. */
|
||||
-1 is returned on error. */
|
||||
|
||||
static int
|
||||
gnuv2_baseclass_offset (struct type *type, int index,
|
||||
|
@ -265,7 +265,8 @@ gnuv3_get_vtable (struct gdbarch *gdbarch,
|
||||
/* Correct it to point at the start of the virtual table, rather
|
||||
than the address point. */
|
||||
return value_at_lazy (vtable_type,
|
||||
vtable_address - vtable_address_point_offset (gdbarch));
|
||||
vtable_address
|
||||
- vtable_address_point_offset (gdbarch));
|
||||
}
|
||||
|
||||
|
||||
@ -322,7 +323,7 @@ gnuv3_rtti_type (struct value *value,
|
||||
class_name = vtable_symbol_name + 11;
|
||||
|
||||
/* Try to look up the class name as a type name. */
|
||||
/* FIXME: chastain/2003-11-26: block=NULL is bogus. See pr gdb/1465. */
|
||||
/* FIXME: chastain/2003-11-26: block=NULL is bogus. See pr gdb/1465. */
|
||||
run_time_type = cp_lookup_rtti_type (class_name, NULL);
|
||||
if (run_time_type == NULL)
|
||||
return NULL;
|
||||
@ -407,7 +408,8 @@ gnuv3_virtual_fn_field (struct value **value_p,
|
||||
The result is the offset of the baseclass value relative
|
||||
to (the address of)(ARG) + OFFSET.
|
||||
|
||||
-1 is returned on error. */
|
||||
-1 is returned on error. */
|
||||
|
||||
static int
|
||||
gnuv3_baseclass_offset (struct type *type, int index, const bfd_byte *valaddr,
|
||||
CORE_ADDR address)
|
||||
@ -825,7 +827,8 @@ gnuv3_pass_by_reference (struct type *type)
|
||||
a reference to this class, then it is a copy constructor. */
|
||||
if (TYPE_NFIELDS (fieldtype) == 2
|
||||
&& TYPE_CODE (TYPE_FIELD_TYPE (fieldtype, 1)) == TYPE_CODE_REF
|
||||
&& check_typedef (TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (fieldtype, 1))) == type)
|
||||
&& check_typedef (TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (fieldtype,
|
||||
1))) == type)
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -847,7 +850,8 @@ gnuv3_pass_by_reference (struct type *type)
|
||||
static void
|
||||
init_gnuv3_ops (void)
|
||||
{
|
||||
vtable_type_gdbarch_data = gdbarch_data_register_post_init (build_gdb_vtable_type);
|
||||
vtable_type_gdbarch_data
|
||||
= gdbarch_data_register_post_init (build_gdb_vtable_type);
|
||||
|
||||
gnu_v3_abi_ops.shortname = "gnu-v3";
|
||||
gnu_v3_abi_ops.longname = "GNU G++ Version 3 ABI";
|
||||
|
@ -121,8 +121,8 @@
|
||||
#include <langinfo.h>
|
||||
|
||||
#if __DJGPP_MINOR__ < 3
|
||||
/* This code will be provided from DJGPP 2.03 on. Until then I code it
|
||||
here */
|
||||
/* This code will be provided from DJGPP 2.03 on. Until then I code it
|
||||
here. */
|
||||
typedef struct
|
||||
{
|
||||
unsigned short sig0;
|
||||
@ -149,8 +149,8 @@ NPX;
|
||||
|
||||
static NPX npx;
|
||||
|
||||
static void save_npx (void); /* Save the FPU of the debugged program */
|
||||
static void load_npx (void); /* Restore the FPU of the debugged program */
|
||||
static void save_npx (void); /* Save the FPU of the debugged program. */
|
||||
static void load_npx (void); /* Restore the FPU of the debugged program. */
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
/* Store the contents of the NPX in the global variable `npx'. */
|
||||
@ -423,7 +423,7 @@ go32_wait (struct target_ops *ops,
|
||||
unsigned long INT3_addr = 0;
|
||||
int stepping_over_INT = 0;
|
||||
|
||||
a_tss.tss_eflags &= 0xfeff; /* reset the single-step flag (TF) */
|
||||
a_tss.tss_eflags &= 0xfeff; /* Reset the single-step flag (TF). */
|
||||
if (resume_is_step)
|
||||
{
|
||||
/* If the next instruction is INT xx or INTO, we need to handle
|
||||
@ -464,7 +464,7 @@ go32_wait (struct target_ops *ops,
|
||||
}
|
||||
else
|
||||
{
|
||||
a_tss.tss_trap = 0xffff; /* run_child looks for this */
|
||||
a_tss.tss_trap = 0xffff; /* run_child looks for this. */
|
||||
a_tss.tss_irqn = resume_signal;
|
||||
}
|
||||
|
||||
@ -477,7 +477,7 @@ go32_wait (struct target_ops *ops,
|
||||
run it. */
|
||||
/* Initialize child_cwd, before the first call to run_child and not
|
||||
in the initialization, so the child get also the changed directory
|
||||
set with the gdb-command "cd ..." */
|
||||
set with the gdb-command "cd ..." */
|
||||
if (!*child_cwd)
|
||||
/* Initialize child's cwd with the current one. */
|
||||
getcwd (child_cwd, sizeof (child_cwd));
|
||||
@ -496,7 +496,7 @@ go32_wait (struct target_ops *ops,
|
||||
if (stepping_over_INT && a_tss.tss_eip == INT3_addr + 1)
|
||||
{
|
||||
/* Restore the original opcode. */
|
||||
a_tss.tss_eip--; /* EIP points *after* the INT3 instruction */
|
||||
a_tss.tss_eip--; /* EIP points *after* the INT3 instruction. */
|
||||
write_child (a_tss.tss_eip, &saved_opcode, 1);
|
||||
/* Simulate a TRAP exception. */
|
||||
a_tss.tss_irqn = 1;
|
||||
@ -540,7 +540,8 @@ fetch_register (struct regcache *regcache, int regno)
|
||||
if (regno < gdbarch_fp0_regnum (gdbarch))
|
||||
regcache_raw_supply (regcache, regno,
|
||||
(char *) &a_tss + regno_mapping[regno].tss_ofs);
|
||||
else if (i386_fp_regnum_p (gdbarch, regno) || i386_fpc_regnum_p (gdbarch, regno))
|
||||
else if (i386_fp_regnum_p (gdbarch, regno) || i386_fpc_regnum_p (gdbarch,
|
||||
regno))
|
||||
i387_supply_fsave (regcache, regno, &npx);
|
||||
else
|
||||
internal_error (__FILE__, __LINE__,
|
||||
@ -570,7 +571,8 @@ store_register (const struct regcache *regcache, int regno)
|
||||
if (regno < gdbarch_fp0_regnum (gdbarch))
|
||||
regcache_raw_collect (regcache, regno,
|
||||
(char *) &a_tss + regno_mapping[regno].tss_ofs);
|
||||
else if (i386_fp_regnum_p (gdbarch, regno) || i386_fpc_regnum_p (gdbarch, regno))
|
||||
else if (i386_fp_regnum_p (gdbarch, regno) || i386_fpc_regnum_p (gdbarch,
|
||||
regno))
|
||||
i387_collect_fsave (regcache, regno, &npx);
|
||||
else
|
||||
internal_error (__FILE__, __LINE__,
|
||||
@ -626,7 +628,7 @@ go32_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int write,
|
||||
}
|
||||
}
|
||||
|
||||
static cmdline_t child_cmd; /* parsed child's command line kept here */
|
||||
static cmdline_t child_cmd; /* Parsed child's command line kept here. */
|
||||
|
||||
static void
|
||||
go32_files_info (struct target_ops *target)
|
||||
@ -666,7 +668,8 @@ go32_create_inferior (struct target_ops *ops, char *exec_file,
|
||||
/* Init command line storage. */
|
||||
if (redir_debug_init (&child_cmd) == -1)
|
||||
internal_error (__FILE__, __LINE__,
|
||||
_("Cannot allocate redirection storage: not enough memory.\n"));
|
||||
_("Cannot allocate redirection storage: "
|
||||
"not enough memory.\n"));
|
||||
|
||||
/* Parse the command line and create redirections. */
|
||||
if (strpbrk (args, "<>"))
|
||||
@ -696,7 +699,7 @@ go32_create_inferior (struct target_ops *ops, char *exec_file,
|
||||
cmdline[cmdlen + 1] = 13;
|
||||
}
|
||||
else
|
||||
cmdline[0] = 0xff; /* signal v2loadimage it's a long command */
|
||||
cmdline[0] = 0xff; /* Signal v2loadimage it's a long command. */
|
||||
|
||||
environ = env;
|
||||
|
||||
@ -819,11 +822,11 @@ device_mode (int fd, int raw_p)
|
||||
else
|
||||
newmode &= ~0x20;
|
||||
|
||||
if (oldmode & 0x80) /* Only for character dev */
|
||||
if (oldmode & 0x80) /* Only for character dev. */
|
||||
{
|
||||
regs.x.ax = 0x4401;
|
||||
regs.x.bx = fd;
|
||||
regs.x.dx = newmode & 0xff; /* Force upper byte zero, else it fails */
|
||||
regs.x.dx = newmode & 0xff; /* Force upper byte zero, else it fails. */
|
||||
__dpmi_int (0x21, ®s);
|
||||
if (regs.x.flags & 1)
|
||||
return -1;
|
||||
@ -844,7 +847,7 @@ static int terminal_is_ours = 1;
|
||||
static void
|
||||
go32_terminal_init (void)
|
||||
{
|
||||
inf_mode_valid = 0; /* reinitialize, in case they are restarting child */
|
||||
inf_mode_valid = 0; /* Reinitialize, in case they are restarting child. */
|
||||
terminal_is_ours = 1;
|
||||
}
|
||||
|
||||
@ -889,8 +892,8 @@ go32_terminal_inferior (void)
|
||||
error (_("Cannot redirect standard handles for program: %s."),
|
||||
safe_strerror (errno));
|
||||
}
|
||||
/* set the console device of the inferior to whatever mode
|
||||
(raw or cooked) we found it last time */
|
||||
/* Set the console device of the inferior to whatever mode
|
||||
(raw or cooked) we found it last time. */
|
||||
if (terminal_is_ours)
|
||||
{
|
||||
if (inf_mode_valid)
|
||||
@ -903,7 +906,7 @@ static void
|
||||
go32_terminal_ours (void)
|
||||
{
|
||||
/* Switch to cooked mode on the gdb terminal and save the inferior
|
||||
terminal mode to be restored when it is resumed */
|
||||
terminal mode to be restored when it is resumed. */
|
||||
if (!terminal_is_ours)
|
||||
{
|
||||
inf_terminal_mode = device_mode (0, 0);
|
||||
@ -994,7 +997,8 @@ init_go32_ops (void)
|
||||
/* Initialize child's command line storage. */
|
||||
if (redir_debug_init (&child_cmd) == -1)
|
||||
internal_error (__FILE__, __LINE__,
|
||||
_("Cannot allocate redirection storage: not enough memory.\n"));
|
||||
_("Cannot allocate redirection storage: "
|
||||
"not enough memory.\n"));
|
||||
|
||||
/* We are always processing GCC-compiled programs. */
|
||||
processing_gcc_compilation = 2;
|
||||
@ -1032,7 +1036,7 @@ nl_langinfo (nl_item item)
|
||||
int blen = sizeof (buf);
|
||||
int needed = snprintf (buf, blen, "CP%d", dos_codepage ());
|
||||
|
||||
if (needed > blen) /* should never happen */
|
||||
if (needed > blen) /* Should never happen. */
|
||||
buf[0] = 0;
|
||||
retval = xstrdup (buf);
|
||||
}
|
||||
@ -1256,7 +1260,7 @@ go32_sysinfo (char *arg, int from_tty)
|
||||
/* We only list features which might be useful in the DPMI
|
||||
environment. */
|
||||
if ((cpuid_edx & 1) == 0)
|
||||
puts_filtered ("No FPU "); /* it's unusual to not have an FPU */
|
||||
puts_filtered ("No FPU "); /* It's unusual to not have an FPU. */
|
||||
if ((cpuid_edx & (1 << 1)) != 0)
|
||||
puts_filtered ("VME ");
|
||||
if ((cpuid_edx & (1 << 2)) != 0)
|
||||
@ -1325,7 +1329,8 @@ go32_sysinfo (char *arg, int from_tty)
|
||||
printf_filtered ("%s)\n", windows_flavor);
|
||||
}
|
||||
else if (true_dos_version == 0x532 && advertized_dos_version == 0x500)
|
||||
printf_filtered ("Windows Version................Windows NT family (W2K/XP/W2K3/Vista/W2K8)\n");
|
||||
printf_filtered ("Windows Version................"
|
||||
"Windows NT family (W2K/XP/W2K3/Vista/W2K8)\n");
|
||||
puts_filtered ("\n");
|
||||
/* On some versions of Windows, __dpmi_get_capabilities returns
|
||||
zero, but the buffer is not filled with info, so we fill the
|
||||
@ -1341,7 +1346,8 @@ go32_sysinfo (char *arg, int from_tty)
|
||||
I don't trust the vendors to follow that... */
|
||||
if (!memchr (&dpmi_vendor_info[2], 0, 126))
|
||||
dpmi_vendor_info[128] = '\0';
|
||||
printf_filtered ("DPMI Host......................%s v%d.%d (capabilities: %#x)\n",
|
||||
printf_filtered ("DPMI Host......................"
|
||||
"%s v%d.%d (capabilities: %#x)\n",
|
||||
&dpmi_vendor_info[2],
|
||||
(unsigned)dpmi_vendor_info[0],
|
||||
(unsigned)dpmi_vendor_info[1],
|
||||
@ -1352,7 +1358,8 @@ go32_sysinfo (char *arg, int from_tty)
|
||||
__dpmi_get_version (&dpmi_version_data);
|
||||
printf_filtered ("DPMI Version...................%d.%02d\n",
|
||||
dpmi_version_data.major, dpmi_version_data.minor);
|
||||
printf_filtered ("DPMI Info......................%s-bit DPMI, with%s Virtual Memory support\n",
|
||||
printf_filtered ("DPMI Info......................"
|
||||
"%s-bit DPMI, with%s Virtual Memory support\n",
|
||||
(dpmi_version_data.flags & 1) ? "32" : "16",
|
||||
(dpmi_version_data.flags & 4) ? "" : "out");
|
||||
printfi_filtered (31, "Interrupts reflected to %s mode\n",
|
||||
@ -1366,7 +1373,8 @@ go32_sysinfo (char *arg, int from_tty)
|
||||
if (prog_has_started)
|
||||
{
|
||||
__asm__ __volatile__ ("pushfl ; popl %0" : "=g" (eflags));
|
||||
printf_filtered ("Protection.....................Ring %d (in %s), with%s I/O protection\n",
|
||||
printf_filtered ("Protection....................."
|
||||
"Ring %d (in %s), with%s I/O protection\n",
|
||||
a_tss.tss_cs & 3, (a_tss.tss_cs & 4) ? "LDT" : "GDT",
|
||||
(a_tss.tss_cs & 3) > ((eflags >> 12) & 3) ? "" : "out");
|
||||
}
|
||||
@ -1617,7 +1625,8 @@ display_descriptor (unsigned type, unsigned long base_addr, int idx, int force)
|
||||
case 23:
|
||||
printf_filtered (" %s-bit Data (%s Exp-%s%s)",
|
||||
descr.bit32 ? "32" : "16",
|
||||
descr.stype & 2 ? "Read/Write," : "Read-Only, ",
|
||||
descr.stype & 2
|
||||
? "Read/Write," : "Read-Only, ",
|
||||
descr.stype & 4 ? "down" : "up",
|
||||
descr.stype & 1 ? "" : ", N.Acc");
|
||||
break;
|
||||
@ -1747,7 +1756,8 @@ go32_sgdt (char *arg, int from_tty)
|
||||
{
|
||||
gdt_entry = parse_and_eval_long (arg);
|
||||
if (gdt_entry < 0 || (gdt_entry & 7) != 0)
|
||||
error (_("Invalid GDT entry 0x%03lx: not an integral multiple of 8."),
|
||||
error (_("Invalid GDT entry 0x%03lx: "
|
||||
"not an integral multiple of 8."),
|
||||
(unsigned long)gdt_entry);
|
||||
}
|
||||
}
|
||||
@ -1794,7 +1804,7 @@ go32_sidt (char *arg, int from_tty)
|
||||
|
||||
__asm__ __volatile__ ("sidt %0" : "=m" (idtr) : /* no inputs */ );
|
||||
max_entry = (idtr.limit + 1) / 8;
|
||||
if (max_entry > 0x100) /* no more than 256 entries */
|
||||
if (max_entry > 0x100) /* No more than 256 entries. */
|
||||
max_entry = 0x100;
|
||||
|
||||
if (idt_entry >= 0)
|
||||
@ -1857,7 +1867,7 @@ get_cr3 (void)
|
||||
cr3 = _farnspeekl (taskbase + 0x1c) & ~0xfff;
|
||||
if (cr3 > 0xfffff)
|
||||
{
|
||||
#if 0 /* not fullly supported yet */
|
||||
#if 0 /* Not fullly supported yet. */
|
||||
/* The Page Directory is in UMBs. In that case, CWSDPMI puts
|
||||
the first Page Table right below the Page Directory. Thus,
|
||||
the first Page Table's entry for its own address and the Page
|
||||
@ -1911,7 +1921,7 @@ get_pte (unsigned long pde, int n)
|
||||
page tables, for now. */
|
||||
if ((pde & 1) && !(pde & 0x80) && n >= 0 && n < 1024)
|
||||
{
|
||||
pde &= ~0xfff; /* clear non-address bits */
|
||||
pde &= ~0xfff; /* Clear non-address bits. */
|
||||
pte = _farpeekl (_dos_ds, pde + 4*n);
|
||||
}
|
||||
return pte;
|
||||
@ -1965,7 +1975,8 @@ go32_pde (char *arg, int from_tty)
|
||||
|
||||
pdbr = get_cr3 ();
|
||||
if (!pdbr)
|
||||
puts_filtered ("Access to Page Directories is not supported on this system.\n");
|
||||
puts_filtered ("Access to Page Directories is "
|
||||
"not supported on this system.\n");
|
||||
else if (pde_idx >= 0)
|
||||
display_ptable_entry (get_pde (pde_idx), 1, 1, 0);
|
||||
else
|
||||
@ -1985,7 +1996,8 @@ display_page_table (long n, int force)
|
||||
{
|
||||
int i;
|
||||
|
||||
printf_filtered ("Page Table pointed to by Page Directory entry 0x%lx:\n", n);
|
||||
printf_filtered ("Page Table pointed to by "
|
||||
"Page Directory entry 0x%lx:\n", n);
|
||||
for (i = 0; i < 1024; i++)
|
||||
display_ptable_entry (get_pte (pde, i), 0, 0, 0);
|
||||
puts_filtered ("\n");
|
||||
|
Loading…
x
Reference in New Issue
Block a user