2011-01-10 Michael Snyder <msnyder@vmware.com>

* nto-procfs.c: Comment cleanup, mostly periods and spaces.
	* nto-tdep.c: Ditto.
	* nto-tdep.h: Ditto.
	* objc-exp.y: Ditto.
	* objc-lang.c: Ditto.
	* objfiles.c: Ditto.
	* objfiles.h: Ditto.
	* observer.c: Ditto.
	* opencl-lang.c: Ditto.
	* osabi.c: Ditto.
	* parse.c: Ditto.
	* parser-defs.h: Ditto.
	* p-exp.y: Ditto.
	* p-lang.c: Ditto.
	* posix-hdep.c: Ditto.
	* ppcbug-rom.c: Ditto.
	* ppc-linux-nat.c: Ditto.
	* ppc-linux-tdep.c: Ditto.
	* ppc-linux-tdep.h: Ditto.
	* ppcnbsd-tdep.c: Ditto.
	* ppcobsd-tdep.c: Ditto.
	* ppcobsd-tdep.h: Ditto.
	* ppc-sysv-tdep.c: Ditto.
	* ppc-tdep.h: Ditto.
	* printcmd.c: Ditto.
	* proc-abi.c: Ditto.
	* proc-flags.c: Ditto.
	* procfs.c: Ditto.
	* proc-utils.h: Ditto.
	* progspace.h: Ditto.
	* prologue-value.c: Ditto.
	* prologue-value.h: Ditto.
	* psympriv.h: Ditto.
	* psymtab.c: Ditto.
	* p-typeprint.c: Ditto.
	* p-valprint.c: Ditto.
	* ravenscar-sparc-thread.c: Ditto.
	* ravenscar-thread.c: Ditto.
	* ravenscar-thread.h: Ditto.
	* record.c: Ditto.
	* regcache.c: Ditto.
	* regcache.h: Ditto.
	* remote.c: Ditto.
	* remote-fileio.c: Ditto.
	* remote-fileio.h: Ditto.
	* remote.h: Ditto.
	* remote-m32r-sdi.c: Ditto.
	* remote-mips.c: Ditto.
	* remote-sim.c: Ditto.
	* rs6000-aix-tdep.c: Ditto.
	* rs6000-nat.c: Ditto.
	* rs6000-tdep.c: Ditto.
This commit is contained in:
Michael Snyder 2011-01-10 20:38:51 +00:00
parent a73c6dcdd4
commit 0df8b4180a
53 changed files with 1096 additions and 936 deletions

View file

@ -1,3 +1,58 @@
2011-01-10 Michael Snyder <msnyder@vmware.com>
* nto-procfs.c: Comment cleanup, mostly periods and spaces.
* nto-tdep.c: Ditto.
* nto-tdep.h: Ditto.
* objc-exp.y: Ditto.
* objc-lang.c: Ditto.
* objfiles.c: Ditto.
* objfiles.h: Ditto.
* observer.c: Ditto.
* opencl-lang.c: Ditto.
* osabi.c: Ditto.
* parse.c: Ditto.
* parser-defs.h: Ditto.
* p-exp.y: Ditto.
* p-lang.c: Ditto.
* posix-hdep.c: Ditto.
* ppcbug-rom.c: Ditto.
* ppc-linux-nat.c: Ditto.
* ppc-linux-tdep.c: Ditto.
* ppc-linux-tdep.h: Ditto.
* ppcnbsd-tdep.c: Ditto.
* ppcobsd-tdep.c: Ditto.
* ppcobsd-tdep.h: Ditto.
* ppc-sysv-tdep.c: Ditto.
* ppc-tdep.h: Ditto.
* printcmd.c: Ditto.
* proc-abi.c: Ditto.
* proc-flags.c: Ditto.
* procfs.c: Ditto.
* proc-utils.h: Ditto.
* progspace.h: Ditto.
* prologue-value.c: Ditto.
* prologue-value.h: Ditto.
* psympriv.h: Ditto.
* psymtab.c: Ditto.
* p-typeprint.c: Ditto.
* p-valprint.c: Ditto.
* ravenscar-sparc-thread.c: Ditto.
* ravenscar-thread.c: Ditto.
* ravenscar-thread.h: Ditto.
* record.c: Ditto.
* regcache.c: Ditto.
* regcache.h: Ditto.
* remote.c: Ditto.
* remote-fileio.c: Ditto.
* remote-fileio.h: Ditto.
* remote.h: Ditto.
* remote-m32r-sdi.c: Ditto.
* remote-mips.c: Ditto.
* remote-sim.c: Ditto.
* rs6000-aix-tdep.c: Ditto.
* rs6000-nat.c: Ditto.
* rs6000-tdep.c: Ditto.
2011-01-10 Joel Brobecker <brobecker@adacore.com>
* ada-valprint.c (printstr): Minor comment reformatting.

View file

@ -604,7 +604,8 @@ procfs_files_info (struct target_ops *ignore)
target_pid_to_str (inferior_ptid), nto_procfs_path);
}
/* Mark our target-struct as eligible for stray "run" and "attach" commands. */
/* Mark our target-struct as eligible for stray "run" and "attach"
commands. */
static int
procfs_can_run (void)
{

View file

@ -92,7 +92,8 @@ nto_find_and_open_solib (char *solib, unsigned o_flags, char **temp_pathname)
char *buf, *arch_path, *nto_root, *endian, *base;
const char *arch;
int ret;
#define PATH_FMT "%s/lib:%s/usr/lib:%s/usr/photon/lib:%s/usr/photon/dll:%s/lib/dll"
#define PATH_FMT \
"%s/lib:%s/usr/lib:%s/usr/photon/lib:%s/usr/photon/dll:%s/lib/dll"
nto_root = nto_target ();
if (strcmp (gdbarch_bfd_arch_info (target_gdbarch)->arch_name, "i386") == 0)
@ -413,6 +414,7 @@ When non-zero, nto specific debug info is\n\
displayed. Different information is displayed\n\
for different positive values."),
NULL,
NULL, /* FIXME: i18n: QNX NTO internal debugging is %s. */
NULL, /* FIXME: i18n: QNX NTO internal
debugging is %s. */
&setdebuglist, &showdebuglist);
}

View file

@ -544,10 +544,12 @@ exp : INT
exp : NAME_OR_INT
{ YYSTYPE val;
parse_number ($1.stoken.ptr, $1.stoken.length, 0, &val);
parse_number ($1.stoken.ptr,
$1.stoken.length, 0, &val);
write_exp_elt_opcode (OP_LONG);
write_exp_elt_type (val.typed_val_int.type);
write_exp_elt_longcst ((LONGEST)val.typed_val_int.val);
write_exp_elt_longcst ((LONGEST)
val.typed_val_int.val);
write_exp_elt_opcode (OP_LONG);
}
;
@ -624,7 +626,8 @@ block : BLOCKNAME
struct symtab *tem =
lookup_symtab (copy_name ($1.stoken));
if (tem)
$$ = BLOCKVECTOR_BLOCK (BLOCKVECTOR (tem), STATIC_BLOCK);
$$ = BLOCKVECTOR_BLOCK (BLOCKVECTOR (tem),
STATIC_BLOCK);
else
error ("No file or function \"%s\".",
copy_name ($1.stoken));
@ -717,10 +720,13 @@ variable: qualified_name
msymbol = lookup_minimal_symbol (name, NULL, NULL);
if (msymbol != NULL)
write_exp_msymbol (msymbol);
else if (!have_full_symbols () && !have_partial_symbols ())
error ("No symbol table is loaded. Use the \"file\" command.");
else if (!have_full_symbols ()
&& !have_partial_symbols ())
error ("No symbol table is loaded. "
"Use the \"file\" command.");
else
error ("No symbol \"%s\" in current context.", name);
error ("No symbol \"%s\" in current context.",
name);
}
;
@ -770,7 +776,8 @@ variable: name_not_typename
write_exp_msymbol (msymbol);
else if (!have_full_symbols () &&
!have_partial_symbols ())
error ("No symbol table is loaded. Use the \"file\" command.");
error ("No symbol table is loaded. "
"Use the \"file\" command.");
else
error ("No symbol \"%s\" in current context.",
copy_name ($1.stoken));
@ -1120,7 +1127,8 @@ parse_number (p, len, parsed_float, putithere)
if (long_p == 0
&& (un >> (gdbarch_int_bit (parse_gdbarch) - 2)) == 0)
{
high_bit = ((unsigned LONGEST)1) << (gdbarch_int_bit (parse_gdbarch) - 1);
high_bit
= ((unsigned LONGEST)1) << (gdbarch_int_bit (parse_gdbarch) - 1);
/* A large decimal (not hex or octal) constant (between INT_MAX
and UINT_MAX) is a long or unsigned long, according to ANSI,
@ -1134,7 +1142,8 @@ parse_number (p, len, parsed_float, putithere)
else if (long_p <= 1
&& (un >> (gdbarch_long_bit (parse_gdbarch) - 2)) == 0)
{
high_bit = ((unsigned LONGEST)1) << (gdbarch_long_bit (parse_gdbarch) - 1);
high_bit
= ((unsigned LONGEST)1) << (gdbarch_long_bit (parse_gdbarch) - 1);
unsigned_type = parse_type->builtin_unsigned_long;
signed_type = parse_type->builtin_long;
}
@ -1331,7 +1340,8 @@ yylex ()
hex = 1;
local_radix = 16;
}
else if (tokchr == '0' && (p[1]=='t' || p[1]=='T' || p[1]=='d' || p[1]=='D'))
else if (tokchr == '0' && (p[1]=='t' || p[1]=='T'
|| p[1]=='d' || p[1]=='D'))
{
p += 2;
hex = 0;

View file

@ -125,7 +125,8 @@ lookup_objc_class (struct gdbarch *gdbarch, char *classname)
function = find_function_in_inferior("objc_lookup_class", NULL);
else
{
complaint (&symfile_complaints, _("no way to lookup Objective-C classes"));
complaint (&symfile_complaints,
_("no way to lookup Objective-C classes"));
return 0;
}
@ -153,12 +154,14 @@ lookup_child_selector (struct gdbarch *gdbarch, char *selname)
function = find_function_in_inferior("sel_get_any_uid", NULL);
else
{
complaint (&symfile_complaints, _("no way to lookup Objective-C selectors"));
complaint (&symfile_complaints,
_("no way to lookup Objective-C selectors"));
return 0;
}
selstring = value_coerce_array (value_string (selname,
strlen (selname) + 1, char_type));
strlen (selname) + 1,
char_type));
return value_as_long (call_function_by_hand (function, 1, &selstring));
}
@ -233,25 +236,26 @@ objc_demangle (const char *mangled, int options)
*cp++ = '+'; /* for class method */
*cp++ = '['; /* opening left brace */
strcpy(cp, mangled+3); /* tack on the rest of the mangled name */
strcpy(cp, mangled+3); /* Tack on the rest of the mangled name. */
while (*cp && *cp == '_')
cp++; /* skip any initial underbars in class name */
cp++; /* Skip any initial underbars in class
name. */
cp = strchr(cp, '_');
if (!cp) /* find first non-initial underbar */
if (!cp) /* Find first non-initial underbar. */
{
xfree(demangled); /* not mangled name */
return NULL;
}
if (cp[1] == '_') /* easy case: no category name */
if (cp[1] == '_') /* Easy case: no category name. */
{
*cp++ = ' '; /* replace two '_' with one ' ' */
*cp++ = ' '; /* Replace two '_' with one ' '. */
strcpy(cp, mangled + (cp - demangled) + 2);
}
else
{
*cp++ = '('; /* less easy case: category name */
*cp++ = '('; /* Less easy case: category name. */
cp = strchr(cp, '_');
if (!cp)
{
@ -259,16 +263,17 @@ objc_demangle (const char *mangled, int options)
return NULL;
}
*cp++ = ')';
*cp++ = ' '; /* overwriting 1st char of method name... */
strcpy(cp, mangled + (cp - demangled)); /* get it back */
*cp++ = ' '; /* Overwriting 1st char of method name... */
strcpy(cp, mangled + (cp - demangled)); /* Get it back. */
}
while (*cp && *cp == '_')
cp++; /* skip any initial underbars in method name */
cp++; /* Skip any initial underbars in
method name. */
for (; *cp; cp++)
if (*cp == '_')
*cp = ':'; /* replace remaining '_' with ':' */
*cp = ':'; /* Replace remaining '_' with ':'. */
*cp++ = ']'; /* closing right brace */
*cp++ = 0; /* string terminator */
@ -525,7 +530,8 @@ const struct language_defn objc_language_defn = {
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
basic_lookup_transparent_type,/* lookup_transparent_type */
objc_demangle, /* Language specific symbol demangler */
NULL, /* Language specific class_name_from_physname */
NULL, /* Language specific
class_name_from_physname */
objc_op_print_tab, /* Expression operators for printing */
1, /* C-style arrays */
0, /* String lower bound */
@ -540,7 +546,7 @@ const struct language_defn objc_language_defn = {
/*
* ObjC:
* Following functions help construct Objective-C message calls
* Following functions help construct Objective-C message calls.
*/
struct selname /* For parsing Objective-C. */
@ -645,10 +651,10 @@ specialcmp (char *a, char *b)
a++, b++;
}
if (*a && *a != ' ' && *a != ']')
return 1; /* a is longer therefore greater */
return 1; /* a is longer therefore greater. */
if (*b && *b != ' ' && *b != ']')
return -1; /* a is shorter therefore lesser */
return 0; /* a and b are identical */
return -1; /* a is shorter therefore lesser. */
return 0; /* a and b are identical. */
}
/*
@ -803,7 +809,8 @@ selectors_info (char *regexp, int from_tty)
begin_line();
}
else
printf_filtered (_("No selectors matching \"%s\"\n"), regexp ? regexp : "*");
printf_filtered (_("No selectors matching \"%s\"\n"),
regexp ? regexp : "*");
}
/*
@ -1214,7 +1221,8 @@ find_methods (struct symtab *symtab, char type,
}
strcpy (tmp, symname);
if (parse_method (tmp, &ntype, &nclass, &ncategory, &nselector) == NULL)
if (parse_method (tmp, &ntype, &nclass,
&ncategory, &nselector) == NULL)
continue;
objfile_csym++;
@ -1579,7 +1587,8 @@ find_objc_msgcall_submethod (int (*f) (CORE_ADDR, CORE_ADDR *),
if (catch_errors (find_objc_msgcall_submethod_helper,
(void *) &s,
"Unable to determine target of Objective-C method call (ignoring):\n",
"Unable to determine target of "
"Objective-C method call (ignoring):\n",
RETURN_MASK_ALL) == 0)
return 1;
else
@ -1610,7 +1619,8 @@ find_objc_msgcall (CORE_ADDR pc, CORE_ADDR *new_pc)
return 0;
}
extern initialize_file_ftype _initialize_objc_language; /* -Wmissing-prototypes */
/* -Wmissing-prototypes */
extern initialize_file_ftype _initialize_objc_language;
void
_initialize_objc_language (void)
@ -1682,7 +1692,8 @@ read_objc_class (struct gdbarch *gdbarch, CORE_ADDR addr,
class->name = read_memory_unsigned_integer (addr + 8, 4, byte_order);
class->version = read_memory_unsigned_integer (addr + 12, 4, byte_order);
class->info = read_memory_unsigned_integer (addr + 16, 4, byte_order);
class->instance_size = read_memory_unsigned_integer (addr + 18, 4, byte_order);
class->instance_size = read_memory_unsigned_integer (addr + 18, 4,
byte_order);
class->ivars = read_memory_unsigned_integer (addr + 24, 4, byte_order);
class->methods = read_memory_unsigned_integer (addr + 28, 4, byte_order);
class->cache = read_memory_unsigned_integer (addr + 32, 4, byte_order);

View file

@ -652,7 +652,7 @@ free_objfile (struct objfile *objfile)
xfree (objfile->global_psymbols.list);
if (objfile->static_psymbols.list)
xfree (objfile->static_psymbols.list);
/* Free the obstacks for non-reusable objfiles */
/* Free the obstacks for non-reusable objfiles. */
psymbol_bcache_free (objfile->psymbol_cache);
bcache_xfree (objfile->macro_cache);
bcache_xfree (objfile->filename_cache);
@ -970,8 +970,8 @@ have_full_symbols (void)
/* This operations deletes all objfile entries that represent solibs that
weren't explicitly loaded by the user, via e.g., the add-symbol-file
command.
*/
command. */
void
objfile_purge_solibs (void)
{
@ -981,8 +981,8 @@ objfile_purge_solibs (void)
ALL_OBJFILES_SAFE (objf, temp)
{
/* We assume that the solib package has been purged already, or will
be soon.
*/
be soon. */
if (!(objf->flags & OBJF_USERLOADED) && (objf->flags & OBJF_SHARED))
free_objfile (objf);
}

View file

@ -23,7 +23,7 @@
#define OBJFILES_H
#include "gdb_obstack.h" /* For obstack internals. */
#include "symfile.h" /* For struct psymbol_allocation_list */
#include "symfile.h" /* For struct psymbol_allocation_list. */
#include "progspace.h"
struct bcache;
@ -49,7 +49,7 @@ struct objfile_data;
the debugging information, where these values are the starting
address (inclusive) and ending address (exclusive) of the
instruction space in the executable which correspond to the
"startup file", I.E. crt0.o in most cases. This file is assumed to
"startup file", i.e. crt0.o in most cases. This file is assumed to
be a startup file and frames with pc's inside it are treated as
nonexistent. Setting these variables is necessary so that
backtraces do not fly off the bottom of the stack.
@ -221,7 +221,7 @@ struct objfile
struct addrmap *psymtabs_addrmap;
/* List of freed partial symtabs, available for re-use */
/* List of freed partial symtabs, available for re-use. */
struct partial_symtab *free_psymtabs;
@ -250,8 +250,8 @@ struct objfile
/* A byte cache where we can stash arbitrary "chunks" of bytes that
will not change. */
struct psymbol_bcache *psymbol_cache; /* Byte cache for partial syms */
struct bcache *macro_cache; /* Byte cache for macros */
struct psymbol_bcache *psymbol_cache; /* Byte cache for partial syms. */
struct bcache *macro_cache; /* Byte cache for macros. */
struct bcache *filename_cache; /* Byte cache for file names. */
/* Hash table for mapping symbol names to demangled names. Each
@ -290,7 +290,7 @@ struct objfile
struct minimal_symbol *msymbol_demangled_hash[MINIMAL_SYMBOL_HASH_SIZE];
/* Structure which keeps track of functions that manipulate objfile's
of the same type as this objfile. I.E. the function to read partial
of the same type as this objfile. I.e. the function to read partial
symbols for example. Note that this structure is in statically
allocated memory, and is shared by all objfiles that use the
object module reader of this type. */
@ -384,7 +384,7 @@ struct objfile
for the same executable objfile. */
struct objfile *separate_debug_objfile_link;
/* Place to stash various statistics about this objfile */
/* Place to stash various statistics about this objfile. */
OBJSTATS;
/* A symtab that the C++ code uses to stash special symbols
@ -505,8 +505,8 @@ extern void objfiles_changed (void);
/* This operation deletes all objfile entries that represent solibs that
weren't explicitly loaded by the user, via e.g., the add-symbol-file
command.
*/
command. */
extern void objfile_purge_solibs (void);
/* Functions for dealing with the minimal symbol table, really a misc
@ -636,8 +636,7 @@ extern int gdb_bfd_close_or_warn (struct bfd *abfd);
loop's loop expression, advance OBJFILE, but iff the inner loop
reached its end. If not, there was a "break;", so leave OBJFILE
as is; the outer loop's conditional will break immediately as
well (as OSECT will be different from OBJFILE->sections_end).
*/
well (as OSECT will be different from OBJFILE->sections_end). */
#define ALL_OBJSECTIONS(objfile, osect) \
for ((objfile) = current_program_space->objfiles, \

View file

@ -825,7 +825,8 @@ evaluate_subexp_opencl (struct type *expect_type, struct expression *exp,
Therefore we evaluate it once using EVAL_AVOID_SIDE_EFFECTS. */
int oldpos = *pos;
arg2 = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_AVOID_SIDE_EFFECTS);
arg2 = evaluate_subexp (NULL_TYPE, exp, pos,
EVAL_AVOID_SIDE_EFFECTS);
*pos = oldpos;
type1 = check_typedef (value_type (arg1));
type2 = check_typedef (value_type (arg2));
@ -1094,7 +1095,8 @@ const struct language_defn opencl_language_defn =
basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
basic_lookup_transparent_type,/* lookup_transparent_type */
NULL, /* Language specific symbol demangler */
NULL, /* Language specific class_name_from_physname */
NULL, /* Language specific
class_name_from_physname */
c_op_print_tab, /* expression operators for printing */
1, /* c-style arrays */
0, /* String lower bound */

View file

@ -41,7 +41,7 @@
- there are some problems with boolean types.
- Pascal type hexadecimal constants are not supported
because they conflict with the internal variables format.
Probably also lots of other problems, less well defined PM */
Probably also lots of other problems, less well defined PM. */
%{
#include "defs.h"
@ -54,7 +54,7 @@
#include "p-lang.h"
#include "bfd.h" /* Required by objfiles.h. */
#include "symfile.h" /* Required by objfiles.h. */
#include "objfiles.h" /* For have_full_symbols and have_partial_symbols */
#include "objfiles.h" /* For have_full_symbols and have_partial_symbols. */
#include "block.h"
#define parse_type builtin_type (parse_gdbarch)
@ -299,7 +299,7 @@ exp : exp '.' { search_field = 1; }
current_type, $4.ptr, 0); };
} ;
exp : exp '['
/* We need to save the current_type value */
/* We need to save the current_type value. */
{ char *arrayname;
int arrayfieldindex;
arrayfieldindex = is_pascal_string_type (
@ -492,11 +492,13 @@ exp : INT
exp : NAME_OR_INT
{ YYSTYPE val;
parse_number ($1.stoken.ptr, $1.stoken.length, 0, &val);
parse_number ($1.stoken.ptr,
$1.stoken.length, 0, &val);
write_exp_elt_opcode (OP_LONG);
write_exp_elt_type (val.typed_val_int.type);
current_type = val.typed_val_int.type;
write_exp_elt_longcst ((LONGEST)val.typed_val_int.val);
write_exp_elt_longcst ((LONGEST)
val.typed_val_int.val);
write_exp_elt_opcode (OP_LONG);
}
;
@ -559,7 +561,7 @@ exp : THIS
struct type * this_type;
write_exp_elt_opcode (OP_THIS);
write_exp_elt_opcode (OP_THIS);
/* we need type of this */
/* We need type of this. */
this_val = value_of_this (0);
if (this_val)
this_type = value_type (this_val);
@ -589,7 +591,8 @@ block : BLOCKNAME
struct symtab *tem =
lookup_symtab (copy_name ($1.stoken));
if (tem)
$$ = BLOCKVECTOR_BLOCK (BLOCKVECTOR (tem), STATIC_BLOCK);
$$ = BLOCKVECTOR_BLOCK (BLOCKVECTOR (tem),
STATIC_BLOCK);
else
error ("No file or function \"%s\".",
copy_name ($1.stoken));
@ -659,10 +662,13 @@ variable: qualified_name
msymbol = lookup_minimal_symbol (name, NULL, NULL);
if (msymbol != NULL)
write_exp_msymbol (msymbol);
else if (!have_full_symbols () && !have_partial_symbols ())
error ("No symbol table is loaded. Use the \"file\" command.");
else if (!have_full_symbols ()
&& !have_partial_symbols ())
error ("No symbol table is loaded. "
"Use the \"file\" command.");
else
error ("No symbol \"%s\" in current context.", name);
error ("No symbol \"%s\" in current context.",
name);
}
;
@ -703,7 +709,7 @@ variable: name_not_typename
write_exp_elt_opcode (STRUCTOP_PTR);
write_exp_string ($1.stoken);
write_exp_elt_opcode (STRUCTOP_PTR);
/* we need type of this */
/* We need type of this. */
this_val = value_of_this (0);
if (this_val)
this_type = value_type (this_val);
@ -725,8 +731,10 @@ variable: name_not_typename
lookup_minimal_symbol (arg, NULL, NULL);
if (msymbol != NULL)
write_exp_msymbol (msymbol);
else if (!have_full_symbols () && !have_partial_symbols ())
error ("No symbol table is loaded. Use the \"file\" command.");
else if (!have_full_symbols ()
&& !have_partial_symbols ())
error ("No symbol table is loaded. "
"Use the \"file\" command.");
else
error ("No symbol \"%s\" in current context.",
copy_name ($1.stoken));
@ -823,7 +831,7 @@ parse_number (char *p, int len, int parsed_float, YYSTYPE *putithere)
return FLOAT;
}
/* Handle base-switching prefixes 0x, 0t, 0d, 0 */
/* Handle base-switching prefixes 0x, 0t, 0d, 0. */
if (p[0] == '0')
switch (p[1])
{
@ -889,13 +897,13 @@ parse_number (char *p, int len, int parsed_float, YYSTYPE *putithere)
return ERROR; /* Char not a digit */
}
if (i >= base)
return ERROR; /* Invalid digit in this base */
return ERROR; /* Invalid digit in this base. */
/* Portably test for overflow (only works for nonzero values, so make
a second check for zero). FIXME: Can't we just make n and prevn
unsigned and avoid this? */
if (c != 'l' && c != 'u' && (prevn >= n) && n != 0)
unsigned_p = 1; /* Try something unsigned */
unsigned_p = 1; /* Try something unsigned. */
/* Portably test for unsigned overflow.
FIXME: This check is wrong; for example it doesn't find overflow
@ -1034,8 +1042,8 @@ static const struct token tokentab2[] =
{":=", ASSIGN, BINOP_END},
{"::", COLONCOLON, BINOP_END} };
/* Allocate uppercased var */
/* make an uppercased copy of tokstart */
/* Allocate uppercased var: */
/* make an uppercased copy of tokstart. */
static char * uptok (tokstart, namelen)
char *tokstart;
int namelen;
@ -1079,7 +1087,8 @@ yylex ()
for (i = 0; i < sizeof (tokentab3) / sizeof (tokentab3[0]); i++)
if (strncasecmp (tokstart, tokentab3[i].operator, 3) == 0
&& (!isalpha (tokentab3[i].operator[0]) || explen == 3
|| (!isalpha (tokstart[3]) && !isdigit (tokstart[3]) && tokstart[3] != '_')))
|| (!isalpha (tokstart[3])
&& !isdigit (tokstart[3]) && tokstart[3] != '_')))
{
lexptr += 3;
yylval.opcode = tokentab3[i].opcode;
@ -1091,7 +1100,8 @@ yylex ()
for (i = 0; i < sizeof (tokentab2) / sizeof (tokentab2[0]); i++)
if (strncasecmp (tokstart, tokentab2[i].operator, 2) == 0
&& (!isalpha (tokentab2[i].operator[0]) || explen == 2
|| (!isalpha (tokstart[2]) && !isdigit (tokstart[2]) && tokstart[2] != '_')))
|| (!isalpha (tokstart[2])
&& !isdigit (tokstart[2]) && tokstart[2] != '_')))
{
lexptr += 2;
yylval.opcode = tokentab2[i].opcode;
@ -1186,7 +1196,8 @@ yylex ()
p += 2;
hex = 1;
}
else if (c == '0' && (p[1]=='t' || p[1]=='T' || p[1]=='d' || p[1]=='D'))
else if (c == '0' && (p[1]=='t' || p[1]=='T'
|| p[1]=='d' || p[1]=='D'))
{
p += 2;
hex = 0;
@ -1215,7 +1226,8 @@ yylex ()
&& (*p < 'A' || *p > 'Z')))
break;
}
toktype = parse_number (tokstart, p - tokstart, got_dot|got_e, &yylval);
toktype = parse_number (tokstart,
p - tokstart, got_dot | got_e, &yylval);
if (toktype == ERROR)
{
char *err_copy = (char *) alloca (p - tokstart + 1);
@ -1260,7 +1272,7 @@ yylex ()
the buffer contains no embedded nulls. Gdb does not depend
upon the buffer being null byte terminated, it uses the length
string instead. This allows gdb to handle C strings (as well
as strings in other languages) with embedded null bytes */
as strings in other languages) with embedded null bytes. */
tokptr = ++tokstart;
tempbufindex = 0;
@ -1297,7 +1309,7 @@ yylex ()
{
error ("Unterminated string in expression.");
}
tempbuf[tempbufindex] = '\0'; /* See note above */
tempbuf[tempbufindex] = '\0'; /* See note above. */
yylval.sval.ptr = tempbuf;
yylval.sval.length = tempbufindex;
lexptr = tokptr;
@ -1397,8 +1409,8 @@ yylex ()
}
if (strcmp (uptokstart, "SELF") == 0)
{
/* here we search for 'this' like
inserted in FPC stabs debug info */
/* Here we search for 'this' like
inserted in FPC stabs debug info. */
static const char this_name[] = "this";
if (lookup_symbol (this_name, expression_context_block,
@ -1642,7 +1654,7 @@ yylex ()
}
free(uptokstart);
/* Any other kind of symbol */
/* Any other kind of symbol. */
yylval.ssym.sym = sym;
yylval.ssym.is_a_field_of_this = is_a_field_of_this;
return NAME;

View file

@ -157,7 +157,7 @@ static void pascal_one_char (int, struct ui_file *, int *);
/* Print the character C on STREAM as part of the contents of a literal
string.
In_quotes is reset to 0 if a char is written with #4 notation */
In_quotes is reset to 0 if a char is written with #4 notation. */
static void
pascal_one_char (int c, struct ui_file *stream, int *in_quotes)

View file

@ -83,7 +83,7 @@ pascal_print_type (struct type *type, const char *varstring,
pascal_type_print_base (type, stream, show, level);
/* 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 ? strchr (varstring, '(') != NULL : 0;
pascal_type_print_varspec_suffix (type, stream, show, 0, demangled_args);
@ -107,7 +107,7 @@ pascal_print_typedef (struct type *type, struct symbol *new_symbol,
/* If TYPE is a derived type, then print out derivation information.
Print only the actual base classes of this type, not the base classes
of the base classes. I.E. for the derivation hierarchy:
of the base classes. I.e. for the derivation hierarchy:
class A { int a; };
class B : public A {int b; };
@ -169,7 +169,7 @@ pascal_type_print_method_args (char *physname, char *methodname,
if (physname && (*physname != 0))
{
fputs_filtered (" (", stream);
/* we must demangle this */
/* We must demangle this. */
while (isdigit (physname[0]))
{
int len = 0;
@ -222,8 +222,8 @@ pascal_type_print_varspec_prefix (struct type *type, struct ui_file *stream,
case TYPE_CODE_PTR:
fprintf_filtered (stream, "^");
pascal_type_print_varspec_prefix (TYPE_TARGET_TYPE (type), stream, 0, 1);
break; /* pointer should be handled normally
in pascal */
break; /* Pointer should be handled normally
in pascal. */
case TYPE_CODE_METHOD:
if (passed_a_ptr)
@ -319,7 +319,7 @@ pascal_print_func_args (struct type *type, struct ui_file *stream)
fputs_filtered (", ", stream);
wrap_here (" ");
}
/* can we find if it is a var parameter ??
/* Can we find if it is a var parameter ??
if ( TYPE_FIELD(type, i) == )
{
fprintf_filtered (stream, "var ");
@ -625,7 +625,7 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show,
if (len && section_type != s_none)
fprintf_filtered (stream, "\n");
/* Pbject pascal: print out the methods */
/* Object pascal: print out the methods. */
for (i = 0; i < len; i++)
{
@ -635,7 +635,7 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show,
/* this is GNU C++ specific
how can we know constructor/destructor?
It might work for GNU pascal */
It might work for GNU pascal. */
for (j = 0; j < len2; j++)
{
char *physname = TYPE_FN_FIELD_PHYSNAME (f, j);
@ -699,7 +699,7 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show,
{
fprintf_filtered (stream, "procedure ");
}
/* this does not work, no idea why !! */
/* This does not work, no idea why !! */
pascal_type_print_method_args (physname,
method_name,
@ -776,7 +776,7 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show,
fprintf_filtered (stream, "%s", TYPE_ERROR_NAME (type));
break;
/* this probably does not work for enums */
/* this probably does not work for enums. */
case TYPE_CODE_RANGE:
{
struct type *target = TYPE_TARGET_TYPE (type);

View file

@ -183,14 +183,14 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
&& (options->format == 0 || options->format == 's')
&& addr != 0)
{
/* no wide string yet */
/* No wide string yet. */
i = val_print_string (elttype, NULL, addr, -1, stream, options);
}
/* also for pointers to pascal strings */
/* Also for pointers to pascal strings. */
/* Note: this is Free Pascal specific:
as GDB does not recognize stabs pascal strings
Pascal strings are mapped to records
with lowercase names PM */
with lowercase names PM. */
if (is_pascal_string_type (elttype, &length_pos, &length_size,
&string_pos, &char_type, NULL)
&& addr != 0)
@ -209,7 +209,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr,
}
else if (pascal_object_is_vtbl_member (type))
{
/* print vtbl's nicely */
/* Print vtbl's nicely. */
CORE_ADDR vt_address = unpack_pointer (type,
valaddr + embedded_offset);
struct minimal_symbol *msymbol =
@ -600,7 +600,7 @@ pascal_value_print (struct value *val, struct ui_file *stream,
&& TYPE_NAME (TYPE_TARGET_TYPE (type)) != NULL
&& strcmp (TYPE_NAME (TYPE_TARGET_TYPE (type)), "char") == 0)
{
/* Print nothing */
/* Print nothing. */
}
else
{
@ -662,9 +662,9 @@ pascal_object_is_vtbl_member (struct type *type)
if (TYPE_CODE (type) == TYPE_CODE_ARRAY)
{
type = TYPE_TARGET_TYPE (type);
if (TYPE_CODE (type) == TYPE_CODE_STRUCT /* if not using
thunks */
|| TYPE_CODE (type) == TYPE_CODE_PTR) /* if using thunks */
if (TYPE_CODE (type) == TYPE_CODE_STRUCT /* If not using
thunks. */
|| TYPE_CODE (type) == TYPE_CODE_PTR) /* If using thunks. */
{
/* Virtual functions tables are full of pointers
to virtual functions. */
@ -830,7 +830,7 @@ pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr,
else if (field_is_static (&TYPE_FIELD (type, i)))
{
/* struct value *v = value_static_field (type, i);
v4.17 specific */
v4.17 specific. */
struct value *v;
v = value_from_longest (TYPE_FIELD_TYPE (type, i),

View file

@ -196,7 +196,7 @@ free_funcalls (void *ignore)
/* Add one element to the end of the expression. */
/* To avoid a bug in the Sun 4 compiler, we pass things that can fit into
a register through here */
a register through here. */
void
write_exp_elt (union exp_element expelt)
@ -309,7 +309,7 @@ write_exp_elt_intern (struct internalvar *expelt)
that contains the length of the string, then stuffing the string
constant itself into however many expression elements are needed
to hold it, and then writing another expression element that contains
the length of the string. I.E. an expression element at each end of
the length of the string. I.e. an expression element at each end of
the string records the string length, so you can skip over the
expression elements containing the actual string bytes from either
end of the string. Note that this also allows gdb to handle
@ -427,7 +427,7 @@ write_exp_string_vector (int type, struct stoken_vector *vec)
that contains the length of the bitstring (in bits), then stuffing the
bitstring constant itself into however many expression elements are
needed to hold it, and then writing another expression element that
contains the length of the bitstring. I.E. an expression element at
contains the length of the bitstring. I.e. an expression element at
each end of the bitstring records the bitstring length, so you can skip
over the expression elements containing the actual bitstring bytes from
either end of the bitstring. */
@ -557,16 +557,14 @@ mark_struct_expression (void)
from the first value which has index 1.
$$digits Value history with index <digits> relative
to the last value. I.E. $$0 is the last
to the last value. I.e. $$0 is the last
value, $$1 is the one previous to that, $$2
is the one previous to $$1, etc.
$ | $0 | $$0 The last value in the value history.
$$ An abbreviation for the second to the last
value in the value history, I.E. $$1
*/
value in the value history, I.e. $$1 */
void
write_dollar_variable (struct stoken str)
@ -589,7 +587,7 @@ write_dollar_variable (struct stoken str)
}
if (i == str.length)
{
/* Just dollars (one or two) */
/* Just dollars (one or two). */
i = -negate;
goto handle_last;
}
@ -852,7 +850,7 @@ operator_length_standard (const struct expression *expr, int endpos,
args = 1;
break;
case OP_OBJC_MSGCALL: /* Objective C message (method) call */
case OP_OBJC_MSGCALL: /* Objective C message (method) call. */
oplen = 4;
args = 1 + longest_to_int (expr->elts[endpos - 2].longconst);
break;
@ -904,8 +902,8 @@ operator_length_standard (const struct expression *expr, int endpos,
case OP_M2_STRING:
case OP_STRING:
case OP_OBJC_NSSTRING: /* Objective C Foundation Class
NSString constant */
case OP_OBJC_SELECTOR: /* Objective C "@selector" pseudo-op */
NSString constant. */
case OP_OBJC_SELECTOR: /* Objective C "@selector" pseudo-op. */
case OP_NAME:
oplen = longest_to_int (expr->elts[endpos - 2].longconst);
oplen = 4 + BYTES_TO_EXP_ELEM (oplen + 1);
@ -1245,7 +1243,7 @@ parse_field_expression (char *string, char **name)
return value_type (val);
}
/* A post-parser that does nothing */
/* A post-parser that does nothing. */
void
null_post_parser (struct expression **exp, int void_context_p)

View file

@ -66,9 +66,9 @@ extern int arglist_len;
struct stoken
{
/* Pointer to first byte of char-string or first bit of bit-string */
/* Pointer to first byte of char-string or first bit of bit-string. */
char *ptr;
/* Length of string in bytes for char-string or bits for bit-string */
/* Length of string in bytes for char-string or bits for bit-string. */
int length;
};
@ -76,9 +76,9 @@ struct typed_stoken
{
/* A language-specific type field. */
int type;
/* Pointer to first byte of char-string or first bit of bit-string */
/* Pointer to first byte of char-string or first bit of bit-string. */
char *ptr;
/* Length of string in bytes for char-string or bits for bit-string */
/* Length of string in bytes for char-string or bits for bit-string. */
int length;
};

View file

@ -130,12 +130,12 @@
struct ppc_debug_info
{
uint32_t version; /* Only version 1 exists to date */
uint32_t version; /* Only version 1 exists to date. */
uint32_t num_instruction_bps;
uint32_t num_data_bps;
uint32_t num_condition_regs;
uint32_t data_bp_alignment;
uint32_t sizeof_condition; /* size of the DVC register */
uint32_t sizeof_condition; /* size of the DVC register. */
uint64_t features;
};
@ -325,10 +325,14 @@ PT_R0, PT_R1, PT_R2, PT_R3, PT_R4, PT_R5, PT_R6, PT_R7,
PT_R8, PT_R9, PT_R10, PT_R11, PT_R12, PT_R13, PT_R14, PT_R15,
PT_R16, PT_R17, PT_R18, PT_R19, PT_R20, PT_R21, PT_R22, PT_R23,
PT_R24, PT_R25, PT_R26, PT_R27, PT_R28, PT_R29, PT_R30, PT_R31,
PT_FPR0, PT_FPR0 + 2, PT_FPR0 + 4, PT_FPR0 + 6, PT_FPR0 + 8, PT_FPR0 + 10, PT_FPR0 + 12, PT_FPR0 + 14,
PT_FPR0 + 16, PT_FPR0 + 18, PT_FPR0 + 20, PT_FPR0 + 22, PT_FPR0 + 24, PT_FPR0 + 26, PT_FPR0 + 28, PT_FPR0 + 30,
PT_FPR0 + 32, PT_FPR0 + 34, PT_FPR0 + 36, PT_FPR0 + 38, PT_FPR0 + 40, PT_FPR0 + 42, PT_FPR0 + 44, PT_FPR0 + 46,
PT_FPR0 + 48, PT_FPR0 + 50, PT_FPR0 + 52, PT_FPR0 + 54, PT_FPR0 + 56, PT_FPR0 + 58, PT_FPR0 + 60, PT_FPR0 + 62,
PT_FPR0, PT_FPR0 + 2, PT_FPR0 + 4, PT_FPR0 + 6,
PT_FPR0 + 8, PT_FPR0 + 10, PT_FPR0 + 12, PT_FPR0 + 14,
PT_FPR0 + 16, PT_FPR0 + 18, PT_FPR0 + 20, PT_FPR0 + 22,
PT_FPR0 + 24, PT_FPR0 + 26, PT_FPR0 + 28, PT_FPR0 + 30,
PT_FPR0 + 32, PT_FPR0 + 34, PT_FPR0 + 36, PT_FPR0 + 38,
PT_FPR0 + 40, PT_FPR0 + 42, PT_FPR0 + 44, PT_FPR0 + 46,
PT_FPR0 + 48, PT_FPR0 + 50, PT_FPR0 + 52, PT_FPR0 + 54,
PT_FPR0 + 56, PT_FPR0 + 58, PT_FPR0 + 60, PT_FPR0 + 62,
PT_NIP, PT_MSR, PT_CCR, PT_LNK, PT_CTR, PT_XER, PT_MQ */
/* *INDENT_ON * */
@ -341,7 +345,7 @@ ppc_register_u_addr (struct gdbarch *gdbarch, int regno)
interface, and not the wordsize of the program's ABI. */
int wordsize = sizeof (long);
/* General purpose registers occupy 1 slot each in the buffer */
/* General purpose registers occupy 1 slot each in the buffer. */
if (regno >= tdep->ppc_gp0_regnum
&& regno < tdep->ppc_gp0_regnum + ppc_num_gprs)
u_addr = ((regno - tdep->ppc_gp0_regnum + PT_R0) * wordsize);
@ -354,7 +358,7 @@ ppc_register_u_addr (struct gdbarch *gdbarch, int regno)
&& regno < tdep->ppc_fp0_regnum + ppc_num_fprs)
u_addr = (PT_FPR0 * wordsize) + ((regno - tdep->ppc_fp0_regnum) * 8);
/* UISA special purpose registers: 1 slot each */
/* UISA special purpose registers: 1 slot each. */
if (regno == gdbarch_pc_regnum (gdbarch))
u_addr = PT_NIP * wordsize;
if (regno == tdep->ppc_lr_regnum)
@ -459,7 +463,8 @@ fetch_altivec_register (struct regcache *regcache, int tid, int regno)
offset = vrregsize - register_size (gdbarch, tdep->ppc_vrsave_regnum);
regcache_raw_supply (regcache, regno,
regs + (regno - tdep->ppc_vr0_regnum) * vrregsize + offset);
regs + (regno
- tdep->ppc_vr0_regnum) * vrregsize + offset);
}
/* Fetch the top 32 bits of TID's general-purpose registers and the
@ -855,10 +860,10 @@ static void
ppc_linux_fetch_inferior_registers (struct target_ops *ops,
struct regcache *regcache, int regno)
{
/* Overload thread id onto process id */
/* Overload thread id onto process id. */
int tid = TIDGET (inferior_ptid);
/* No thread id, just use process id */
/* No thread id, just use process id. */
if (tid == 0)
tid = PIDGET (inferior_ptid);
@ -925,7 +930,8 @@ store_altivec_register (const struct regcache *regcache, int tid, int regno)
offset = vrregsize - register_size (gdbarch, tdep->ppc_vrsave_regnum);
regcache_raw_collect (regcache, regno,
regs + (regno - tdep->ppc_vr0_regnum) * vrregsize + offset);
regs + (regno
- tdep->ppc_vr0_regnum) * vrregsize + offset);
ret = ptrace (PTRACE_SETVRREGS, tid, 0, &regs);
if (ret < 0)
@ -1413,7 +1419,8 @@ have_ptrace_booke_interface (void)
{
have_ptrace_booke_interface = 1;
max_slots_number = booke_debug_info.num_instruction_bps
+ booke_debug_info.num_data_bps + booke_debug_info.num_condition_regs;
+ booke_debug_info.num_data_bps
+ booke_debug_info.num_condition_regs;
}
else
{
@ -1464,9 +1471,9 @@ ppc_linux_can_use_hw_breakpoint (int type, int cnt, int ot)
int tid;
ptid_t ptid = inferior_ptid;
/* We need to know whether ptrace supports PTRACE_SET_DEBUGREG and whether
the target has DABR. If either answer is no, the ptrace call will
return -1. Fail in that case. */
/* We need to know whether ptrace supports PTRACE_SET_DEBUGREG
and whether the target has DABR. If either answer is no, the
ptrace call will return -1. Fail in that case. */
tid = TIDGET (ptid);
if (tid == 0)
tid = PIDGET (ptid);
@ -1541,7 +1548,8 @@ booke_find_thread_points_by_tid (int tid, int alloc_new)
if (alloc_new)
{
t = xmalloc (sizeof (struct thread_points));
t->hw_breaks = xzalloc (max_slots_number * sizeof (struct hw_break_tuple));
t->hw_breaks
= xzalloc (max_slots_number * sizeof (struct hw_break_tuple));
t->tid = tid;
VEC_safe_push (thread_points_p, ppc_threads, t);
}
@ -1615,7 +1623,8 @@ booke_remove_point (struct ppc_hw_breakpoint *b, int tid)
errno = 0;
if (ptrace (PPC_PTRACE_DELHWDEBUG, tid, 0, hw_breaks[i].slot) < 0)
if (errno != ENOENT)
perror_with_name (_("Unexpected error deleting breakpoint or watchpoint"));
perror_with_name (_("Unexpected error deleting "
"breakpoint or watchpoint"));
xfree (hw_breaks[i].hw_break);
hw_breaks[i].hw_break = NULL;
@ -1750,7 +1759,8 @@ calculate_dvc (CORE_ADDR addr, int len, CORE_ADDR data_value,
*condition_mode = PPC_BREAKPOINT_CONDITION_AND;
for (i = 0; i < num_byte_enable; i++)
*condition_mode |= PPC_BREAKPOINT_CONDITION_BE (i + rightmost_enabled_byte);
*condition_mode
|= PPC_BREAKPOINT_CONDITION_BE (i + rightmost_enabled_byte);
/* Now we need to match the position within the DVC of the comparison
value with where the watch region is relative to the window
@ -2141,10 +2151,10 @@ static void
ppc_linux_store_inferior_registers (struct target_ops *ops,
struct regcache *regcache, int regno)
{
/* Overload thread id onto process id */
/* Overload thread id onto process id. */
int tid = TIDGET (inferior_ptid);
/* No thread id, just use process id */
/* No thread id, just use process id. */
if (tid == 0)
tid = PIDGET (inferior_ptid);
@ -2156,7 +2166,7 @@ ppc_linux_store_inferior_registers (struct target_ops *ops,
/* Functions for transferring registers between a gregset_t or fpregset_t
(see sys/ucontext.h) and gdb's regcache. The word size is that used
by the ptrace interface, not the current program's ABI. eg. If a
by the ptrace interface, not the current program's ABI. Eg. if a
powerpc64-linux gdb is being used to debug a powerpc32-linux app, we
read or write 64-bit gregsets. This is to suit the host libthread_db. */
@ -2314,7 +2324,8 @@ ppc_linux_read_description (struct target_ops *ops)
else if (vsx)
return isa205? tdesc_powerpc_isa205_vsx64l : tdesc_powerpc_vsx64l;
else if (altivec)
return isa205? tdesc_powerpc_isa205_altivec64l : tdesc_powerpc_altivec64l;
return isa205
? tdesc_powerpc_isa205_altivec64l : tdesc_powerpc_altivec64l;
return isa205? tdesc_powerpc_isa205_64l : tdesc_powerpc_64l;
}
@ -2353,7 +2364,8 @@ _initialize_ppc_linux_nat (void)
t->to_stopped_by_watchpoint = ppc_linux_stopped_by_watchpoint;
t->to_stopped_data_address = ppc_linux_stopped_data_address;
t->to_watchpoint_addr_within_range = ppc_linux_watchpoint_addr_within_range;
t->to_can_accel_watchpoint_condition = ppc_linux_can_accel_watchpoint_condition;
t->to_can_accel_watchpoint_condition
= ppc_linux_can_accel_watchpoint_condition;
t->to_read_description = ppc_linux_read_description;
t->to_auxv_parse = ppc_linux_auxv_parse;

View file

@ -216,7 +216,7 @@ ppc_linux_memory_remove_breakpoint (struct gdbarch *gdbarch,
/* If our breakpoint is no longer at the address, this means that the
program modified the code on us, so it is wrong to put back the
old value */
old value. */
if (val == 0 && memcmp (bp, old_contents, bplen) == 0)
val = target_write_memory (addr, bp_tgt->shadow_contents, bplen);
@ -912,7 +912,8 @@ ppc_linux_sigtramp_cache (struct frame_info *this_frame,
for (i = 0; i < 32; i++)
{
int regnum = i + tdep->ppc_gp0_regnum;
trad_frame_set_reg_addr (this_cache, regnum, gpregs + i * tdep->wordsize);
trad_frame_set_reg_addr (this_cache,
regnum, gpregs + i * tdep->wordsize);
}
trad_frame_set_reg_addr (this_cache,
gdbarch_pc_regnum (gdbarch),
@ -1526,8 +1527,10 @@ ppc_linux_init_abi (struct gdbarch_info info,
set_xml_syscall_file_name (XML_SYSCALL_FILENAME_PPC);
/* Trampolines. */
tramp_frame_prepend_unwinder (gdbarch, &ppc32_linux_sigaction_tramp_frame);
tramp_frame_prepend_unwinder (gdbarch, &ppc32_linux_sighandler_tramp_frame);
tramp_frame_prepend_unwinder (gdbarch,
&ppc32_linux_sigaction_tramp_frame);
tramp_frame_prepend_unwinder (gdbarch,
&ppc32_linux_sighandler_tramp_frame);
/* BFD target for core files. */
if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_LITTLE)
@ -1565,8 +1568,10 @@ ppc_linux_init_abi (struct gdbarch_info info,
set_xml_syscall_file_name (XML_SYSCALL_FILENAME_PPC64);
/* Trampolines. */
tramp_frame_prepend_unwinder (gdbarch, &ppc64_linux_sigaction_tramp_frame);
tramp_frame_prepend_unwinder (gdbarch, &ppc64_linux_sighandler_tramp_frame);
tramp_frame_prepend_unwinder (gdbarch,
&ppc64_linux_sigaction_tramp_frame);
tramp_frame_prepend_unwinder (gdbarch,
&ppc64_linux_sighandler_tramp_frame);
/* BFD target for core files. */
if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_LITTLE)
@ -1587,7 +1592,8 @@ ppc_linux_init_abi (struct gdbarch_info info,
set_gdbarch_core_regset_sections (gdbarch,
ppc64_linux_fp_regset_sections);
}
set_gdbarch_regset_from_core_section (gdbarch, ppc_linux_regset_from_core_section);
set_gdbarch_regset_from_core_section (gdbarch,
ppc_linux_regset_from_core_section);
set_gdbarch_core_read_description (gdbarch, ppc_linux_core_read_description);
/* Enable TLS support. */

View file

@ -587,7 +587,8 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *type,
if (TYPE_CODE (type) == TYPE_CODE_FLT
&& TYPE_LENGTH (type) == 16
&& !tdep->soft_float
&& (gdbarch_long_double_format (gdbarch) == floatformats_ibm_long_double))
&& (gdbarch_long_double_format (gdbarch)
== floatformats_ibm_long_double))
{
/* IBM long double stored in f1 and f2. */
if (readbuf)
@ -606,7 +607,8 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *type,
}
if (TYPE_LENGTH (type) == 16
&& ((TYPE_CODE (type) == TYPE_CODE_FLT
&& (gdbarch_long_double_format (gdbarch) == floatformats_ibm_long_double))
&& (gdbarch_long_double_format (gdbarch)
== floatformats_ibm_long_double))
|| (TYPE_CODE (type) == TYPE_CODE_DECFLOAT && tdep->soft_float)))
{
/* Soft-float IBM long double or _Decimal128 stored in r3, r4,
@ -888,7 +890,8 @@ convert_code_addr_to_desc_addr (CORE_ADDR code_addr, CORE_ADDR *desc_addr)
greatly simplifies the logic. */
CORE_ADDR
ppc64_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
ppc64_sysv_abi_push_dummy_call (struct gdbarch *gdbarch,
struct value *function,
struct regcache *regcache, CORE_ADDR bp_addr,
int nargs, struct value **args, CORE_ADDR sp,
int struct_return, CORE_ADDR struct_addr)
@ -1452,7 +1455,8 @@ ppc64_sysv_abi_return_value (struct gdbarch *gdbarch, struct type *func_type,
if (readbuf)
regcache_cooked_read (regcache, tdep->ppc_vr0_regnum + 2, readbuf);
if (writebuf)
regcache_cooked_write (regcache, tdep->ppc_vr0_regnum + 2, writebuf);
regcache_cooked_write (regcache, tdep->ppc_vr0_regnum + 2,
writebuf);
return RETURN_VALUE_REGISTER_CONVENTION;
}
}

View file

@ -146,7 +146,7 @@ extern void ppc_supply_vsxregset (const struct regset *regset,
int regnum, const void *vsxregs, size_t len);
/* Collect register REGNUM in the general-purpose register set
REGSET. from register cache REGCACHE into the buffer specified by
REGSET, from register cache REGCACHE into the buffer specified by
GREGS and LEN. If REGNUM is -1, do this for all registers in
REGSET. */
@ -155,7 +155,7 @@ extern void ppc_collect_gregset (const struct regset *regset,
int regnum, void *gregs, size_t len);
/* Collect register REGNUM in the floating-point register set
REGSET. from register cache REGCACHE into the buffer specified by
REGSET, from register cache REGCACHE into the buffer specified by
FPREGS and LEN. If REGNUM is -1, do this for all registers in
REGSET. */
@ -214,8 +214,8 @@ struct gdbarch_tdep
is not present in this variant. */
/* Floating-point registers. */
int ppc_fp0_regnum; /* floating-point register 0 */
int ppc_fpscr_regnum; /* fp status and condition register */
int ppc_fp0_regnum; /* Floating-point register 0. */
int ppc_fpscr_regnum; /* fp status and condition register. */
/* Multiplier-Quotient Register (older POWER architectures only). */
int ppc_mq_regnum;
@ -226,14 +226,14 @@ struct gdbarch_tdep
int ppc_efpr0_regnum; /* First Extended FP register. */
/* Altivec registers. */
int ppc_vr0_regnum; /* First AltiVec register */
int ppc_vrsave_regnum; /* Last AltiVec register */
int ppc_vr0_regnum; /* First AltiVec register. */
int ppc_vrsave_regnum; /* Last AltiVec register. */
/* SPE registers. */
int ppc_ev0_upper_regnum; /* First GPR upper half register */
int ppc_ev0_regnum; /* First ev register */
int ppc_acc_regnum; /* SPE 'acc' register */
int ppc_spefscr_regnum; /* SPE 'spefscr' register */
int ppc_ev0_upper_regnum; /* First GPR upper half register. */
int ppc_ev0_regnum; /* First ev register. */
int ppc_acc_regnum; /* SPE 'acc' register. */
int ppc_spefscr_regnum; /* SPE 'spefscr' register. */
/* Decimal 128 registers. */
int ppc_dl0_regnum; /* First Decimal128 argument register pair. */

View file

@ -165,7 +165,8 @@ init_ppc_cmds (char *LOAD_CMD,
OPS->getreg.resp_delim = "="; /* getreg.resp_delim */
OPS->getreg.term = NULL; /* getreg.term */
OPS->getreg.term_cmd = NULL; /* getreg.term_cmd */
OPS->register_pattern = "\\(\\w+\\) +=\\([0-9a-fA-F]+\\b\\)"; /* register_pattern */
/* register_pattern */
OPS->register_pattern = "\\(\\w+\\) +=\\([0-9a-fA-F]+\\b\\)";
OPS->supply_register = ppcbug_supply_register;
OPS->dump_registers = "rd\r"; /* dump all registers */
OPS->load_routine = NULL; /* load_routine (defaults to SRECs) */

View file

@ -74,7 +74,7 @@ ppcnbsd_regset_from_core_section (struct gdbarch *gdbarch,
/* NetBSD is confused. It appears that 1.5 was using the correct SVR4
convention but, 1.6 switched to the below broken convention. For
the moment use the broken convention. Ulgh!. */
the moment use the broken convention. Ulgh! */
static enum return_value_convention
ppcnbsd_return_value (struct gdbarch *gdbarch, struct type *func_type,

View file

@ -57,7 +57,7 @@ ppcobsd_supply_gregset (const struct regset *regset,
}
/* Collect register REGNUM in the general-purpose register set
REGSET. from register cache REGCACHE into the buffer specified by
REGSET, from register cache REGCACHE into the buffer specified by
GREGS and LEN. If REGNUM is -1, do this for all registers in
REGSET. */

View file

@ -44,7 +44,7 @@ extern void ppcobsd_supply_gregset (const struct regset *regset,
const void *gregs, size_t len);
/* Collect register REGNUM in the general-purpose register set
REGSET. from register cache REGCACHE into the buffer specified by
REGSET, from register cache REGCACHE into the buffer specified by
GREGS and LEN. If REGNUM is -1, do this for all registers in
REGSET. */

View file

@ -51,7 +51,7 @@
#include "arch-utils.h"
#ifdef TUI
#include "tui/tui.h" /* For tui_active et.al. */
#include "tui/tui.h" /* For tui_active et al. */
#endif
#if defined(__MINGW32__) && !defined(PRINTF_HAS_LONG_LONG)
@ -61,7 +61,8 @@
# define USE_PRINTF_I64 0
#endif
extern int asm_demangle; /* Whether to demangle syms in asm printouts */
extern int asm_demangle; /* Whether to demangle syms in asm
printouts. */
struct format_data
{
@ -152,10 +153,10 @@ struct display
/* Program space associated with `block'. */
struct program_space *pspace;
/* Innermost block required by this expression when evaluated */
/* Innermost block required by this expression when evaluated. */
struct block *block;
/* Status of this display (enabled or disabled) */
/* Status of this display (enabled or disabled). */
int enabled_p;
};
@ -857,8 +858,8 @@ do_examine (struct format_data fmt, struct gdbarch *gdbarch, CORE_ADDR addr)
else
{
if (size != '\0' && size != 'b')
warning (_("Unable to display strings with size '%c', using 'b' \
instead."), size);
warning (_("Unable to display strings with "
"size '%c', using 'b' instead."), size);
size = 'b';
val_type = builtin_type (next_gdbarch)->builtin_int8;
}
@ -1988,7 +1989,7 @@ ui_printf (char *arg, struct ui_file *stream)
if (s == 0)
error_no_arg (_("format-control string and values to print"));
/* Skip white space before format string */
/* Skip white space before format string. */
while (*s == ' ' || *s == '\t')
s++;
@ -2040,7 +2041,7 @@ ui_printf (char *arg, struct ui_file *stream)
*f++ = '"';
break;
default:
/* ??? TODO: handle other escape sequences */
/* ??? TODO: handle other escape sequences. */
error (_("Unrecognized escape character \\%c in format string."),
c);
}

View file

@ -363,7 +363,7 @@ typedef lwpstatus_t gdb_lwpstatus_t;
# define STATUS_PROC_NAME_FMT "/proc/%05d"
# define MAX_PROC_NAME_SIZE sizeof("/proc/ttttppppp")
# endif
/* the name of the proc status struct depends on the implementation */
/* The name of the proc status struct depends on the implementation. */
typedef prstatus_t gdb_prstatus_t;
typedef prstatus_t gdb_lwpstatus_t;
#endif /* NEW_PROC_API */
@ -589,8 +589,7 @@ open_procinfo_files (procinfo *pi, int which)
These do not even have their own independent file descriptor.
All operations are carried out on the file descriptor of the
parent process. Therefore we just call open again for each
thread, getting a new handle for the same 'file'.
*/
thread, getting a new handle for the same 'file'. */
#ifdef NEW_PROC_API
/* In this case, there are several different file descriptors that
@ -599,7 +598,7 @@ open_procinfo_files (procinfo *pi, int which)
needed. */
strcpy (tmp, pi->pathname);
switch (which) { /* which file descriptor to open? */
switch (which) { /* Which file descriptor to open? */
case FD_CTL:
if (pi->tid)
strcat (tmp, "/lwpctl");
@ -612,7 +611,7 @@ open_procinfo_files (procinfo *pi, int which)
break;
case FD_AS:
if (pi->tid)
return 0; /* there is no 'as' file descriptor for an lwp */
return 0; /* There is no 'as' file descriptor for an lwp. */
strcat (tmp, "/as");
fd = open_with_retry (tmp, O_RDWR);
if (fd <= 0)
@ -670,7 +669,7 @@ open_procinfo_files (procinfo *pi, int which)
if ((fd = ioctl (process->ctl_fd, PIOCOPENLWP, &lwpid)) <= 0)
return 0; /* fail */
#else /* Irix, other? */
return 0; /* Don't know how to open threads */
return 0; /* Don't know how to open threads. */
#endif /* Sol 2.5 PIOCOPENLWP */
}
#endif /* OSF PIOCTSTATUS */
@ -692,7 +691,7 @@ create_procinfo (int pid, int tid)
if ((pi = find_procinfo (pid, tid)))
return pi; /* Already exists, nothing to do. */
/* find parent before doing malloc, to save having to cleanup */
/* Find parent before doing malloc, to save having to cleanup. */
if (tid != 0)
parent = find_procinfo_or_die (pid, 0); /* FIXME: should I
create it if it
@ -781,12 +780,12 @@ destroy_procinfo (procinfo *pi)
{
procinfo *tmp;
if (pi->tid != 0) /* destroy a thread procinfo */
if (pi->tid != 0) /* Destroy a thread procinfo. */
{
tmp = find_procinfo (pi->pid, 0); /* find the parent process */
tmp = find_procinfo (pi->pid, 0); /* Find the parent process. */
destroy_one_procinfo (&tmp->thread_list, pi);
}
else /* destroy a process procinfo and all its threads */
else /* Destroy a process procinfo and all its threads. */
{
/* First destroy the children, if any; */
while (pi->thread_list != NULL)
@ -953,7 +952,7 @@ load_syscalls (procinfo *pi)
if (pi->syscall_names[callnum] != NULL)
{
/* FIXME: Generate warning */
/* FIXME: Generate warning. */
continue;
}
@ -1090,7 +1089,7 @@ proc_error (procinfo *pi, char *func, int line)
int
proc_get_status (procinfo *pi)
{
/* Status file descriptor is opened "lazily" */
/* Status file descriptor is opened "lazily". */
if (pi->status_fd == 0 &&
open_procinfo_files (pi, FD_STATUS) == 0)
{
@ -1373,7 +1372,7 @@ proc_modify_flag (procinfo *pi, long flag, long mode)
if (pi->pid != 0)
pi = find_procinfo_or_die (pi->pid, 0);
#ifdef NEW_PROC_API /* Newest method: UnixWare and newer Solarii */
#ifdef NEW_PROC_API /* Newest method: UnixWare and newer Solarii. */
/* First normalize the PCUNSET/PCRESET command opcode
(which for no obvious reason has a different definition
from one operating system to the next...) */
@ -1387,9 +1386,9 @@ proc_modify_flag (procinfo *pi, long flag, long mode)
{
procfs_ctl_t arg[2];
if (mode == FLAG_SET) /* Set the flag (RLC, FORK, or ASYNC) */
if (mode == FLAG_SET) /* Set the flag (RLC, FORK, or ASYNC). */
arg[0] = PCSET;
else /* Reset the flag */
else /* Reset the flag. */
arg[0] = GDBRESET;
arg[1] = flag;
@ -1397,11 +1396,11 @@ proc_modify_flag (procinfo *pi, long flag, long mode)
}
#else
#ifdef PIOCSET /* Irix/Sol5 method */
if (mode == FLAG_SET) /* Set the flag (hopefully RLC, FORK, or ASYNC) */
if (mode == FLAG_SET) /* Set the flag (hopefully RLC, FORK, or ASYNC). */
{
win = (ioctl (pi->ctl_fd, PIOCSET, &flag) >= 0);
}
else /* Reset the flag */
else /* Reset the flag. */
{
win = (ioctl (pi->ctl_fd, PIOCRESET, &flag) >= 0);
}
@ -1430,7 +1429,7 @@ proc_modify_flag (procinfo *pi, long flag, long mode)
}
break;
default:
win = 0; /* fail -- unknown flag (can't do PR_ASYNC) */
win = 0; /* Fail -- unknown flag (can't do PR_ASYNC). */
break;
}
#endif
@ -1654,12 +1653,12 @@ proc_run_process (procinfo *pi, int step, int signo)
return 0;
}
runflags = PRCFAULT; /* always clear current fault */
runflags = PRCFAULT; /* Always clear current fault. */
if (step)
runflags |= PRSTEP;
if (signo == 0)
runflags |= PRCSIG;
else if (signo != -1) /* -1 means do nothing W.R.T. signals */
else if (signo != -1) /* -1 means do nothing W.R.T. signals. */
proc_set_current_signal (pi, signo);
#ifdef NEW_PROC_API
@ -2681,8 +2680,8 @@ proc_set_watchpoint (procinfo *pi, CORE_ADDR addr, int len, int wflags)
systems. */
return 0;
#else
/* Horrible hack! Detect Solaris 2.5, because this doesn't work on 2.5 */
#if defined (PIOCOPENLWP) || defined (UNIXWARE) /* Solaris 2.5: bail out */
/* Horrible hack! Detect Solaris 2.5, because this doesn't work on 2.5. */
#if defined (PIOCOPENLWP) || defined (UNIXWARE) /* Solaris 2.5: bail out. */
return 0;
#else
struct {
@ -2866,7 +2865,7 @@ proc_get_nthreads (procinfo *pi)
/* NEW_PROC_API: only works for the process procinfo, because the
LWP procinfos do not get prstatus filled in. */
#ifdef NEW_PROC_API
if (pi->tid != 0) /* find the parent process procinfo */
if (pi->tid != 0) /* Find the parent process procinfo. */
pi = find_procinfo_or_die (pi->pid, 0);
#endif
return pi->prstatus.pr_nlwp;
@ -2998,7 +2997,7 @@ proc_update_threads (procinfo *pi)
}
#else
#ifdef NEW_PROC_API
/* Unixware and Solaris 6 (and later) version */
/* Unixware and Solaris 6 (and later) version. */
static void
do_closedir_cleanup (void *dir)
{
@ -3071,7 +3070,7 @@ proc_update_threads (procinfo *pi)
nthreads = proc_get_nthreads (pi);
if (nthreads < 2)
return 0; /* nothing to do for 1 or fewer threads */
return 0; /* Nothing to do for 1 or fewer threads. */
threads = xmalloc (nthreads * sizeof (tid_t));
@ -3129,7 +3128,7 @@ proc_iterate_over_threads (procinfo *pi,
for (thread = pi->thread_list; thread != NULL; thread = next)
{
next = thread->next; /* in case thread is destroyed */
next = thread->next; /* In case thread is destroyed. */
if ((retval = (*func) (pi, thread, ptr)) != 0)
break;
}
@ -3236,7 +3235,7 @@ procfs_debug_inferior (procinfo *pi)
return __LINE__;
}
#else /* not PRFS_STOPEXEC */
/* Everyone else's (except OSF) method for tracing exec syscalls */
/* Everyone else's (except OSF) method for tracing exec syscalls. */
/* GW: Rationale...
Not all systems with /proc have all the exec* syscalls with the same
names. On the SGI, for example, there is no SYS_exec, but there
@ -3259,7 +3258,7 @@ procfs_debug_inferior (procinfo *pi)
gdb_praddsysset (traced_syscall_exits, SYS_lwpexit);
#endif
#ifdef SYS_lwp_create /* FIXME: once only, please */
#ifdef SYS_lwp_create /* FIXME: once only, please. */
gdb_praddsysset (traced_syscall_exits, SYS_lwp_create);
gdb_praddsysset (traced_syscall_exits, SYS_lwp_exit);
#endif
@ -3417,7 +3416,7 @@ do_detach (int signo)
{
procinfo *pi;
/* Find procinfo for the main process */
/* Find procinfo for the main process. */
pi = find_procinfo_or_die (PIDGET (inferior_ptid), 0); /* FIXME: threads */
if (signo)
if (!proc_set_current_signal (pi, signo))
@ -3812,7 +3811,7 @@ static ptid_t
procfs_wait (struct target_ops *ops,
ptid_t ptid, struct target_waitstatus *status, int options)
{
/* First cut: loosely based on original version 2.1 */
/* First cut: loosely based on original version 2.1. */
procinfo *pi;
int wstat;
int temp_tid;
@ -3826,7 +3825,7 @@ wait_again:
wstat = 0;
retval = pid_to_ptid (-1);
/* Find procinfo for main process */
/* Find procinfo for main process. */
pi = find_procinfo_or_die (PIDGET (inferior_ptid), 0);
if (pi)
{
@ -3851,7 +3850,7 @@ wait_again:
int wait_retval;
/* /proc file not found; presumably child has terminated. */
wait_retval = wait (&wstat); /* "wait" for the child's exit */
wait_retval = wait (&wstat); /* "wait" for the child's exit. */
if (wait_retval != PIDGET (inferior_ptid)) /* wrong child? */
error (_("procfs: couldn't stop "
@ -3920,7 +3919,7 @@ wait_again:
{
struct inferior *inf;
/* Handle SYS_exit call only */
/* Handle SYS_exit call only. */
/* Stopped at entry to SYS_exit.
Make it runnable, resume it, then use
the wait system call to get its exit code.
@ -3954,7 +3953,8 @@ wait_again:
somehow, I could get its termination event
here. */
/* If wait returns -1, that's what we return to GDB. */
/* If wait returns -1, that's what we return
to GDB. */
if (temp < 0)
retval = pid_to_ptid (temp);
}
@ -3982,7 +3982,8 @@ wait_again:
#endif
if (status)
{
/* How to exit gracefully, returning "unknown event" */
/* How to exit gracefully, returning "unknown
event". */
status->kind = TARGET_WAITKIND_SPURIOUS;
return inferior_ptid;
}
@ -4130,13 +4131,13 @@ wait_again:
#endif
/* FIXME: use si_signo where possible. */
case FLTPRIV:
#if (FLTILL != FLTPRIV) /* avoid "duplicate case" error */
#if (FLTILL != FLTPRIV) /* Avoid "duplicate case" error. */
case FLTILL:
#endif
wstat = (SIGILL << 8) | 0177;
break;
case FLTBPT:
#if (FLTTRACE != FLTBPT) /* avoid "duplicate case" error */
#if (FLTTRACE != FLTBPT) /* Avoid "duplicate case" error. */
case FLTTRACE:
#endif
/* If we hit our __dbx_link() internal breakpoint,
@ -4151,20 +4152,21 @@ wait_again:
break;
case FLTSTACK:
case FLTACCESS:
#if (FLTBOUNDS != FLTSTACK) /* avoid "duplicate case" error */
#if (FLTBOUNDS != FLTSTACK) /* Avoid "duplicate case" error. */
case FLTBOUNDS:
#endif
wstat = (SIGSEGV << 8) | 0177;
break;
case FLTIOVF:
case FLTIZDIV:
#if (FLTFPE != FLTIOVF) /* avoid "duplicate case" error */
#if (FLTFPE != FLTIOVF) /* Avoid "duplicate case" error. */
case FLTFPE:
#endif
wstat = (SIGFPE << 8) | 0177;
break;
case FLTPAGE: /* Recoverable page fault */
default: /* FIXME: use si_signo if possible for fault */
default: /* FIXME: use si_signo if possible for
fault. */
retval = pid_to_ptid (-1);
printf_filtered ("procfs:%d -- ", __LINE__);
printf_filtered (_("child stopped for unknown reason:\n"));
@ -4194,7 +4196,7 @@ wait_again:
create_procinfo (PIDGET (retval), TIDGET (retval));
}
}
else /* flags do not indicate STOPPED */
else /* Flags do not indicate STOPPED. */
{
/* surely this can't happen... */
printf_filtered ("procfs:%d -- process not stopped.\n",
@ -4262,7 +4264,7 @@ procfs_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int dowrite,
procinfo *pi;
int nbytes = 0;
/* Find procinfo for main process */
/* Find procinfo for main process. */
pi = find_procinfo_or_die (PIDGET (inferior_ptid), 0);
if (pi->as_fd == 0 &&
open_procinfo_files (pi, FD_AS) == 0)
@ -4405,7 +4407,7 @@ procfs_resume (struct target_ops *ops,
So basically PR_STEP is the sole argument that must be passed
to proc_run_process (for use in the prrun struct by ioctl). */
/* Find procinfo for main process */
/* Find procinfo for main process. */
pi = find_procinfo_or_die (PIDGET (inferior_ptid), 0);
/* First cut: ignore pid argument. */
@ -4446,7 +4448,8 @@ procfs_resume (struct target_ops *ops,
make_signal_thread_runnable,
NULL);
#endif
pi = thread; /* substitute the thread's procinfo for run */
pi = thread; /* Substitute the thread's procinfo
for run. */
}
}
}
@ -4531,7 +4534,7 @@ unconditionally_kill_inferior (procinfo *pi)
parent_pid = proc_parent_pid (pi);
#ifdef PROCFS_NEED_CLEAR_CURSIG_FOR_KILL
/* FIXME: use access functions */
/* FIXME: use access functions. */
/* Alpha OSF/1-3.x procfs needs a clear of the current signal
before the PIOCKILL, otherwise it might generate a corrupted core
file for the inferior. */
@ -4555,7 +4558,7 @@ unconditionally_kill_inferior (procinfo *pi)
newsiginfo.si_errno = 0;
newsiginfo.si_pid = getpid ();
newsiginfo.si_uid = getuid ();
/* FIXME: use proc_set_current_signal */
/* FIXME: use proc_set_current_signal. */
ioctl (pi->ctl_fd, PIOCSSIG, &newsiginfo);
}
#else /* PROCFS_NEED_PIOCSSIG_FOR_KILL */
@ -4587,7 +4590,7 @@ procfs_kill_inferior (struct target_ops *ops)
{
if (!ptid_equal (inferior_ptid, null_ptid)) /* ? */
{
/* Find procinfo for main process */
/* Find procinfo for main process. */
procinfo *pi = find_procinfo (PIDGET (inferior_ptid), 0);
if (pi)
@ -4605,7 +4608,7 @@ procfs_mourn_inferior (struct target_ops *ops)
if (!ptid_equal (inferior_ptid, null_ptid))
{
/* Find procinfo for main process */
/* Find procinfo for main process. */
pi = find_procinfo (PIDGET (inferior_ptid), 0);
if (pi)
destroy_procinfo (pi);
@ -4982,7 +4985,7 @@ procfs_find_new_threads (struct target_ops *ops)
{
procinfo *pi;
/* Find procinfo for main process */
/* Find procinfo for main process. */
pi = find_procinfo_or_die (PIDGET (inferior_ptid), 0);
proc_update_threads (pi);
proc_iterate_over_threads (pi, procfs_notice_thread, NULL);
@ -5046,8 +5049,8 @@ procfs_set_watchpoint (ptid_t ptid, CORE_ADDR addr, int len, int rwflag,
pi = find_procinfo_or_die (PIDGET (ptid) == -1 ?
PIDGET (inferior_ptid) : PIDGET (ptid), 0);
/* Translate from GDB's flags to /proc's */
if (len > 0) /* len == 0 means delete watchpoint */
/* Translate from GDB's flags to /proc's. */
if (len > 0) /* len == 0 means delete watchpoint. */
{
switch (rwflag) { /* FIXME: need an enum! */
case hw_write: /* default watchpoint (write) */
@ -5071,7 +5074,7 @@ procfs_set_watchpoint (ptid_t ptid, CORE_ADDR addr, int len, int rwflag,
if (!proc_set_watchpoint (pi, addr, len, pflags))
{
if (errno == E2BIG) /* Typical error for no resources */
if (errno == E2BIG) /* Typical error for no resources. */
return -1; /* fail */
/* GDB may try to remove the same watchpoint twice.
If a remove request returns no match, don't error. */

View file

@ -45,7 +45,7 @@ struct partial_symbol
ENUM_BITFIELD(domain_enum_tag) domain : 6;
/* Address class (for info_symbols) */
/* Address class (for info_symbols). */
ENUM_BITFIELD(address_class) aclass : 6;
@ -71,7 +71,7 @@ struct partial_symtab
struct partial_symtab *next;
/* Name of the source file which this partial_symtab defines */
/* Name of the source file which this partial_symtab defines. */
const char *filename;

View file

@ -114,7 +114,7 @@ lookup_partial_symtab (struct objfile *objfile, const char *name,
}
}
/* Now, search for a matching tail (only if name doesn't have any dirs) */
/* Now, search for a matching tail (only if name doesn't have any dirs). */
if (lbasename (name) == name)
ALL_OBJFILE_PSYMTABS (objfile, pst)
@ -163,7 +163,7 @@ find_pc_sect_psymtab_closer (CORE_ADDR pc, struct obj_section *section,
we want the partial symbol table that contains the
function containing the PC. */
if (!(objfile->flags & OBJF_REORDERED) &&
section == 0) /* can't validate section this way */
section == 0) /* Can't validate section this way. */
return pst;
if (msymbol == NULL)
@ -327,7 +327,7 @@ find_pc_sect_psymbol (struct partial_symtab *psymtab, CORE_ADDR pc,
gdb_assert (psymtab != NULL);
/* Cope with programs that start at address 0 */
/* Cope with programs that start at address 0. */
best_pc = (psymtab->textlow != 0) ? psymtab->textlow - 1 : 0;
/* Search the global symbols as well as the static symbols, so that
@ -346,7 +346,7 @@ find_pc_sect_psymbol (struct partial_symtab *psymtab, CORE_ADDR pc,
|| (psymtab->textlow == 0
&& best_pc == 0 && SYMBOL_VALUE_ADDRESS (p) == 0)))
{
if (section) /* match on a specific section */
if (section) /* Match on a specific section. */
{
fixup_psymbol_section (p, psymtab->objfile);
if (!matching_obj_sections (SYMBOL_OBJ_SECTION (p), section))
@ -370,7 +370,7 @@ find_pc_sect_psymbol (struct partial_symtab *psymtab, CORE_ADDR pc,
|| (psymtab->textlow == 0
&& best_pc == 0 && SYMBOL_VALUE_ADDRESS (p) == 0)))
{
if (section) /* match on a specific section */
if (section) /* Match on a specific section. */
{
fixup_psymbol_section (p, psymtab->objfile);
if (!matching_obj_sections (SYMBOL_OBJ_SECTION (p), section))
@ -726,7 +726,7 @@ print_partial_symbols (struct gdbarch *gdbarch,
fputs_filtered ("undefined domain, ", outfile);
break;
case VAR_DOMAIN:
/* This is the usual thing -- don't print it */
/* This is the usual thing -- don't print it. */
break;
case STRUCT_DOMAIN:
fputs_filtered ("struct domain, ", outfile);
@ -1029,7 +1029,7 @@ psymtab_to_fullname (struct partial_symtab *ps)
return NULL;
/* Don't check ps->fullname here, the file could have been
deleted/moved/..., look for it again */
deleted/moved/..., look for it again. */
r = find_and_open_source (ps->filename, ps->dirname, &ps->fullname);
if (r >= 0)
@ -1232,7 +1232,7 @@ compare_psymbols (const void *s1p, const void *s2p)
void
sort_pst_symbols (struct partial_symtab *pst)
{
/* Sort the global list; don't sort the static list */
/* Sort the global list; don't sort the static list. */
qsort (pst->objfile->global_psymbols.list + pst->globals_offset,
pst->n_global_syms, sizeof (struct partial_symbol *),
@ -1324,7 +1324,7 @@ psymbol_bcache_free (struct psymbol_bcache *bcache)
xfree (bcache);
}
/* Return the internal bcache of the psymbol_bcache BCACHE*/
/* Return the internal bcache of the psymbol_bcache BCACHE. */
struct bcache *
psymbol_bcache_get_bcache (struct psymbol_bcache *bcache)
@ -1370,7 +1370,7 @@ add_psymbol_to_bcache (const char *name, int namelength, int copy_name,
entire field. */
memset (&psymbol.ginfo.value, 0, sizeof (psymbol.ginfo.value));
/* val and coreaddr are mutually exclusive, one of them *will* be zero */
/* val and coreaddr are mutually exclusive, one of them *will* be zero. */
if (val != 0)
{
SYMBOL_VALUE (&psymbol) = val;
@ -1387,7 +1387,7 @@ add_psymbol_to_bcache (const char *name, int namelength, int copy_name,
SYMBOL_SET_NAMES (&psymbol, name, namelength, copy_name, objfile);
/* Stash the partial symbol away in the cache */
/* Stash the partial symbol away in the cache. */
return psymbol_bcache_full (&psymbol,
objfile->psymbol_cache,
added);
@ -1417,7 +1417,7 @@ extend_psymbol_list (struct psymbol_allocation_list *listp,
new_size * sizeof (struct partial_symbol *));
}
/* Next assumes we only went one over. Should be good if
program works correctly */
program works correctly. */
listp->next = listp->list + listp->size;
listp->size = new_size;
}
@ -1464,7 +1464,7 @@ add_psymbol_to_list (const char *name, int namelength, int copy_name,
int added;
/* Stash the partial symbol away in the cache */
/* Stash the partial symbol away in the cache. */
psym = add_psymbol_to_bcache (name, namelength, copy_name, domain, class,
val, coreaddr, language, objfile, &added);
@ -1496,7 +1496,7 @@ init_psymbol_list (struct objfile *objfile, int total_symbols)
/* Current best guess is that approximately a twentieth
of the total symbols (in a debugging file) are global or static
oriented symbols */
oriented symbols. */
objfile->global_psymbols.size = total_symbols / 10;
objfile->static_psymbols.size = total_symbols / 10;
@ -1560,14 +1560,14 @@ discard_psymtab (struct partial_symtab *pst)
nothing else is not empty, but we don't realize that. Fixing
that without slowing things down might be tricky. */
/* First, snip it out of the psymtab chain */
/* First, snip it out of the psymtab chain. */
prev_pst = &(pst->objfile->psymtabs);
while ((*prev_pst) != pst)
prev_pst = &((*prev_pst)->next);
(*prev_pst) = pst->next;
/* Next, put it on a free list for recycling */
/* Next, put it on a free list for recycling. */
pst->next = pst->objfile->free_psymtabs;
pst->objfile->free_psymtabs = pst;
@ -1599,7 +1599,7 @@ print-psymbols takes an output file name and optional symbol file name"));
if (argv[0] != NULL)
{
filename = argv[0];
/* If a second arg is supplied, it is a source file name to match on */
/* If a second arg is supplied, it is a source file name to match on. */
if (argv[1] != NULL)
{
symname = argv[1];

View file

@ -52,7 +52,8 @@ static const char running_thread_name[] = "__gnat_running_thread_table";
static const char known_tasks_name[] = "system__tasking__debug__known_tasks";
static const char ravenscar_runtime_initializer[] = "system__bb__threads__initialize";
static const char ravenscar_runtime_initializer[] =
"system__bb__threads__initialize";
static struct observer *update_target_observer = NULL;

View file

@ -37,7 +37,7 @@
*/
/* Per-architecture object describing the layout of a register cache.
Computed once when the architecture is created */
Computed once when the architecture is created. */
struct gdbarch_data *regcache_descr_handle;

View file

@ -390,7 +390,7 @@ remote_fileio_extract_ptr_w_len (char **buf, CORE_ADDR *ptrval, int *length)
return 0;
}
/* Convert to big endian */
/* Convert to big endian. */
static void
remote_fileio_to_be (LONGEST num, char *buf, int bytes)
{
@ -435,7 +435,7 @@ remote_fileio_to_fio_stat (struct stat *st, struct fio_stat *fst)
{
LONGEST blksize;
/* `st_dev' is set in the calling function */
/* `st_dev' is set in the calling function. */
remote_fileio_to_fio_uint ((long) st->st_ino, fst->fst_ino);
remote_fileio_to_fio_mode (st->st_mode, fst->fst_mode);
remote_fileio_to_fio_uint ((long) st->st_nlink, fst->fst_nlink);
@ -617,7 +617,7 @@ remote_fileio_func_open (char *buf)
char *pathname;
struct stat st;
/* 1. Parameter: Ptr to pathname / length incl. trailing zero */
/* 1. Parameter: Ptr to pathname / length incl. trailing zero. */
if (remote_fileio_extract_ptr_w_len (&buf, &ptrval, &length))
{
remote_fileio_ioerror ();
@ -638,7 +638,7 @@ remote_fileio_func_open (char *buf)
}
mode = remote_fileio_mode_to_host (num, 1);
/* Request pathname using 'm' packet */
/* Request pathname using 'm' packet. */
pathname = alloca (length);
retlength = remote_read_bytes (ptrval, (gdb_byte *) pathname, length);
if (retlength != length)
@ -810,7 +810,7 @@ remote_fileio_func_read (char *buf)
{
new_offset = lseek (fd, 0, SEEK_CUR);
/* If some data has been read, return the number of bytes read.
The Ctrl-C flag is set in remote_fileio_reply() anyway */
The Ctrl-C flag is set in remote_fileio_reply() anyway. */
if (old_offset != new_offset)
ret = new_offset - old_offset;
}
@ -822,7 +822,7 @@ remote_fileio_func_read (char *buf)
retlength = remote_fileio_write_bytes (ptrval, buffer, ret);
if (retlength != ret)
ret = -1; /* errno has been set to EIO in
remote_fileio_write_bytes() */
remote_fileio_write_bytes(). */
}
if (ret < 0)
@ -1003,7 +1003,7 @@ remote_fileio_func_rename (char *buf)
return;
}
/* Only operate on regular files and directories */
/* Only operate on regular files and directories. */
of = stat (oldpath, &ost);
nf = stat (newpath, &nst);
if ((!of && !S_ISREG (ost.st_mode) && !S_ISDIR (ost.st_mode))
@ -1083,7 +1083,7 @@ remote_fileio_func_unlink (char *buf)
}
/* Only operate on regular files (and directories, which allows to return
the correct return code) */
the correct return code). */
if (!stat (pathname, &st) && !S_ISREG (st.st_mode) && !S_ISDIR (st.st_mode))
{
remote_fileio_reply (-1, FILEIO_ENODEV);
@ -1141,7 +1141,7 @@ remote_fileio_func_stat (char *buf)
remote_fileio_return_errno (-1);
return;
}
/* Only operate on regular files and directories */
/* Only operate on regular files and directories. */
if (!ret && !S_ISREG (st.st_mode) && !S_ISDIR (st.st_mode))
{
remote_fileio_reply (-1, FILEIO_EACCES);
@ -1269,7 +1269,7 @@ remote_fileio_func_gettimeofday (char *buf)
remote_fileio_ioerror ();
return;
}
/* ...which has to be NULL */
/* ...which has to be NULL. */
if (lnum)
{
remote_fileio_reply (-1, FILEIO_EINVAL);

View file

@ -26,13 +26,13 @@
struct cmd_list_element;
/* Unified interface to remote fileio, called in remote.c from
remote_wait () and remote_async_wait () */
remote_wait () and remote_async_wait (). */
extern void remote_fileio_request (char *buf, int ctrlc_pending_p);
/* Cleanup any remote fileio state. */
extern void remote_fileio_reset (void);
/* Called from _initialize_remote () */
/* Called from _initialize_remote (). */
extern void initialize_remote_fileio (
struct cmd_list_element *remote_set_cmdlist,
struct cmd_list_element *remote_show_cmdlist);

View file

@ -156,9 +156,9 @@ static ptid_t remote_m32r_ptid;
#define SDI_REG_ACC1L 35
/* Low level communication functions */
/* Low level communication functions. */
/* Check an ack packet from the target */
/* Check an ack packet from the target. */
static int
get_ack (void)
{
@ -178,7 +178,7 @@ get_ack (void)
return 0;
}
/* Send data to the target and check an ack packet */
/* Send data to the target and check an ack packet. */
static int
send_data (void *buf, int len)
{
@ -196,7 +196,7 @@ send_data (void *buf, int len)
return len;
}
/* Receive data from the target */
/* Receive data from the target. */
static int
recv_data (void *buf, int len)
{
@ -219,7 +219,7 @@ recv_data (void *buf, int len)
return len;
}
/* Store unsigned long parameter on packet */
/* Store unsigned long parameter on packet. */
static void
store_long_parameter (void *buf, long val)
{
@ -289,13 +289,13 @@ recv_long_data (void)
}
/* Check if MMU is on */
/* Check if MMU is on. */
static void
check_mmu_status (void)
{
unsigned long val;
/* Read PC address */
/* Read PC address. */
if (send_one_arg_cmd (SDI_READ_CPU_REG, SDI_REG_BPC) == -1)
return;
val = recv_long_data ();
@ -305,7 +305,7 @@ check_mmu_status (void)
return;
}
/* Read EVB address */
/* Read EVB address. */
if (send_one_arg_cmd (SDI_READ_CPU_REG, SDI_REG_EVB) == -1)
return;
val = recv_long_data ();
@ -398,7 +398,7 @@ m32r_open (char *args, int from_tty)
if (send_cmd (SDI_OPEN) == -1)
error (_("Cannot connect to SDI target."));
/* Get maximum number of ib breakpoints */
/* Get maximum number of ib breakpoints. */
send_one_arg_cmd (SDI_GET_ATTR, SDI_ATTR_BRK);
max_ib_breakpoints = recv_char_data ();
if (remote_debug)
@ -619,7 +619,7 @@ m32r_resume (struct target_ops *ops,
if (ab_addr == 0x00000000)
continue;
/* DBC register */
/* DBC register. */
if (gdbarch_byte_order (target_gdbarch) == BFD_ENDIAN_BIG)
{
switch (ab_type[i])
@ -657,18 +657,18 @@ m32r_resume (struct target_ops *ops,
}
}
/* DBAH register */
/* DBAH register. */
send_three_arg_cmd (SDI_WRITE_MEMORY, 0xffff8180 + 4 * i, 4, ab_addr);
/* DBAL register */
/* DBAL register. */
send_three_arg_cmd (SDI_WRITE_MEMORY, 0xffff8200 + 4 * i, 4,
0xffffffff);
/* DBD register */
/* DBD register. */
send_three_arg_cmd (SDI_WRITE_MEMORY, 0xffff8280 + 4 * i, 4,
0x00000000);
/* DBDM register */
/* DBDM register. */
send_three_arg_cmd (SDI_WRITE_MEMORY, 0xffff8300 + 4 * i, 4,
0x00000000);
}
@ -720,7 +720,7 @@ m32r_wait (struct target_ops *ops,
interrupted = 0;
prev_sigint = signal (SIGINT, gdb_cntrl_c);
/* Wait for ready */
/* Wait for ready. */
buf[0] = SDI_WAIT_FOR_READY;
if (serial_write (sdi_desc, buf, 1) != 0)
error (_("Remote connection closed"));
@ -888,7 +888,7 @@ m32r_detach (struct target_ops *ops, char *args, int from_tty)
m32r_resume (ops, inferior_ptid, 0, TARGET_SIGNAL_0);
/* calls m32r_close to do the real work */
/* Calls m32r_close to do the real work. */
pop_target ();
if (from_tty)
fprintf_unfiltered (gdb_stdlog, "Ending remote %s debugging\n",
@ -1018,7 +1018,7 @@ m32r_store_register (struct target_ops *ops,
static void
m32r_prepare_to_store (struct regcache *regcache)
{
/* Do nothing, since we can store individual regs */
/* Do nothing, since we can store individual regs. */
if (remote_debug)
fprintf_unfiltered (gdb_stdlog, "m32r_prepare_to_store()\n");
}
@ -1225,11 +1225,11 @@ m32r_load (char *args, int from_tty)
int quiet;
int nostart;
struct timeval start_time, end_time;
unsigned long data_count; /* Number of bytes transferred to memory */
unsigned long data_count; /* Number of bytes transferred to memory. */
int ret;
static RETSIGTYPE (*prev_sigint) ();
/* for direct tcp connections, we can do a fast binary download */
/* for direct tcp connections, we can do a fast binary download. */
quiet = 0;
nostart = 0;
filename = NULL;
@ -1363,12 +1363,12 @@ m32r_load (char *args, int from_tty)
gettimeofday (&end_time, NULL);
/* Make the PC point at the start address */
/* Make the PC point at the start address. */
if (exec_bfd)
regcache_write_pc (get_current_regcache (),
bfd_get_start_address (exec_bfd));
inferior_ptid = null_ptid; /* No process now */
inferior_ptid = null_ptid; /* No process now. */
delete_thread_silent (remote_m32r_ptid);
/* This is necessary because many things were based on the PC at the time
@ -1610,7 +1610,7 @@ m32r_return_one (struct target_ops *target)
return 1;
}
/* Define the target subroutine names */
/* Define the target subroutine names. */
struct target_ops m32r_ops;

View file

@ -299,9 +299,13 @@ enum mips_monitor_type
/* IDT/SIM monitor being used: */
MON_IDT,
/* PMON monitor being used: */
MON_PMON, /* 3.0.83 [COGENT,EB,FP,NET] Algorithmics Ltd. Nov 9 1995 17:19:50 */
MON_DDB, /* 2.7.473 [DDBVR4300,EL,FP,NET] Risq Modular Systems, Thu Jun 6 09:28:40 PDT 1996 */
MON_LSI, /* 4.3.12 [EB,FP], LSI LOGIC Corp. Tue Feb 25 13:22:14 1997 */
MON_PMON, /* 3.0.83 [COGENT,EB,FP,NET]
Algorithmics Ltd. Nov 9 1995 17:19:50 */
MON_DDB, /* 2.7.473 [DDBVR4300,EL,FP,NET]
Risq Modular Systems,
Thu Jun 6 09:28:40 PDT 1996 */
MON_LSI, /* 4.3.12 [EB,FP],
LSI LOGIC Corp. Tue Feb 25 13:22:14 1997 */
MON_ROCKHOPPER,
/* Last and unused value, for sizing vectors, etc. */
MON_LAST
@ -325,7 +329,7 @@ static char *mips_monitor_prompt;
/* Set to 1 if the target is open. */
static int mips_is_open;
/* Currently active target description (if mips_is_open == 1) */
/* Currently active target description (if mips_is_open == 1). */
static struct target_ops *current_ops;
/* Set to 1 while the connection is being initialized. */
@ -387,13 +391,13 @@ static int monitor_supports_breakpoints = 0;
static DCACHE *mips_dcache;
#endif
/* Non-zero means that we've just hit a read or write watchpoint */
/* Non-zero means that we've just hit a read or write watchpoint. */
static int hit_watchpoint;
/* Table of breakpoints/watchpoints (used only on LSI PMON target).
The table is indexed by a breakpoint number, which is an integer
from 0 to 255 returned by the LSI PMON when a breakpoint is set.
*/
from 0 to 255 returned by the LSI PMON when a breakpoint is set. */
#define MAX_LSI_BREAKPOINTS 256
struct lsi_breakpoint_info
{
@ -406,15 +410,21 @@ lsi_breakpoints[MAX_LSI_BREAKPOINTS];
/* Error/warning codes returned by LSI PMON for breakpoint commands.
Warning values may be ORed together; error values may not. */
#define W_WARN 0x100 /* This bit is set if the error code is a warning */
#define W_MSK 0x101 /* warning: Range feature is supported via mask */
#define W_VAL 0x102 /* warning: Value check is not supported in hardware */
#define W_QAL 0x104 /* warning: Requested qualifiers are not supported in hardware */
#define W_WARN 0x100 /* This bit is set if the error code
is a warning */
#define W_MSK 0x101 /* warning: Range feature is supported
via mask */
#define W_VAL 0x102 /* warning: Value check is not
supported in hardware */
#define W_QAL 0x104 /* warning: Requested qualifiers are
not supported in hardware */
#define E_ERR 0x200 /* This bit is set if the error code is an error */
#define E_ERR 0x200 /* This bit is set if the error code
is an error */
#define E_BPT 0x200 /* error: No such breakpoint number */
#define E_RGE 0x201 /* error: Range is not supported */
#define E_QAL 0x202 /* error: The requested qualifiers can not be used */
#define E_QAL 0x202 /* error: The requested qualifiers can
not be used */
#define E_OUT 0x203 /* error: Out of hardware resources */
#define E_NON 0x204 /* error: Hardware breakpoint not supported */
@ -482,7 +492,7 @@ mips_error (char *string,...)
va_start (args, string);
target_terminal_ours ();
wrap_here (""); /* Force out any buffered output */
wrap_here (""); /* Force out any buffered output. */
gdb_flush (gdb_stdout);
if (error_pre_print)
fputs_filtered (error_pre_print, gdb_stderr);
@ -563,8 +573,7 @@ read_hex_value (const char *p, ULONGEST *result)
/* Wait until STRING shows up in mips_desc. Returns 1 if successful, else 0 if
timed out. TIMEOUT specifies timeout value in seconds.
*/
timed out. TIMEOUT specifies timeout value in seconds. */
static int
mips_expect_timeout (const char *string, int timeout)
@ -619,8 +628,7 @@ mips_expect_timeout (const char *string, int timeout)
/* Wait until STRING shows up in mips_desc. Returns 1 if successful, else 0 if
timed out. The timeout value is hard-coded to 2 seconds. Use
mips_expect_timeout if a different timeout value is needed.
*/
mips_expect_timeout if a different timeout value is needed. */
static int
mips_expect (const char *string)
@ -661,7 +669,7 @@ mips_readchar (int timeout)
timeout = 1;
ch = serial_readchar (mips_desc, timeout);
if (ch == SERIAL_TIMEOUT && timeout == -1) /* Watchdog went off */
if (ch == SERIAL_TIMEOUT && timeout == -1) /* Watchdog went off. */
{
target_mourn_inferior ();
error ("Watchdog has expired. Target detached.\n");
@ -694,7 +702,8 @@ mips_readchar (int timeout)
if (remote_debug > 0)
/* Don't use _filtered; we can't deal with a QUIT out of
target_wait, and I think this might be called from there. */
fprintf_unfiltered (gdb_stdlog, "Reinitializing MIPS debugging mode\n");
fprintf_unfiltered (gdb_stdlog,
"Reinitializing MIPS debugging mode\n");
mips_need_reply = 0;
mips_initialize ();
@ -762,7 +771,8 @@ mips_receive_header (unsigned char *hdr, int *pgarbage, int ch, int timeout)
if (mips_syn_garbage > 0
&& *pgarbage > mips_syn_garbage)
mips_error ("Debug protocol failure: more than %d characters before a sync.",
mips_error ("Debug protocol failure: more "
"than %d characters before a sync.",
mips_syn_garbage);
}
}
@ -793,7 +803,8 @@ mips_receive_header (unsigned char *hdr, int *pgarbage, int ch, int timeout)
for success, -1 for timeout, -2 for error. */
static int
mips_receive_trailer (unsigned char *trlr, int *pgarbage, int *pch, int timeout)
mips_receive_trailer (unsigned char *trlr, int *pgarbage,
int *pch, int timeout)
{
int i;
int ch;
@ -934,7 +945,7 @@ mips_send_packet (const char *s, int get_ack)
}
if (rch == SERIAL_TIMEOUT)
break;
/* ignore the character */
/* Ignore the character. */
}
if (i == len)
@ -1245,7 +1256,8 @@ mips_request (int cmd,
{
if (mips_need_reply)
internal_error (__FILE__, __LINE__,
_("mips_request: Trying to send command before reply"));
_("mips_request: Trying to send "
"command before reply"));
/* 'T' sets a register to a 64-bit value, so make sure we use
the right conversion function. */
if (cmd == 'T')
@ -1334,7 +1346,7 @@ mips_enter_debug (void)
if (mips_monitor != MON_IDT)
mips_send_command ("debug\r", 0);
else /* assume IDT monitor by default */
else /* Assume IDT monitor by default. */
mips_send_command ("db tty0\r", 0);
sleep (1);
@ -1414,24 +1426,25 @@ mips_initialize (void)
/* Force the system into the monitor. After this we *should* be at
the mips_monitor_prompt. */
if (mips_monitor != MON_IDT)
j = 0; /* start by checking if we are already at the prompt */
j = 0; /* Start by checking if we are already
at the prompt. */
else
j = 1; /* start by sending a break */
j = 1; /* Start by sending a break. */
for (; j <= 4; j++)
{
switch (j)
{
case 0: /* First, try sending a CR */
case 0: /* First, try sending a CR. */
serial_flush_input (mips_desc);
serial_write (mips_desc, "\r", 1);
break;
case 1: /* First, try sending a break */
case 1: /* First, try sending a break. */
serial_send_break (mips_desc);
break;
case 2: /* Then, try a ^C */
case 2: /* Then, try a ^C. */
serial_write (mips_desc, "\003", 1);
break;
case 3: /* Then, try escaping from download */
case 3: /* Then, try escaping from download. */
{
if (mips_monitor != MON_IDT)
{
@ -1458,8 +1471,7 @@ mips_initialize (void)
out is to send enough termination packets (8 bytes)
to fill up and then overflow the largest size
S-record (255 bytes in this case). This amounts to
256/8 + 1 packets.
*/
256/8 + 1 packets. */
mips_make_srec (srec, '7', 0, NULL, 0);
@ -1532,15 +1544,15 @@ common_open (struct target_ops *ops, char *name, int from_tty,
char **argv;
if (name == 0)
error (
"To open a MIPS remote debugging connection, you need to specify what serial\n\
device is attached to the target board (e.g., /dev/ttya).\n"
"If you want to use TFTP to download to the board, specify the name of a\n"
"temporary file to be used by GDB for downloads as the second argument.\n"
"This filename must be in the form host:filename, where host is the name\n"
"of the host running the TFTP server, and the file must be readable by the\n"
"world. If the local name of the temporary file differs from the name as\n"
"seen from the board via TFTP, specify that name as the third parameter.\n");
error (_("\
To open a MIPS remote debugging connection, you need to specify what\n\
serial device is attached to the target board (e.g., /dev/ttya).\n\
If you want to use TFTP to download to the board, specify the name of a\n\
temporary file to be used by GDB for downloads as the second argument.\n\
This filename must be in the form host:filename, where host is the name\n\
of the host running the TFTP server, and the file must be readable by the\n\
world. If the local name of the temporary file differs from the name as\n\
seen from the board via TFTP, specify that name as the third parameter.\n"));
/* Parse the serial port name, the optional TFTP name, and the
optional local TFTP name. */
@ -1548,10 +1560,10 @@ device is attached to the target board (e.g., /dev/ttya).\n"
make_cleanup_freeargv (argv);
serial_port_name = xstrdup (argv[0]);
if (argv[1]) /* remote TFTP name specified? */
if (argv[1]) /* Remote TFTP name specified? */
{
remote_name = argv[1];
if (argv[2]) /* local TFTP filename specified? */
if (argv[2]) /* Local TFTP filename specified? */
local_name = argv[2];
}
@ -1600,9 +1612,9 @@ device is attached to the target board (e.g., /dev/ttya).\n"
xfree (tftp_localname);
if (local_name == NULL)
if ((local_name = strchr (remote_name, ':')) != NULL)
local_name++; /* skip over the colon */
local_name++; /* Skip over the colon. */
if (local_name == NULL)
local_name = remote_name; /* local name same as remote name */
local_name = remote_name; /* Local name same as remote name. */
tftp_name = xstrdup (remote_name);
tftp_localname = xstrdup (local_name);
tftp_in_use = 1;
@ -1852,9 +1864,11 @@ mips_wait (struct target_ops *ops,
mips_enter_debug ();
}
/* See if we got back extended status. If so, pick out the pc, fp, sp, etc... */
/* See if we got back extended status. If so, pick out the pc, fp,
sp, etc... */
nfields = sscanf (buff, "0x%*x %*c 0x%*x 0x%*x 0x%16s 0x%16s 0x%16s 0x%*x %s",
nfields = sscanf (buff,
"0x%*x %*c 0x%*x 0x%*x 0x%16s 0x%16s 0x%16s 0x%*x %s",
pc_string, fp_string, sp_string, flags);
if (nfields >= 3
&& read_hex_value (pc_string, &rpc)
@ -1883,12 +1897,13 @@ mips_wait (struct target_ops *ops,
if (strcmp (target_shortname, "lsi") == 0)
{
#if 0
/* If this is an LSI PMON target, see if we just hit a hardrdware watchpoint.
Right now, PMON doesn't give us enough information to determine which
breakpoint we hit. So we have to look up the PC in our own table
of breakpoints, and if found, assume it's just a normal instruction
fetch breakpoint, not a data watchpoint. FIXME when PMON
provides some way to tell us what type of breakpoint it is. */
/* If this is an LSI PMON target, see if we just hit a
hardrdware watchpoint. Right now, PMON doesn't give us
enough information to determine which breakpoint we hit. So
we have to look up the PC in our own table of breakpoints,
and if found, assume it's just a normal instruction fetch
breakpoint, not a data watchpoint. FIXME when PMON provides
some way to tell us what type of breakpoint it is. */
int i;
CORE_ADDR pc = regcache_read_pc (get_current_regcache ());
@ -2173,10 +2188,11 @@ mips_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int write,
if (mips_fetch_word (addr + (count - 1) * 4, &val))
return 0;
store_unsigned_integer (&buffer[(count - 1) * 4], 4, byte_order, val);
store_unsigned_integer (&buffer[(count - 1) * 4],
4, byte_order, val);
}
/* Copy data to be written over corresponding part of buffer */
/* Copy data to be written over corresponding part of buffer. */
memcpy ((char *) buffer + (memaddr & 3), myaddr, len);
@ -2188,7 +2204,7 @@ mips_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int write,
word = extract_unsigned_integer (&buffer[i * 4], 4, byte_order);
status = mips_store_word (addr, word, NULL);
/* Report each kilobyte (we download 32-bit words at a time) */
/* Report each kilobyte (we download 32-bit words at a time). */
if (i % 256 == 255)
{
printf_unfiltered ("*");
@ -2206,7 +2222,7 @@ mips_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int write,
}
else
{
/* Read all the longwords */
/* Read all the longwords. */
for (i = 0; i < count; i++, addr += 4)
{
unsigned int val;
@ -2257,9 +2273,9 @@ mips_kill (struct target_ops *ops)
if (query (_("Interrupted while waiting for the program.\n\
Give up (and stop debugging it)? ")))
{
/* Clean up in such a way that mips_close won't try to talk to the
board (it almost surely won't work since we weren't able to talk to
it). */
/* Clean up in such a way that mips_close won't try to talk
to the board (it almost surely won't work since we
weren't able to talk to it). */
mips_wait_flag = 0;
close_ports ();
@ -2606,9 +2622,7 @@ mips_common_breakpoint: Bad response from remote board: %s",
succesful completion, other values indicate various
errors and warnings.
Possible return codes: OK, W_QAL, E_QAL, E_OUT, E_NON.
*/
Possible return codes: OK, W_QAL, E_QAL, E_OUT, E_NON. */
if (type == BREAK_FETCH) /* instruction breakpoint */
{
@ -2654,8 +2668,9 @@ mips_common_breakpoint: Bad response from remote board: %s",
/* On non-LSI targets, the breakpoint command has this form:
0x0 <CMD> <ADDR> <MASK> <FLAGS>
<MASK> is a don't care mask for addresses.
<FLAGS> is any combination of `r', `w', or `f' for read/write/fetch.
*/
<FLAGS> is any combination of `r', `w', or `f' for
read/write/fetch. */
unsigned long mask;
mask = calculate_mask (addr, len);
@ -2680,7 +2695,8 @@ mips_common_breakpoint: Bad response from remote board: %s",
flags = "f";
break;
default:
internal_error (__FILE__, __LINE__, _("failed internal consistency check"));
internal_error (__FILE__, __LINE__,
_("failed internal consistency check"));
}
cmd = 'B';
@ -2746,7 +2762,8 @@ send_srec (char *srec, int len, CORE_ADDR addr)
case 0x6: /* ACK */
return;
case 0x15: /* NACK */
fprintf_unfiltered (gdb_stderr, "Download got a NACK at byte %s! Retrying.\n",
fprintf_unfiltered (gdb_stderr,
"Download got a NACK at byte %s! Retrying.\n",
paddress (target_gdbarch, addr));
continue;
default:
@ -2886,8 +2903,8 @@ mips_make_srec (char *buf, int type, CORE_ADDR memaddr, unsigned char *myaddr,
unsigned char checksum;
int i;
/* Create the header for the srec. addr_size is the number of bytes in the address,
and 1 is the number of bytes in the count. */
/* Create the header for the srec. addr_size is the number of bytes
in the address, and 1 is the number of bytes in the count. */
/* FIXME!! bigger buf required for 64-bit! */
buf[0] = 'S';
@ -2906,7 +2923,7 @@ mips_make_srec (char *buf, int type, CORE_ADDR memaddr, unsigned char *myaddr,
hexified data. It includes the length, address and the data
portions of the packet. */
checksum = 0;
buf += 2; /* Point at length byte */
buf += 2; /* Point at length byte. */
for (i = 0; i < len + 4 + 1; i++)
checksum += *buf++;
@ -2926,7 +2943,8 @@ mips_make_srec (char *buf, int type, CORE_ADDR memaddr, unsigned char *myaddr,
'K' clear checksum
'C' compare checksum (12bit value, not included in checksum calculation)
'S' define symbol name (for addr) terminated with "," and padded to 4char boundary
'S' define symbol name (for addr) terminated with ","
and padded to 4char boundary
'Z' zero fill multiple of 3bytes
'B' byte (12bit encoded value, of 8bit data)
'A' address (36bit encoded value)
@ -2941,7 +2959,8 @@ mips_make_srec (char *buf, int type, CORE_ADDR memaddr, unsigned char *myaddr,
The encoding of numbers is done in 6bit fields. The 6bit value is
used to index into this string to get the specific character
encoding for the value: */
static char encoding[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789,.";
static char encoding[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789,.";
/* Convert the number of bits required into an encoded number, 6bits
at a time (range 0..63). Keep a checksum if required (passed
@ -2956,13 +2975,16 @@ pmon_makeb64 (unsigned long v, char *p, int n, int *chksum)
if ((n % 12) != 0)
{
fprintf_unfiltered (gdb_stderr,
"Fast encoding bitcount must be a multiple of 12bits: %dbit%s\n", n, (n == 1) ? "" : "s");
"Fast encoding bitcount must be a "
"multiple of 12bits: %dbit%s\n",
n, (n == 1) ? "" : "s");
return (0);
}
if (n > 36)
{
fprintf_unfiltered (gdb_stderr,
"Fast encoding cannot process more than 36bits at the moment: %dbits\n", n);
"Fast encoding cannot process more "
"than 36bits at the moment: %dbits\n", n);
return (0);
}
@ -3029,7 +3051,7 @@ pmon_checkset (int recsize, char **buff, int *value)
count = pmon_makeb64 (*value, (*buff + 2), 12, NULL);
*buff += (count + 2);
sprintf (*buff, "\n");
*buff += 2; /* include zero terminator */
*buff += 2; /* Include zero terminator. */
/* Forcing a checksum validation clears the sum: */
*value = 0;
return (recsize + count + 3);
@ -3102,7 +3124,9 @@ pmon_make_fastrec (char **outbuf, unsigned char *inbuf, int *inptr,
}
else
{
unsigned int value = ((inbuf[*inptr + 0] << 16) | (inbuf[*inptr + 1] << 8) | inbuf[*inptr + 2]);
unsigned int value = ((inbuf[*inptr + 0] << 16)
| (inbuf[*inptr + 1] << 8)
| (inbuf[*inptr + 2]));
/* Simple check for zero data. TODO: A better check would be
to check the last, and then the middle byte for being zero
@ -3151,7 +3175,7 @@ pmon_check_ack (char *mesg)
{
fprintf_unfiltered (gdb_stderr,
"Failed to receive valid ACK for %s\n", mesg);
return (-1); /* terminate the download */
return (-1); /* Terminate the download. */
}
}
#endif /* DOETXACK */
@ -3192,7 +3216,7 @@ mips_expect_download (char *string)
{
fprintf_unfiltered (gdb_stderr, "Load did not complete successfully.\n");
if (tftp_in_use)
remove (tftp_localname); /* Remove temporary file */
remove (tftp_localname); /* Remove temporary file. */
return 0;
}
else
@ -3211,7 +3235,7 @@ mips_expect_download (char *string)
static void
pmon_check_entry_address (char *entry_address, int final)
{
char hexnumber[9]; /* includes '\0' space */
char hexnumber[9]; /* Includes '\0' space. */
mips_expect_timeout (entry_address, tftp_in_use ? 15 : remote_timeout);
sprintf (hexnumber, "%x", final);
@ -3226,7 +3250,7 @@ pmon_check_entry_address (char *entry_address, int final)
static int
pmon_check_total (int bintotal)
{
char hexnumber[9]; /* includes '\0' space */
char hexnumber[9]; /* Includes '\0' space. */
mips_expect ("\r\ntotal = 0x");
sprintf (hexnumber, "%x", bintotal);
@ -3244,7 +3268,7 @@ pmon_check_total (int bintotal)
static void
pmon_end_download (int final, int bintotal)
{
char hexnumber[9]; /* includes '\0' space */
char hexnumber[9]; /* Includes '\0' space. */
if (tftp_in_use)
{
@ -3304,7 +3328,7 @@ pmon_end_download (int final, int bintotal)
}
if (tftp_in_use)
remove (tftp_localname); /* Remove temporary file */
remove (tftp_localname); /* Remove temporary file. */
}
/* Write the buffer specified by BUFFER of length LENGTH to either
@ -3362,28 +3386,29 @@ pmon_load_fast (char *file)
/* Start the download: */
pmon_start_download ();
/* Zero the checksum */
/* Zero the checksum. */
sprintf (buffer, "/Kxx\n");
reclen = strlen (buffer);
pmon_download (buffer, reclen);
finished = pmon_check_ack ("/Kxx");
for (s = abfd->sections; s && !finished; s = s->next)
if (s->flags & SEC_LOAD) /* only deal with loadable sections */
if (s->flags & SEC_LOAD) /* Only deal with loadable sections. */
{
bintotal += bfd_get_section_size (s);
final = (s->vma + bfd_get_section_size (s));
printf_filtered ("%s\t: 0x%4x .. 0x%4x ", s->name, (unsigned int) s->vma,
printf_filtered ("%s\t: 0x%4x .. 0x%4x ", s->name,
(unsigned int) s->vma,
(unsigned int) (s->vma + bfd_get_section_size (s)));
gdb_flush (gdb_stdout);
/* Output the starting address */
/* Output the starting address. */
sprintf (buffer, "/A");
reclen = pmon_makeb64 (s->vma, &buffer[2], 36, &csum);
buffer[2 + reclen] = '\n';
buffer[3 + reclen] = '\0';
reclen += 3; /* for the initial escape code and carriage return */
reclen += 3; /* For the initial escape code and carriage return. */
pmon_download (buffer, reclen);
finished = pmon_check_ack ("/A");
@ -3419,7 +3444,8 @@ pmon_load_fast (char *file)
finished = pmon_check_ack ("data record");
if (finished)
{
zerofill = 0; /* do not transmit pending zerofills */
zerofill = 0; /* Do not transmit pending
zerofills. */
break;
}
@ -3458,7 +3484,7 @@ pmon_load_fast (char *file)
/* Terminate the transfer. We know that we have an empty output
buffer at this point. */
sprintf (buffer, "/E/E\n"); /* include dummy padding characters */
sprintf (buffer, "/E/E\n"); /* Include dummy padding characters. */
reclen = strlen (buffer);
pmon_download (buffer, reclen);
@ -3492,7 +3518,7 @@ mips_load (char *file, int from_tty)
mips_initialize ();
/* Finally, make the PC point at the start address */
/* Finally, make the PC point at the start address. */
regcache = get_current_regcache ();
if (mips_monitor != MON_IDT)
{
@ -3552,7 +3578,8 @@ pmon_command (char *args, int from_tty)
printf_filtered ("Received packet: %s\n", buf);
}
extern initialize_file_ftype _initialize_remote_mips; /* -Wmissing-prototypes */
/* -Wmissing-prototypes */
extern initialize_file_ftype _initialize_remote_mips;
/* Initialize mips_ops, lsi_ops, ddb_ops, pmon_ops, and rockhopper_ops.
Create target specific commands and perform other initializations

View file

@ -64,7 +64,7 @@ static void gdb_os_flush_stderr (host_callback *);
static int gdb_os_poll_quit (host_callback *);
/* printf_filtered is depreciated */
/* printf_filtered is depreciated. */
static void gdb_os_printf_filtered (host_callback *, const char *, ...);
static void gdb_os_vprintf_filtered (host_callback *, const char *, va_list);
@ -475,7 +475,8 @@ gdbsim_fetch_register (struct target_ops *ops,
&& nr_bytes != register_size (gdbarch, regno) && warn_user)
{
fprintf_unfiltered (gdb_stderr,
"Size of register %s (%d/%d) incorrect (%d instead of %d))",
"Size of register %s (%d/%d) "
"incorrect (%d instead of %d))",
gdbarch_register_name (gdbarch, regno),
regno,
gdbarch_register_sim_regno
@ -644,7 +645,8 @@ gdbsim_create_inferior (struct target_ops *target, char *exec_file, char *args,
inferior_appeared (current_inferior (), ptid_get_pid (inferior_ptid));
add_thread_silent (inferior_ptid);
insert_breakpoints (); /* Needed to get correct instruction in cache */
insert_breakpoints (); /* Needed to get correct instruction
in cache. */
clear_proceed_status ();
}
@ -652,7 +654,7 @@ gdbsim_create_inferior (struct target_ops *target, char *exec_file, char *args,
/* The open routine takes the rest of the parameters from the command,
and (if successful) pushes a new target onto the stack.
Targets should supply this routine, if only to provide an error message. */
/* Called when selecting the simulator. EG: (gdb) target sim name. */
/* Called when selecting the simulator. E.g. (gdb) target sim name. */
static void
gdbsim_open (char *args, int from_tty)
@ -725,7 +727,8 @@ gdbsim_open (char *args, int from_tty)
/* Allocate the inferior data, but do not allocate a sim instance
since we've already just done that. */
sim_data = get_sim_inferior_data (current_inferior (), SIM_INSTANCE_NOT_NEEDED);
sim_data = get_sim_inferior_data (current_inferior (),
SIM_INSTANCE_NOT_NEEDED);
sim_data->gdbsim_desc = gdbsim_desc;
@ -922,7 +925,8 @@ gdbsim_stop (ptid_t ptid)
struct inferior *inf = find_inferior_pid (ptid_get_pid (ptid));
if (inf == NULL)
error (_("Can't stop pid %d. No inferior found."), ptid_get_pid (ptid));
error (_("Can't stop pid %d. No inferior found."),
ptid_get_pid (ptid));
gdbsim_stop_inferior (inf, NULL);
}
@ -972,7 +976,8 @@ gdbsim_wait (struct target_ops *ops,
When ptid is minus_one_ptid, just use the current inferior. If we're
given an explicit pid, we'll try to find it and use that instead. */
if (ptid_equal (ptid, minus_one_ptid))
sim_data = get_sim_inferior_data (current_inferior (), SIM_INSTANCE_NEEDED);
sim_data = get_sim_inferior_data (current_inferior (),
SIM_INSTANCE_NEEDED);
else
{
sim_data = get_sim_inferior_data_by_ptid (ptid, SIM_INSTANCE_NEEDED);
@ -1047,7 +1052,7 @@ gdbsim_wait (struct target_ops *ops,
static void
gdbsim_prepare_to_store (struct regcache *regcache)
{
/* Do nothing, since we can store individual regs */
/* Do nothing, since we can store individual regs. */
}
/* Transfer LEN bytes between GDB address MYADDR and target address
@ -1237,7 +1242,7 @@ gdbsim_has_memory (struct target_ops *ops)
return 1;
}
/* Define the target subroutine names */
/* Define the target subroutine names. */
struct target_ops gdbsim_ops;

View file

@ -68,7 +68,7 @@
#include "ax.h"
#include "ax-gdb.h"
/* temp hacks for tracepoint encoding migration */
/* Temp hacks for tracepoint encoding migration. */
static char *target_buf;
static long target_buf_size;
/*static*/ void
@ -435,7 +435,7 @@ remote_get_noisy_reply (char **buf_p,
{
char *buf;
QUIT; /* allow user to bail out with ^C */
QUIT; /* Allow user to bail out with ^C. */
getpkt (buf_p, sizeof_buf, 0);
buf = *buf_p;
if (buf[0] == 'E')
@ -492,7 +492,7 @@ remote_get_noisy_reply (char **buf_p,
else if (buf[0] == 'O' && buf[1] != 'K')
remote_console_output (buf + 1); /* 'O' message from stub */
else
return buf; /* here's the actual reply */
return buf; /* Here's the actual reply. */
}
while (1);
}
@ -1540,8 +1540,7 @@ demand_private_info (ptid_t ptid)
/* Call this function as a result of
1) A halt indication (T packet) containing a thread id
2) A direct query of currthread
3) Successful execution of set thread
*/
3) Successful execution of set thread */
static void
record_currthread (ptid_t currthread)
@ -1728,12 +1727,11 @@ remote_thread_alive (struct target_ops *ops, ptid_t ptid)
typedef unsigned char threadref[OPAQUETHREADBYTES];
/* WARNING: This threadref data structure comes from the remote O.S.,
libstub protocol encoding, and remote.c. it is not particularly
libstub protocol encoding, and remote.c. It is not particularly
changable. */
/* Right now, the internal structure is int. We want it to be bigger.
Plan to fix this.
*/
Plan to fix this. */
typedef int gdb_threadref; /* Internal GDB thread reference. */
@ -1755,8 +1753,7 @@ struct gdb_ext_thread_info
/* The volume of remote transfers can be limited by submitting
a mask containing bits specifying the desired information.
Use a union of these values as the 'selection' parameter to
get_thread_info. FIXME: Make these TAG names more thread specific.
*/
get_thread_info. FIXME: Make these TAG names more thread specific. */
#define TAG_THREADID 1
#define TAG_EXISTS 2
@ -6237,8 +6234,8 @@ remote_write_bytes_aux (const char *header, CORE_ADDR memaddr,
rs->buf[0] = '\0';
/* Compute the size of the actual payload by subtracting out the
packet header and footer overhead: "$M<memaddr>,<len>:...#nn".
*/
packet header and footer overhead: "$M<memaddr>,<len>:...#nn". */
payload_size -= strlen ("$,:#NN");
if (!use_length)
/* The comma won't be used. */
@ -6433,7 +6430,7 @@ remote_read_bytes (CORE_ADDR memaddr, gdb_byte *myaddr, int len)
int todo;
int i;
todo = min (len, max_buf_size / 2); /* num bytes that will fit */
todo = min (len, max_buf_size / 2); /* num bytes that will fit. */
/* construct "m"<memaddr>","<len>" */
/* sprintf (rs->buf, "m%lx,%x", (unsigned long) memaddr, todo); */
@ -7943,17 +7940,17 @@ compare_sections_command (char *args, int from_tty)
for (s = exec_bfd->sections; s; s = s->next)
{
if (!(s->flags & SEC_LOAD))
continue; /* skip non-loadable section */
continue; /* Skip non-loadable section. */
size = bfd_get_section_size (s);
if (size == 0)
continue; /* skip zero-length section */
continue; /* Skip zero-length section. */
sectname = bfd_get_section_name (exec_bfd, s);
if (args && strcmp (args, sectname) != 0)
continue; /* not the section selected by user */
continue; /* Not the section selected by user. */
matched = 1; /* do this section */
matched = 1; /* Do this section. */
lma = s->lma;
sectdata = xmalloc (size);
@ -8310,10 +8307,10 @@ remote_search_memory (struct target_ops* ops,
int max_size = get_memory_write_packet_size ();
struct packet_config *packet =
&remote_protocol_packets[PACKET_qSearch_memory];
/* number of packet bytes used to encode the pattern,
this could be more than PATTERN_LEN due to escape characters */
/* Number of packet bytes used to encode the pattern;
this could be more than PATTERN_LEN due to escape characters. */
int escaped_pattern_len;
/* amount of pattern that was encodable in the packet */
/* Amount of pattern that was encodable in the packet. */
int used_pattern_len;
int i;
int found;
@ -9674,7 +9671,7 @@ remote_download_command_source (int num, ULONGEST addr,
for (cmd = cmds; cmd; cmd = cmd->next)
{
QUIT; /* allow user to bail out with ^C */
QUIT; /* Allow user to bail out with ^C. */
strcpy (rs->buf, "QTDPsrc:");
encode_source_string (num, addr, "cmd", cmd->line,
rs->buf + strlen (rs->buf),
@ -9689,7 +9686,7 @@ remote_download_command_source (int num, ULONGEST addr,
{
remote_download_command_source (num, addr, *cmd->body_list);
QUIT; /* allow user to bail out with ^C */
QUIT; /* Allow user to bail out with ^C. */
strcpy (rs->buf, "QTDPsrc:");
encode_source_string (num, addr, "cmd", "end",
rs->buf + strlen (rs->buf),
@ -9814,7 +9811,7 @@ remote_download_tracepoint (struct breakpoint *t)
{
for (ndx = 0; tdp_actions[ndx]; ndx++)
{
QUIT; /* allow user to bail out with ^C */
QUIT; /* Allow user to bail out with ^C. */
sprintf (buf, "QTDP:-%x:%s:%s%c",
t->number, addrbuf, /* address */
tdp_actions[ndx],
@ -9831,7 +9828,7 @@ remote_download_tracepoint (struct breakpoint *t)
{
for (ndx = 0; stepping_actions[ndx]; ndx++)
{
QUIT; /* allow user to bail out with ^C */
QUIT; /* Allow user to bail out with ^C. */
sprintf (buf, "QTDP:-%x:%s:%s%s%s",
t->number, addrbuf, /* address */
((ndx == 0) ? "S" : ""),
@ -9951,7 +9948,7 @@ static int
remote_get_trace_status (struct trace_status *ts)
{
char *p;
/* FIXME we need to get register block size some other way */
/* FIXME we need to get register block size some other way. */
extern int trace_regblock_size;
trace_regblock_size = get_remote_arch_state ()->sizeof_g_packet;

View file

@ -34,7 +34,7 @@ extern void getpkt (char **buf, long *sizeof_buf, int forever);
of the packet is in BUF. The string in BUF can be at most PBUFSIZ
- 5 to account for the $, # and checksum, and for a possible /0 if
we are debugging (remote_debug) and want to print the sent packet
as a string */
as a string. */
extern int putpkt (char *buf);

View file

@ -122,7 +122,7 @@ rs6000_aix_supply_regset (const struct regset *regset,
}
/* Collect register REGNUM in the general-purpose register set
REGSET. from register cache REGCACHE into the buffer specified by
REGSET, from register cache REGCACHE into the buffer specified by
GREGS and LEN. If REGNUM is -1, do this for all registers in
REGSET. */
@ -176,7 +176,7 @@ rs6000_aix_regset_from_core_section (struct gdbarch *gdbarch,
/* Pass the arguments in either registers, or in the stack. In RS/6000,
the first eight words of the argument list (that might be less than
eight parameters if some parameters occupy more than one word) are
passed in r3..r10 registers. float and double parameters are
passed in r3..r10 registers. Float and double parameters are
passed in fpr's, in addition to that. Rest of the parameters if any
are passed in user stack. There might be cases in which half of the
parameter is copied into registers, the other half is pushed into
@ -231,8 +231,7 @@ rs6000_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
ii++;
}
/*
effectively indirect call... gcc does...
/* effectively indirect call... gcc does...
return_val example( float, int);
@ -247,8 +246,7 @@ rs6000_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
return in r3 or f0. If no float, must study how gcc emulates floats;
pay attention to arg promotion.
User may have to cast\args to handle promotion correctly
since gdb won't know if prototype supplied or not.
*/
since gdb won't know if prototype supplied or not. */
for (argno = 0, argbytes = 0; argno < nargs && ii < 8; ++ii)
{
@ -662,13 +660,15 @@ branch_dest (struct frame_info *frame, int opcode, int instr,
else if (ext_op == 528) /* br cond to count reg */
{
dest = get_frame_register_unsigned (frame, tdep->ppc_ctr_regnum) & ~3;
dest = get_frame_register_unsigned (frame,
tdep->ppc_ctr_regnum) & ~3;
/* If we are about to execute a system call, dest is something
like 0x22fc or 0x3b00. Upon completion the system call
will return to the address in the link register. */
if (dest < AIX_TEXT_SEGMENT_BASE)
dest = get_frame_register_unsigned (frame, tdep->ppc_lr_regnum) & ~3;
dest = get_frame_register_unsigned (frame,
tdep->ppc_lr_regnum) & ~3;
}
else
return -1;

View file

@ -238,7 +238,8 @@ fetch_register (struct regcache *regcache, int regno)
else
{
if (!ARCH64 ())
*addr = rs6000_ptrace32 (PT_READ_GPR, PIDGET (inferior_ptid), (int *)nr, 0, 0);
*addr = rs6000_ptrace32 (PT_READ_GPR, PIDGET (inferior_ptid),
(int *) nr, 0, 0);
else
{
/* PT_READ_GPR requires the buffer parameter to point to long long,
@ -309,7 +310,8 @@ store_register (struct regcache *regcache, int regno)
the register's value is passed by value, but for 64-bit inferiors,
the address of a buffer containing the value is passed. */
if (!ARCH64 ())
rs6000_ptrace32 (PT_WRITE_GPR, PIDGET (inferior_ptid), (int *)nr, *addr, 0);
rs6000_ptrace32 (PT_WRITE_GPR, PIDGET (inferior_ptid),
(int *) nr, *addr, 0);
else
{
/* PT_WRITE_GPR requires the buffer parameter to point to an 8-byte
@ -469,7 +471,8 @@ rs6000_xfer_partial (struct target_ops *ops, enum target_object object,
rounded_offset, 0, NULL);
else
buffer.word = rs6000_ptrace32 (PT_READ_I, pid,
(int *)(uintptr_t)rounded_offset,
(int *) (uintptr_t)
rounded_offset,
0, NULL);
}
@ -484,7 +487,8 @@ rs6000_xfer_partial (struct target_ops *ops, enum target_object object,
rounded_offset, buffer.word, NULL);
else
rs6000_ptrace32 (PT_WRITE_D, pid,
(int *)(uintptr_t)rounded_offset, buffer.word, NULL);
(int *) (uintptr_t) rounded_offset,
buffer.word, NULL);
if (errno)
return 0;
}
@ -602,7 +606,8 @@ exec_one_dummy_insn (struct regcache *regcache)
if (ARCH64 ())
ret = rs6000_ptrace64 (PT_CONTINUE, PIDGET (inferior_ptid), 1, 0, NULL);
else
ret = rs6000_ptrace32 (PT_CONTINUE, PIDGET (inferior_ptid), (int *)1, 0, NULL);
ret = rs6000_ptrace32 (PT_CONTINUE, PIDGET (inferior_ptid),
(int *) 1, 0, NULL);
if (ret != 0)
perror ("pt_continue");
@ -646,7 +651,7 @@ vmap_secs (struct vmap *vp, LdInfo *ldi, int arch64)
vp->tstart += vp->toffs;
}
/* handle symbol translation on vmapping */
/* Handle symbol translation on vmapping. */
static void
vmap_symtab (struct vmap *vp)
@ -754,7 +759,7 @@ add_vmap (LdInfo *ldi)
return NULL;
}
/* make sure we have an object file */
/* Make sure we have an object file. */
if (bfd_check_format (abfd, bfd_object))
vp = map_vmap (abfd, 0);
@ -891,7 +896,8 @@ vmap_ldinfo (LdInfo *ldi)
/* There may be more, so we don't break out of the loop. */
}
/* if there was no matching *vp, we must perforce create the sucker(s) */
/* If there was no matching *vp, we must perforce create the
sucker(s). */
if (!got_one && !retried)
{
add_vmap (ldi);
@ -927,8 +933,7 @@ symbols to the proper address)."),
to look up symbols.
`exec_sections' need to be relocated only once, as long as the exec
file remains unchanged.
*/
file remains unchanged. */
static void
vmap_exec (void)
@ -1017,7 +1022,8 @@ rs6000_create_inferior (struct target_ops * ops, char *exec_file,
if (!gdbarch_update_p (info))
internal_error (__FILE__, __LINE__,
_("rs6000_create_inferior: failed to select architecture"));
_("rs6000_create_inferior: failed "
"to select architecture"));
}

View file

@ -1017,7 +1017,8 @@ ppc_displaced_step_fixup (struct gdbarch *gdbarch,
paddress (gdbarch, insn), paddress (gdbarch, current_pc),
paddress (gdbarch, from + offset));
regcache_cooked_write_unsigned (regs, gdbarch_pc_regnum (gdbarch),
regcache_cooked_write_unsigned (regs,
gdbarch_pc_regnum (gdbarch),
from + offset);
}
}
@ -1317,8 +1318,7 @@ rs6000_skip_stack_check (struct gdbarch *gdbarch, const CORE_ADDR start_pc)
/* First possible sequence: A small number of probes.
stw 0, -<some immediate>(1)
[repeat this instruction any (small) number of times]
*/
[repeat this instruction any (small) number of times]. */
if ((op & 0xffff0000) == 0x90010000)
{
@ -1340,8 +1340,7 @@ rs6000_skip_stack_check (struct gdbarch *gdbarch, const CORE_ADDR start_pc)
addi 12,12,-<some immediate>
stw 0,0(12)
b <disp>
[possibly one last probe: stw 0,<some immediate>(12)]
*/
[possibly one last probe: stw 0,<some immediate>(12)]. */
while (1)
{
@ -1397,7 +1396,7 @@ rs6000_skip_stack_check (struct gdbarch *gdbarch, const CORE_ADDR start_pc)
if ((op & 0xfc000001) != 0x48000000)
break;
/* [possibly one last probe: stw 0,<some immediate>(12)] */
/* [possibly one last probe: stw 0,<some immediate>(12)]. */
pc = pc + 4;
op = rs6000_fetch_instruction (gdbarch, pc);
if ((op & 0xffff0000) == 0x900c0000)
@ -1491,8 +1490,7 @@ rs6000_skip_stack_check (struct gdbarch *gdbarch, const CORE_ADDR start_pc)
- ev_offset is the offset of the first saved ev from the previous frame.
- lr_offset is the offset of the saved lr
- cr_offset is the offset of the saved cr
- vrsave_offset is the offset of the saved vrsave register
*/
- vrsave_offset is the offset of the saved vrsave register. */
static CORE_ADDR
skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc,
@ -1741,7 +1739,8 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc,
struct symtab_and_line prologue_sal = find_pc_line (orig_pc, 0);
struct symtab_and_line this_sal = find_pc_line (pc, 0);
if ((prologue_sal.line == 0) || (prologue_sal.line != this_sal.line))
if ((prologue_sal.line == 0)
|| (prologue_sal.line != this_sal.line))
break;
}
@ -1753,8 +1752,8 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc,
was part of the function prologue. */
if (op == 0x4def7b82 || op == 0) /* crorc 15, 15, 15 */
break; /* don't skip over
this branch */
break; /* Don't skip over
this branch. */
fdata->used_bl = 1;
continue;
@ -1769,7 +1768,7 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc,
}
else if ((op & 0xfc1f016a) == 0x7c01016e)
{ /* stwux rX,r1,rY */
/* no way to figure out what r1 is going to be */
/* No way to figure out what r1 is going to be. */
fdata->frameless = 0;
offset = fdata->offset;
continue;
@ -1783,7 +1782,7 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc,
}
else if ((op & 0xfc1f016a) == 0x7c01016a)
{ /* stdux rX,r1,rY */
/* no way to figure out what r1 is going to be */
/* No way to figure out what r1 is going to be. */
fdata->frameless = 0;
offset = fdata->offset;
continue;
@ -1811,7 +1810,8 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc,
else if ((op & 0xfc0007fe) == 0x7c000378 && /* mr(.) Rx,Ry */
(((op >> 21) & 31) >= 3) && /* R3 >= Ry >= R10 */
(((op >> 21) & 31) <= 10) &&
((long) ((op >> 16) & 31) >= fdata->saved_gpr)) /* Rx: local var reg */
((long) ((op >> 16) & 31)
>= fdata->saved_gpr)) /* Rx: local var reg */
{
continue;
@ -2256,7 +2256,8 @@ rs6000_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc)
if (op != trampoline_code[ii])
return 0;
}
ii = get_frame_register_unsigned (frame, 11); /* r11 holds destination addr */
ii = get_frame_register_unsigned (frame, 11); /* r11 holds destination
addr. */
pc = read_memory_unsigned_integer (ii, tdep->wordsize, byte_order);
return pc;
}
@ -2734,7 +2735,8 @@ efpr_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
}
static void
rs6000_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
rs6000_pseudo_register_read (struct gdbarch *gdbarch,
struct regcache *regcache,
int reg_nr, gdb_byte *buffer)
{
struct gdbarch *regcache_arch = get_regcache_arch (regcache);
@ -3213,12 +3215,14 @@ rs6000_frame_cache (struct frame_info *this_frame, void **this_cache)
/* If != 0, fdata.cr_offset is the offset from the frame that
holds the CR. */
if (fdata.cr_offset != 0)
cache->saved_regs[tdep->ppc_cr_regnum].addr = cache->base + fdata.cr_offset;
cache->saved_regs[tdep->ppc_cr_regnum].addr
= cache->base + fdata.cr_offset;
/* If != 0, fdata.lr_offset is the offset from the frame that
holds the LR. */
if (fdata.lr_offset != 0)
cache->saved_regs[tdep->ppc_lr_regnum].addr = cache->base + fdata.lr_offset;
cache->saved_regs[tdep->ppc_lr_regnum].addr
= cache->base + fdata.lr_offset;
else if (fdata.lr_register != -1)
cache->saved_regs[tdep->ppc_lr_regnum].realreg = fdata.lr_register;
/* The PC is found in the link register. */
@ -3228,7 +3232,8 @@ rs6000_frame_cache (struct frame_info *this_frame, void **this_cache)
/* If != 0, fdata.vrsave_offset is the offset from the frame that
holds the VRSAVE. */
if (fdata.vrsave_offset != 0)
cache->saved_regs[tdep->ppc_vrsave_regnum].addr = cache->base + fdata.vrsave_offset;
cache->saved_regs[tdep->ppc_vrsave_regnum].addr
= cache->base + fdata.vrsave_offset;
if (fdata.alloca_reg < 0)
/* If no alloca register used, then fi->frame is the value of the
@ -3950,7 +3955,8 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
if (have_spe || have_dfp || have_vsx)
{
set_gdbarch_pseudo_register_read (gdbarch, rs6000_pseudo_register_read);
set_gdbarch_pseudo_register_write (gdbarch, rs6000_pseudo_register_write);
set_gdbarch_pseudo_register_write (gdbarch,
rs6000_pseudo_register_write);
}
set_gdbarch_have_nonsteppable_watchpoint (gdbarch, 1);
@ -4179,7 +4185,8 @@ powerpc_set_vector_abi (char *args, int from_tty,
/* Initialization code. */
extern initialize_file_ftype _initialize_rs6000_tdep; /* -Wmissing-prototypes */
/* -Wmissing-prototypes */
extern initialize_file_ftype _initialize_rs6000_tdep;
void
_initialize_rs6000_tdep (void)