diff options
Diffstat (limited to 'gdb')
53 files changed, 1097 insertions, 937 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c03a6fc..9f135f4 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -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. diff --git a/gdb/nto-procfs.c b/gdb/nto-procfs.c index dec085d..aa9599b 100644 --- a/gdb/nto-procfs.c +++ b/gdb/nto-procfs.c @@ -1,5 +1,5 @@ /* Machine independent support for QNX Neutrino /proc (process file system) - for GDB. Written by Colin Burgess at QNX Software Systems Limited. + for GDB. Written by Colin Burgess at QNX Software Systems Limited. Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. @@ -402,7 +402,7 @@ procfs_pidlist (char *args, int from_tty) } while (pid == 0); - /* Open the procfs path. */ + /* Open the procfs path. */ fd = open (buf, O_RDONLY); if (fd == -1) { @@ -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) { @@ -998,7 +999,7 @@ procfs_resume (struct target_ops *ops, signal_to_pass, 0, 0); run.flags |= _DEBUG_RUN_CLRFLT | _DEBUG_RUN_CLRSIG; } - else /* Let it kill the program without telling us. */ + else /* Let it kill the program without telling us. */ sigdelset (&run.trace, signal_to_pass); } } diff --git a/gdb/nto-tdep.c b/gdb/nto-tdep.c index 6694a79..5858dc2 100644 --- a/gdb/nto-tdep.c +++ b/gdb/nto-tdep.c @@ -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); } diff --git a/gdb/nto-tdep.h b/gdb/nto-tdep.h index 462ca32..c2a0eaf 100644 --- a/gdb/nto-tdep.h +++ b/gdb/nto-tdep.h @@ -65,7 +65,7 @@ struct nto_target_ops regset, 0 if unknown register. */ int (*register_area) (struct gdbarch *, int, int, unsigned *); -/* Build the Neutrino register set info into the data buffer. +/* Build the Neutrino register set info into the data buffer. Return -1 if unknown regset, 0 otherwise. */ int (*regset_fill) (const struct regcache *, int, char *); @@ -123,7 +123,7 @@ enum OSTYPE_NTO }; -/* These correspond to the DSMSG_* versions in dsmsgs.h. */ +/* These correspond to the DSMSG_* versions in dsmsgs.h. */ enum { NTO_REG_GENERAL, diff --git a/gdb/objc-exp.y b/gdb/objc-exp.y index a50d945..3322874 100644 --- a/gdb/objc-exp.y +++ b/gdb/objc-exp.y @@ -178,7 +178,7 @@ parse_number (char *, int, int, YYSTYPE *); %token <sval> STRING %token <sval> NSSTRING /* ObjC Foundation "NSString" literal */ %token <sval> SELECTOR /* ObjC "@selector" pseudo-operator */ -%token <ssym> NAME /* BLOCKNAME defined below to give it higher precedence. */ +%token <ssym> NAME /* BLOCKNAME defined below to give it higher precedence. */ %token <tsym> TYPENAME %token <class> CLASSNAME /* ObjC Class name */ %type <sval> name @@ -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; diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c index 565ef8f..25e13be 100644 --- a/gdb/objc-lang.c +++ b/gdb/objc-lang.c @@ -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 */ @@ -434,7 +439,7 @@ objc_printstr (struct ui_file *stream, struct type *type, /* Determine if we are currently in the Objective-C dispatch function. If so, get the address of the method function that the dispatcher - would call and use that as the function to step into instead. Also + would call and use that as the function to step into instead. Also skip over the trampoline for the function (if any). This is better for the user since they are only interested in stepping into the method function anyway. */ @@ -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 : "*"); } /* @@ -959,7 +966,7 @@ classes_info (char *regexp, int from_tty) * into two parts: debuggable (struct symbol) syms, and * non_debuggable (struct minimal_symbol) syms. The debuggable * ones will come first, before NUM_DEBUGGABLE (which will thus - * be the index of the first non-debuggable one). + * be the index of the first non-debuggable one). */ /* @@ -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++; @@ -1363,7 +1371,7 @@ char *find_imps (struct symtab *symtab, struct block *block, * with debug symbols from the first batch. Repeat until either the * second section is out of debug symbols or the first section is * full of debug symbols. Either way we have all debug symbols - * packed to the beginning of the buffer. + * packed to the beginning of the buffer. */ if (syms != NULL) @@ -1468,7 +1476,7 @@ print_object_command (char *args, int from_tty) /* The data structure 'methcalls' is used to detect method calls (thru * ObjC runtime lib functions objc_msgSend, objc_msgSendSuper, etc.), - * and ultimately find the method being called. + * and ultimately find the method being called. */ struct objc_methcall { @@ -1501,7 +1509,7 @@ static struct objc_methcall methcalls[] = { * structure "objc_msgs" by finding the addresses of each of the * (currently four) functions that it holds (of which objc_msgSend is * the first). This must be called each time symbols are loaded, in - * case the functions have moved for some reason. + * case the functions have moved for some reason. */ static void @@ -1545,7 +1553,7 @@ find_objc_msgsend (void) * returning the address of the shlib function that would be called. * That functionality has been moved into the gdbarch_skip_trampoline_code and * IN_SOLIB_TRAMPOLINE macros, which are resolved in the target- - * dependent modules. + * dependent modules. */ struct objc_submethod_helper_data { @@ -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); @@ -1731,7 +1742,7 @@ find_implementation_from_class (struct gdbarch *gdbarch, if (meth_str.name == sel) /* FIXME: hppa arch was doing a pointer dereference - here. There needs to be a better way to do that. */ + here. There needs to be a better way to do that. */ return meth_str.imp; } mlistnum++; diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 4f70d3f..2223038 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -22,7 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* This file contains support routines for creating, manipulating, and - destroying objfile structures. */ + destroying objfile structures. */ #include "defs.h" #include "bfd.h" /* Binary File Description */ @@ -62,7 +62,7 @@ static void objfile_alloc_data (struct objfile *objfile); static void objfile_free_data (struct objfile *objfile); /* Externally visible variables that are owned by this module. - See declarations in objfile.h for more info. */ + See declarations in objfile.h for more info. */ struct objfile *current_objfile; /* For symbol file being read in */ struct objfile *rt_common_objfile; /* For runtime common symbols */ @@ -111,14 +111,14 @@ get_objfile_pspace_data (struct program_space *pspace) /* Records whether any objfiles appeared or disappeared since we last updated address to obj section map. */ -/* Locate all mappable sections of a BFD file. +/* Locate all mappable sections of a BFD file. objfile_p_char is a char * to get it through bfd_map_over_sections; we cast it back to its proper type. */ /* Called via bfd_map_over_sections to build up the section table that the objfile references. The objfile contains pointers to the start of the table (objfile->sections) and to the first location after - the end of the table (objfile->sections_end). */ + the end of the table (objfile->sections_end). */ static void add_to_objfile_sections (struct bfd *abfd, struct bfd_section *asect, @@ -158,7 +158,7 @@ add_to_objfile_sections (struct bfd *abfd, struct bfd_section *asect, are initialized to zero. Also note that if anything else writes to the psymbol obstack while - we are building the table, we're pretty much hosed. */ + we are building the table, we're pretty much hosed. */ int build_objfile_section_table (struct objfile *objfile) @@ -184,7 +184,7 @@ build_objfile_section_table (struct objfile *objfile) The FLAGS word contains various bits (OBJF_*) that can be taken as requests for specific operations. Other bits like OBJF_SHARED are - simply copied through to the new objfile flags member. */ + simply copied through to the new objfile flags member. */ /* NOTE: carlton/2003-02-04: This function is called with args NULL, 0 by jv-lang.c, to create an artificial objfile used to hold @@ -213,7 +213,7 @@ allocate_objfile (bfd *abfd, int flags) /* Update the per-objfile information that comes from the bfd, ensuring that any data that is reference is saved in the per-objfile data - region. */ + region. */ objfile->obfd = gdb_bfd_ref (abfd); if (abfd != NULL) @@ -240,7 +240,7 @@ allocate_objfile (bfd *abfd, int flags) objfile->pspace = current_program_space; /* Initialize the section indexes for this objfile, so that we can - later detect if they are used w/o being properly assigned to. */ + later detect if they are used w/o being properly assigned to. */ objfile->sect_index_text = -1; objfile->sect_index_data = -1; @@ -251,7 +251,7 @@ allocate_objfile (bfd *abfd, int flags) objfile->cp_namespace_symtab = NULL; - /* Add this file onto the tail of the linked list of other such files. */ + /* Add this file onto the tail of the linked list of other such files. */ objfile->next = NULL; if (object_files == NULL) @@ -266,7 +266,7 @@ allocate_objfile (bfd *abfd, int flags) last_one->next = objfile; } - /* Save passed in flag bits. */ + /* Save passed in flag bits. */ objfile->flags |= flags; /* Rebuild section map next time we need it. */ @@ -282,7 +282,7 @@ get_objfile_arch (struct objfile *objfile) return objfile->gdbarch; } -/* Initialize entry point information for this objfile. */ +/* Initialize entry point information for this objfile. */ void init_entry_point_info (struct objfile *objfile) @@ -420,7 +420,7 @@ objfile_separate_debug_iterate (const struct objfile *parent, /* Put one object file before a specified on in the global list. This can be used to make sure an object file is destroyed before - another when using ALL_OBJFILES_SAFE to free all objfiles. */ + another when using ALL_OBJFILES_SAFE to free all objfiles. */ void put_objfile_before (struct objfile *objfile, struct objfile *before_this) { @@ -473,7 +473,7 @@ objfile_to_front (struct objfile *objfile) If OBJFILE turns out to be in the list, we zap it's NEXT pointer after unlinking it, just to ensure that we have completely severed any linkages - between the OBJFILE and the list. */ + between the OBJFILE and the list. */ void unlink_objfile (struct objfile *objfile) @@ -510,7 +510,7 @@ add_separate_debug_objfile (struct objfile *objfile, struct objfile *parent) parent->separate_debug_objfile = objfile; /* Put the separate debug object before the normal one, this is so that - usage of the ALL_OBJFILES_SAFE macro will stay safe. */ + usage of the ALL_OBJFILES_SAFE macro will stay safe. */ put_objfile_before (objfile, parent); } @@ -544,7 +544,7 @@ free_objfile_separate_debug (struct objfile *objfile) may be using the symbol information at the same time (when mmalloc is extended to support cooperative locking). When more than one process is using the mapped symbol info, we need to be more careful about when - we free objects in the reusable area. */ + we free objects in the reusable area. */ void free_objfile (struct objfile *objfile) @@ -592,7 +592,7 @@ free_objfile (struct objfile *objfile) is using reusable symbol information (via mmalloc) then each of these routines is responsible for doing the correct thing, either freeing things which are valid only during this particular gdb - execution, or leaving them to be reused during the next one. */ + execution, or leaving them to be reused during the next one. */ if (objfile->sf != NULL) { @@ -604,7 +604,7 @@ free_objfile (struct objfile *objfile) gdb_bfd_unref (objfile->obfd); - /* Remove it from the chain of all objfiles. */ + /* Remove it from the chain of all objfiles. */ unlink_objfile (objfile); @@ -619,7 +619,7 @@ free_objfile (struct objfile *objfile) linkage unit, gdb used to do these things whenever the monolithic symbol table was blown away. How much still needs to be done is unknown, but we play it safe for now and keep each action until - it is shown to be no longer needed. */ + it is shown to be no longer needed. */ /* Not all our callers call clear_symtab_users (objfile_purge_solibs, for example), so we need to call this here. */ @@ -632,7 +632,7 @@ free_objfile (struct objfile *objfile) innermost_block = NULL; /* Check to see if the current_source_symtab belongs to this objfile, - and if so, call clear_current_source_symtab_and_line. */ + and if so, call clear_current_source_symtab_and_line. */ { struct symtab_and_line cursal = get_current_source_symtab_and_line (); @@ -645,14 +645,14 @@ free_objfile (struct objfile *objfile) } } - /* The last thing we do is free the objfile struct itself. */ + /* The last thing we do is free the objfile struct itself. */ xfree (objfile->name); if (objfile->global_psymbols.list) 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); @@ -897,7 +897,7 @@ objfile_relocate (struct objfile *objfile, struct section_offsets *new_offsets) do_cleanups (my_cleanups); } - /* Relocate breakpoints as necessary, after things are relocated. */ + /* Relocate breakpoints as necessary, after things are relocated. */ if (changed) breakpoint_re_set (); } @@ -935,7 +935,7 @@ objfile_has_symbols (struct objfile *objfile) /* Many places in gdb want to test just to see if we have any partial symbols available. This function returns zero if none are currently - available, nonzero otherwise. */ + available, nonzero otherwise. */ int have_partial_symbols (void) @@ -952,7 +952,7 @@ have_partial_symbols (void) /* Many places in gdb want to test just to see if we have any full symbols available. This function returns zero if none are currently - available, nonzero otherwise. */ + available, nonzero otherwise. */ int have_full_symbols (void) @@ -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); } @@ -991,7 +991,7 @@ objfile_purge_solibs (void) /* Many places in gdb want to test just to see if we have any minimal symbols available. This function returns zero if none are currently - available, nonzero otherwise. */ + available, nonzero otherwise. */ int have_minimal_symbols (void) @@ -1027,7 +1027,7 @@ qsort_cmp (const void *a, const void *b) /* Sections are at the same address. This could happen if A) we have an objfile and a separate debuginfo. B) we are confused, and have added sections without proper relocation, - or something like that. */ + or something like that. */ const struct objfile *const objfile1 = sect1->objfile; const struct objfile *const objfile2 = sect2->objfile; @@ -1292,7 +1292,7 @@ update_section_map (struct program_space *pspace, *pmap_size = map_size; } -/* Bsearch comparison function. */ +/* Bsearch comparison function. */ static int bsearch_cmp (const void *key, const void *elt) diff --git a/gdb/objfiles.h b/gdb/objfiles.h index 683f7c3..c44517f 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -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. @@ -57,7 +57,7 @@ struct objfile_data; NOTE: cagney/2003-09-09: It turns out that this "traditional" method doesn't work. Corinna writes: ``It turns out that the call to test for "inside entry file" destroys a meaningful backtrace - under some conditions. E. g. the backtrace tests in the asm-source + under some conditions. E.g. the backtrace tests in the asm-source testcase are broken for some targets. In this test the functions are all implemented as part of one file and the testcase is not necessarily linked with a start file (depending on the target). @@ -118,7 +118,7 @@ struct obj_section /* Objfile this section is part of. */ struct objfile *objfile; - /* True if this "overlay section" is mapped into an "overlay region". */ + /* True if this "overlay section" is mapped into an "overlay region". */ int ovly_mapped; }; @@ -141,7 +141,7 @@ struct obj_section /* The "objstats" structure provides a place for gdb to record some interesting information about its internal state at runtime, on a per objfile basis, such as information about the number of symbols - read, size of string table (if any), etc. */ + read, size of string table (if any), etc. */ struct objstats { @@ -185,7 +185,7 @@ struct objfile struct list {struct list *next; struct objfile *objfile}; where the list structure is completely maintained separately within - each gdb process. */ + each gdb process. */ struct objfile *next; @@ -194,7 +194,7 @@ struct objfile char *name; - /* Some flag bits for this objfile. */ + /* Some flag bits for this objfile. */ unsigned short flags; @@ -204,13 +204,13 @@ struct objfile /* Each objfile points to a linked list of symtabs derived from this file, one symtab structure for each compilation unit (source file). Each link - in the symtab list contains a backpointer to this objfile. */ + in the symtab list contains a backpointer to this objfile. */ struct symtab *symtabs; /* Each objfile points to a linked list of partial symtabs derived from this file, one partial symtab structure for each compilation unit - (source file). */ + (source file). */ struct partial_symtab *psymtabs; @@ -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; @@ -243,16 +243,16 @@ struct objfile long mtime; /* Obstack to hold objects that should be freed when we load a new symbol - table from this object file. */ + table from this object file. */ struct obstack objfile_obstack; /* A byte cache where we can stash arbitrary "chunks" of bytes that - will not change. */ + will not change. */ - 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. */ + 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 entry in the hash table is actually two consecutive strings, @@ -262,7 +262,7 @@ struct objfile struct htab *demangled_names_hash; /* Vectors of all partial symbols read in from file. The actual data - is stored in the objfile_obstack. */ + is stored in the objfile_obstack. */ struct psymbol_allocation_list global_psymbols; struct psymbol_allocation_list static_psymbols; @@ -275,7 +275,7 @@ struct objfile of it. There is also a count of the number of symbols, which does not include the terminating null symbol. The array itself, as well as all the data that it points to, should be allocated on the - objfile_obstack for this file. */ + objfile_obstack for this file. */ struct minimal_symbol *msymbols; int minimal_symbol_count; @@ -290,20 +290,20 @@ 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. */ + object module reader of this type. */ const struct sym_fns *sf; /* The per-objfile information about the entry point, the scope (file/func) - containing the entry point, and the scope of the user's main() func. */ + containing the entry point, and the scope of the user's main() func. */ struct entry_info ei; /* Information about stabs. Will be filled in with a dbx_symfile_info - struct by those readers that need it. */ + struct by those readers that need it. */ /* NOTE: cagney/2004-10-23: This has been replaced by per-objfile data points implemented using "data" and "num_data" below. For an example of how to use this replacement, see "objfile_data" @@ -342,12 +342,12 @@ struct objfile struct section_offsets *section_offsets; int num_sections; - /* Indexes in the section_offsets array. These are initialized by the + /* Indexes in the section_offsets array. These are initialized by the *_symfile_offsets() family of functions (som_symfile_offsets, - xcoff_symfile_offsets, default_symfile_offsets). In theory they + xcoff_symfile_offsets, default_symfile_offsets). In theory they should correspond to the section indexes used by bfd for the - current objfile. The exception to this for the time being is the - SOM version. */ + current objfile. The exception to this for the time being is the + SOM version. */ int sect_index_text; int sect_index_data; @@ -377,14 +377,14 @@ struct objfile struct objfile *separate_debug_objfile; /* If this is a separate debug object, this is used as a link to the - actual executable objfile. */ + actual executable objfile. */ struct objfile *separate_debug_objfile_backlink; /* If this is a separate debug object, this is a link to the next one 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 @@ -401,7 +401,7 @@ struct objfile struct symbol *template_symbols; }; -/* Defines for the objfile flag word. */ +/* Defines for the objfile flag word. */ /* When an object file has its functions reordered (currently Irix-5.2 shared libraries exhibit this behaviour), we will need an expensive @@ -412,7 +412,7 @@ struct objfile #define OBJF_REORDERED (1 << 0) /* Functions are reordered */ /* Distinguish between an objfile for a shared library and a "vanilla" - objfile. (If not set, the objfile may still actually be a solib. + objfile. (If not set, the objfile may still actually be a solib. This can happen if the user created the objfile by using the add-symbol-file command. GDB doesn't in that situation actually check whether the file is a solib. Rather, the target's @@ -421,7 +421,7 @@ struct objfile #define OBJF_SHARED (1 << 1) /* From a shared library */ -/* User requested that this objfile be read in it's entirety. */ +/* User requested that this objfile be read in it's entirety. */ #define OBJF_READNOW (1 << 2) /* Immediate full read */ @@ -430,12 +430,12 @@ struct objfile for run_command to remove old objfile entries which are no longer valid (i.e., are associated with an old inferior), but to preserve ones that the user explicitly loaded via the add-symbol-file - command. */ + command. */ #define OBJF_USERLOADED (1 << 3) /* User loaded */ /* The object file that contains the runtime common minimal symbols - for SunOS4. Note that this objfile has no associated BFD. */ + for SunOS4. Note that this objfile has no associated BFD. */ extern struct objfile *rt_common_objfile; @@ -450,7 +450,7 @@ extern struct objfile *rt_common_objfile; objfile, and when we are done, we set it back to NULL, to ensure that we never put a type someplace other than where we are expecting to put it. FIXME: Maybe we should review the entire type handling system and - see if there is a better way to avoid this problem. */ + see if there is a better way to avoid this problem. */ extern struct objfile *current_objfile; @@ -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, \ @@ -671,8 +670,8 @@ extern int gdb_bfd_close_or_warn (struct bfd *abfd); : objfile->sect_index_text) /* Sometimes the .bss section is missing from the objfile, so we don't - want to die here. Let the users of SECT_OFF_BSS deal with an - uninitialized section index. */ + want to die here. Let the users of SECT_OFF_BSS deal with an + uninitialized section index. */ #define SECT_OFF_BSS(objfile) (objfile)->sect_index_bss /* Answer whether there is more than one object file loaded. */ diff --git a/gdb/observer.c b/gdb/observer.c index 570d979..de59ac6 100644 --- a/gdb/observer.c +++ b/gdb/observer.c @@ -19,9 +19,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* An observer is an entity who is interested in being notified when GDB - reaches certain states, or certain events occur in GDB. The entity being - observed is called the Subject. To receive notifications, the observer - attaches a callback to the subject. One subject can have several + reaches certain states, or certain events occur in GDB. The entity being + observed is called the Subject. To receive notifications, the observer + attaches a callback to the subject. One subject can have several observers. This file implements an internal generic low-level event notification @@ -31,15 +31,15 @@ for all possible notifications. The current implementation of the generic observer provides support - for contextual data. This contextual data is given to the subject - when attaching the callback. In return, the subject will provide + for contextual data. This contextual data is given to the subject + when attaching the callback. In return, the subject will provide this contextual data back to the observer as a parameter of the callback. FIXME: The current support for the contextual data is only partial, as it lacks a mechanism that would deallocate this data when the - callback is detached. This is not a problem so far, as this contextual - data is only used internally to hold a function pointer. Later on, + callback is detached. This is not a problem so far, as this contextual + data is only used internally to hold a function pointer. Later on, if a certain observer needs to provide support for user-level contextual data, then the generic notification mechanism will need need to be enhanced to allow the observer to provide a routine to diff --git a/gdb/opencl-lang.c b/gdb/opencl-lang.c index 9db01c7..bfc863e 100644 --- a/gdb/opencl-lang.c +++ b/gdb/opencl-lang.c @@ -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 */ diff --git a/gdb/osabi.c b/gdb/osabi.c index 3521877..a264924 100644 --- a/gdb/osabi.c +++ b/gdb/osabi.c @@ -184,7 +184,7 @@ gdbarch_register_osabi (enum bfd_architecture arch, unsigned long machine, } -/* Sniffer to find the OS ABI for a given file's architecture and flavour. +/* Sniffer to find the OS ABI for a given file's architecture and flavour. It is legal to have multiple sniffers for each arch/flavour pair, to disambiguate one OS's a.out from another, for example. The first sniffer to return something other than GDB_OSABI_UNKNOWN wins, so a sniffer should diff --git a/gdb/p-exp.y b/gdb/p-exp.y index 56e163f..21c3dbb 100644 --- a/gdb/p-exp.y +++ b/gdb/p-exp.y @@ -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) @@ -64,7 +64,7 @@ yacc generated parsers in gdb. Note that these are only the variables produced by yacc. If other parser generators (bison, byacc, etc) produce additional global names that conflict at link time, then those parser - generators need to be fixed instead of adding those names to this list. */ + generators need to be fixed instead of adding those names to this list. */ #define yymaxdepth pascal_maxdepth #define yyparse pascal_parse @@ -184,7 +184,7 @@ static int search_field; %token <sval> STRING %token <sval> FIELDNAME -%token <ssym> NAME /* BLOCKNAME defined below to give it higher precedence. */ +%token <ssym> NAME /* BLOCKNAME defined below to give it higher precedence. */ %token <tsym> TYPENAME %type <sval> name %type <ssym> name_not_typename @@ -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); } ; @@ -514,7 +516,7 @@ exp : variable ; exp : VARIABLE - /* Already written by write_dollar_variable. */ + /* Already written by write_dollar_variable. */ ; exp : SIZEOF '(' type ')' %prec UNARY @@ -533,7 +535,7 @@ exp : STRING an explicit null byte added at the end. Thus the array upper bound is the string length. There is no such thing in C as a completely empty - string. */ + string. */ char *sp = $1.ptr; int count = $1.length; while (count-- > 0) { @@ -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 @@ -959,7 +967,7 @@ parse_number (char *p, int len, int parsed_float, YYSTYPE *putithere) putithere->typed_val_int.val = n; /* If the high bit of the worked out type is set then this number - has to be unsigned. */ + has to be unsigned. */ if (unsigned_p || (n & high_bit)) { @@ -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; @@ -1112,7 +1122,7 @@ yylex () case '\'': /* We either have a character constant ('0' or '\177' for example) or we have a quoted symbol reference ('foo(int,int)' in object pascal - for example). */ + for example). */ lexptr++; c = *lexptr++; if (c == '\\') @@ -1162,7 +1172,7 @@ yylex () case '.': /* Might be a floating point number. */ if (lexptr[1] < '0' || lexptr[1] > '9') - goto symbol; /* Nope, must be a symbol. */ + goto symbol; /* Nope, must be a symbol. */ /* FALL THRU into number case. */ case '0': @@ -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,14 +1272,14 @@ 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; do { /* Grow the static temp buffer if necessary, including allocating - the first one on demand. */ + the first one on demand. */ if (tempbufindex + 1 >= tempbufsize) { tempbuf = (char *) realloc (tempbuf, tempbufsize += 64); @@ -1277,7 +1289,7 @@ yylex () { case '\0': case '"': - /* Do nothing, loop will terminate. */ + /* Do nothing, loop will terminate. */ break; case '\\': tokptr++; @@ -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; @@ -1337,7 +1349,7 @@ yylex () break; } - /* do NOT uppercase internals because of registers !!! */ + /* do NOT uppercase internals because of registers !!! */ c = tokstart[++namelen]; } @@ -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, @@ -1441,7 +1453,7 @@ yylex () if (search_field && current_type) - is_a_field = (lookup_struct_elt_type (current_type, tmp, 1) != NULL); + is_a_field = (lookup_struct_elt_type (current_type, tmp, 1) != NULL); if (is_a_field) sym = NULL; else @@ -1456,7 +1468,7 @@ yylex () tmp[i] -= ('a'-'A'); } if (search_field && current_type) - is_a_field = (lookup_struct_elt_type (current_type, tmp, 1) != NULL); + is_a_field = (lookup_struct_elt_type (current_type, tmp, 1) != NULL); if (is_a_field) sym = NULL; else @@ -1484,7 +1496,7 @@ yylex () tmp[i] -= ('A'-'a'); } if (search_field && current_type) - is_a_field = (lookup_struct_elt_type (current_type, tmp, 1) != NULL); + is_a_field = (lookup_struct_elt_type (current_type, tmp, 1) != NULL); if (is_a_field) sym = NULL; else @@ -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; diff --git a/gdb/p-lang.c b/gdb/p-lang.c index 79a3338..0469de5 100644 --- a/gdb/p-lang.c +++ b/gdb/p-lang.c @@ -36,7 +36,7 @@ extern void _initialize_pascal_language (void); /* All GPC versions until now (2007-09-27) also define a symbol called - '_p_initialize'. Check for the presence of this symbol first. */ + '_p_initialize'. Check for the presence of this symbol first. */ static const char GPC_P_INITIALIZE[] = "_p_initialize"; /* The name of the symbol that GPC uses as the name of the main @@ -54,7 +54,7 @@ static const char GPC_MAIN_PROGRAM_NAME_2[] = "pascal_main_program"; so that it finds the even if the program was compiled without debugging information. According to information supplied by Waldeck Hebisch, - this should work for all versions posterior to June 2000. */ + this should work for all versions posterior to June 2000. */ const char * pascal_main_name (void) @@ -137,7 +137,7 @@ is_pascal_string_type (struct type *type,int *length_pos, *length_size = TYPE_LENGTH (TYPE_FIELD_TYPE (type, 1)); if (string_pos) *string_pos = TYPE_FIELD_BITPOS (type, 2) / TARGET_CHAR_BIT; - /* FIXME: how can I detect wide chars in GPC ?? */ + /* FIXME: how can I detect wide chars in GPC ?? */ if (char_type) { *char_type = TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (type, 2)); @@ -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) @@ -188,7 +188,7 @@ static void pascal_emit_char (int c, struct type *type, /* Print the character C on STREAM as part of the contents of a literal string whose delimiter is QUOTER. Note that that format for printing - characters and strings is language specific. */ + characters and strings is language specific. */ static void pascal_emit_char (int c, struct type *type, struct ui_file *stream, int quoter) diff --git a/gdb/p-typeprint.c b/gdb/p-typeprint.c index cee9c81..54a761d 100644 --- a/gdb/p-typeprint.c +++ b/gdb/p-typeprint.c @@ -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; }; @@ -127,7 +127,7 @@ pascal_print_typedef (struct type *type, struct symbol *new_symbol, } In general, gdb should try to print the types as closely as possible to - the form that they appear in the source code. */ + the form that they appear in the source code. */ static void pascal_type_print_derivation_info (struct ui_file *stream, struct type *type) @@ -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 "); @@ -503,7 +503,7 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show, case TYPE_CODE_METHOD: /* pascal_type_print_base (TYPE_TARGET_TYPE (type), stream, show, level); - only after args !! */ + only after args !! */ break; case TYPE_CODE_STRUCT: if (TYPE_TAG_NAME (type) != NULL) @@ -552,7 +552,7 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show, /* Start off with no specific section type, so we can print one for the first field we find, and use that section type - thereafter until we find another type. */ + thereafter until we find another type. */ section_type = s_none; @@ -569,7 +569,7 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show, continue; /* If this is a pascal object or class we can print the - various section labels. */ + various section labels. */ if (HAVE_CPLUS_STRUCT (type)) { @@ -620,12 +620,12 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show, fprintf_filtered (stream, ";\n"); } - /* If there are both fields and methods, put a space between. */ + /* If there are both fields and methods, put a space between. */ len = TYPE_NFN_FIELDS (type); 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, @@ -731,7 +731,7 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show, fputs_filtered (" ", stream); } /* enum is just defined by - type enume_name = (enum_member1,enum_member2,...) */ + type enume_name = (enum_member1,enum_member2,...) */ fprintf_filtered (stream, " = "); wrap_here (" "); if (show < 0) @@ -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); @@ -805,7 +805,7 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show, /* Handle types not explicitly handled by the other cases, such as fundamental types. For these, just print whatever the type name is, as recorded in the type itself. If there - is no type name, then complain. */ + is no type name, then complain. */ if (TYPE_NAME (type) != NULL) { fputs_filtered (TYPE_NAME (type), stream); diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c index 5390dd9..e993c05 100644 --- a/gdb/p-valprint.c +++ b/gdb/p-valprint.c @@ -96,7 +96,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, { unsigned int temp_len; - /* Look for a NULL char. */ + /* Look for a NULL char. */ for (temp_len = 0; extract_unsigned_integer (valaddr + embedded_offset + temp_len * eltlen, eltlen, @@ -147,7 +147,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, { /* Print the unmangled name if desired. */ /* Print vtable entry - we only get here if we ARE using - -fvtable_thunks. (Otherwise, look under TYPE_CODE_STRUCT.) */ + -fvtable_thunks. (Otherwise, look under TYPE_CODE_STRUCT.) */ /* Extract the address, assume that it is unsigned. */ addr = extract_unsigned_integer (valaddr + embedded_offset, TYPE_LENGTH (type), byte_order); @@ -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 = @@ -302,7 +302,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, { /* Print the unmangled name if desired. */ /* Print vtable entry - we only get here if NOT using - -fvtable_thunks. (Otherwise, look under TYPE_CODE_PTR.) */ + -fvtable_thunks. (Otherwise, look under TYPE_CODE_PTR.) */ /* Extract the address, assume that it is unsigned. */ print_address_demangle (gdbarch, @@ -594,13 +594,13 @@ pascal_value_print (struct value *val, struct ui_file *stream, || TYPE_CODE (type) == TYPE_CODE_REF) { /* Hack: remove (char *) for char strings. Their - type is indicated by the quoted string anyway. */ + type is indicated by the quoted string anyway. */ if (TYPE_CODE (type) == TYPE_CODE_PTR && TYPE_NAME (type) == NULL && TYPE_NAME (TYPE_TARGET_TYPE (type)) != NULL && strcmp (TYPE_NAME (TYPE_TARGET_TYPE (type)), "char") == 0) { - /* Print nothing */ + /* Print nothing. */ } else { @@ -662,12 +662,12 @@ 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. */ + to virtual functions. */ return pascal_object_is_vtbl_ptr_type (type); } } @@ -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), @@ -940,12 +940,12 @@ pascal_object_print_value (struct type *type, const gdb_byte *valaddr, fputs_filtered ("> = ", stream); /* The virtual base class pointer might have been clobbered by the - user program. Make sure that it still points to a valid memory + user program. Make sure that it still points to a valid memory location. */ if (boffset != -1 && (boffset < 0 || boffset >= TYPE_LENGTH (type))) { - /* FIXME (alloc): not safe is baseclass is really really big. */ + /* FIXME (alloc): not safe is baseclass is really really big. */ gdb_byte *buf = alloca (TYPE_LENGTH (baseclass)); base_valaddr = buf; diff --git a/gdb/parse.c b/gdb/parse.c index 4f0c111..856c24d 100644 --- a/gdb/parse.c +++ b/gdb/parse.c @@ -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 @@ -321,7 +321,7 @@ write_exp_elt_intern (struct internalvar *expelt) actual length is recorded in expression elements at each end of the string. The null byte is taken into consideration when computing how many expression elements are required to hold the string constant, of - course. */ + course. */ void @@ -334,12 +334,12 @@ write_exp_string (struct stoken str) /* Compute the number of expression elements required to hold the string (including a null byte terminator), along with one expression element at each end to record the actual string length (not including the - null byte terminator). */ + null byte terminator). */ lenelt = 2 + BYTES_TO_EXP_ELEM (len + 1); /* Ensure that we have enough available expression elements to store - everything. */ + everything. */ if ((expout_ptr + lenelt) >= expout_size) { @@ -352,7 +352,7 @@ write_exp_string (struct stoken str) /* Write the leading length expression element (which advances the current expression element index), then write the string constant followed by a terminating null byte, and then write the trailing length expression - element. */ + element. */ write_exp_elt_longcst ((LONGEST) len); strdata = (char *) &expout->elts[expout_ptr]; @@ -427,10 +427,10 @@ 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. */ + either end of the bitstring. */ void write_exp_bitstring (struct stoken str) @@ -442,12 +442,12 @@ write_exp_bitstring (struct stoken str) /* Compute the number of expression elements required to hold the bitstring, along with one expression element at each end to record the actual - bitstring length in bits. */ + bitstring length in bits. */ lenelt = 2 + BYTES_TO_EXP_ELEM (len); /* Ensure that we have enough available expression elements to store - everything. */ + everything. */ if ((expout_ptr + lenelt) >= expout_size) { @@ -459,7 +459,7 @@ write_exp_bitstring (struct stoken str) /* Write the leading length expression element (which advances the current expression element index), then write the bitstring constant, and then - write the trailing length expression element. */ + write the trailing length expression element. */ write_exp_elt_longcst ((LONGEST) bits); strdata = (char *) &expout->elts[expout_ptr]; @@ -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) @@ -576,7 +574,7 @@ write_dollar_variable (struct stoken str) struct internalvar *isym = NULL; /* Handle the tokens $digits; also $ (short for $0) and $$ (short for $$1) - and $$digits (equivalent to $<-digits> if you could type that). */ + and $$digits (equivalent to $<-digits> if you could type that). */ int negate = 0; int i = 1; @@ -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; } @@ -624,7 +622,7 @@ write_dollar_variable (struct stoken str) } /* On some systems, such as HP-UX and hppa-linux, certain system routines - have names beginning with $ or $$. Check for those, first. */ + have names beginning with $ or $$. Check for those, first. */ sym = lookup_symbol (copy_name (str), (struct block *) NULL, VAR_DOMAIN, (int *) NULL); @@ -683,7 +681,7 @@ find_template_name_end (char *p) case '\"': case '{': case '}': - /* In future, may want to allow these?? */ + /* In future, may want to allow these?? */ return 0; case '<': depth++; /* start nested template */ @@ -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); @@ -1117,9 +1115,9 @@ parse_exp_in_context (char **stringptr, struct block *block, int comma, startup phase to re-parse breakpoint expressions after a new shared library has been loaded. The language associated to the current frame at this moment is not relevant for - the breakpoint. Using it would therefore be silly, so it seems + the breakpoint. Using it would therefore be silly, so it seems better to rely on the current language rather than relying on - the current frame language to parse the expression. That's why + the current frame language to parse the expression. That's why we do the following language detection only if the context block has been specifically provided. */ struct symbol *func = block_linkage_function (block); @@ -1157,7 +1155,7 @@ parse_exp_in_context (char **stringptr, struct block *block, int comma, /* Record the actual number of expression elements, and then reallocate the expression memory so that we free up any - excess elements. */ + excess elements. */ expout->nelts = expout_ptr; expout = (struct expression *) @@ -1165,7 +1163,7 @@ parse_exp_in_context (char **stringptr, struct block *block, int comma, sizeof (struct expression) + EXP_ELEM_TO_BYTES (expout_ptr));; /* Convert expression from postfix form as generated by yacc - parser, to a prefix form. */ + parser, to a prefix form. */ if (expressiondebug) dump_raw_expression (expout, gdb_stdlog, @@ -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) diff --git a/gdb/parser-defs.h b/gdb/parser-defs.h index 95dd799..3f743d1 100644 --- a/gdb/parser-defs.h +++ b/gdb/parser-defs.h @@ -50,7 +50,7 @@ extern struct block *expression_context_block; extern CORE_ADDR expression_context_pc; /* The innermost context required by the stack and register variables - we've encountered so far. */ + we've encountered so far. */ extern struct block *innermost_block; /* The block in which the most recently discovered symbol was found. @@ -62,13 +62,13 @@ extern struct block *block_found; extern int arglist_len; /* A string token, either a char-string or bit-string. Char-strings are - used, for example, for the names of symbols. */ + used, for example, for the names of symbols. */ 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; }; @@ -215,7 +215,7 @@ extern int parse_c_float (struct gdbarch *gdbarch, const char *p, int len, extern char *lexptr; -/* After a token has been recognized, this variable points to it. +/* After a token has been recognized, this variable points to it. Currently used only for error reporting. */ extern char *prev_lexptr; @@ -265,7 +265,7 @@ struct op_print enum precedence precedence; /* For a binary operator: 1 iff right associate. - For a unary operator: 1 iff postfix. */ + For a unary operator: 1 iff postfix. */ int right_assoc; }; diff --git a/gdb/posix-hdep.c b/gdb/posix-hdep.c index 1136541..9bd3a9a 100644 --- a/gdb/posix-hdep.c +++ b/gdb/posix-hdep.c @@ -27,7 +27,7 @@ /* The strerror() function can return NULL for errno values that are out of range. Provide a "safe" version that always returns a - printable string. */ + printable string. */ char * safe_strerror (int errnum) diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c index ca7312b..c0f0708 100644 --- a/gdb/ppc-linux-nat.c +++ b/gdb/ppc-linux-nat.c @@ -42,7 +42,7 @@ #include <sys/procfs.h> #include <sys/ptrace.h> -/* Prototypes for supply_gregset etc. */ +/* Prototypes for supply_gregset etc. */ #include "gregset.h" #include "ppc-tdep.h" #include "ppc-linux-tdep.h" @@ -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; }; @@ -205,7 +205,7 @@ struct ppc_hw_breakpoint There are 32 vector registers 16 bytes longs, plus a VSCR register which is only 4 bytes long, but is fetched as a 16 bytes - quantity. Up to here we have the elf_vrregset_t structure. + quantity. Up to here we have the elf_vrregset_t structure. Appended to this there is space for the VRSAVE register: 4 bytes. Even though this vrsave register is not included in the regset typedef, it is handled by the ptrace requests. @@ -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 @@ -543,7 +548,7 @@ fetch_register (struct regcache *regcache, int tid, int regno) /* This isn't really an address. But ptrace thinks of it as one. */ CORE_ADDR regaddr = ppc_register_u_addr (gdbarch, regno); int bytes_transferred; - unsigned int offset; /* Offset of registers within the u area. */ + unsigned int offset; /* Offset of registers within the u area. */ char buf[MAX_REGISTER_SIZE]; if (altivec_register_p (gdbarch, regno)) @@ -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); @@ -868,7 +873,7 @@ ppc_linux_fetch_inferior_registers (struct target_ops *ops, fetch_register (regcache, tid, regno); } -/* Store one VSX register. */ +/* Store one VSX register. */ static void store_vsx_register (const struct regcache *regcache, int tid, int regno) { @@ -897,7 +902,7 @@ store_vsx_register (const struct regcache *regcache, int tid, int regno) perror_with_name (_("Unable to store VSX register")); } -/* Store one register. */ +/* Store one register. */ static void store_altivec_register (const struct regcache *regcache, int tid, int regno) { @@ -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, ®s); 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 @@ -1799,7 +1809,7 @@ num_memory_accesses (struct value *v) if (!value_lazy (v)) found_memory_cnt++; } - /* Other kinds of values are not fine. */ + /* Other kinds of values are not fine. */ else return -1; } @@ -2025,11 +2035,11 @@ ppc_linux_new_thread (ptid_t ptid) if (VEC_empty (thread_points_p, ppc_threads)) return; - /* Get a list of breakpoints from any thread. */ + /* Get a list of breakpoints from any thread. */ p = VEC_last (thread_points_p, ppc_threads); hw_breaks = p->hw_breaks; - /* Copy that thread's breakpoints and watchpoints to the new thread. */ + /* Copy that thread's breakpoints and watchpoints to the new thread. */ for (i = 0; i < max_slots_number; i++) if (hw_breaks[i].hw_break) booke_insert_point (hw_breaks[i].hw_break, tid); @@ -2133,7 +2143,7 @@ ppc_linux_watchpoint_addr_within_range (struct target_ops *target, addr &= ~mask; - /* Check whether [start, start+length-1] intersects [addr, addr+mask]. */ + /* Check whether [start, start+length-1] intersects [addr, addr+mask]. */ return start <= addr + mask && start + length - 1 >= addr; } @@ -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. */ @@ -2296,7 +2306,7 @@ ppc_linux_read_description (struct target_ops *ops) } /* Power ISA 2.05 (implemented by Power 6 and newer processors) increases - the FPSCR from 32 bits to 64 bits. Even though Power 7 supports this + the FPSCR from 32 bits to 64 bits. Even though Power 7 supports this ISA version, it doesn't have PPC_FEATURE_ARCH_2_05 set, only PPC_FEATURE_ARCH_2_06. Since for now the only bits used in the higher half of the register are for Decimal Floating Point, we check if that @@ -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; diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c index 000be5c..d2c9737 100644 --- a/gdb/ppc-linux-tdep.c +++ b/gdb/ppc-linux-tdep.c @@ -147,7 +147,7 @@ Now we've hit the breakpoint at shr1. (The breakpoint was reset from the PLT entry to the actual shr1 function after the shared library was loaded.) Note that the PLT entry has been - resolved to contain a branch that takes us directly to shr1. + resolved to contain a branch that takes us directly to shr1. (The real one, not the PLT entry.) (gdb) x/2i 0x100409d4 @@ -158,7 +158,7 @@ changed twice. Now the problem should be obvious. GDB places a breakpoint (a - trap instruction) on the zero value of the PLT entry for shr1. + trap instruction) on the zero value of the PLT entry for shr1. Later on, after the shared library had been loaded and the PLT initialized, GDB gets a signal indicating this fact and attempts (as it always does when it stops) to remove all the breakpoints. @@ -181,7 +181,7 @@ that the latter does not is check to make sure that the breakpoint location actually contains a breakpoint (trap instruction) prior to attempting to write back the old contents. If it does contain - a trap instruction, we allow the old contents to be written back. + a trap instruction, we allow the old contents to be written back. Otherwise, we silently do nothing. The big question is whether memory_remove_breakpoint () should be @@ -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); @@ -284,8 +284,8 @@ read_insn (CORE_ADDR pc) /* An instruction to match. */ struct insn_pattern { - unsigned int mask; /* mask the insn with this... */ - unsigned int data; /* ...and see if it matches this. */ + unsigned int mask; /* mask the insn with this... */ + unsigned int data; /* ...and see if it matches this. */ int optional; /* If non-zero, this insn may be absent. */ }; @@ -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. */ diff --git a/gdb/ppc-linux-tdep.h b/gdb/ppc-linux-tdep.h index b1acfde..52cefa3 100644 --- a/gdb/ppc-linux-tdep.h +++ b/gdb/ppc-linux-tdep.h @@ -22,7 +22,7 @@ struct regset; -/* From ppc-linux-tdep.c ... */ +/* From ppc-linux-tdep.c ... */ const struct regset *ppc_linux_gregset (int); const struct regset *ppc_linux_fpregset (void); diff --git a/gdb/ppc-sysv-tdep.c b/gdb/ppc-sysv-tdep.c index 81d0f55..23d7a71 100644 --- a/gdb/ppc-sysv-tdep.c +++ b/gdb/ppc-sysv-tdep.c @@ -31,16 +31,16 @@ #include "objfiles.h" #include "infcall.h" -/* Pass the arguments in either registers, or in the stack. Using the +/* Pass the arguments in either registers, or in the stack. Using the ppc sysv ABI, 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 fpr's, in addition to that. Rest of the parameters if any - are passed in user stack. + passed in fpr's, in addition to that. Rest of the parameters if any + are passed in user stack. If the function is returning a structure, then the return address is passed in r3, then the first 7 words of the parametes can be passed in registers, - starting from r4. */ + starting from r4. */ CORE_ADDR ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, @@ -387,7 +387,7 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, || TYPE_CODE (type) == TYPE_CODE_UNION) { /* Structs and large values are put in an - aligned stack slot ... */ + aligned stack slot ... */ if (TYPE_CODE (type) == TYPE_CODE_ARRAY && TYPE_VECTOR (type) && len >= 16) @@ -443,7 +443,7 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, /* The psABI says that "A caller of a function that takes a variable argument list shall set condition register bit 6 to 1 if it passes one or more arguments in the floating-point - registers. It is strongly recommended that the caller set the + registers. It is strongly recommended that the caller set the bit to 0 otherwise..." Doing this for normal functions too shouldn't hurt. */ if (write_pass) @@ -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, @@ -880,15 +882,16 @@ convert_code_addr_to_desc_addr (CORE_ADDR code_addr, CORE_ADDR *desc_addr) return 1; } -/* Pass the arguments in either registers, or in the stack. Using the +/* Pass the arguments in either registers, or in the stack. Using the ppc 64 bit SysV ABI. This implements a dumbed down version of the ABI. It always writes values to memory, GPR and FPR, even when not necessary. Doing this - greatly simplifies the logic. */ + 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) @@ -906,7 +909,7 @@ ppc64_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, in the for-loop below. */ LONGEST gparam_size = 0; /* Kevin writes ... I don't mind seeing tdep->wordsize used in the - calls to align_up(), align_down(), etc. because this makes it + calls to align_up(), align_down(), etc. because this makes it easier to reuse this code (in a copy/paste sense) in the future, but it is a 64-bit ABI and asserting that the wordsize is 8 bytes at some point makes it easier to verify that this function is @@ -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; } } diff --git a/gdb/ppc-tdep.h b/gdb/ppc-tdep.h index 7bd016f..84d4f90 100644 --- a/gdb/ppc-tdep.h +++ b/gdb/ppc-tdep.h @@ -27,7 +27,7 @@ struct value; struct regcache; struct type; -/* From ppc-sysv-tdep.c ... */ +/* From ppc-sysv-tdep.c ... */ enum return_value_convention ppc_sysv_abi_return_value (struct gdbarch *gdbarch, struct type *func_type, struct type *valtype, @@ -61,7 +61,7 @@ enum return_value_convention ppc64_sysv_abi_return_value (struct gdbarch *gdbarc gdb_byte *readbuf, const gdb_byte *writebuf); -/* From rs6000-tdep.c... */ +/* From rs6000-tdep.c... */ int altivec_register_p (struct gdbarch *gdbarch, int regno); int vsx_register_p (struct gdbarch *gdbarch, int regno); int spe_register_p (struct gdbarch *gdbarch, int regno); @@ -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. */ @@ -181,7 +181,7 @@ extern void ppc_collect_vsxregset (const struct regset *regset, const struct regcache *regcache, int regnum, void *vsxregs, size_t len); -/* Private data that this module attaches to struct gdbarch. */ +/* Private data that this module attaches to struct gdbarch. */ /* Vector ABI used by the inferior. */ enum powerpc_vector_abi @@ -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. */ diff --git a/gdb/ppcbug-rom.c b/gdb/ppcbug-rom.c index f4b3a69..db12054 100644 --- a/gdb/ppcbug-rom.c +++ b/gdb/ppcbug-rom.c @@ -95,10 +95,10 @@ ppcbug_supply_register (struct regcache *regcache, char *regname, } /* - * This array of registers needs to match the indexes used by GDB. The + * This array of registers needs to match the indexes used by GDB. The * whole reason this exists is because the various ROM monitors use * different names than GDB does, and don't support all the - * registers either. So, typing "info reg sp" becomes an "A7". + * registers either. So, typing "info reg sp" becomes an "A7". */ static char *ppcbug_regnames[] = @@ -118,9 +118,9 @@ static char *ppcbug_regnames[] = }; /* - * Define the monitor command strings. Since these are passed directly + * Define the monitor command strings. Since these are passed directly * through to a printf style function, we need can include formatting - * strings. We also need a CR or LF on the end. + * strings. We also need a CR or LF on the end. */ static struct target_ops ppcbug_ops0; @@ -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) */ diff --git a/gdb/ppcnbsd-tdep.c b/gdb/ppcnbsd-tdep.c index ff2cd6f..bb7070d 100644 --- a/gdb/ppcnbsd-tdep.c +++ b/gdb/ppcnbsd-tdep.c @@ -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, @@ -133,7 +133,7 @@ ppcnbsd_sigtramp_cache_init (const struct tramp_frame *self, trad_frame_set_reg_addr (this_cache, tdep->ppc_ctr_regnum, addr); addr += tdep->wordsize; trad_frame_set_reg_addr (this_cache, gdbarch_pc_regnum (gdbarch), - addr); /* SRR0? */ + addr); /* SRR0? */ addr += tdep->wordsize; /* Construct the frame ID using the function start. */ diff --git a/gdb/ppcobsd-tdep.c b/gdb/ppcobsd-tdep.c index df70489..51cb639 100644 --- a/gdb/ppcobsd-tdep.c +++ b/gdb/ppcobsd-tdep.c @@ -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. */ @@ -208,7 +208,7 @@ ppcobsd_sigtramp_frame_cache (struct frame_info *this_frame, void **this_cache) trad_frame_set_reg_addr (cache, tdep->ppc_ctr_regnum, addr); addr += tdep->wordsize; trad_frame_set_reg_addr (cache, gdbarch_pc_regnum (gdbarch), addr); - /* SRR0? */ + /* SRR0? */ addr += tdep->wordsize; /* Construct the frame ID using the function start. */ diff --git a/gdb/ppcobsd-tdep.h b/gdb/ppcobsd-tdep.h index c49b268..503619b 100644 --- a/gdb/ppcobsd-tdep.h +++ b/gdb/ppcobsd-tdep.h @@ -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. */ diff --git a/gdb/printcmd.c b/gdb/printcmd.c index b7d3ade..f435f6d 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -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; }; @@ -166,13 +167,13 @@ static struct display *display_chain; static int display_number; -/* Prototypes for exported functions. */ +/* Prototypes for exported functions. */ void output_command (char *, int); void _initialize_printcmd (void); -/* Prototypes for local functions. */ +/* Prototypes for local functions. */ static void do_one_display (struct display *); @@ -619,11 +620,11 @@ print_address_symbolic (struct gdbarch *gdbarch, CORE_ADDR addr, } /* Given an address ADDR return all the elements needed to print the - address in a symbolic form. NAME can be mangled or not depending + address in a symbolic form. NAME can be mangled or not depending on DO_DEMANGLE (and also on the asm_demangle global variable, - manipulated via ''set print asm-demangle''). Return 0 in case of - success, when all the info in the OUT paramters is valid. Return 1 - otherwise. */ + manipulated via ''set print asm-demangle''). Return 0 in case of + success, when all the info in the OUT paramters is valid. Return 1 + otherwise. */ int build_address_symbolic (struct gdbarch *gdbarch, CORE_ADDR addr, /* IN */ @@ -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; } @@ -904,7 +905,7 @@ instead."), size); the address stored in LAST_EXAMINE_VALUE. FIXME: Should the disassembler be modified so that LAST_EXAMINE_VALUE is left with the byte sequence from the last complete - instruction fetched from memory? */ + instruction fetched from memory? */ last_examine_value = value_at_lazy (val_type, next_address); if (last_examine_value) @@ -1189,7 +1190,7 @@ address_info (char *exp, int from_tty) struct obj_section *section; CORE_ADDR load_addr, context_pc = 0; int is_a_field_of_this; /* C++: lookup_symbol sets this to nonzero - if exp is a field of `this'. */ + if exp is a field of `this'. */ if (exp == 0) error (_("Argument required.")); @@ -1453,7 +1454,7 @@ x_command (char *exp, int from_tty) last_size = fmt.size; last_format = fmt.format; - /* Set a couple of internal variables if appropriate. */ + /* Set a couple of internal variables if appropriate. */ if (last_examine_value) { /* Make last address examined available to the user as $_. Use @@ -1634,7 +1635,7 @@ undisplay_command (char *args, int from_tty) /* Display a single auto-display. Do nothing if the display cannot be printed in the current context, - or if the display is disabled. */ + or if the display is disabled. */ static void do_one_display (struct display *d) @@ -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); } @@ -2809,7 +2810,7 @@ Use \"set variable\" for variables with names identical to set subcommands.\n\ \nWith a subcommand, this command modifies parts of the gdb environment.\n\ You can see these environment settings with the \"show\" command.")); - /* "call" is the same as "set", but handy for dbx users to call fns. */ + /* "call" is the same as "set", but handy for dbx users to call fns. */ c = add_com ("call", class_vars, call_command, _("\ Call a function in the program.\n\ The argument is the function name and arguments, in the notation of the\n\ diff --git a/gdb/proc-api.c b/gdb/proc-api.c index 9731338..6904d15 100644 --- a/gdb/proc-api.c +++ b/gdb/proc-api.c @@ -44,7 +44,7 @@ #ifdef HAVE_SYS_USER_H #include <sys/user.h> /* for struct user */ #endif -#include <fcntl.h> /* for O_RDWR etc. */ +#include <fcntl.h> /* for O_RDWR etc. */ #include "gdb_wait.h" #include "proc-utils.h" @@ -52,7 +52,7 @@ /* Much of the information used in the /proc interface, particularly for printing status information, is kept as tables of structures of the following form. These tables can be used to map numeric values to - their symbolic names and to a string that describes their specific use. */ + their symbolic names and to a string that describes their specific use. */ struct trans { long value; /* The numeric value */ diff --git a/gdb/proc-flags.c b/gdb/proc-flags.c index 386d4ac..9dd2fb0 100644 --- a/gdb/proc-flags.c +++ b/gdb/proc-flags.c @@ -39,7 +39,7 @@ /* Much of the information used in the /proc interface, particularly for printing status information, is kept as tables of structures of the following form. These tables can be used to map numeric values to - their symbolic names and to a string that describes their specific use. */ + their symbolic names and to a string that describes their specific use. */ struct trans { int value; /* The numeric value */ @@ -48,7 +48,7 @@ struct trans { }; /* Translate bits in the pr_flags member of the prstatus structure, - into the names and desc information. */ + into the names and desc information. */ static struct trans pr_flag_table[] = { diff --git a/gdb/proc-utils.h b/gdb/proc-utils.h index b20f17e..27ddd82 100644 --- a/gdb/proc-utils.h +++ b/gdb/proc-utils.h @@ -91,7 +91,7 @@ extern void procfs_note (char *, char *, int); proc_prettyfprint_status (X, Y, Z, T) /* Define the type (and more importantly the width) of the control - word used to write to the /proc/PID/ctl file. */ + word used to write to the /proc/PID/ctl file. */ #if defined (PROC_CTL_WORD_TYPE) typedef PROC_CTL_WORD_TYPE procfs_ctl_t; #else diff --git a/gdb/procfs.c b/gdb/procfs.c index 08a0fcd..321d137 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -32,7 +32,7 @@ #include "inf-child.h" #if defined (NEW_PROC_API) -#define _STRUCTURED_PROC 1 /* Should be done by configure script. */ +#define _STRUCTURED_PROC 1 /* Should be done by configure script. */ #endif #include <sys/procfs.h> @@ -338,7 +338,7 @@ typedef struct siginfo gdb_siginfo_t; There will be a separate procinfo structure for use by the (not yet implemented) "info proc" command, so that we can print useful information about any random process without interfering with the - inferior's procinfo information. */ + inferior's procinfo information. */ #ifdef NEW_PROC_API /* format strings for /proc paths */ @@ -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) @@ -646,10 +645,10 @@ open_procinfo_files (procinfo *pi, int which) #ifdef PIOCTSTATUS /* OSF */ - /* Only one FD; just open it. */ + /* Only one FD; just open it. */ if ((fd = open_with_retry (pi->pathname, O_RDWR)) == 0) return 0; -#else /* Sol 2.5, Irix, other? */ +#else /* Sol 2.5, Irix, other? */ if (pi->tid == 0) /* Master procinfo for the process */ { fd = open_with_retry (pi->pathname, O_RDWR); @@ -662,15 +661,15 @@ open_procinfo_files (procinfo *pi, int which) procinfo *process; int lwpid = pi->tid; - /* Find the procinfo for the entire process. */ + /* Find the procinfo for the entire process. */ if ((process = find_procinfo (pi->pid, 0)) == NULL) return 0; /* fail */ - /* Now obtain the file descriptor for the LWP. */ + /* Now obtain the file descriptor for the LWP. */ if ((fd = ioctl (process->ctl_fd, PIOCOPENLWP, &lwpid)) <= 0) return 0; /* fail */ -#else /* Irix, other? */ - return 0; /* Don't know how to open threads */ +#else /* Irix, other? */ + return 0; /* Don't know how to open threads. */ #endif /* Sol 2.5 PIOCOPENLWP */ } #endif /* OSF PIOCTSTATUS */ @@ -690,13 +689,13 @@ create_procinfo (int pid, int tid) procinfo *pi, *parent = NULL; if ((pi = find_procinfo (pid, tid))) - return pi; /* Already exists, nothing to do. */ + 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 - doesn't exist yet? */ + doesn't exist yet? */ pi = (procinfo *) xmalloc (sizeof (procinfo)); memset (pi, 0, sizeof (procinfo)); @@ -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) @@ -866,7 +865,7 @@ sysset_t_alloc (procinfo * pi) /* Extract syscall numbers and names from /proc/<pid>/sysent. Initialize pi->num_syscalls with the number of syscalls and pi->syscall_names with the names. (Certain numbers may be skipped in which case the - names for these numbers will be left as NULL.) */ + names for these numbers will be left as NULL.) */ #define MAX_SYSCALL_NAME_LENGTH 256 #define MAX_SYSCALLS 65536 @@ -915,7 +914,7 @@ load_syscalls (procinfo *pi) /* Find maximum syscall number. This may not be the same as pr_nsyscalls since that value refers to the number of entries in the table. (Also, the docs indicate that some system - call numbers may be skipped.) */ + call numbers may be skipped.) */ maxcall = syscalls[0].pr_number; @@ -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) { @@ -1104,7 +1103,7 @@ proc_get_status (procinfo *pi) else { /* Sigh... I have to read a different data structure, - depending on whether this is a main process or an LWP. */ + depending on whether this is a main process or an LWP. */ if (pi->tid) pi->status_valid = (read (pi->status_fd, (char *) &pi->prstatus.pr_lwp, @@ -1120,7 +1119,7 @@ proc_get_status (procinfo *pi) if (pi->status_valid && (pi->prstatus.pr_lwp.pr_flags & PR_ISTOP) && pi->prstatus.pr_lwp.pr_why == PR_REQUESTED) - /* Unixware peculiarity -- read the damn thing again! */ + /* Unixware peculiarity -- read the damn thing again! */ pi->status_valid = (read (pi->status_fd, (char *) &pi->prstatus, sizeof (gdb_prstatus_t)) @@ -1132,7 +1131,7 @@ proc_get_status (procinfo *pi) #ifdef PIOCTSTATUS /* osf */ if (pi->tid == 0) /* main process */ { - /* Just read the danged status. Now isn't that simple? */ + /* Just read the danged status. Now isn't that simple? */ pi->status_valid = (ioctl (pi->status_fd, PIOCSTATUS, &pi->prstatus) >= 0); } @@ -1186,7 +1185,7 @@ proc_flags (procinfo *pi) { if (!pi->status_valid) if (!proc_get_status (pi)) - return 0; /* FIXME: not a good failure value (but what is?) */ + return 0; /* FIXME: not a good failure value (but what is?) */ #ifdef NEW_PROC_API # ifdef UNIXWARE @@ -1209,7 +1208,7 @@ proc_why (procinfo *pi) { if (!pi->status_valid) if (!proc_get_status (pi)) - return 0; /* FIXME: not a good failure value (but what is?) */ + return 0; /* FIXME: not a good failure value (but what is?) */ #ifdef NEW_PROC_API return pi->prstatus.pr_lwp.pr_why; @@ -1225,7 +1224,7 @@ proc_what (procinfo *pi) { if (!pi->status_valid) if (!proc_get_status (pi)) - return 0; /* FIXME: not a good failure value (but what is?) */ + return 0; /* FIXME: not a good failure value (but what is?) */ #ifdef NEW_PROC_API return pi->prstatus.pr_lwp.pr_what; @@ -1319,7 +1318,7 @@ proc_cursig (struct procinfo *pi) { if (!pi->status_valid) if (!proc_get_status (pi)) - return 0; /* FIXME: not a good failure value (but what is?) */ + return 0; /* FIXME: not a good failure value (but what is?) */ #ifdef NEW_PROC_API return pi->prstatus.pr_lwp.pr_cursig; @@ -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 @@ -1715,7 +1714,7 @@ proc_set_traced_signals (procinfo *pi, gdb_sigset_t *sigset) #else /* ioctl method */ win = (ioctl (pi->ctl_fd, PIOCSTRACE, sigset) >= 0); #endif - /* The above operation renders the procinfo's cached pstatus obsolete. */ + /* The above operation renders the procinfo's cached pstatus obsolete. */ pi->status_valid = 0; if (!win) @@ -1755,7 +1754,7 @@ proc_set_traced_faults (procinfo *pi, fltset_t *fltset) #else /* ioctl method */ win = (ioctl (pi->ctl_fd, PIOCSFAULT, fltset) >= 0); #endif - /* The above operation renders the procinfo's cached pstatus obsolete. */ + /* The above operation renders the procinfo's cached pstatus obsolete. */ pi->status_valid = 0; return win; @@ -2319,7 +2318,7 @@ proc_set_current_signal (procinfo *pi, int signo) bug. */ if (signo > 0 && signo == proc_cursig (pi)) - return 1; /* I assume this is a success? */ + return 1; /* I assume this is a success? */ #endif /* The pointer is just a type alias. */ @@ -2625,7 +2624,7 @@ proc_kill (procinfo *pi, int signo) win = (write (pi->ctl_fd, (char *) &cmd, sizeof (cmd)) == sizeof (cmd)); #else /* ioctl method */ /* FIXME: do I need the Alpha OSF fixups present in - procfs.c/unconditionally_kill_inferior? Perhaps only for SIGKILL? */ + procfs.c/unconditionally_kill_inferior? Perhaps only for SIGKILL? */ win = (ioctl (pi->ctl_fd, PIOCKILL, &signo) >= 0); #endif } @@ -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 { @@ -2745,7 +2744,7 @@ proc_get_LDT_entry (procinfo *pi, int key) proc_warn (pi, "proc_get_LDT_entry (open)", __LINE__); return NULL; } - /* Make sure it gets closed again! */ + /* Make sure it gets closed again! */ old_chain = make_cleanup_close (fd); /* Now 'read' thru the table, find a match and return it. */ @@ -2756,11 +2755,11 @@ proc_get_LDT_entry (procinfo *pi, int key) ldt_entry->acc1 == 0 && ldt_entry->acc2 == 0) break; /* end of table */ - /* If key matches, return this entry. */ + /* If key matches, return this entry. */ if (ldt_entry->sel == key) return ldt_entry; } - /* Loop ended, match not found. */ + /* Loop ended, match not found. */ return NULL; #else int nldt, i; @@ -2773,8 +2772,8 @@ proc_get_LDT_entry (procinfo *pi, int key) return NULL; } - /* Allocate space for the number of LDT entries. */ - /* This alloc has to persist, 'cause we return a pointer to it. */ + /* Allocate space for the number of LDT entries. */ + /* This alloc has to persist, 'cause we return a pointer to it. */ if (nldt > nalloc) { ldt_entry = (struct ssd *) @@ -2789,12 +2788,12 @@ proc_get_LDT_entry (procinfo *pi, int key) return NULL; } - /* Search the table and return the (first) entry matching 'key'. */ + /* Search the table and return the (first) entry matching 'key'. */ for (i = 0; i < nldt; i++) if (ldt_entry[i].sel == key) return &ldt_entry[i]; - /* Loop ended, match not found. */ + /* Loop ended, match not found. */ return NULL; #endif } @@ -2808,24 +2807,24 @@ procfs_find_LDT_entry (ptid_t ptid) int key; procinfo *pi; - /* Find procinfo for the lwp. */ + /* Find procinfo for the lwp. */ if ((pi = find_procinfo (PIDGET (ptid), TIDGET (ptid))) == NULL) { warning (_("procfs_find_LDT_entry: could not find procinfo for %d:%ld."), PIDGET (ptid), TIDGET (ptid)); return NULL; } - /* get its general registers. */ + /* get its general registers. */ if ((gregs = proc_get_gregs (pi)) == NULL) { warning (_("procfs_find_LDT_entry: could not read gregs for %d:%ld."), PIDGET (ptid), TIDGET (ptid)); return NULL; } - /* Now extract the GS register's lower 16 bits. */ + /* Now extract the GS register's lower 16 bits. */ key = (*gregs)[GS] & 0xffff; - /* Find the matching entry and return it. */ + /* Find the matching entry and return it. */ return proc_get_LDT_entry (pi, key); } @@ -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; @@ -2919,7 +2918,7 @@ proc_get_current_thread (procinfo *pi) int proc_get_current_thread (procinfo *pi) { -#if 0 /* FIXME: not ready for prime time? */ +#if 0 /* FIXME: not ready for prime time? */ return pi->prstatus.pr_tid; #else return 0; @@ -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; } @@ -3177,17 +3176,17 @@ procfs_debug_inferior (procinfo *pi) #ifdef PROCFS_DONT_TRACE_FAULTS /* On some systems (OSF), we don't trace hardware faults. Apparently it's enough that we catch them as signals. - Wonder why we don't just do that in general? */ - premptyset (&traced_faults); /* don't trace faults. */ + Wonder why we don't just do that in general? */ + premptyset (&traced_faults); /* don't trace faults. */ #else - /* Register to trace hardware faults in the child. */ - prfillset (&traced_faults); /* trace all faults... */ + /* Register to trace hardware faults in the child. */ + prfillset (&traced_faults); /* trace all faults... */ gdb_prdelset (&traced_faults, FLTPAGE); /* except page fault. */ #endif if (!proc_set_traced_faults (pi, &traced_faults)) return __LINE__; - /* Register to trace selected signals in the child. */ + /* Register to trace selected signals in the child. */ premptyset (&traced_signals); if (!register_gdb_signals (pi, &traced_signals)) return __LINE__; @@ -3200,7 +3199,7 @@ procfs_debug_inferior (procinfo *pi) gdb_praddsysset (traced_syscall_entries, SYS_exit); #endif #ifdef SYS_lwpexit - gdb_praddsysset (traced_syscall_entries, SYS_lwpexit); /* And _lwp_exit... */ + gdb_praddsysset (traced_syscall_entries, SYS_lwpexit);/* And _lwp_exit... */ #endif #ifdef SYS_lwp_exit gdb_praddsysset (traced_syscall_entries, SYS_lwp_exit); @@ -3223,7 +3222,7 @@ procfs_debug_inferior (procinfo *pi) /* OSF method for tracing exec syscalls. Quoting: Under Alpha OSF/1 we have to use a PIOCSSPCACT ioctl to trace exits from exec system calls because of the user level loader. */ - /* FIXME: make nice and maybe move into an access function. */ + /* FIXME: make nice and maybe move into an access function. */ { int prfs_flags; @@ -3236,11 +3235,11 @@ 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 - *is* a SYS_execv. So, we try to account for that. */ + *is* a SYS_execv. So, we try to account for that. */ traced_syscall_exits = sysset_t_alloc (pi); gdb_premptysysset (traced_syscall_exits); @@ -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 @@ -3374,7 +3373,7 @@ do_attach (ptid_t ptid) if (!proc_set_run_on_last_close (pi)) dead_procinfo (pi, "do_attach: couldn't set RLC.", NOKILL); - /* Now stop the process. */ + /* Now stop the process. */ if (!proc_stop_process (pi)) dead_procinfo (pi, "do_attach: couldn't stop the process.", NOKILL); pi->ignore_next_sigstop = 1; @@ -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)) @@ -3681,7 +3680,7 @@ dbx_link_addr (bfd *abfd) } /* Search the symbol table of the file referenced by FD for a symbol - named __dbx_link(). If found, then insert a breakpoint at this location, + named __dbx_link(). If found, then insert a breakpoint at this location, and return nonzero. Return zero otherwise. */ static int @@ -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,46 +3825,46 @@ 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) { - /* We must assume that the status is stale now... */ + /* We must assume that the status is stale now... */ pi->status_valid = 0; pi->gregs_valid = 0; pi->fpregs_valid = 0; -#if 0 /* just try this out... */ +#if 0 /* just try this out... */ flags = proc_flags (pi); why = proc_why (pi); if ((flags & PR_STOPPED) && (why == PR_REQUESTED)) - pi->status_valid = 0; /* re-read again, IMMEDIATELY... */ + pi->status_valid = 0; /* re-read again, IMMEDIATELY... */ #endif /* If child is not stopped, wait for it to stop. */ if (!(proc_flags (pi) & (PR_STOPPED | PR_ISTOP)) && !proc_wait_for_stop (pi)) { - /* wait_for_stop failed: has the child terminated? */ + /* wait_for_stop failed: has the child terminated? */ if (errno == ENOENT) { int wait_retval; - /* /proc file not found; presumably child has terminated. */ - wait_retval = wait (&wstat); /* "wait" for the child's exit */ + /* /proc file not found; presumably child has terminated. */ + wait_retval = wait (&wstat); /* "wait" for the child's exit. */ - if (wait_retval != PIDGET (inferior_ptid)) /* wrong child? */ + if (wait_retval != PIDGET (inferior_ptid)) /* wrong child? */ error (_("procfs: couldn't stop " "process %d: wait returned %d."), PIDGET (inferior_ptid), wait_retval); /* FIXME: might I not just use waitpid? - Or try find_procinfo to see if I know about this child? */ + Or try find_procinfo to see if I know about this child? */ retval = pid_to_ptid (wait_retval); } else if (errno == EINTR) goto wait_again; else { - /* Unknown error from wait_for_stop. */ + /* Unknown error from wait_for_stop. */ proc_error (pi, "target_wait (wait_for_stop)", __LINE__); } } @@ -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; } @@ -4000,7 +4001,7 @@ wait_again: /* Hopefully this is our own "fork-child" execing the real child. Hoax this event into a trap, and GDB will see the child about to execute its start - address. */ + address. */ wstat = (SIGTRAP << 8) | 0177; } #ifdef SYS_syssgi @@ -4039,7 +4040,7 @@ wait_again: if (!in_thread_list (temp_ptid)) add_thread (temp_ptid); - /* Return to WFI, but tell it to immediately resume. */ + /* Return to WFI, but tell it to immediately resume. */ status->kind = TARGET_WAITKIND_SPURIOUS; return inferior_ptid; } @@ -4128,15 +4129,15 @@ wait_again: wstat = (SIGTRAP << 8) | 0177; break; #endif - /* FIXME: use si_signo where possible. */ + /* 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,9 +4196,9 @@ 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... */ + /* surely this can't happen... */ printf_filtered ("procfs:%d -- process not stopped.\n", __LINE__); proc_prettyprint_flags (flags, 1); @@ -4253,7 +4255,7 @@ procfs_xfer_partial (struct target_ops *ops, enum target_object object, transferred. Otherwise, it will be a positive value which indicates the number of bytes transferred between gdb and the target. (Note that the interface also makes provisions for - negative values, but this capability isn't implemented here.) */ + negative values, but this capability isn't implemented here.) */ static int procfs_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int dowrite, @@ -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); @@ -4664,7 +4667,7 @@ procfs_init_inferior (struct target_ops *ops, int pid) /* Save some of the /proc state to be restored if we detach. */ /* FIXME: Why? In case another debugger was debugging it? - We're it's parent, for Ghu's sake! */ + We're it's parent, for Ghu's sake! */ if (!proc_get_traced_signals (pi, &pi->saved_sigset)) proc_error (pi, "init_inferior, get_traced_signals", __LINE__); if (!proc_get_held_signals (pi, &pi->saved_sighold)) @@ -4720,7 +4723,7 @@ procfs_init_inferior (struct target_ops *ops, int pid) So what we need to do is to insert a breakpoint in the runtime loader (rld), more precisely in __dbx_link(). This procedure is called by rld once all shared libraries have been mapped, but before - the -init code is executed. Unfortuantely, this is not straightforward, + the -init code is executed. Unfortuantely, this is not straightforward, as rld is not part of the executable we are running, and thus we need the inferior to run until rld itself has been mapped in memory. @@ -4827,7 +4830,7 @@ procfs_set_exec_trap (void) } #endif /* PRFS_STOPEXEC */ - /* FIXME: should this be done in the parent instead? */ + /* FIXME: should this be done in the parent instead? */ /* Turn off inherit on fork flag so that all grand-children of gdb start with tracing flags cleared. */ if (!proc_unset_inherit_on_fork (pi)) @@ -4840,7 +4843,7 @@ procfs_set_exec_trap (void) proc_warn (pi, "set_exec_trap, unset_RLC", __LINE__); /* FIXME: No need to destroy the procinfo -- - we have our own address space, and we're about to do an exec! */ + we have our own address space, and we're about to do an exec! */ /*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); @@ -5000,7 +5003,7 @@ procfs_thread_alive (struct target_ops *ops, ptid_t ptid) proc = PIDGET (ptid); thread = TIDGET (ptid); - /* If I don't know it, it ain't alive! */ + /* If I don't know it, it ain't alive! */ if ((pi = find_procinfo (proc, thread)) == NULL) return 0; @@ -5046,10 +5049,10 @@ 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! */ + switch (rwflag) { /* FIXME: need an enum! */ case hw_write: /* default watchpoint (write) */ pflags = WRITE_WATCHFLAG; break; @@ -5062,16 +5065,16 @@ procfs_set_watchpoint (ptid_t ptid, CORE_ADDR addr, int len, int rwflag, case hw_execute: /* execution HW breakpoint */ pflags = EXEC_WATCHFLAG; break; - default: /* Something weird. Return error. */ + default: /* Something weird. Return error. */ return -1; } - if (after) /* Stop after r/w access is completed. */ + if (after) /* Stop after r/w access is completed. */ pflags |= AFTER_WATCHFLAG; } 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. */ @@ -5241,12 +5244,12 @@ iterate_over_mappings (procinfo *pi, find_memory_region_ftype child_func, /* Get the number of mappings, allocate space, and read the mappings into prmaps. */ #ifdef NEW_PROC_API - /* Open map fd. */ + /* Open map fd. */ sprintf (pathname, "/proc/%d/map", pi->pid); if ((map_fd = open (pathname, O_RDONLY)) < 0) proc_error (pi, "iterate_over_mappings (open)", __LINE__); - /* Make sure it gets closed again. */ + /* Make sure it gets closed again. */ make_cleanup_close (map_fd); /* Use stat to determine the file size, and compute @@ -5379,7 +5382,7 @@ static void info_proc_mappings (procinfo *pi, int summary) { if (summary) - return; /* No output for summary mode. */ + return; /* No output for summary mode. */ printf_filtered (_("Mapped address spaces:\n\n")); if (gdbarch_ptr_bit (target_gdbarch) == 32) @@ -5450,7 +5453,7 @@ info_proc_cmd (char *args, int from_tty) else { /* Have pid, will travel. - First see if it's a process we're already debugging. */ + First see if it's a process we're already debugging. */ process = find_procinfo (pid, 0); if (process == NULL) { @@ -5495,9 +5498,9 @@ info_proc_cmd (char *args, int from_tty) the set of syscalls that are currently traced/debugged. If ENTRY_OR_EXIT is set to PR_SYSENTRY, then the entry syscalls set - will be updated. Otherwise, the exit syscalls set will be updated. + will be updated. Otherwise, the exit syscalls set will be updated. - If MODE is FLAG_SET, then traces will be enabled. Otherwise, they + If MODE is FLAG_SET, then traces will be enabled. Otherwise, they will be disabled. */ static void @@ -5633,7 +5636,7 @@ procfs_do_thread_registers (bfd *obfd, ptid_t ptid, /* This part is the old method for fetching registers. It should be replaced by the newer one using regsets once it is implemented in this platform: - gdbarch_regset_from_core_section() and regset->collect_regset(). */ + gdbarch_regset_from_core_section() and regset->collect_regset(). */ old_chain = save_inferior_ptid (); inferior_ptid = ptid; diff --git a/gdb/progspace.h b/gdb/progspace.h index d7c76e2..5d3ed95 100644 --- a/gdb/progspace.h +++ b/gdb/progspace.h @@ -174,7 +174,7 @@ struct program_space struct objfile *symfile_object_file; /* All known objfiles are kept in a linked list. This points to - the head of this list. */ + the head of this list. */ struct objfile *objfiles; /* The set of target sections matching the sections mapped into @@ -196,7 +196,7 @@ struct program_space #define symfile_objfile current_program_space->symfile_object_file /* All known objfiles are kept in a linked list. This points to the - root of this list. */ + root of this list. */ #define object_files current_program_space->objfiles /* The set of target sections matching the sections mapped into the diff --git a/gdb/prologue-value.c b/gdb/prologue-value.c index adbf5b6..46c5b68 100644 --- a/gdb/prologue-value.c +++ b/gdb/prologue-value.c @@ -15,7 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. */ + along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "defs.h" #include "gdb_string.h" diff --git a/gdb/prologue-value.h b/gdb/prologue-value.h index 54d12a6..c8d45ff 100644 --- a/gdb/prologue-value.h +++ b/gdb/prologue-value.h @@ -15,7 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. */ + along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef PROLOGUE_VALUE_H #define PROLOGUE_VALUE_H diff --git a/gdb/psympriv.h b/gdb/psympriv.h index 7e38f46..8e8e15c 100644 --- a/gdb/psympriv.h +++ b/gdb/psympriv.h @@ -32,12 +32,12 @@ struct psymbol_allocation_list; normal symtab once the partial_symtab has been referenced. */ /* This structure is space critical. See space comments at the top of - symtab.h. */ + symtab.h. */ struct partial_symbol { - /* The general symbol info required for all types of symbols. */ + /* The general symbol info required for all types of symbols. */ struct general_symbol_info ginfo; @@ -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; @@ -92,7 +92,7 @@ struct partial_symtab struct section_offsets *section_offsets; /* Range of text addresses covered by this file; texthigh is the - beginning of the next section. */ + beginning of the next section. */ CORE_ADDR textlow; CORE_ADDR texthigh; @@ -112,7 +112,7 @@ struct partial_symtab /* Global symbol list. This list will be sorted after readin to improve access. Binary search will be the usual method of - finding a symbol within it. globals_offset is an integer offset + finding a symbol within it. globals_offset is an integer offset within global_psymbols[]. */ int globals_offset; diff --git a/gdb/psymtab.c b/gdb/psymtab.c index 64db67c..a555665 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -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) @@ -171,7 +171,7 @@ find_pc_sect_psymtab_closer (CORE_ADDR pc, struct obj_section *section, /* The code range of partial symtabs sometimes overlap, so, in the loop below, we need to check all partial symtabs and - find the one that fits better for the given PC address. We + find the one that fits better for the given PC address. We select the partial symtab that contains a symbol whose address is closest to the PC address. By closest we mean that find_pc_sect_symbol returns the symbol with address @@ -207,11 +207,11 @@ find_pc_sect_psymtab_closer (CORE_ADDR pc, struct obj_section *section, necessarily lower or equal to PC, the symbol closer to PC is the symbol which address is the highest. This way we return the psymtab which contains such - best match symbol. This can help in cases where the + best match symbol. This can help in cases where the symbol information/debuginfo is not complete, like for instance on IRIX6 with gcc, where no debug info - is emitted for statics. (See also the nodebug.exp - testcase.) */ + is emitted for statics. (See also the nodebug.exp + testcase.) */ if (this_addr > best_addr) { best_addr = this_addr; @@ -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)) @@ -539,7 +539,7 @@ lookup_partial_symbol (struct partial_symtab *pst, const char *name, pst->objfile->global_psymbols.list + pst->globals_offset : pst->objfile->static_psymbols.list + pst->statics_offset); - if (global) /* This means we can use a binary search. */ + if (global) /* This means we can use a binary search. */ { do_linear_search = 0; @@ -611,7 +611,7 @@ lookup_partial_symbol (struct partial_symtab *pst, const char *name, static struct symtab * psymtab_to_symtab (struct partial_symtab *pst) { - /* If it's been looked up before, return it. */ + /* If it's been looked up before, return it. */ if (pst->symtab) return pst->symtab; @@ -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); @@ -908,7 +908,7 @@ dump_psymtabs_for_objfile (struct objfile *objfile) } /* Look through the partial symtabs for all symbols which begin - by matching FUNC_NAME. Make sure we read that symbol table in. */ + by matching FUNC_NAME. Make sure we read that symbol table in. */ static void read_symtabs_for_function (struct objfile *objfile, const char *func_name) @@ -973,7 +973,7 @@ map_symbol_names_psymtab (struct objfile *objfile, + ps->n_global_syms); psym++) { - /* If interrupted, then quit. */ + /* If interrupted, then quit. */ QUIT; (*fun) (SYMBOL_NATURAL_NAME (*psym), data); } @@ -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) @@ -1149,7 +1149,7 @@ expand_symtabs_matching_via_partial (struct objfile *objfile, bound = gbound; /* Go through all of the symbols stored in a partial - symtab in one loop. */ + symtab in one loop. */ psym = objfile->global_psymbols.list + ps->globals_offset; while (keep_going) { @@ -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 *), @@ -1242,7 +1242,7 @@ sort_pst_symbols (struct partial_symtab *pst) /* Allocate and partially fill a partial symtab. It will be completely filled at the end of the symbol list. - FILENAME is the name of the symbol-file we are reading from. */ + FILENAME is the name of the symbol-file we are reading from. */ struct partial_symtab * start_psymtab_common (struct objfile *objfile, @@ -1264,7 +1264,7 @@ start_psymtab_common (struct objfile *objfile, /* Calculate a hash code for the given partial symbol. The hash is calculated using the symbol's value, language, domain, class - and name. These are the values which are set by + and name. These are the values which are set by add_psymbol_to_bcache. */ static unsigned long @@ -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,14 +1387,14 @@ 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); } /* Increase the space allocated for LISTP, which is probably - global_psymbols or static_psymbols. This space will eventually + global_psymbols or static_psymbols. This space will eventually be freed in free_objfile(). */ static void @@ -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); @@ -1473,7 +1473,7 @@ add_psymbol_to_list (const char *name, int namelength, int copy_name, && !added) return psym; - /* Save pointer to partial symbol in psymtab, growing symtab if needed. */ + /* Save pointer to partial symbol in psymtab, growing symtab if needed. */ append_psymbol_to_list (list, psym, objfile); return psym; } @@ -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; @@ -1539,7 +1539,7 @@ allocate_psymtab (const char *filename, struct objfile *objfile) /* Prepend it to the psymtab list for the objfile it belongs to. Psymtabs are searched in most recent inserted -> least recent - inserted order. */ + inserted order. */ psymtab->objfile = objfile; psymtab->next = objfile->psymtabs; @@ -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]; diff --git a/gdb/ravenscar-sparc-thread.c b/gdb/ravenscar-sparc-thread.c index 6bf29f2..beb6bbc 100644 --- a/gdb/ravenscar-sparc-thread.c +++ b/gdb/ravenscar-sparc-thread.c @@ -33,8 +33,8 @@ static void ravenscar_sparc_store_registers (struct regcache *regcache, static void ravenscar_sparc_prepare_to_store (struct regcache *regcache); /* Register offsets from a referenced address (exempli gratia the - Thread_Descriptor). The referenced address depends on the register - number. The Thread_Descriptor layout and the stack layout are documented + Thread_Descriptor). The referenced address depends on the register + number. The Thread_Descriptor layout and the stack layout are documented in the GNAT sources, in sparc-bb.h. */ static const int sparc_register_offsets[] = diff --git a/gdb/ravenscar-thread.c b/gdb/ravenscar-thread.c index 173ab7f..173a524 100644 --- a/gdb/ravenscar-thread.c +++ b/gdb/ravenscar-thread.c @@ -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; @@ -329,7 +330,7 @@ ravenscar_register_arch_ops (struct ravenscar_arch_ops *ops) architectures, just like in remote-wtx-hw.c. However, for now the only Ravenscar run-time for bare board that is implemented in GNAT is for only one architecture: erc32-elf. So no need to care about - that for now...*/ + that for now... */ current_arch_ops = ops; } diff --git a/gdb/ravenscar-thread.h b/gdb/ravenscar-thread.h index 253d0c5..0e1bfa7 100644 --- a/gdb/ravenscar-thread.h +++ b/gdb/ravenscar-thread.h @@ -33,7 +33,7 @@ struct ravenscar_arch_ops to_prepare_to_store and to_fetch_registers when the inferior_ptid is different from the running thread. In that case, the registers are saved in a architecture-specific location. */ -/* FIXME: only one architecture can be registered for now. See +/* FIXME: only one architecture can be registered for now. See implementation. */ extern void ravenscar_register_arch_ops (struct ravenscar_arch_ops *ops); diff --git a/gdb/record.c b/gdb/record.c index 96c6e5d..784f5fa 100644 --- a/gdb/record.c +++ b/gdb/record.c @@ -495,7 +495,7 @@ record_arch_list_add_mem (CORE_ADDR addr, int len) "record list.\n", paddress (target_gdbarch, addr), len); - if (!addr) /* FIXME: Why? Some arch must permit it... */ + if (!addr) /* FIXME: Why? Some arch must permit it... */ return 0; rec = record_mem_alloc (addr, len); diff --git a/gdb/regcache.c b/gdb/regcache.c index fc4ffba..3ca3008 100644 --- a/gdb/regcache.c +++ b/gdb/regcache.c @@ -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; @@ -555,7 +555,7 @@ registers_changed_ptid (ptid_t ptid) current_thread_ptid = null_ptid; current_thread_arch = NULL; - /* Need to forget about any frames we have cached, too. */ + /* Need to forget about any frames we have cached, too. */ reinit_frame_cache (); /* Force cleanup of any alloca areas if using C alloca instead of @@ -754,7 +754,7 @@ regcache_raw_write (struct regcache *regcache, int regnum, return; /* If we have a valid copy of the register, and new value == old - value, then don't bother doing the actual store. */ + value, then don't bother doing the actual store. */ if (regcache_valid_p (regcache, regnum) && (memcmp (register_buffer (regcache, regnum), buf, regcache->descr->sizeof_register[regnum]) == 0)) @@ -809,7 +809,7 @@ regcache_xfer_part (struct regcache *regcache, int regnum, /* Something to do? */ if (offset + len == 0) return; - /* Read (when needed) ... */ + /* Read (when needed) ... */ if (in != NULL || offset > 0 || offset + len < descr->sizeof_register[regnum]) @@ -817,7 +817,7 @@ regcache_xfer_part (struct regcache *regcache, int regnum, gdb_assert (read != NULL); read (regcache, regnum, reg); } - /* ... modify ... */ + /* ... modify ... */ if (in != NULL) memcpy (in, reg + offset, len); if (out != NULL) diff --git a/gdb/regcache.h b/gdb/regcache.h index 474ab6e..99bb322 100644 --- a/gdb/regcache.h +++ b/gdb/regcache.h @@ -43,7 +43,7 @@ extern struct gdbarch *get_regcache_arch (const struct regcache *regcache); extern struct address_space *get_regcache_aspace (const struct regcache *); /* Transfer a raw register [0..NUM_REGS) between core-gdb and the - regcache. */ + regcache. */ void regcache_raw_read (struct regcache *regcache, int rawnum, gdb_byte *buf); void regcache_raw_write (struct regcache *regcache, int rawnum, diff --git a/gdb/remote-fileio.c b/gdb/remote-fileio.c index 022e4d1..4931c45 100644 --- a/gdb/remote-fileio.c +++ b/gdb/remote-fileio.c @@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* See the GDB User Guide for details of the GDB remote protocol. */ +/* See the GDB User Guide for details of the GDB remote protocol. */ #include "defs.h" #include "gdb_string.h" @@ -151,7 +151,7 @@ remote_fileio_oflags_to_host (long flags) if (flags & FILEIO_O_RDWR) hflags |= O_RDWR; /* On systems supporting binary and text mode, always open files in - binary mode. */ + binary mode. */ #ifdef O_BINARY hflags |= O_BINARY; #endif @@ -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); @@ -590,7 +590,7 @@ remote_fileio_return_success (int retcode) /* Wrapper function for remote_write_bytes() which has the disadvantage to write only one packet, regardless of the requested number of bytes to - transfer. This wrapper calls remote_write_bytes() as often as needed. */ + transfer. This wrapper calls remote_write_bytes() as often as needed. */ static int remote_fileio_write_bytes (CORE_ADDR memaddr, gdb_byte *myaddr, int len) { @@ -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) @@ -649,7 +649,7 @@ remote_fileio_func_open (char *buf) /* Check if pathname exists and is not a regular file or directory. If so, return an appropriate error code. Same for trying to open directories - for writing. */ + for writing. */ if (!stat (pathname, &st)) { if (!S_ISREG (st.st_mode) && !S_ISDIR (st.st_mode)) @@ -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) @@ -896,7 +896,7 @@ remote_fileio_func_write (char *buf) ret = write (fd, buffer, length); if (ret < 0 && errno == EACCES) errno = EBADF; /* Cygwin returns EACCESS when writing to a - R/O file.*/ + R/O file. */ break; } @@ -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)) @@ -1020,11 +1020,11 @@ remote_fileio_func_rename (char *buf) { /* Special case: newpath is a non-empty directory. Some systems return ENOTEMPTY, some return EEXIST. We coerce that to be - always EEXIST. */ + always EEXIST. */ if (errno == ENOTEMPTY) errno = EEXIST; #ifdef __CYGWIN__ - /* Workaround some Cygwin problems with correct errnos. */ + /* Workaround some Cygwin problems with correct errnos. */ if (errno == EACCES) { if (!of && !nf && S_ISDIR (nst.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); @@ -1263,13 +1263,13 @@ remote_fileio_func_gettimeofday (char *buf) return; } ptrval = (CORE_ADDR) lnum; - /* 2. Parameter: some pointer value... */ + /* 2. Parameter: some pointer value... */ if (remote_fileio_extract_long (&buf, &lnum)) { remote_fileio_ioerror (); return; } - /* ...which has to be NULL */ + /* ...which has to be NULL. */ if (lnum) { remote_fileio_reply (-1, FILEIO_EINVAL); @@ -1404,7 +1404,7 @@ do_remote_fileio_request (struct ui_out *uiout, void *buf_arg) for (idx = 0; remote_fio_func_map[idx].name; ++idx) if (!strcmp (remote_fio_func_map[idx].name, buf)) break; - if (!remote_fio_func_map[idx].name) /* ERROR: No such function. */ + if (!remote_fio_func_map[idx].name) /* ERROR: No such function. */ return RETURN_ERROR; remote_fio_func_map[idx].func (c); return 0; @@ -1432,8 +1432,8 @@ remote_fileio_reset (void) } } -/* Handle a file I/O request. BUF points to the packet containing the - request. CTRLC_PENDING_P should be nonzero if the target has not +/* Handle a file I/O request. BUF points to the packet containing the + request. CTRLC_PENDING_P should be nonzero if the target has not acknowledged the Ctrl-C sent asynchronously earlier. */ void diff --git a/gdb/remote-fileio.h b/gdb/remote-fileio.h index b9e15ea..2f95589 100644 --- a/gdb/remote-fileio.h +++ b/gdb/remote-fileio.h @@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* See the GDB User Guide for details of the GDB remote protocol. */ +/* See the GDB User Guide for details of the GDB remote protocol. */ #ifndef REMOTE_FILEIO_H #define REMOTE_FILEIO_H @@ -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); diff --git a/gdb/remote-m32r-sdi.c b/gdb/remote-m32r-sdi.c index 82c4cde..3247b6f 100644 --- a/gdb/remote-m32r-sdi.c +++ b/gdb/remote-m32r-sdi.c @@ -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,29 +398,29 @@ 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) printf_filtered ("Max IB Breakpoints = %d\n", max_ib_breakpoints); - /* Initialize breakpoints. */ + /* Initialize breakpoints. */ for (i = 0; i < MAX_BREAKPOINTS; i++) bp_address[i] = 0xffffffff; - /* Get maximum number of access breaks. */ + /* Get maximum number of access breaks. */ send_one_arg_cmd (SDI_GET_ATTR, SDI_ATTR_ABRK); max_access_breaks = recv_char_data (); if (remote_debug) printf_filtered ("Max Access Breaks = %d\n", max_access_breaks); - /* Initialize access breask. */ + /* Initialize access breask. */ for (i = 0; i < MAX_ACCESS_BREAKS; i++) ab_address[i] = 0x00000000; check_mmu_status (); - /* Get the name of chip on target board. */ + /* Get the name of chip on target board. */ send_one_arg_cmd (SDI_GET_ATTR, SDI_ATTR_NAME); recv_data (chip_name, 64); @@ -429,7 +429,7 @@ m32r_open (char *args, int from_tty) chip_name); } -/* Close out all files and local state before this target loses control. */ +/* Close out all files and local state before this target loses control. */ static void m32r_close (int quitting) @@ -475,17 +475,17 @@ m32r_resume (struct target_ops *ops, fprintf_unfiltered (gdb_stdlog, "pc <= 0x%lx\n", pc_addr); /* At pc address there is a parallel instruction with +2 offset, - so we have to make it a serial instruction or avoid it. */ + so we have to make it a serial instruction or avoid it. */ if (pc_addr == last_pc_addr) { - /* Avoid a parallel nop. */ + /* Avoid a parallel nop. */ if (last_pc_addr_data[0] == 0xf0 && last_pc_addr_data[1] == 0x00) { pc_addr += 2; - /* Now we can forget this instruction. */ + /* Now we can forget this instruction. */ last_pc_addr = 0xffffffff; } - /* Clear a parallel bit. */ + /* Clear a parallel bit. */ else { buf[0] = SDI_WRITE_MEMORY; @@ -499,19 +499,19 @@ m32r_resume (struct target_ops *ops, } } - /* Set PC. */ + /* Set PC. */ send_two_arg_cmd (SDI_WRITE_CPU_REG, SDI_REG_BPC, pc_addr); - /* step mode. */ + /* step mode. */ step_mode = step; if (step) { - /* Set PBP. */ + /* Set PBP. */ send_two_arg_cmd (SDI_WRITE_CPU_REG, SDI_REG_PBP, pc_addr | 1); } else { - /* Unset PBP. */ + /* Unset PBP. */ send_two_arg_cmd (SDI_WRITE_CPU_REG, SDI_REG_PBP, 0x00000000); } @@ -520,7 +520,7 @@ m32r_resume (struct target_ops *ops, else ib_breakpoints = 0; - /* Set ib breakpoints. */ + /* Set ib breakpoints. */ for (i = 0; i < ib_breakpoints; i++) { bp_addr = bp_address[i]; @@ -528,7 +528,7 @@ m32r_resume (struct target_ops *ops, if (bp_addr == 0xffffffff) continue; - /* Set PBP. */ + /* Set PBP. */ if (gdbarch_byte_order (target_gdbarch) == BFD_ENDIAN_BIG) send_three_arg_cmd (SDI_WRITE_MEMORY, 0xffff8000 + 4 * i, 4, 0x00000006); @@ -539,7 +539,7 @@ m32r_resume (struct target_ops *ops, send_three_arg_cmd (SDI_WRITE_MEMORY, 0xffff8080 + 4 * i, 4, bp_addr); } - /* Set dbt breakpoints. */ + /* Set dbt breakpoints. */ for (i = ib_breakpoints; i < MAX_BREAKPOINTS; i++) { bp_addr = bp_address[i]; @@ -550,7 +550,7 @@ m32r_resume (struct target_ops *ops, if (!mmu_on) bp_addr &= 0x7fffffff; - /* Write DBT instruction. */ + /* Write DBT instruction. */ buf[0] = SDI_WRITE_MEMORY; store_long_parameter (buf + 1, (bp_addr & 0xfffffffc)); store_long_parameter (buf + 5, 4); @@ -611,7 +611,7 @@ m32r_resume (struct target_ops *ops, send_data (buf, 13); } - /* Set access breaks. */ + /* Set access breaks. */ for (i = 0; i < max_access_breaks; i++) { ab_addr = ab_address[i]; @@ -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,23 +657,23 @@ 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); } - /* Resume program. */ + /* Resume program. */ send_cmd (SDI_EXEC_CPU); /* Without this, some commands which require an active target (such as kill) @@ -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")); @@ -759,7 +759,7 @@ m32r_wait (struct target_ops *ops, check_mmu_status (); - /* Recover parallel bit. */ + /* Recover parallel bit. */ if (last_pc_addr != 0xffffffff) { buf[0] = SDI_WRITE_MEMORY; @@ -778,7 +778,7 @@ m32r_wait (struct target_ops *ops, else ib_breakpoints = 0; - /* Set back pc by 2 if m32r is stopped with dbt. */ + /* Set back pc by 2 if m32r is stopped with dbt. */ last_pc_addr = 0xffffffff; send_one_arg_cmd (SDI_READ_CPU_REG, SDI_REG_BPC); pc_addr = recv_long_data () - 2; @@ -789,7 +789,7 @@ m32r_wait (struct target_ops *ops, send_two_arg_cmd (SDI_WRITE_CPU_REG, SDI_REG_BPC, pc_addr); /* If there is a parallel instruction with +2 offset at pc - address, we have to take care of it later. */ + address, we have to take care of it later. */ if ((pc_addr & 0x2) != 0) { if (gdbarch_byte_order (target_gdbarch) == BFD_ENDIAN_BIG) @@ -815,14 +815,14 @@ m32r_wait (struct target_ops *ops, } } - /* Remove ib breakpoints. */ + /* Remove ib breakpoints. */ for (i = 0; i < ib_breakpoints; i++) { if (bp_address[i] != 0xffffffff) send_three_arg_cmd (SDI_WRITE_MEMORY, 0xffff8000 + 4 * i, 4, 0x00000000); } - /* Remove dbt breakpoints. */ + /* Remove dbt breakpoints. */ for (i = ib_breakpoints; i < MAX_BREAKPOINTS; i++) { bp_addr = bp_address[i]; @@ -841,7 +841,7 @@ m32r_wait (struct target_ops *ops, } } - /* Remove access breaks. */ + /* Remove access breaks. */ hit_watchpoint_addr = 0; for (i = 0; i < max_access_breaks; i++) { @@ -888,14 +888,14 @@ 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", target_shortname); } -/* Return the id of register number REGNO. */ +/* Return the id of register number REGNO. */ static int get_reg_id (int regno) @@ -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,19 +1363,19 @@ 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 that we attached to the monitor, which is no longer valid now that we have loaded new code (and just changed the PC). Another way to do this might be to call normal_stop, except that the stack may not be valid, - and things would get horribly confused... */ + and things would get horribly confused... */ clear_symtab_users (0); @@ -1418,7 +1418,7 @@ m32r_can_use_hw_watchpoint (int type, int cnt, int othertype) /* Set a data watchpoint. ADDR and LEN should be obvious. TYPE is 0 for a write watchpoint, 1 for a read watchpoint, or 2 for a read/write - watchpoint. */ + watchpoint. */ static int m32r_insert_watchpoint (CORE_ADDR addr, int len, int type, @@ -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; @@ -1664,11 +1664,11 @@ _initialize_remote_m32r (void) init_m32r_ops (); - /* Initialize breakpoints. */ + /* Initialize breakpoints. */ for (i = 0; i < MAX_BREAKPOINTS; i++) bp_address[i] = 0xffffffff; - /* Initialize access breaks. */ + /* Initialize access breaks. */ for (i = 0; i < MAX_ACCESS_BREAKS; i++) ab_address[i] = 0x00000000; diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c index 7ea1365..bc82bc8 100644 --- a/gdb/remote-mips.c +++ b/gdb/remote-mips.c @@ -299,11 +299,15 @@ 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. */ + /* Last and unused value, for sizing vectors, etc. */ MON_LAST }; static enum mips_monitor_type mips_monitor = 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. */ @@ -375,25 +379,25 @@ static FILE *tftp_file; via ^C. */ static int interrupt_count; -/* If non-zero, means that the target is running. */ +/* If non-zero, means that the target is running. */ static int mips_wait_flag = 0; -/* If non-zero, monitor supports breakpoint commands. */ +/* If non-zero, monitor supports breakpoint commands. */ static int monitor_supports_breakpoints = 0; /* Data cache header. */ -#if 0 /* not used (yet?) */ +#if 0 /* not used (yet?) */ 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 E_ERR 0x200 /* This bit is set if the error code is an error */ +#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_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) @@ -584,7 +593,7 @@ mips_expect_timeout (const char *string, int timeout) int c; /* Must use serial_readchar() here cuz mips_readchar would get - confused if we were waiting for the mips_monitor_prompt... */ + confused if we were waiting for the mips_monitor_prompt... */ c = serial_readchar (mips_desc, 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) @@ -649,7 +657,7 @@ mips_readchar (int timeout) static int state = 0; int mips_monitor_prompt_len = strlen (mips_monitor_prompt); - { /* FIXME this whole block is dead code! */ + { /* FIXME this whole block is dead code! */ int i; i = timeout; @@ -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 (); @@ -702,7 +711,7 @@ mips_readchar (int timeout) state = 0; /* At this point, about the only thing we can do is abort the command - in progress and get back to command level as quickly as possible. */ + in progress and get back to command level as quickly as possible. */ error ("Remote board reset, debug protocol re-initialized."); } @@ -742,7 +751,7 @@ mips_receive_header (unsigned char *hdr, int *pgarbage, int ch, int timeout) what the program is outputting, if the debugging is being done on the console port. Don't use _filtered: we can't deal with a QUIT out of target_wait and - buffered target output confuses the user. */ + buffered target output confuses the user. */ if (!mips_initializing || remote_debug > 0) { if (isprint (ch) || isspace (ch)) @@ -756,13 +765,14 @@ mips_receive_header (unsigned char *hdr, int *pgarbage, int ch, int timeout) gdb_flush (gdb_stdtarg); } - /* Only count unprintable characters. */ + /* Only count unprintable characters. */ if (! (isprint (ch) || isspace (ch))) (*pgarbage) += 1; 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; @@ -918,7 +929,7 @@ mips_send_packet (const char *s, int get_ack) int i; /* Ignore any errors raised whilst attempting to ignore - packet. */ + packet. */ len = HDR_GET_LEN (hdr); @@ -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) @@ -942,7 +953,7 @@ mips_send_packet (const char *s, int get_ack) remote_timeout); /* We don't bother checking the checksum, or providing an - ACK to the packet. */ + ACK to the packet. */ continue; } @@ -1042,7 +1053,7 @@ mips_receive_packet (char *buff, int throw_error, int timeout) if (len == 0) { /* Ignore the error condition, since we are going to - ignore the packet anyway. */ + ignore the packet anyway. */ (void) mips_receive_trailer (trlr, &garbage, &ch, timeout); } /* Don't use _filtered; we can't deal with a QUIT out of @@ -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); @@ -1343,7 +1355,7 @@ mips_enter_debug (void) /* We don't need to absorb any spurious characters here, since the mips_receive_header will eat up a reasonable number of characters whilst looking for the SYN, however this avoids the "garbage" - being displayed to the user. */ + being displayed to the user. */ if (mips_monitor != MON_IDT) mips_expect ("\r"); @@ -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) { @@ -1440,9 +1453,9 @@ mips_initialize (void) /* We shouldn't need to send multiple termination sequences, since the target performs line (or block) reads, and then processes those - packets. In-case we were downloading a large packet + packets. In-case we were downloading a large packet we flush the output buffer before inserting a - termination sequence. */ + termination sequence. */ serial_flush_output (mips_desc); sprintf (tbuff, "\r/E/E\r"); serial_write (mips_desc, tbuff, 6); @@ -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); @@ -1469,7 +1481,7 @@ mips_initialize (void) if (serial_readchar (mips_desc, 0) >= 0) break; /* Break immediatly if we get something from - the board. */ + the board. */ } } } @@ -1497,7 +1509,7 @@ mips_initialize (void) /* Delete all the current breakpoints: */ mips_send_command ("db *\r", -1); /* NOTE: PMON does not have breakpoint support through the - "debug" mode, only at the monitor command-line. */ + "debug" mode, only at the monitor command-line. */ } mips_enter_debug (); @@ -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; @@ -1840,21 +1852,23 @@ mips_wait (struct target_ops *ops, /* On returning from a continue, the PMON monitor seems to start echoing back the messages we send prior to sending back the - ACK. The code can cope with this, but to try and avoid the + ACK. The code can cope with this, but to try and avoid the unnecessary serial traffic, and "spurious" characters displayed - to the user, we cheat and reset the debug protocol. The problems + to the user, we cheat and reset the debug protocol. The problems seems to be caused by a check on the number of arguments, and the command length, within the monitor causing it to echo the command - as a bad packet. */ + as a bad packet. */ if (mips_monitor == MON_PMON) { mips_exit_debug (); 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 ()); @@ -2022,8 +2037,8 @@ mips_fetch_registers (struct target_ops *ops, else { /* Unfortunately the PMON version in the Vr4300 board has been - compiled without the 64bit register access commands. This - means we cannot get hold of the full register width. */ + compiled without the 64bit register access commands. This + means we cannot get hold of the full register width. */ if (mips_monitor == MON_DDB || mips_monitor == MON_ROCKHOPPER) val = mips_request ('t', pmon_reg, 0, &err, mips_receive_wait, NULL); @@ -2096,7 +2111,7 @@ mips_fetch_word (CORE_ADDR addr, unsigned int *valp) success. If OLD_CONTENTS is non-NULL, put the old contents of that memory location there. */ -/* FIXME! make sure only 32-bit quantities get stored! */ +/* FIXME! make sure only 32-bit quantities get stored! */ static int mips_store_word (CORE_ADDR addr, unsigned int val, int *old_contents) { @@ -2139,7 +2154,7 @@ mips_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int write, int status; /* PMON targets do not cope well with 64 bit addresses. Mask the - value down to 32 bits. */ + value down to 32 bits. */ if (mask_address_p) memaddr &= (CORE_ADDR) 0xffffffff; @@ -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 (); @@ -2399,7 +2415,7 @@ calculate_mask (CORE_ADDR addr, int len) /* Set a data watchpoint. ADDR and LEN should be obvious. TYPE is 0 for a write watchpoint, 1 for a read watchpoint, or 2 for a read/write - watchpoint. */ + watchpoint. */ int mips_insert_watchpoint (CORE_ADDR addr, int len, int type, @@ -2455,7 +2471,7 @@ mips_clear_breakpoint (CORE_ADDR addr, int len, enum break_type type) command. If there's no error, just return 0. If it's a warning, print the warning text and return 0. If it's an error, print the error text and return 1. <ADDR> is the address of the breakpoint - that was being set. <RERRFLG> is the error code returned by PMON. + that was being set. <RERRFLG> is the error code returned by PMON. This is a helper function for mips_common_breakpoint. */ static int @@ -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: @@ -2755,7 +2772,7 @@ send_srec (char *srec, int len, CORE_ADDR addr) } } -/* Download a binary file by converting it to S records. */ +/* Download a binary file by converting it to S records. */ static void mips_load_srec (char *args) @@ -2792,7 +2809,7 @@ mips_load_srec (char *args) { unsigned int numbytes; - /* FIXME! vma too small????? */ + /* FIXME! vma too small????? */ printf_filtered ("%s\t: 0x%4lx .. 0x%4lx ", s->name, (long) s->vma, (long) (s->vma + bfd_get_section_size (s))); @@ -2836,7 +2853,7 @@ mips_load_srec (char *args) } /* - * mips_make_srec -- make an srecord. This writes each line, one at a + * mips_make_srec -- make an srecord. This writes each line, one at a * time, each with it's own header and trailer line. * An srecord looks like this: * @@ -2853,7 +2870,7 @@ mips_load_srec (char *args) * * Where * - length - * is the number of bytes following upto the checksum. Note that + * is the number of bytes following upto the checksum. Note that * this is not the number of chars following, since it takes two * chars to represent a byte. * - type @@ -2886,16 +2903,16 @@ 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! */ + /* FIXME!! bigger buf required for 64-bit! */ buf[0] = 'S'; buf[1] = type; buf[2] = len + 4 + 1; /* len + 4 byte address + 1 byte checksum */ - /* This assumes S3 style downloads (4byte addresses). There should + /* This assumes S3 style downloads (4byte addresses). There should probably be a check, or the code changed to make it more - explicit. */ + explicit. */ buf[3] = memaddr >> 24; buf[4] = memaddr >> 16; buf[5] = memaddr >> 8; @@ -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++; @@ -2916,8 +2933,8 @@ mips_make_srec (char *buf, int type, CORE_ADDR memaddr, unsigned char *myaddr, } /* The following manifest controls whether we enable the simple flow - control support provided by the monitor. If enabled the code will - wait for an affirmative ACK between transmitting packets. */ + control support provided by the monitor. If enabled the code will + wait for an affirmative ACK between transmitting packets. */ #define DOETXACK (1) /* The PMON fast-download uses an encoded packet format constructed of @@ -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,12 +2959,13 @@ 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 - pointer non-NULL). The function returns the number of encoded - characters written into the buffer. */ + pointer non-NULL). The function returns the number of encoded + characters written into the buffer. */ static int pmon_makeb64 (unsigned long v, char *p, int n, int *chksum) @@ -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); } @@ -2991,7 +3013,7 @@ pmon_makeb64 (unsigned long v, char *p, int n, int *chksum) } /* Shorthand function (that could be in-lined) to output the zero-fill - escape sequence into the data stream. */ + escape sequence into the data stream. */ static int pmon_zeroset (int recsize, char **buff, int *amount, unsigned int *chksum) @@ -3015,7 +3037,7 @@ pmon_zeroset (int recsize, char **buff, int *amount, unsigned int *chksum) Return the total size of the record after adding the checksum escape, the checksum itself, and the trailing newline. - The checksum specified by *VALUE is zeroed out prior to returning. + The checksum specified by *VALUE is zeroed out prior to returning. Additionally, *BUF is updated to refer to the location just beyond the record elements added by this call. */ @@ -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); @@ -3038,7 +3060,7 @@ pmon_checkset (int recsize, char **buff, int *value) /* Amount of padding we leave after at the end of the output buffer, for the checksum and line termination characters: */ #define CHECKSIZE (4 + 4 + 4 + 2) -/* zero-fill, checksum, transfer end and line termination space. */ +/* zero-fill, checksum, transfer end and line termination space. */ /* The amount of binary data loaded from the object file in a single operation: */ @@ -3046,8 +3068,8 @@ pmon_checkset (int recsize, char **buff, int *value) /* Maximum line of data accepted by the monitor: */ #define MAXRECSIZE (550) -/* NOTE: This constant depends on the monitor being used. This value - is for PMON 5.x on the Cogent Vr4300 board. */ +/* NOTE: This constant depends on the monitor being used. This value + is for PMON 5.x on the Cogent Vr4300 board. */ /* Create a FastLoad format record. @@ -3084,9 +3106,9 @@ pmon_make_fastrec (char **outbuf, unsigned char *inbuf, int *inptr, char *p = *outbuf; /* This is a simple check to ensure that our data will fit within - the maximum allowable record size. Each record output is 4bytes - in length. We must allow space for a pending zero fill command, - the record, and a checksum record. */ + the maximum allowable record size. Each record output is 4bytes + in length. We must allow space for a pending zero fill command, + the record, and a checksum record. */ while ((*recsize < (MAXRECSIZE - CHECKSIZE)) && ((inamount - *inptr) > 0)) { /* Process the binary data: */ @@ -3102,15 +3124,17 @@ 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 + /* Simple check for zero data. TODO: A better check would be to check the last, and then the middle byte for being zero - (if the first byte is not). We could then check for + (if the first byte is not). We could then check for following runs of zeros, and if above a certain size it is worth the 4 or 8 character hit of the byte insertions used - to pad to the start of the zeroes. NOTE: This also depends - on the alignment at the end of the zero run. */ + to pad to the start of the zeroes. NOTE: This also depends + on the alignment at the end of the zero run. */ if (value == 0x00000000) { (*zerofill)++; @@ -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) { @@ -3281,7 +3305,7 @@ pmon_end_download (int final, int bintotal) /* Wait for the stuff that PMON prints after the load has completed. The timeout value for use in the tftp case (15 seconds) was picked - arbitrarily but might be too small for really large downloads. FIXME. */ + arbitrarily but might be too small for really large downloads. FIXME. */ switch (mips_monitor) { case MON_LSI: @@ -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 @@ -3357,33 +3381,34 @@ pmon_load_fast (char *file) mips_send_command ("set dlproto etxack\r", -1); mips_send_command ("set dlecho off\r", -1); /* NOTE: We get a "cannot set variable" message if the variable is - already defined to have the argument we give. The code doesn't - care, since it just scans to the next prompt anyway. */ + already defined to have the argument we give. The code doesn't + care, since it just scans to the next prompt anyway. */ /* 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; } @@ -3456,9 +3482,9 @@ pmon_load_fast (char *file) putchar_unfiltered ('\n'); } - /* Terminate the transfer. We know that we have an empty output - buffer at this point. */ - sprintf (buffer, "/E/E\n"); /* include dummy padding characters */ + /* Terminate the transfer. We know that we have an empty output + buffer at this point. */ + sprintf (buffer, "/E/E\n"); /* Include dummy padding characters. */ reclen = strlen (buffer); pmon_download (buffer, reclen); @@ -3474,7 +3500,7 @@ pmon_load_fast (char *file) return; } -/* mips_load -- download a file. */ +/* mips_load -- download a file. */ static void mips_load (char *file, int from_tty) @@ -3492,12 +3518,12 @@ 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) { /* Work around problem where PMON monitor updates the PC after a load - to a different value than GDB thinks it has. The following ensures + to a different value than GDB thinks it has. The following ensures that the regcache_write_pc() WILL update the PC value: */ regcache_invalidate (regcache, mips_regnum (get_regcache_arch (regcache))->pc); @@ -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 diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c index 1f4e367..f2015f0 100644 --- a/gdb/remote-sim.c +++ b/gdb/remote-sim.c @@ -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 @@ -587,7 +588,7 @@ gdbsim_load (char *args, int fromtty) error (_("unable to load program")); /* FIXME: If a load command should reset the targets registers then - a call to sim_create_inferior() should go here. */ + a call to sim_create_inferior() should go here. */ sim_data->program_loaded = 1; } @@ -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) @@ -683,7 +685,7 @@ gdbsim_open (char *args, int from_tty) arg_buf = (char *) alloca (len); strcpy (arg_buf, "gdbsim"); /* 7 */ /* Specify the byte order for the target when it is explicitly - specified by the user (not auto detected). */ + specified by the user (not auto detected). */ switch (selected_byte_order ()) { case BFD_ENDIAN_BIG: @@ -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; @@ -755,7 +758,7 @@ gdbsim_close_inferior (struct inferior *inf, void *arg) set_inferior_data (inf, sim_inferior_data_key, NULL); /* Having a ptid allocated and stored in remote_sim_ptid does - not mean that a corresponding inferior was ever created. + not mean that a corresponding inferior was ever created. Thus we need to verify the existence of an inferior using the pid in question before setting inferior_ptid via switch_to_thread() or mourning the inferior. */ @@ -776,7 +779,7 @@ gdbsim_close_inferior (struct inferior *inf, void *arg) always called just before a routine is popped off the target stack. Closing file descriptors and freeing memory are typical things it should do. */ -/* Close out all files and local state before this target loses control. */ +/* Close out all files and local state before this target loses control. */ static void gdbsim_close (int quitting) @@ -864,7 +867,7 @@ gdbsim_resume (struct target_ops *ops, rd.siggnal = siggnal; rd.step = step; - /* We don't access any sim_data members within this function. + /* We don't access any sim_data members within this function. What's of interest is whether or not the call to get_sim_inferior_data_by_ptid(), above, is able to obtain a non-NULL pointer. If it managed to obtain a non-NULL pointer, we @@ -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); } @@ -951,7 +955,7 @@ gdb_os_poll_quit (host_callback *p) /* Wait for inferior process to do something. Return pid of child, or -1 in case of error; store status through argument pointer STATUS, - just as `wait' would. */ + just as `wait' would. */ static void gdbsim_cntrl_c (int signo) @@ -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); @@ -1031,7 +1036,7 @@ gdbsim_wait (struct target_ops *ops, break; case sim_running: case sim_polling: - /* FIXME: Is this correct? */ + /* FIXME: Is this correct? */ break; } @@ -1047,14 +1052,14 @@ 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 MEMADDR. If WRITE is non-zero, transfer them to the target, otherwise transfer them from the target. TARGET is unused. - Returns the number of bytes transferred. */ + Returns the number of bytes transferred. */ static int gdbsim_xfer_inferior_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, @@ -1083,7 +1088,7 @@ gdbsim_xfer_inferior_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, if (remote_debug) { - /* FIXME: Send to something other than STDOUT? */ + /* FIXME: Send to something other than STDOUT? */ printf_filtered ("gdbsim_xfer_inferior_memory: myaddr 0x"); gdb_print_host_address (myaddr, gdb_stdout); printf_filtered (", memaddr %s, len %d, write %d\n", @@ -1167,12 +1172,12 @@ simulator_command (char *args, int from_tty) /* PREVIOUSLY: The user may give a command before the simulator is opened. [...] (??? assuming of course one wishes to continue to allow commands to be sent to unopened simulators, - which isn't entirely unreasonable). */ + which isn't entirely unreasonable). */ /* The simulator is a builtin abstraction of a remote target. Consistent with that model, access to the simulator, via sim commands, is restricted to the period when the channel to the - simulator is open. */ + simulator is open. */ error (_("Not connected to the simulator target")); } @@ -1180,7 +1185,7 @@ simulator_command (char *args, int from_tty) sim_do_command (sim_data->gdbsim_desc, args); /* Invalidate the register cache, in case the simulator command does - something funny. */ + something funny. */ registers_changed (); } @@ -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; diff --git a/gdb/remote.c b/gdb/remote.c index c120c63..99594cb 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -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); } @@ -589,7 +589,7 @@ init_remote_state (struct gdbarch *gdbarch) to be smaller. */ rsa->sizeof_g_packet = offset; - /* Default maximum number of characters in a packet body. Many + /* Default maximum number of characters in a packet body. Many remote stubs have a hardwired buffer size of 400 bytes (c.f. BUFMAX in m68k-stub.c and i386-stub.c). BUFMAX-1 is used as the maximum packet-size to ensure that the packet and an extra @@ -602,9 +602,9 @@ init_remote_state (struct gdbarch *gdbarch) rsa->actual_register_packet_size = 0; /* Should rsa->sizeof_g_packet needs more space than the - default, adjust the size accordingly. Remember that each byte is - encoded as two characters. 32 is the overhead for the packet - header / footer. NOTE: cagney/1999-10-26: I suspect that 8 + default, adjust the size accordingly. Remember that each byte is + encoded as two characters. 32 is the overhead for the packet + header / footer. NOTE: cagney/1999-10-26: I suspect that 8 (``$NN:G...#NN'') is a better guess, the below has been padded a little. */ if (rsa->sizeof_g_packet > ((rsa->remote_packet_size - 32) / 2)) @@ -768,7 +768,7 @@ static struct serial *remote_desc = NULL; /* This variable sets the number of bits in an address that are to be sent in a memory ("M" or "m") packet. Normally, after stripping - leading zeros, the entire address would be sent. This variable + leading zeros, the entire address would be sent. This variable restricts the address to REMOTE_ADDRESS_SIZE bits. HISTORY: The initial implementation of remote.c restricted the address sent in memory packets to ``host::sizeof long'' bytes - (typically 32 @@ -864,7 +864,7 @@ get_memory_packet_size (struct memory_packet_config *config) return what_they_get; } -/* Update the size of a read/write packet. If they user wants +/* Update the size of a read/write packet. If they user wants something really big then do a sanity check. */ static void @@ -977,7 +977,7 @@ get_memory_read_packet_size (void) /* Generic configuration support for packets the stub optionally - supports. Allows the user to specify the use of the packet as well + supports. Allows the user to specify the use of the packet as well as allowing GDB to auto-detect support in the remote stub. */ enum packet_support @@ -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 @@ -2083,7 +2080,7 @@ unpack_threadid (char *inbuf, threadref *id) } /* Externally, threadrefs are 64 bits but internally, they are still - ints. This is due to a mismatch of specifications. We would like + ints. This is due to a mismatch of specifications. We would like to use 64bit thread references internally. This is an adapter function. */ @@ -4024,9 +4021,9 @@ remote_open_1 (char *name, int from_tty, /* FIXME: cagney/1999-09-23: During the initial connection it is assumed that the target is already ready and able to respond to - requests. Unfortunately remote_start_remote() eventually calls + requests. Unfortunately remote_start_remote() eventually calls wait_for_inferior() with no timeout. wait_forever_enabled_p gets - around this. Eventually a mechanism that allows + around this. Eventually a mechanism that allows wait_for_inferior() to expect/get timeouts will be implemented. */ wait_forever_enabled_p = 0; @@ -4569,8 +4566,8 @@ remote_resume (struct target_ops *ops, done: /* We are about to start executing the inferior, let's register it - with the event loop. NOTE: this is the one place where all the - execution commands end up. We could alternatively do this in each + with the event loop. NOTE: this is the one place where all the + execution commands end up. We could alternatively do this in each of the execution commands in infcmd.c. */ /* FIXME: ezannoni 1999-09-28: We may need to move this out of here into infcmd.c in order to allow inferior function calls to work @@ -4627,7 +4624,7 @@ async_remote_interrupt (gdb_client_data arg) target_stop (inferior_ptid); } -/* Perform interrupt, if the first attempt did not succeed. Just give +/* Perform interrupt, if the first attempt did not succeed. Just give up on the target alltogether. */ void async_remote_interrupt_twice (gdb_client_data arg) @@ -4650,9 +4647,9 @@ cleanup_sigint_signal_handler (void *dummy) packet. */ static void (*ofunc) (int); -/* The command line interface's stop routine. This function is installed - as a signal handler for SIGINT. The first time a user requests a - stop, we call remote_stop to send a break or ^C. If there is no +/* The command line interface's stop routine. This function is installed + as a signal handler for SIGINT. The first time a user requests a + stop, we call remote_stop to send a break or ^C. If there is no response from the target (it didn't stop when the user requested it), we ask the user if he'd like to detach from the target. */ static void @@ -4746,7 +4743,7 @@ remote_stop_as (ptid_t ptid) send_interrupt_sequence (); } -/* This is the generic stop called via the target vector. When a target +/* This is the generic stop called via the target vector. When a target interrupt is requested, either by the command line or the GUI, we will eventually end up here. */ @@ -5962,7 +5959,7 @@ remote_store_registers (struct target_ops *ops, /* For now, don't complain if we have no way to write the register. GDB loses track of unavailable registers too easily. Some day, this may be an error. We don't have - any way to read the register, either... */ + any way to read the register, either... */ if (!reg->in_g_packet) return; @@ -6139,7 +6136,7 @@ remote_unescape_input (const gdb_byte *buffer, int len, remote_write_bytes. NOTE: This can still lose if the serial line is not eight-bit - clean. In cases like this, the user should clear "remote + clean. In cases like this, the user should clear "remote X-packet". */ static void @@ -6237,11 +6234,11 @@ 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. */ + /* The comma won't be used. */ payload_size += 1; header_length = strlen (header); payload_size -= header_length; @@ -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); @@ -8148,7 +8145,7 @@ remote_xfer_partial (struct target_ops *ops, enum target_object object, return -1; } - /* Handle SPU memory using qxfer packets. */ + /* Handle SPU memory using qxfer packets. */ if (object == TARGET_OBJECT_SPU) { if (readbuf) @@ -8256,7 +8253,7 @@ remote_xfer_partial (struct target_ops *ops, enum target_object object, buffer size. */ if (offset == 0 && len == 0) return (get_remote_packet_size ()); - /* Minimum outbuf size is get_remote_packet_size (). If LEN is not + /* Minimum outbuf size is get_remote_packet_size (). If LEN is not large enough let the caller deal with it. */ if (len < get_remote_packet_size ()) return -1; @@ -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" : ""), @@ -9917,7 +9914,7 @@ remote_trace_set_readonly_regions (void) char tmp1[40], tmp2[40]; if ((s->flags & SEC_LOAD) == 0 || - /* (s->flags & SEC_CODE) == 0 || */ + /* (s->flags & SEC_CODE) == 0 || */ (s->flags & SEC_READONLY) == 0) continue; @@ -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; diff --git a/gdb/remote.h b/gdb/remote.h index 19a58c8..5327947 100644 --- a/gdb/remote.h +++ b/gdb/remote.h @@ -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); diff --git a/gdb/rs6000-aix-tdep.c b/gdb/rs6000-aix-tdep.c index dd30fdc..3ce3e37 100644 --- a/gdb/rs6000-aix-tdep.c +++ b/gdb/rs6000-aix-tdep.c @@ -38,14 +38,14 @@ #include "exceptions.h" /* Hook for determining the TOC address when calling functions in the - inferior under AIX. The initialization code in rs6000-nat.c sets + inferior under AIX. The initialization code in rs6000-nat.c sets this hook to point to find_toc_address. */ CORE_ADDR (*rs6000_find_toc_address_hook) (CORE_ADDR) = NULL; /* If the kernel has to deliver a signal, it pushes a sigcontext structure on the stack and then calls the signal handler, passing - the address of the sigcontext in an argument register. Usually + the address of the sigcontext in an argument register. Usually the signal handler doesn't save this register, so we have to access the sigcontext structure via an offset from the signal handler frame. @@ -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. */ @@ -173,10 +173,10 @@ rs6000_aix_regset_from_core_section (struct gdbarch *gdbarch, } -/* Pass the arguments in either registers, or in the stack. In RS/6000, +/* 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); @@ -245,10 +244,9 @@ rs6000_push_dummy_call (struct gdbarch *gdbarch, struct value *function, offset of stack on overflow different both: return in r3 or f0. If no float, must study how gcc emulates floats; - pay attention to arg promotion. + 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) { @@ -262,7 +260,7 @@ rs6000_push_dummy_call (struct gdbarch *gdbarch, struct value *function, { /* Floating point arguments are passed in fpr's, as well as gpr's. - There are 13 fpr's reserved for passing parameters. At this point + There are 13 fpr's reserved for passing parameters. At this point there is no way we would run out of them. */ gdb_assert (len <= 8); @@ -351,7 +349,7 @@ ran_out_of_registers_for_arguments: sp -= space; /* This is another instance we need to be concerned about - securing our stack space. If we write anything underneath %sp + securing our stack space. If we write anything underneath %sp (r1), we might conflict with the kernel who thinks he is free to use this area. So, update %sp first before doing anything else. */ @@ -456,7 +454,7 @@ rs6000_return_value (struct gdbarch *gdbarch, struct type *func_type, /* If the called subprogram returns an aggregate, there exists an implicit first argument, whose value is the address of a caller- allocated buffer into which the callee is assumed to store its - return value. All explicit parameters are appropriately + return value. All explicit parameters are appropriately relabeled. */ if (TYPE_CODE (valtype) == TYPE_CODE_STRUCT || TYPE_CODE (valtype) == TYPE_CODE_UNION @@ -551,8 +549,8 @@ rs6000_return_value (struct gdbarch *gdbarch, struct type *func_type, /* Support for CONVERT_FROM_FUNC_PTR_ADDR (ARCH, ADDR, TARG). Usually a function pointer's representation is simply the address - of the function. On the RS/6000 however, a function pointer is - represented by a pointer to an OPD entry. This OPD entry contains + of the function. On the RS/6000 however, a function pointer is + represented by a pointer to an OPD entry. This OPD entry contains three words, the first word is the address of the function, the second word is the TOC pointer (r2), and the third word is the static chain value. Throughout GDB it is currently assumed that a @@ -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; @@ -704,19 +704,19 @@ rs6000_software_single_step (struct frame_info *frame) opcode = insn >> 26; breaks[1] = branch_dest (frame, opcode, insn, loc, breaks[0]); - /* Don't put two breakpoints on the same address. */ + /* Don't put two breakpoints on the same address. */ if (breaks[1] == breaks[0]) breaks[1] = -1; for (ii = 0; ii < 2; ++ii) { - /* ignore invalid breakpoint. */ + /* ignore invalid breakpoint. */ if (breaks[ii] == -1) continue; insert_single_step_breakpoint (gdbarch, aspace, breaks[ii]); } - errno = 0; /* FIXME, don't ignore errors! */ + errno = 0; /* FIXME, don't ignore errors! */ /* What errors? {read,write}_memory call error(). */ return 1; } diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c index 4a98612..ec1e401 100644 --- a/gdb/rs6000-nat.c +++ b/gdb/rs6000-nat.c @@ -61,16 +61,16 @@ /* On AIX4.3+, sys/ldr.h provides different versions of struct ld_info for debugging 32-bit and 64-bit processes. Define a typedef and macros for - accessing fields in the appropriate structures. */ + accessing fields in the appropriate structures. */ /* In 32-bit compilation mode (which is the only mode from which ptrace() - works on 4.3), __ld_info32 is #defined as equivalent to ld_info. */ + works on 4.3), __ld_info32 is #defined as equivalent to ld_info. */ #ifdef __ld_info32 # define ARCH3264 #endif -/* Return whether the current architecture is 64-bit. */ +/* Return whether the current architecture is 64-bit. */ #ifndef ARCH3264 # define ARCH64() 0 @@ -78,7 +78,7 @@ # define ARCH64() (register_size (target_gdbarch, 0) == 8) #endif -/* Union of 32-bit and 64-bit versions of ld_info. */ +/* Union of 32-bit and 64-bit versions of ld_info. */ typedef union { #ifndef ARCH3264 @@ -92,7 +92,7 @@ typedef union { /* If compiling with 32-bit and 64-bit debugging capability (e.g. AIX 4.x), declare and initialize a variable named VAR suitable for use as the arch64 - parameter to the various LDI_*() macros. */ + parameter to the various LDI_*() macros. */ #ifndef ARCH3264 # define ARCH64_DECL(var) @@ -102,7 +102,7 @@ typedef union { /* Return LDI's FIELD for a 64-bit process if ARCH64 and for a 32-bit process otherwise. This technique only works for FIELDs with the same data type in - 32-bit and 64-bit versions of ld_info. */ + 32-bit and 64-bit versions of ld_info. */ #ifndef ARCH3264 # define LDI_FIELD(ldi, arch64, field) (ldi)->l32.ldinfo_##field @@ -112,7 +112,7 @@ typedef union { #endif /* Return various LDI fields for a 64-bit process if ARCH64 and for a 32-bit - process otherwise. */ + process otherwise. */ #define LDI_NEXT(ldi, arch64) LDI_FIELD(ldi, arch64, next) #define LDI_FD(ldi, arch64) LDI_FIELD(ldi, arch64, fd) @@ -176,7 +176,7 @@ regmap (struct gdbarch *gdbarch, int regno, int *isfloat) return -1; } -/* Call ptrace(REQ, ID, ADDR, DATA, BUF). */ +/* Call ptrace(REQ, ID, ADDR, DATA, BUF). */ static int rs6000_ptrace32 (int req, int id, int *addr, int data, int *buf) @@ -189,7 +189,7 @@ rs6000_ptrace32 (int req, int id, int *addr, int data, int *buf) return ret; } -/* Call ptracex(REQ, ID, ADDR, DATA, BUF). */ +/* Call ptracex(REQ, ID, ADDR, DATA, BUF). */ static int rs6000_ptrace64 (int req, int id, long long addr, int data, void *buf) @@ -206,7 +206,7 @@ rs6000_ptrace64 (int req, int id, long long addr, int data, void *buf) return ret; } -/* Fetch register REGNO from the inferior. */ +/* Fetch register REGNO from the inferior. */ static void fetch_register (struct regcache *regcache, int regno) @@ -215,16 +215,16 @@ fetch_register (struct regcache *regcache, int regno) int addr[MAX_REGISTER_SIZE]; int nr, isfloat; - /* Retrieved values may be -1, so infer errors from errno. */ + /* Retrieved values may be -1, so infer errors from errno. */ errno = 0; nr = regmap (gdbarch, regno, &isfloat); - /* Floating-point registers. */ + /* Floating-point registers. */ if (isfloat) rs6000_ptrace32 (PT_READ_FPR, PIDGET (inferior_ptid), addr, nr, 0); - /* Bogus register number. */ + /* Bogus register number. */ else if (nr < 0) { if (regno >= gdbarch_num_regs (gdbarch)) @@ -234,15 +234,16 @@ fetch_register (struct regcache *regcache, int regno) return; } - /* Fixed-point registers. */ + /* Fixed-point registers. */ 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, - even if the register is really only 32 bits. */ + even if the register is really only 32 bits. */ long long buf; rs6000_ptrace64 (PT_READ_GPR, PIDGET (inferior_ptid), nr, 0, &buf); if (register_size (gdbarch, regno) == 8) @@ -257,14 +258,14 @@ fetch_register (struct regcache *regcache, int regno) else { #if 0 - /* FIXME: this happens 3 times at the start of each 64-bit program. */ + /* FIXME: this happens 3 times at the start of each 64-bit program. */ perror ("ptrace read"); #endif errno = 0; } } -/* Store register REGNO back into the inferior. */ +/* Store register REGNO back into the inferior. */ static void store_register (struct regcache *regcache, int regno) @@ -276,16 +277,16 @@ store_register (struct regcache *regcache, int regno) /* Fetch the register's value from the register cache. */ regcache_raw_collect (regcache, regno, addr); - /* -1 can be a successful return value, so infer errors from errno. */ + /* -1 can be a successful return value, so infer errors from errno. */ errno = 0; nr = regmap (gdbarch, regno, &isfloat); - /* Floating-point registers. */ + /* Floating-point registers. */ if (isfloat) rs6000_ptrace32 (PT_WRITE_FPR, PIDGET (inferior_ptid), addr, nr, 0); - /* Bogus register number. */ + /* Bogus register number. */ else if (nr < 0) { if (regno >= gdbarch_num_regs (gdbarch)) @@ -294,7 +295,7 @@ store_register (struct regcache *regcache, int regno) regno); } - /* Fixed-point registers. */ + /* Fixed-point registers. */ else { if (regno == gdbarch_sp_regnum (gdbarch)) @@ -302,18 +303,19 @@ store_register (struct regcache *regcache, int regno) process to give kernel a chance to do internal housekeeping. Otherwise the following ptrace(2) calls will mess up user stack since kernel will get confused about the bottom of the stack - (%sp). */ + (%sp). */ exec_one_dummy_insn (regcache); /* The PT_WRITE_GPR operation is rather odd. For 32-bit inferiors, 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 - area, even if the register is really only 32 bits. */ + area, even if the register is really only 32 bits. */ long long buf; if (register_size (gdbarch, regno) == 8) memcpy (&buf, addr, 8); @@ -331,7 +333,7 @@ store_register (struct regcache *regcache, int regno) } /* Read from the inferior all registers if REGNO == -1 and just register - REGNO otherwise. */ + REGNO otherwise. */ static void rs6000_fetch_inferior_registers (struct target_ops *ops, @@ -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; } @@ -562,7 +566,7 @@ rs6000_wait (struct target_ops *ops, /* stop after load" status. */ if (status == 0x57c) ourstatus->kind = TARGET_WAITKIND_LOADED; - /* signal 0. I have no idea why wait(2) returns with this status word. */ + /* signal 0. I have no idea why wait(2) returns with this status word. */ else if (status == 0x7f) ourstatus->kind = TARGET_WAITKIND_SPURIOUS; /* A normal waitstatus. Let the usual macros deal with it. */ @@ -574,7 +578,7 @@ rs6000_wait (struct target_ops *ops, /* Execute one dummy breakpoint instruction. This way we give the kernel a chance to do some housekeeping and update inferior's internal data, - including u_area. */ + including u_area. */ static void exec_one_dummy_insn (struct regcache *regcache) @@ -586,9 +590,9 @@ exec_one_dummy_insn (struct regcache *regcache) CORE_ADDR prev_pc; void *bp; - /* We plant one dummy breakpoint into DUMMY_INSN_ADDR address. We + /* We plant one dummy breakpoint into DUMMY_INSN_ADDR address. We assume that this address will never be executed again by the real - code. */ + code. */ bp = deprecated_insert_raw_breakpoint (gdbarch, NULL, DUMMY_INSN_ADDR); @@ -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"); @@ -619,7 +624,7 @@ exec_one_dummy_insn (struct regcache *regcache) /* Copy information about text and data sections from LDI to VP for a 64-bit - process if ARCH64 and for a 32-bit process otherwise. */ + process if ARCH64 and for a 32-bit process otherwise. */ static void vmap_secs (struct vmap *vp, LdInfo *ldi, int arch64) @@ -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) @@ -666,7 +671,7 @@ vmap_symtab (struct vmap *vp) objfile = symfile_objfile; } else if (!vp->loaded) - /* If symbols are not yet loaded, offsets are not yet valid. */ + /* If symbols are not yet loaded, offsets are not yet valid. */ return; new_offsets = @@ -732,8 +737,8 @@ add_vmap (LdInfo *ldi) ARCH64_DECL (arch64); /* This ldi structure was allocated using alloca() in - xcoff_relocate_symtab(). Now we need to have persistent object - and member names, so we should save them. */ + xcoff_relocate_symtab(). Now we need to have persistent object + and member names, so we should save them. */ filename = LDI_FILENAME (ldi, arch64); mem = filename + strlen (filename) + 1; @@ -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); @@ -762,7 +767,7 @@ add_vmap (LdInfo *ldi) else if (bfd_check_format (abfd, bfd_archive)) { last = 0; - /* FIXME??? am I tossing BFDs? bfd? */ + /* FIXME??? am I tossing BFDs? bfd? */ while ((last = bfd_openr_next_archived_file (abfd, last))) if (strcmp (mem, last->filename) == 0) break; @@ -829,7 +834,7 @@ vmap_ldinfo (LdInfo *ldi) if (fstat (fd, &ii) < 0) { /* The kernel sets ld_info to -1, if the process is still using the - object, and the object is removed. Keep the symbol info for the + object, and the object is removed. Keep the symbol info for the removed object and issue a warning. */ warning (_("%s (fd=%d) has disappeared, keeping its symbols"), name, fd); @@ -841,12 +846,12 @@ vmap_ldinfo (LdInfo *ldi) struct objfile *objfile; /* First try to find a `vp', which is the same as in ldinfo. - If not the same, just continue and grep the next `vp'. If same, - relocate its tstart, tend, dstart, dend values. If no such `vp' + If not the same, just continue and grep the next `vp'. If same, + relocate its tstart, tend, dstart, dend values. If no such `vp' found, get out of this for loop, add this ldi entry as a new vmap - (add_vmap) and come back, find its `vp' and so on... */ + (add_vmap) and come back, find its `vp' and so on... */ - /* The filenames are not always sufficient to match on. */ + /* The filenames are not always sufficient to match on. */ if ((name[0] == '/' && strcmp (name, vp->name) != 0) || (memb[0] && strcmp (memb, vp->member) != 0)) @@ -880,7 +885,7 @@ vmap_ldinfo (LdInfo *ldi) if (vp->objfile == NULL) got_exec_file = 1; - /* relocate symbol table(s). */ + /* relocate symbol table(s). */ vmap_symtab (vp); /* Announce new object files. Doing this after symbol relocation @@ -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); @@ -920,15 +926,14 @@ symbols to the proper address)."), breakpoint_re_set (); } -/* As well as symbol tables, exec_sections need relocation. After +/* As well as symbol tables, exec_sections need relocation. After the inferior process' termination, there will be a relocated symbol - table exist with no corresponding inferior process. At that time, we + table exist with no corresponding inferior process. At that time, we need to use `exec' bfd, rather than the inferior process's memory space 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) @@ -966,7 +971,7 @@ vmap_exec (void) } /* Set the current architecture from the host running GDB. Called when - starting a child process. */ + starting a child process. */ static void (*super_create_inferior) (struct target_ops *,char *exec_file, char *allargs, char **env, int from_tty); @@ -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")); } @@ -1048,8 +1054,8 @@ xcoff_relocate_symtab (unsigned int pid) #if 0 /* According to my humble theory, AIX has some timing problems and when the user stack grows, kernel doesn't update stack info in time - and ptrace calls step on user stack. That is why we sleep here a - little, and give kernel to update its internals. */ + and ptrace calls step on user stack. That is why we sleep here a + little, and give kernel to update its internals. */ usleep (36000); #endif @@ -1068,7 +1074,7 @@ xcoff_relocate_symtab (unsigned int pid) else { vmap_ldinfo (ldi); - vmap_exec (); /* relocate the exec and core sections as well. */ + vmap_exec (); /* relocate the exec and core sections as well. */ } } while (rc == -1); if (ldi) @@ -1089,7 +1095,7 @@ xcoff_relocate_core (struct target_ops *target) struct vmap *vp; int arch64 = ARCH64 (); - /* Size of a struct ld_info except for the variable-length filename. */ + /* Size of a struct ld_info except for the variable-length filename. */ int nonfilesz = (int)LDI_FILENAME ((LdInfo *)0, arch64); /* Allocated size of buffer. */ @@ -1147,7 +1153,7 @@ xcoff_relocate_core (struct target_ops *target) else vp = add_vmap (ldi); - /* Process next shared library upon error. */ + /* Process next shared library upon error. */ offset += LDI_NEXT (ldi, arch64); if (vp == NULL) continue; diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index d94fbc8..81aa9a3 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -122,7 +122,7 @@ static const char *powerpc_vector_strings[] = static enum powerpc_vector_abi powerpc_vector_abi_global = POWERPC_VEC_AUTO; static const char *powerpc_vector_abi_string = "auto"; -/* To be used by skip_prologue. */ +/* To be used by skip_prologue. */ struct rs6000_framedata { @@ -135,8 +135,8 @@ struct rs6000_framedata int saved_vr; /* smallest # of saved vr */ int saved_ev; /* smallest # of saved ev */ int alloca_reg; /* alloca register number (frame ptr) */ - char frameless; /* true if frameless functions. */ - char nosavedpc; /* true if pc not saved. */ + char frameless; /* true if frameless functions. */ + char nosavedpc; /* true if pc not saved. */ char used_bl; /* true if link register clobbered */ int gpr_offset; /* offset of saved gprs from prev sp */ int fpr_offset; /* offset of saved fprs from prev sp */ @@ -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); } } @@ -1275,7 +1276,7 @@ bl_to_blrl_insn_p (CORE_ADDR pc, int insn, enum bfd_endian byte_order) return 0; } -/* Masks for decoding a branch-and-link (bl) instruction. +/* Masks for decoding a branch-and-link (bl) instruction. BL_MASK and BL_INSTRUCTION are used in combination with each other. The former is anded with the opcode in question; if the result of @@ -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, @@ -1540,7 +1538,7 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc, /* Sometimes it isn't clear if an instruction is a prologue instruction or not. When we encounter one of these ambiguous cases, we'll set prev_insn_was_prologue_insn to 0 (false). - Otherwise, we'll assume that it really is a prologue instruction. */ + Otherwise, we'll assume that it really is a prologue instruction. */ if (prev_insn_was_prologue_insn) last_prologue_pc = pc; @@ -1625,7 +1623,7 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc, /* nop */ /* Allow nops in the prologue, but do not consider them to be part of the prologue unless followed by other prologue - instructions. */ + instructions. */ prev_insn_was_prologue_insn = 0; continue; @@ -1719,7 +1717,7 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc, } else if ((op & 0xfc000001) == 0x48000001) { /* bl foo, - to save fprs??? */ + to save fprs??? */ fdata->frameless = 0; @@ -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; } @@ -1750,11 +1749,11 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc, /* At this point, make sure this is not a trampoline function (a function that simply calls another functions, and nothing else). If the next is not a nop, this branch - was part of the function prologue. */ + 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; @@ -1797,8 +1796,8 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc, } /* Load up minimal toc pointer. Do not treat an epilogue restore of r31 as a minimal TOC load. */ - else if (((op >> 22) == 0x20f || /* l r31,... or l r30,... */ - (op >> 22) == 0x3af) /* ld r31,... or ld r30,... */ + else if (((op >> 22) == 0x20f || /* l r31,... or l r30,... */ + (op >> 22) == 0x3af) /* ld r31,... or ld r30,... */ && !framep && !minimal_toc_loaded) { @@ -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; @@ -1893,7 +1893,7 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc, vr_saved_offset = SIGNED_SHORT (op); /* This insn by itself is not part of the prologue, unless - if part of the pair of insns mentioned above. So do not + if part of the pair of insns mentioned above. So do not record this insn as part of the prologue yet. */ prev_insn_was_prologue_insn = 0; } @@ -2051,7 +2051,7 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc, #if 0 /* I have problems with skipping over __main() that I need to address - * sometime. Previously, I used to use misc_function_vector which + * sometime. Previously, I used to use misc_function_vector which * didn't work as well as I wanted to be. -MGO */ /* If the first thing after skipping a prolog is a branch to a function, @@ -2062,7 +2062,7 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc, if ((op & 0xfc000001) == 0x48000001) - { /* bl foo, an initializer function? */ + { /* bl foo, an initializer function? */ op = read_memory_integer (pc + 4, 4, byte_order); if (op == 0x4def7b82) @@ -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); @@ -3194,7 +3196,7 @@ rs6000_frame_cache (struct frame_info *this_frame, void **this_cache) } /* if != -1, fdata.saved_ev is the smallest number of saved_ev. - All vr's from saved_ev to ev31 are saved. ????? */ + All vr's from saved_ev to ev31 are saved. ????? */ if (tdep->ppc_ev0_regnum != -1) { if (fdata.saved_ev >= 0) @@ -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); @@ -4008,13 +4014,13 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_breakpoint_from_pc (gdbarch, rs6000_breakpoint_from_pc); /* The value of symbols of type N_SO and N_FUN maybe null when - it shouldn't be. */ + it shouldn't be. */ set_gdbarch_sofun_address_maybe_missing (gdbarch, 1); /* Handles single stepping of atomic sequences. */ set_gdbarch_software_single_step (gdbarch, ppc_deal_with_atomic_sequence); - /* Not sure on this. FIXMEmgo */ + /* Not sure on this. FIXMEmgo */ set_gdbarch_frame_args_skip (gdbarch, 8); /* Helpers for function argument information. */ @@ -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) |