* 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>
+
+ * 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.
#include "value.h"
/* Define whether or not the C operator '/' truncates towards zero for
- differently signed operands (truncation direction is undefined in C).
+ differently signed operands (truncation direction is undefined in C).
Copied from valarith.c. */
#ifndef TRUNCATION_TOWARDS_ZERO
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 *,
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)
{
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)
{
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)
{
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)
{
/* 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. */
/* 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
previously computed. Tries to save the decoded name in the same
obstack as GSYMBOL, if possible, and otherwise on the heap (so that,
in any case, the decoded symbol has a lifetime at least that of
- GSYMBOL).
+ 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)
}
/* 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)
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;
}
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);
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));
/* Create a new value of type TYPE from the contents of OBJ starting
at byte OFFSET, and bit offset BIT_OFFSET within that byte,
proceeding for BIT_SIZE bits. If OBJ is an lval in memory, then
- assigning through the result will set the field fetched from.
+ assigning through the result will set the field fetched from.
VALADDR is ignored unless OBJ is NULL, in which case,
VALADDR+OFFSET must address the start of storage containing the
packed value. The value returned in this case is never an lval.
/* 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)
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
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),
}
\f
/* 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,
xget_renaming_scope (struct type *renaming_type)
{
/* The renaming types adhere to the following convention:
- <scope>__<rename>___<XR extension>.
+ <scope>__<rename>___<XR extension>.
So, to extract the scope, we search for the "___XR" extension,
and then backtrack until we find the first "__". */
/* 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)
{
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);
}
}
/* Return a symbol in DOMAIN matching NAME, in BLOCK0 and enclosing
scope and in global scopes, or NULL if none. NAME is folded and
encoded first. Otherwise, the result is as for ada_lookup_symbol_list,
- choosing the first symbol if there are multiple choices.
+ choosing the first symbol if there are multiple choices.
*IS_A_FIELD_OF_THIS is set to 0 and *SYMTAB is set to the symbol
table in which the symbol was found (in both cases, these
assignments occur only if the pointers are non-null). */
#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 */
/* Add symbols from BLOCK matching identifier NAME in DOMAIN to
vector *defn_symbols, updating the list of symbols in OBSTACKP
- (if necessary). If WILD, treat as NAME with a wildcard prefix.
+ (if necessary). If WILD, treat as NAME with a wildcard prefix.
OBJFILE is the section containing BLOCK.
SYMTAB is recorded with each symbol added. */
}
/* 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)
/* 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,
static int ada_tag_name_2 (struct tag_args *);
/* Wrapper function used by ada_tag_name. Given a struct tag_args*
- value ARGS, sets ARGS->name to the tag name of ARGS->tag.
+ value ARGS, sets ARGS->name to the tag name of ARGS->tag.
The value stored in ARGS->name is valid until the next call to
ada_tag_name_1. */
/* 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)
}
}
-/* 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)
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,
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)
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));
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));
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));
/* 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,
/* 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,
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));
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)
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.
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.
/* 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)
/* 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)
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;
/* 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);
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)
{
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,
/* 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). */
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
/* 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)
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,
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,
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,
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,
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. */
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)
/* 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);
}
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);
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;
}
/* 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. */
{
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".
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 */
/* 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]$", \
#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;
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;
};
/* 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);
};
/* 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
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)
/* 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. */
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. */
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)
}
/* 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)
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)
{
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,
}
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),
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
{
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);
}
/* Write register function should be able to write requested context
- information to specified debuggee's kernel thread id.
+ information to specified debuggee's kernel thread id.
If successful return 0, else non-zero is returned. */
static int
return ptid;
}
-/* Try to start debugging threads in the current process.
+/* Try to start debugging threads in the current process.
If successful and SET_INFPID, set inferior_ptid to reflect the
current thread. */
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));
}
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;
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);
}
#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)
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)
(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)
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;
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;
}
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);
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;
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,
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)
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
};
#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)
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)
}
\f
-/* 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 =
{
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;
/* 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. */
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);
break;
default:
- internal_error (__FILE__, __LINE__, _("unknown floating point width"));
+ internal_error (__FILE__, __LINE__,
+ _("unknown floating point width"));
}
break;
break;
default:
- internal_error (__FILE__, __LINE__, _("unknown floating point width"));
+ internal_error (__FILE__, __LINE__,
+ _("unknown floating point width"));
}
break;
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;
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;
/* 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)
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 */
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;
}
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
insn = alpha_read_insn (gdbarch, pc);
- /* Opcode is top 6 bits. */
+ /* Opcode is top 6 bits. */
op = (insn >> 26) & 0x3f;
if (op == 0x1a)
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;
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);
}
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.
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);
}
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);
}
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;
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;
}
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);
4 * 8, /* %rdi */
6 * 8, /* %rbp */
7 * 8, /* %rsp */
- 8 * 8, /* %r8 ... */
+ 8 * 8, /* %r8 ... */
9 * 8,
10 * 8,
11 * 8,
<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>
14 * 8, /* %rdi */
4 * 8, /* %rbp */
19 * 8, /* %rsp */
- 9 * 8, /* %r8 ... */
+ 9 * 8, /* %r8 ... */
8 * 8,
7 * 8,
6 * 8,
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 ();
}
8 * 8, /* %rdi */
10 * 8, /* %rbp */
20 * 8, /* %rsp */
- 7 * 8, /* %r8 ... */
+ 7 * 8, /* %r8 ... */
6 * 8,
5 * 8,
4 * 8,
/* 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
/* 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);
8 * 8, /* %rdi */
10 * 8, /* %rbp */
20 * 8, /* %rsp */
- 7 * 8, /* %r8 ... */
+ 7 * 8, /* %r8 ... */
6 * 8,
5 * 8,
4 * 8,
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,
-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 */
0 * 8, /* %rdi */
12 * 8, /* %rbp */
24 * 8, /* %rsp */
- 4 * 8, /* %r8 .. */
+ 4 * 8, /* %r8 .. */
5 * 8,
6 * 8,
7 * 8,
0 * 8, /* %rdi */
12 * 8, /* %rbp */
15 * 8, /* %rsp */
- 4 * 8, /* %r8 .. */
+ 4 * 8, /* %r8 .. */
5 * 8,
6 * 8,
7 * 8,
0 * 8, /* %rdi */
12 * 8, /* %rbp */
24 * 8, /* %rsp */
- 4 * 8, /* %r8 ... */
+ 4 * 8, /* %r8 ... */
5 * 8,
6 * 8,
7 * 8,
13 * 8, /* %rdi */
15 * 8, /* %rbp */
-1, /* %rsp */
- 12 * 8, /* %r8 ... */
+ 12 * 8, /* %r8 ... */
11 * 8,
10 * 8,
9 * 8,
#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. */
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;
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.
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)
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]:
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].
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
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"
#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"
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) \
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)];
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);
/* 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. */
;
}
/* 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,
[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)
/* 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. */
break;
}
- return skip_pc; /* End of prologue */
+ return skip_pc; /* End of prologue. */
}
/* *INDENT-OFF* */
R7 -> 0 local variables (16 bytes)
SP -> -12 additional stack space (12 bytes)
The frame size would thus be 36 bytes, and the frame offset would be
- 12 bytes. The frame register is R7.
+ 12 bytes. The frame register is R7.
The comments for thumb_skip_prolog() describe the algorithm we use
to detect the end of the prolog. */
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;
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]);
}
}
/* 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. */
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]))
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;
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;
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));
}
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)
{
{
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;
}
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;
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);
}
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);
}
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);
}
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)
{
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
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))
{
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;
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.
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. */
/* 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)
/* 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);
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:
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,
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);
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);
}
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;
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);
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);
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);
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);
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;
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,
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;
}
}
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)
{
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);
}
{
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);
}
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
_("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,
_("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. */
const char *thumb2_breakpoint;
int thumb2_breakpoint_size;
- int jb_pc; /* Offset to PC value in jump buffer.
+ int jb_pc; /* Offset to PC value in jump buffer.
If this is negative, longjmp support
will be disabled. */
size_t jb_elt_size; /* And the size of each entry in the buf. */
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);
(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.
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)))
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 */
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.
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 */
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)
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)
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)
return ((x) & 0xffffffff);
}
-/* SRAM address checks and convertions. */
+/* SRAM address checks and convertions. */
static CORE_ADDR
avr_make_saddr (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) */
/* 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,
/* 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
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);
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;
}
}
- /* 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)
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. */
/* 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);
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,
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;
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];
}
/* 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
{
(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
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
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,
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--;
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);
}
}
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));
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)
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);
}
/* 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)
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);
/* 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"),
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;
}
#endif
- /* i18n: PCB == "Process Control Block" */
+ /* i18n: PCB == "Process Control Block". */
error (_("Cannot find a valid PCB"));
}
\f
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)
_("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.
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);
}
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,
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
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);
break;
case TYPE_CODE_RANGE:
- /* This should not occur */
+ /* This should not occur. */
fprintf_filtered (stream, _("<range type>"));
break;
}
/* 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. */
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
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"),
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
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.
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,
/* FIXME: If ERP is in a delay slot at this point then the PC will
be wrong at this point. This problem manifests itself in the
sigaltstack.exp test case, which occasionally generates FAILs when
- the signal is received while in a delay slot.
+ the signal is received while in a delay slot.
This could be solved by a couple of read_memory_unsigned_integer and a
trad_frame_set_value. */
struct frame_info *next_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.
Copied from d10v-tdep.c. */
struct stack_item
the subq-instruction will be present with X as the number of bytes
needed for storage. The reshuffle with respect to r8 may be performed
with any size S (b, w, d) and any of the general registers Z={0..13}.
- The offset U should be representable by a signed 8-bit value in all cases.
+ The offset U should be representable by a signed 8-bit value in all cases.
Thus, the prefix word is assumed to be immediate byte offset mode followed
by another word containing the instruction.
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
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);
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};
/* 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)
/* 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)
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)
}
/* There is no hardware single-step support. The function find_step_target
- digs through the opcodes in order to find all possible targets.
+ digs through the opcodes in order to find all possible targets.
Either one ordinary target or two targets for branches may be found. */
static int
}
/* 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. */
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. */
}
/* 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)
{
/* 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)
inst_env->disable_interrupt = 0;
}
-/* Calculate the result of the instruction for ADD, SUB, CMP AND, OR and MOVE.
+/* Calculate the result of the instruction for ADD, SUB, CMP AND, OR and MOVE.
The MOVE instruction is the move from source to register. */
static void
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;
unsigned long operand3;
int size;
- /* The instruction is either an indirect or autoincrement addressing mode.
+ /* The instruction is either an indirect or autoincrement addressing mode.
Check if the destination register is the PC. */
if (cris_get_operand2 (inst) == REG_PC)
{
}
/* 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);
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,
_("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);
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);
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. */
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. */
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;
/* 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
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:
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.
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)
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);
\f
/* 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)
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)
#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. */
\f
/* We put a pointer to this structure in the read_symtab_private field
#define FILE_STRING_OFFSET(p) (SYMLOC(p)->file_string_offset)
\f
-/* 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;
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;
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;
/* 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);
struct partial_symbol **,
struct partial_symbol **);
-/* Free up old header file tables */
+/* Free up old header file tables. */
void
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)
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);
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);
Since BFD doesn't know how to read debug symbols in a format-independent
way (and may never do so...), we have to do it ourselves. We will never
- be called unless this is an a.out (or very similar) file.
+ be called unless this is an a.out (or very similar) file.
FIXME, there should be a cleaner peephole into the BFD environment here. */
#define DBX_STRINGTAB_SIZE_SIZE sizeof(long) /* FIXME */
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,
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;
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;
}
{
/* 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;
}
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)
/* 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)
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);
}
/* 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;
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;
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;
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++];
*) 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)
{
nlist.n_type, objfile); /* Always */
continue;
- /* Standard, local, non-debugger, symbols */
+ /* Standard, local, non-debugger, symbols. */
case N_NBTEXT:
{
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)
case N_NBBSS:
continue;
- /* Keep going . . . */
+ /* Keep going . . . */
/*
* Special symbol types for GNU
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
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)
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;
}
/* 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);
}
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;
}
{
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);
/* 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.
}
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. */
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;
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" */
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,
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,
}
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))
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;
}
}
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))
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;
}
case '8':
case '9':
case '-':
- case '#': /* for symbol identification (used in live ranges) */
+ case '#': /* For symbol identification (used in live ranges). */
continue;
case ':':
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);
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:
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:
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,
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;
}
-/* Close off the current usage of PST.
+/* Close off the current usage of PST.
Returns PST or NULL if the partial symtab was empty and thrown away.
FIXME: List variables and peculiarities of same. */
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
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;
}
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));
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)
{
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 ();
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);
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 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)
/* 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;
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;
}
/* 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
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++];
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
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;
/* 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
/* 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 ();
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;
.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,
/* 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);
.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,
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,
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 *)
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);
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
};
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;
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. */
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).
{
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");
}
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);
return ESUCCESS;
}
-/* Get integer regs */
+/* Get integer regs. */
static int
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,
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
/* 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
/* 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. */
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 (); \
/* 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
{
Use make_cleanup to add an element to the cleanup chain.
Use do_cleanups to do all cleanup actions back to a given
point in the chain. Use discard_cleanups to remove cleanups
- from the chain back to a given point, not doing them.
+ from the chain back to a given point, not doing them.
If the argument is pointer to allocated memory, then you need to
to additionally set the 'free_arg' member to a function that will
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 *);
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;
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);
extern void generic_load (char *name, int from_tty);
/* Report on STREAM the performance of memory transfer operation,
- such as 'load'.
+ such as 'load'.
DATA_COUNT is the number of bytes transferred.
WRITE_COUNT is the number of separate write operations, or 0,
if that information is not available.
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,
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;
};
extern void free_command_lines (struct command_line **);
-/* To continue the execution commands when running gdb asynchronously.
+/* 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;
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
{
#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)
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. */
#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)
#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
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. */
/* 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
/* 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;
unsigned long num);
-/* Inhibit window interface if non-zero. */
+/* Inhibit window interface if non-zero. */
extern int use_windows;
/* 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"
"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
/* 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;
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)
/* 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;
}
/* 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)
{
{
/* 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);
}
}
-/* Fake a "set demangle-style" command. */
+/* Fake a "set demangle-style" command. */
void
set_demangling_style (char *style)
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);
}
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;
}
* 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. */
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,
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[] =
{
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";
/* 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
&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);
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,
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)
}
/* 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);
{
if (next_line != 0)
{
- /* Just one line to print. */
+ /* Just one line to print. */
if (next_line == mle[i].line)
{
ui_out_tuple_chain
}
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;
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");
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)
{
/* We start counting from the other end (i.e, from the high bytes
rather than the low bytes). As such, we need to be concerned
- with what happens if bit 0 doesn't start on a byte boundary.
+ with what happens if bit 0 doesn't start on a byte boundary.
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)
}
}
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;
}
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;
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. */
/* 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;
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,
[gdbarch_byte_order (gdbarch)];
/* On i386 the 'long double' type takes 96 bits,
while the real number of used bits is only 80,
- both in processor and in memory.
+ both in processor and in memory.
The code below accepts the real bit size. */
else if ((gdbarch_long_double_format (gdbarch) != NULL)
&& (len * TARGET_CHAR_BIT
/* 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),
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,
}
/*
- * 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:
*
*
* 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
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",
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));
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);
/* 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. */
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;
/* 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
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];
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];
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
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
/* 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
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
{
};
/* 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. */
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 */
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;
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. */
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)
#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;
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;
}
-/* 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)
}
/* 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,
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;
/* 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;
/* 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);
}
else
{
- /* Static Variable. Skip symbols without location descriptors. */
+ /* Static Variable. Skip symbols without location descriptors. */
if (pdi->locdesc == NULL)
{
if (built_actual_name)
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]);
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);
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)
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;
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;
}
break;
default:
- /* Ignore. */
+ /* Ignore. */
break;
}
}
/* 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));
/* 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;
}
/* 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. */
}
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)
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 **)
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. */
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"))
}
/* 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)
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);
}
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)
{
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);
/* 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)
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;
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
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);
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);
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)
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;
/* 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;
}
}
-/* 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 *
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;
}
/* 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)
{
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;
};
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
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;
}
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)
/* 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. */
}
/* 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
}
/* 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] == '.')
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,
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,
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
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)
{
/* 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)
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)
/* 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]
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++;
#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"
/* 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 *);
}
/* 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)
{
}
/* 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)
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++;
}
else
{
- /* Unlabelled tuple element - go to next field. */
+ /* Unlabelled tuple element - go to next field. */
if (variantno >= 0)
{
subfieldno++;
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);
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;
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,
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);
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)
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
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)
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)
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:");
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;
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;
{
/* 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);
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)
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);
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
}
else
{
- /* Non-method function call */
+ /* Non-method function call. */
save_pos1 = *pos;
tem = 1;
}
}
- /* 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)
{
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++)
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
== 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++)
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;
}
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;
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++)
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);
}
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:
{
/* 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]);
array subscript operations cannot be disambiguated
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. */
+ 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. */
nargs = longest_to_int (exp->elts[pc + 1].longconst);
(*pos) += 2;
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;
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);
/* 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;
{
/* 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));
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)
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)
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);
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);
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];
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);
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;
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,
}
}
-/* 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)
#define PREFIX(X) the_prompts.prompt_stack[the_prompts.top + X].prefix
#define SUFFIX(X) the_prompts.prompt_stack[the_prompts.top + X].suffix
-/* Exported functions from event-top.c.
+/* Exported functions from event-top.c.
FIXME: these should really go into top.h. */
extern void display_gdb_prompt (char *new_prompt);
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. */
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);
}
/* 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);
}
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);
}
/* 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);
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 ();
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,
/* 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,
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.
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,
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)
{
/* 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);
/* 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)
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)
exec_file_attach (NULL, from_tty);
}
-/* Set both the exec file and the symbol file, in one command.
+/* Set both the exec file and the symbol file, in one command.
What a novelty. Why did GDB go through four major releases before this
command was added? */
}
\f
-/* Locate all mappable sections of a BFD file.
+/* Locate all mappable sections of a BFD file.
table_pp_char is a char * to get it through bfd_map_over_sections;
we cast it back to its proper type. */
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.
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;
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)
}
}
- return 0; /* We can't help */
+ return 0; /* We can't help. */
}
struct target_section_table *
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;
!= 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 *))
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;
}
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)
|| 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;
}
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);
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)
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)
#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. */
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
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.
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. */
/* 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.
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> ) */
+ /* 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> ). */
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.
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.
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
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 ":"). */
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"
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))
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
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;
/* 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 */
} 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)
}
/* Blatantly ripped off from ch-exp.y. This routine recognizes F77
- string-literals.
+ string-literals.
Recognize a string literal. A string literal is a nonzero sequence
of characters enclosed in matching single quotes, except that
/* 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;
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':
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;
#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;
};
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))
{
}
/* 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)
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,
}
/* 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 *);
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)
/* 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
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;
#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
/* 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 ();
}
#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
#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)
{
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;
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)
#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) \
}
#endif
-/* This function frees the entire (.bf,function) list */
+/* This function frees the entire (.bf,function) list. */
#if 0
static void
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__,
/* 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");
/* 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 *);
#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
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);
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, "*");
}
/* 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))
{
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;
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*(*)");
/* 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
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])
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)
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)
/* 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);
}
/* 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,
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);
{
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;
/* 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);
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;
}
}
}
/* 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)
/* 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)
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));
}
/* 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)
{
}
/* 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
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)
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);
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);
}
/* Given a struct symbol for a variable,
and a stack frame id, read the value of the variable
- and return a (pointer to a) struct value containing the value.
+ and return a (pointer to a) struct value containing the value.
If the variable cannot be found, return a zero pointer. */
struct value *
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. */
/* 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);
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
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
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. */
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;
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. */
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);
&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."), _("\
/* 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);
/* 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
};
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."));
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 :
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);
}
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);
}
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);
}
#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. */
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]);
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]);
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);
{
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
/* 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];
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. */
/* 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. */
/* 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
to the call instruction.
Skip over this instruction if present. It won't be present in
- non-PIC code, and even in PIC code, it might not be present.
+ non-PIC code, and even in PIC code, it might not be present.
(This is due to the fact that GR15, the FDPIC register, already
contains the correct value.)
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
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;
{
#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);
&& !(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. */
}
}
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. */
{
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];
};
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;
/* 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 : \
#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
#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) \
{
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. */
/* 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. */
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. */
/* 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)
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"
}
-/* Maintain the struct gdbarch object */
+/* Maintain the struct gdbarch object. */
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.
/* The default architecture uses host values (for want of a better
- choice). */
+ choice). */
extern const struct bfd_arch_info bfd_default_arch_struct;
{
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 */
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,
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;
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 */
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 */
/* 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 */
/* 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 */
}
-/* 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)
/* Keep a registry of per-architecture data-pointers required by GDB
- modules. */
+ modules. */
struct gdbarch_data
{
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)
}
/* Initialize the current value of the specified per-architecture
- data-pointer. */
+ data-pointer. */
void
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)
}
-/* Keep a registry of the architectures known by GDB. */
+/* Keep a registry of the architectures known by GDB. */
struct gdbarch_registration
{
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;
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 */
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)
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
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. */
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.
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
{
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). */
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). */
/* 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);
/* 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 *);
#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);
/* 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 *);
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
}
# 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}" ]
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.
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
{
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). */
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). */
/* 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);
/* 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 *);
#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);
/* 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 *);
# 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"
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
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
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"
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
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
cat <<EOF
/* Create a new \`\`struct gdbarch'' based on information provided by
- \`\`struct gdbarch_info''. */
+ \`\`struct gdbarch_info''. */
EOF
printf "\n"
cat <<EOF
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
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
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
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)
/* Keep a registry of per-architecture data-pointers required by GDB
- modules. */
+ modules. */
struct gdbarch_data
{
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)
}
/* Initialize the current value of the specified per-architecture
- data-pointer. */
+ data-pointer. */
void
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)
}
-/* Keep a registry of the architectures known by GDB. */
+/* Keep a registry of the architectures known by GDB. */
struct gdbarch_registration
{
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;
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 */
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)
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);
/* 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;
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 *);
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,
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 */
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)
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);
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
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;
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);
#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;
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;
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
/* 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;
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);
argcount = 1;
}
- if (*p != ')') /* () means no args, skip while */
+ if (*p != ')') /* () means no args, skip while. */
{
depth = 0;
while (*p)
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)
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
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.
? 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;
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)
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))
{
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 */
}
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:
}
-/* End of functions for overload resolution */
+/* End of functions for overload resolution. */
static void
print_bit_vector (B_TYPE *bits, int nbits)
}
}
- /* 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));
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
};
/* 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)
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)
(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)
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)
#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)
struct main_type
{
- /* Code for kind of type */
+ /* Code for kind of type. */
ENUM_BITFIELD(type_code) code : 8;
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
{
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;
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;
{
/* 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;
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;
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;
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
{
/* 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;
*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;
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 */
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;
};
/* 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;
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
#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))
/* 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) \
#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;
/* 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. */
};
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. */
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
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");
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)
{
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);
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);
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);
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)
/* 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)
{
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));
}
\f
-/* 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)
{
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)
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)
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);
}
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));
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)
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);
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;
}
}
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",
{
/* 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 */
}
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);
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);
}
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;
}
}
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;
}
{
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. */
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)
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);
/* 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
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. */
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
}
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. */
}
\f
static void
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));
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;
}
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,
&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"),
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));
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;
/* 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))
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))
\f
/* 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,
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
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
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);
}
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);
}
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);
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);
}
_("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, _("\
/* 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)
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
#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. */
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
}
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);
}
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))
{
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;
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;
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 )
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;
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))
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,
/* 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));
}
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;
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)
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;
}
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";
#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;
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'. */
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
}
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;
}
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));
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;
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__,
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__,
}
}
-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)
/* 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, "<>"))
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;
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;
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;
}
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)
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);
/* 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;
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);
}
/* 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)
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
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],
__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",
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");
}
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;
{
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);
}
}
__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)
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
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;
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
{
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");