diff options
47 files changed, 948 insertions, 815 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9c823a661c1..d0cd0cdfadc 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -51,6 +51,55 @@ * linux-thread-db.c: Ditto. * lm32-tdep.c: Ditto. +2011-01-08 Michael Snyder <msnyder@vmware.com> + + * m2-exp.y: Comment cleanup, mostly periods and spaces. + * m2-lang.c: Ditto. + * m2-typeprint.c: Ditto. + * m2-valprint.c: Ditto. + * m32c-tdep.c: Ditto. + * m32r-linux-nat.c: Ditto. + * m32r-rom.c: Ditto. + * m32r-tdep.c: Ditto. + * m32r-tdep.h: Ditto. + * m68hc11-tdep.c: Ditto. + * m58klinux-nat.c: Ditto. + * m68k-tdep.c: Ditto. + * m88k-tdep.c: Ditto. + * m88k-tdep.h: Ditto. + * machoread.c: Ditto. + * macrocmd.c: Ditto. + * macroexp.c: Ditto. + * macrotab.c: Ditto. + * main.c: Ditto. + * maint.c: Ditto. + * mdebugread.c: Ditto. + * mdebugread.h: Ditto. + * memattr.c: Ditto. + * memattr.h: Ditto. + * memory-map.h: Ditto. + * mep-tdep.c: Ditto. + * microblaze-rom.c: Ditto. + * microblaze-tdep.c: Ditto. + * minsyms.c: Ditto. + * mips-irix-tdep.c: Ditto. + * mips-linux-nat.c: Ditto. + * mips-linux-tdep.c: Ditto. + * mips-linux-tdep.h: Ditto. + * mipsnbsd-nat.c: Ditto. + * mipsnbsd-tdep.c: Ditto. + * mipsread.c: Ditto. + * mips-tdep.c: Ditto. + * mips-tdep.h: Ditto. + * mn10300-linux-tdep.c: Ditto. + * mn10300-tdep.c: Ditto. + * mn10300-tdep.h: Ditto. + * monitor.c: Ditto. + * monitor.h: Ditto. + * moxie-tdep.c: Ditto. + * moxie-tdep.h: Ditto. + * mt-tdep.c: Ditto. + 2011-01-08 Mike Frysinger <vapier@gentoo.org> * bfin-tdep.h (BFIN_A0_DOT_W_REGNUM): Fix typo in name. diff --git a/gdb/m2-exp.y b/gdb/m2-exp.y index 5c70b243799..56ec4048c0f 100644 --- a/gdb/m2-exp.y +++ b/gdb/m2-exp.y @@ -34,7 +34,7 @@ generator. Doing this with #defines and trying to control the interaction with include files (<malloc.h> and <stdlib.h> for example) just became too messy, particularly when such includes can be inserted at random - times by the parser generator. */ + times by the parser generator. */ %{ @@ -58,7 +58,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 m2_maxdepth #define yyparse m2_parse @@ -119,7 +119,7 @@ static char *make_qualname (char *, char *); static int parse_number (int); -/* The sign of the number being parsed. */ +/* The sign of the number being parsed. */ static int number_sign = 1; /* The block that the module specified by the qualifer on an identifer is @@ -543,7 +543,7 @@ exp : STRING write_exp_elt_opcode (OP_M2_STRING); } ; -/* This will be used for extensions later. Like adding modules. */ +/* This will be used for extensions later. Like adding modules. */ block : fblock { $$ = SYMBOL_BLOCK_VALUE($1); } ; @@ -596,7 +596,7 @@ variable: block COLONCOLON NAME write_exp_elt_opcode (OP_VAR_VALUE); } ; -/* Base case for variables. */ +/* Base case for variables. */ variable: NAME { struct symbol *sym; int is_a_field_of_this; @@ -718,7 +718,7 @@ parse_number (olen) if(!unsigned_p && number_sign == 1 && (prevn >= n)) unsigned_p=1; /* Try something unsigned */ /* Don't do the range check if n==i and i==0, since that special - case will give an overflow error. */ + case will give an overflow error. */ if(RANGE_CHECK && n!=i && i) { if((unsigned_p && (unsigned)prevn >= (unsigned)n) || @@ -1051,7 +1051,7 @@ yylex () } else { - /* Built-in BOOLEAN type. This is sort of a hack. */ + /* Built-in BOOLEAN type. This is sort of a hack. */ if (strncmp (tokstart, "TRUE", 4) == 0) { yylval.ulval = 1; @@ -1064,7 +1064,7 @@ yylex () } } - /* Must be another type of name... */ + /* Must be another type of name... */ return NAME; } } diff --git a/gdb/m2-lang.c b/gdb/m2-lang.c index bcae52f81c9..b0a9e27fded 100644 --- a/gdb/m2-lang.c +++ b/gdb/m2-lang.c @@ -42,7 +42,7 @@ static void m2_emit_char (int c, struct type *type, struct ui_file *stream, int quoter) { - c &= 0xFF; /* Avoid sign bit follies */ + c &= 0xFF; /* Avoid sign bit follies. */ if (PRINT_LITERAL_FORM (c)) { @@ -243,7 +243,8 @@ evaluate_subexp_modula2 (struct type *expect_type, struct expression *exp, type = TYPE_FIELD_TYPE (type, 0); if (type == NULL || (TYPE_CODE (type) != TYPE_CODE_PTR)) { - warning (_("internal error: unbounded array structure is unknown")); + warning (_("internal error: unbounded " + "array structure is unknown")); return evaluate_subexp_standard (expect_type, exp, pos, noside); } /* i18n: Do not translate the "_m2_contents" part! */ @@ -389,7 +390,8 @@ const struct language_defn m2_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 */ m2_op_print_tab, /* expression operators for printing */ 0, /* arrays are first-class (not c-style) */ 0, /* String lower bound */ diff --git a/gdb/m2-typeprint.c b/gdb/m2-typeprint.c index 6516b2c78c8..0caf945d618 100644 --- a/gdb/m2-typeprint.c +++ b/gdb/m2-typeprint.c @@ -67,7 +67,8 @@ int m2_is_unbounded_array (struct type *type); void -m2_print_type (struct type *type, const char *varstring, struct ui_file *stream, +m2_print_type (struct type *type, const char *varstring, + struct ui_file *stream, int show, int level) { enum type_code code; @@ -133,7 +134,7 @@ m2_print_type (struct type *type, const char *varstring, struct ui_file *stream, break; case TYPE_CODE_UNDEF: - /* i18n: Do not translate the "struct" part! */ + /* i18n: Do not translate the "struct" part! */ m2_unknown (_("undef"), type, stream, show, level); break; @@ -328,8 +329,8 @@ m2_short_set (struct type *type, struct ui_file *stream, int show, int level) int m2_is_long_set (struct type *type) { - LONGEST previous_high = 0; /* unnecessary initialization - keeps gcc -Wall happy */ + LONGEST previous_high = 0; /* Unnecessary initialization + keeps gcc -Wall happy. */ int len, i; struct type *range; @@ -467,7 +468,7 @@ m2_long_set (struct type *type, struct ui_file *stream, int show, int level) } } else - /* i18n: Do not translate the "SET OF" part! */ + /* i18n: Do not translate the "SET OF" part! */ fprintf_filtered(stream, _("SET OF <unknown>")); return 1; @@ -554,7 +555,7 @@ m2_record_fields (struct type *type, struct ui_file *stream, int show, if (TYPE_CODE (type) == TYPE_CODE_STRUCT) fprintf_filtered (stream, "RECORD\n"); else if (TYPE_CODE (type) == TYPE_CODE_UNION) - /* i18n: Do not translate "CASE" and "OF" */ + /* i18n: Do not translate "CASE" and "OF". */ fprintf_filtered (stream, _("CASE <variant> OF\n")); for (i = TYPE_N_BASECLASSES (type); i < len; i++) diff --git a/gdb/m2-valprint.c b/gdb/m2-valprint.c index ca0702511cd..89809403467 100644 --- a/gdb/m2-valprint.c +++ b/gdb/m2-valprint.c @@ -323,7 +323,7 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, const struct value_print_options *options) { struct gdbarch *gdbarch = get_type_arch (type); - unsigned int i = 0; /* Number of characters printed */ + unsigned int i = 0; /* Number of characters printed. */ unsigned len; struct type *elttype; unsigned eltlen; @@ -354,7 +354,7 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, { unsigned int temp_len; - /* Look for a NULL char. */ + /* Look for a NULL char. */ for (temp_len = 0; (valaddr + embedded_offset)[temp_len] && temp_len < len && temp_len < options->print_max; @@ -371,7 +371,8 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, { fprintf_filtered (stream, "{"); val_print_array_elements (type, valaddr + embedded_offset, - address, stream, recurse, original_value, + address, stream, + recurse, original_value, options, 0); fprintf_filtered (stream, "}"); } diff --git a/gdb/m32c-tdep.c b/gdb/m32c-tdep.c index 8e7c7e94fe7..b74b017cfa2 100644 --- a/gdb/m32c-tdep.c +++ b/gdb/m32c-tdep.c @@ -2345,8 +2345,8 @@ m32c_skip_trampoline_code (struct frame_info *frame, CORE_ADDR stop_pc) /* What we have now is the address of a jump instruction. What we need is the destination of that jump. - The opcode is 1 byte, and the destination is the next 3 bytes. - */ + The opcode is 1 byte, and the destination is the next 3 bytes. */ + target = read_memory_unsigned_integer (target + 1, 3, byte_order); return target; } @@ -2566,7 +2566,8 @@ m32c_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); if (!find_pc_partial_function (pc, &name, &func_addr, &func_end)) - internal_error (__FILE__, __LINE__, _("No virtual frame pointer available")); + internal_error (__FILE__, __LINE__, + _("No virtual frame pointer available")); m32c_analyze_prologue (gdbarch, func_addr, pc, &p); switch (p.kind) @@ -2586,7 +2587,8 @@ m32c_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, } /* Sanity check */ if (*frame_regnum > gdbarch_num_regs (gdbarch)) - internal_error (__FILE__, __LINE__, _("No virtual frame pointer available")); + internal_error (__FILE__, __LINE__, + _("No virtual frame pointer available")); } @@ -2638,8 +2640,7 @@ m32c_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) They may be in the dwarf2 cfi code in GDB, or they may be in the debug info emitted by the upstream toolchain. I don't know which, but I do know that the prologue analyzer works better. - MVS 04/13/06 - */ + MVS 04/13/06 */ dwarf2_append_sniffers (arch); #endif frame_unwind_append_unwinder (arch, &m32c_unwind); @@ -2657,7 +2658,7 @@ m32c_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* m32c function boundary addresses are not necessarily even. Therefore, the `vbit', which indicates a pointer to a virtual member function, is stored in the delta field, rather than as - the low bit of a function pointer address. + the low bit of a function pointer address. In order to verify this, see the definition of TARGET_PTRMEMFUNC_VBIT_LOCATION in gcc/defaults.h along with the diff --git a/gdb/m32r-linux-nat.c b/gdb/m32r-linux-nat.c index 4c68284aee0..05f338809dd 100644 --- a/gdb/m32r-linux-nat.c +++ b/gdb/m32r-linux-nat.c @@ -56,8 +56,9 @@ static int regmap[] = { #define SPU_REGMAP 23 #define SPI_REGMAP 26 -/* Doee apply to the corresponding SET requests as well. */ -#define GETREGS_SUPPLIES(regno) (0 <= (regno) && (regno) <= M32R_LINUX_NUM_REGS) +/* Doee (??) apply to the corresponding SET requests as well. */ +#define GETREGS_SUPPLIES(regno) (0 <= (regno) \ + && (regno) <= M32R_LINUX_NUM_REGS) diff --git a/gdb/m32r-rom.c b/gdb/m32r-rom.c index b09ef8f39c6..f5dc7799964 100644 --- a/gdb/m32r-rom.c +++ b/gdb/m32r-rom.c @@ -21,7 +21,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/>. */ -/* This module defines communication with the Renesas m32r monitor */ +/* This module defines communication with the Renesas m32r monitor. */ #include "defs.h" #include "gdbcore.h" @@ -36,7 +36,7 @@ #include <sys/time.h> #include <time.h> /* for time_t */ #include "gdb_string.h" -#include "objfiles.h" /* for ALL_OBJFILES etc. */ +#include "objfiles.h" /* for ALL_OBJFILES etc. */ #include "inferior.h" #include <ctype.h> #include "regcache.h" @@ -174,19 +174,19 @@ m32r_load (char *filename, int from_tty) print_transfer_performance (gdb_stdout, data_count, 0, &start_time, &end_time); - /* Finally, make the PC point at the start address */ + /* Finally, 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. */ /* 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... */ + confused... */ clear_symtab_users (0); } @@ -200,10 +200,10 @@ m32r_load_gen (char *filename, int from_tty) static void m32r_open (char *args, int from_tty); static void mon2000_open (char *args, int from_tty); -/* 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". */ + either. So, typing "info reg sp" becomes an "A7". */ static char *m32r_regnames[] = { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", @@ -227,9 +227,9 @@ m32r_supply_register (struct regcache *regcache, char *regname, return; /* no match */ if (regno == ACCL_REGNUM) - { /* special handling for 64-bit acc reg */ + { /* Special handling for 64-bit acc reg. */ monitor_supply_register (regcache, ACCH_REGNUM, val); - val = strchr (val, ':'); /* skip past ':' to get 2nd word */ + val = strchr (val, ':'); /* Skip past ':' to get 2nd word. */ if (val != NULL) monitor_supply_register (regcache, ACCL_REGNUM, val + 1); } @@ -243,37 +243,45 @@ m32r_supply_register (struct regcache *regcache, char *regname, #ifdef SM_REGNUM /* Stack mode bit */ - monitor_supply_register (regcache, SM_REGNUM, (psw & 0x80) ? one : zero); + monitor_supply_register (regcache, SM_REGNUM, + (psw & 0x80) ? one : zero); #endif #ifdef BSM_REGNUM /* Backup stack mode bit */ - monitor_supply_register (regcache, BSM_REGNUM, (psw & 0x8000) ? one : zero); + monitor_supply_register (regcache, BSM_REGNUM, + (psw & 0x8000) ? one : zero); #endif #ifdef IE_REGNUM /* Interrupt enable bit */ - monitor_supply_register (regcache, IE_REGNUM, (psw & 0x40) ? one : zero); + monitor_supply_register (regcache, IE_REGNUM, + (psw & 0x40) ? one : zero); #endif #ifdef BIE_REGNUM /* Backup interrupt enable bit */ - monitor_supply_register (regcache, BIE_REGNUM, (psw & 0x4000) ? one : zero); + monitor_supply_register (regcache, BIE_REGNUM, + (psw & 0x4000) ? one : zero); #endif #ifdef COND_REGNUM /* Condition bit (carry etc.) */ - monitor_supply_register (regcache, COND_REGNUM, (psw & 0x1) ? one : zero); + monitor_supply_register (regcache, COND_REGNUM, + (psw & 0x1) ? one : zero); #endif #ifdef CBR_REGNUM - monitor_supply_register (regcache, CBR_REGNUM, (psw & 0x1) ? one : zero); + monitor_supply_register (regcache, CBR_REGNUM, + (psw & 0x1) ? one : zero); #endif #ifdef BPC_REGNUM - monitor_supply_register (regcache, BPC_REGNUM, zero); /* KLUDGE: (???????) */ + monitor_supply_register (regcache, BPC_REGNUM, + zero); /* KLUDGE: (???????) */ #endif #ifdef BCARRY_REGNUM - monitor_supply_register (regcache, BCARRY_REGNUM, zero); /* KLUDGE: (??????) */ + monitor_supply_register (regcache, BCARRY_REGNUM, + zero); /* KLUDGE: (??????) */ #endif } if (regno == SPI_REGNUM || regno == SPU_REGNUM) - { /* special handling for stack pointer (spu or spi) */ + { /* special handling for stack pointer (spu or spi). */ ULONGEST stackmode, psw; regcache_cooked_read_unsigned (regcache, PSW_REGNUM, &psw); stackmode = psw & 0x80; @@ -331,7 +339,8 @@ init_m32r_cmds (void) m32r_cmds.getreg.term = NULL; /* getreg.term */ m32r_cmds.getreg.term_cmd = NULL; /* getreg.term_cmd */ m32r_cmds.dump_registers = ".reg\r"; /* dump_registers */ - m32r_cmds.register_pattern = "\\(\\w+\\) += \\([0-9a-fA-F]+\\b\\)"; /* register_pattern */ + /* register_pattern */ + m32r_cmds.register_pattern = "\\(\\w+\\) += \\([0-9a-fA-F]+\\b\\)"; m32r_cmds.supply_register = m32r_supply_register; m32r_cmds.load_routine = NULL; /* load_routine (defaults to SRECs) */ m32r_cmds.load = NULL; /* download command */ @@ -391,7 +400,8 @@ init_mon2000_cmds (void) mon2000_cmds.getreg.term = NULL; /* getreg.term */ mon2000_cmds.getreg.term_cmd = NULL; /* getreg.term_cmd */ mon2000_cmds.dump_registers = ".reg\r"; /* dump_registers */ - mon2000_cmds.register_pattern = "\\(\\w+\\) += \\([0-9a-fA-F]+\\b\\)"; /* register_pattern */ + /* register_pattern */ + mon2000_cmds.register_pattern = "\\(\\w+\\) += \\([0-9a-fA-F]+\\b\\)"; mon2000_cmds.supply_register = m32r_supply_register; mon2000_cmds.load_routine = NULL; /* load_routine (defaults to SRECs) */ mon2000_cmds.load = NULL; /* download command */ @@ -422,7 +432,7 @@ m32r_upload_command (char *args, int from_tty) struct hostent *hostent; struct in_addr inet_addr; - /* first check to see if there's an ethernet port! */ + /* First check to see if there's an ethernet port! */ monitor_printf ("ust\r"); resp_len = monitor_expect_prompt (buf, sizeof (buf)); if (!strchr (buf, ':')) @@ -430,15 +440,15 @@ m32r_upload_command (char *args, int from_tty) if (board_addr == 0) { - /* scan second colon in the output from the "ust" command */ + /* Scan second colon in the output from the "ust" command. */ char *myIPaddress = strchr (strchr (buf, ':') + 1, ':') + 1; while (isspace (*myIPaddress)) myIPaddress++; if (!strncmp (myIPaddress, "0.0.", 4)) /* empty */ - error - ("Please use 'set board-address' to set the M32R-EVA board's IP address."); + error ("Please use 'set board-address' to " + "set the M32R-EVA board's IP address."); if (strchr (myIPaddress, '(')) *(strchr (myIPaddress, '(')) = '\0'; /* delete trailing junk */ board_addr = xstrdup (myIPaddress); @@ -447,7 +457,7 @@ m32r_upload_command (char *args, int from_tty) { #ifdef __MINGW32__ WSADATA wd; - /* Winsock initialization. */ + /* Winsock initialization. */ if (WSAStartup (MAKEWORD (1, 1), &wd)) error (_("Couldn't initialize WINSOCK.")); #endif @@ -468,12 +478,13 @@ m32r_upload_command (char *args, int from_tty) #endif } } - if (server_addr == 0) /* failed? */ - error - ("Need to know gdb host computer's IP address (use 'set server-address')"); + if (server_addr == 0) /* failed? */ + error ("Need to know gdb host computer's " + "IP address (use 'set server-address')"); } - if (args == 0 || args[0] == 0) /* no args: upload the current file */ + if (args == 0 || args[0] == 0) /* No args: upload the current + file. */ args = get_exec_file (1); if (args[0] != '/' && download_path == 0) @@ -481,30 +492,30 @@ m32r_upload_command (char *args, int from_tty) if (current_directory) download_path = xstrdup (current_directory); else - error - ("Need to know default download path (use 'set download-path')"); + error ("Need to know default download " + "path (use 'set download-path')"); } gettimeofday (&start_time, NULL); monitor_printf ("uhip %s\r", server_addr); - resp_len = monitor_expect_prompt (buf, sizeof (buf)); /* parse result? */ + resp_len = monitor_expect_prompt (buf, sizeof (buf)); /* parse result? */ monitor_printf ("ulip %s\r", board_addr); - resp_len = monitor_expect_prompt (buf, sizeof (buf)); /* parse result? */ + resp_len = monitor_expect_prompt (buf, sizeof (buf)); /* parse result? */ if (args[0] != '/') monitor_printf ("up %s\r", download_path); /* use default path */ else monitor_printf ("up\r"); /* rooted filename/path */ - resp_len = monitor_expect_prompt (buf, sizeof (buf)); /* parse result? */ + resp_len = monitor_expect_prompt (buf, sizeof (buf)); /* parse result? */ if (strrchr (args, '.') && !strcmp (strrchr (args, '.'), ".srec")) monitor_printf ("ul %s\r", args); else /* add ".srec" suffix */ monitor_printf ("ul %s.srec\r", args); - resp_len = monitor_expect_prompt (buf, sizeof (buf)); /* parse result? */ + resp_len = monitor_expect_prompt (buf, sizeof (buf)); /* parse result? */ if (buf[0] == 0 || strstr (buf, "complete") == 0) - error - ("Upload file not found: %s.srec\nCheck IP addresses and download path.", + error ("Upload file not found: %s.srec\n" + "Check IP addresses and download path.", args); else printf_filtered (" -- Ethernet load complete.\n"); @@ -512,7 +523,7 @@ m32r_upload_command (char *args, int from_tty) gettimeofday (&end_time, NULL); abfd = bfd_openr (args, 0); if (abfd != NULL) - { /* Download is done -- print section statistics */ + { /* Download is done -- print section statistics. */ if (bfd_check_format (abfd, bfd_object) == 0) { printf_filtered ("File is not an object file\n"); @@ -534,7 +545,7 @@ m32r_upload_command (char *args, int from_tty) printf_filtered ("\n"); gdb_flush (gdb_stdout); } - /* Finally, make the PC point at the start address */ + /* Finally, make the PC point at the start address. */ regcache_write_pc (get_current_regcache (), bfd_get_start_address (abfd)); printf_filtered ("Start address 0x%lx\n", @@ -542,14 +553,14 @@ m32r_upload_command (char *args, int from_tty) print_transfer_performance (gdb_stdout, data_count, 0, &start_time, &end_time); } - inferior_ptid = null_ptid; /* No process now */ + inferior_ptid = null_ptid; /* No process now. */ /* 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... */ + confused... */ clear_symtab_users (0); } @@ -560,13 +571,14 @@ extern initialize_file_ftype _initialize_m32r_rom; void _initialize_m32r_rom (void) { - /* Initialize m32r RevC monitor target */ + /* Initialize m32r RevC monitor target. */ init_m32r_cmds (); init_monitor_ops (&m32r_ops); m32r_ops.to_shortname = "m32r"; m32r_ops.to_longname = "m32r monitor"; - m32r_ops.to_load = m32r_load_gen; /* monitor lacks a download command */ + m32r_ops.to_load = m32r_load_gen; /* Monitor lacks a download + command. */ m32r_ops.to_doc = "Debug via the m32r monitor.\n\ Specify the serial device it is connected to (e.g. /dev/ttya)."; m32r_ops.to_open = m32r_open; @@ -578,7 +590,8 @@ Specify the serial device it is connected to (e.g. /dev/ttya)."; mon2000_ops.to_shortname = "mon2000"; mon2000_ops.to_longname = "Mon2000 monitor"; - mon2000_ops.to_load = m32r_load_gen; /* monitor lacks a download command */ + mon2000_ops.to_load = m32r_load_gen; /* Monitor lacks a download + command. */ mon2000_ops.to_doc = "Debug via the Mon2000 monitor.\n\ Specify the serial device it is connected to (e.g. /dev/ttya)."; mon2000_ops.to_open = mon2000_open; @@ -589,7 +602,8 @@ Set the default path for downloadable SREC files."), _("\ Show the default path for downloadable SREC files."), _("\ Determines the default path for downloadable SREC files."), NULL, - NULL, /* FIXME: i18n: The default path for downloadable SREC files is %s. */ + NULL, /* FIXME: i18n: The default path for + downloadable SREC files is %s. */ &setlist, &showlist); add_setshow_string_cmd ("board-address", class_obscure, &board_addr, _("\ @@ -597,7 +611,8 @@ Set IP address for M32R-EVA target board."), _("\ Show IP address for M32R-EVA target board."), _("\ Determine the IP address for M32R-EVA target board."), NULL, - NULL, /* FIXME: i18n: IP address for M32R-EVA target board is %s. */ + NULL, /* FIXME: i18n: IP address for + M32R-EVA target board is %s. */ &setlist, &showlist); add_setshow_string_cmd ("server-address", class_obscure, &server_addr, _("\ @@ -605,7 +620,9 @@ Set IP address for download server (GDB's host computer)."), _("\ Show IP address for download server (GDB's host computer)."), _("\ Determine the IP address for download server (GDB's host computer)."), NULL, - NULL, /* FIXME: i18n: IP address for download server (GDB's host computer) is %s. */ + NULL, /* FIXME: i18n: IP address for + download server (GDB's host + computer) is %s. */ &setlist, &showlist); add_com ("upload", class_obscure, m32r_upload_command, _("\ diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c index c18b7054f66..f629ca1b5f4 100644 --- a/gdb/m32r-tdep.c +++ b/gdb/m32r-tdep.c @@ -57,7 +57,7 @@ m32r_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp) /* Breakpoints - The little endian mode of M32R is unique. In most of architectures, + The little endian mode of M32R is unique. In most of architectures, two 16-bit instructions, A and B, are placed as the following: Big endian: @@ -76,7 +76,7 @@ m32r_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp) This is because M32R always fetches instructions in 32-bit. - The following functions take care of this behavior. */ + The following functions take care of this behavior. */ static int m32r_memory_insert_breakpoint (struct gdbarch *gdbarch, @@ -168,10 +168,15 @@ m32r_memory_remove_breakpoint (struct gdbarch *gdbarch, } static const gdb_byte * -m32r_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr) +m32r_breakpoint_from_pc (struct gdbarch *gdbarch, + CORE_ADDR *pcptr, int *lenptr) { - static gdb_byte be_bp_entry[] = { 0x10, 0xf1, 0x70, 0x00 }; /* dpt -> nop */ - static gdb_byte le_bp_entry[] = { 0x00, 0x70, 0xf1, 0x10 }; /* dpt -> nop */ + static gdb_byte be_bp_entry[] = { + 0x10, 0xf1, 0x70, 0x00 + }; /* dpt -> nop */ + static gdb_byte le_bp_entry[] = { + 0x00, 0x70, 0xf1, 0x10 + }; /* dpt -> nop */ gdb_byte *bp; /* Determine appropriate breakpoint. */ @@ -240,9 +245,9 @@ m32r_register_type (struct gdbarch *gdbarch, int reg_nr) /* Write into appropriate registers a function return value - of type TYPE, given in virtual format. + of type TYPE, given in virtual format. - Things always get returned in RET1_REGNUM, RET2_REGNUM. */ + Things always get returned in RET1_REGNUM, RET2_REGNUM. */ static void m32r_store_return_value (struct type *type, struct regcache *regcache, @@ -264,7 +269,7 @@ m32r_store_return_value (struct type *type, struct regcache *regcache, } } -/* This is required by skip_prologue. The results of decoding a prologue +/* This is required by skip_prologue. The results of decoding a prologue should be cached because this thrashing is getting nuts. */ static int @@ -287,7 +292,7 @@ decode_prologue (struct gdbarch *gdbarch, for (current_pc = start_pc; current_pc < scan_limit; current_pc += 2) { - /* Check if current pc's location is readable. */ + /* Check if current pc's location is readable. */ if (!safe_read_memory_integer (current_pc, 2, byte_order, &return_value)) return -1; @@ -297,10 +302,10 @@ decode_prologue (struct gdbarch *gdbarch, break; /* If this is a 32 bit instruction, we dont want to examine its - immediate data as though it were an instruction */ + immediate data as though it were an instruction. */ if (current_pc & 0x02) { - /* decode this instruction further */ + /* Decode this instruction further. */ insn &= 0x7fff; } else @@ -312,7 +317,7 @@ decode_prologue (struct gdbarch *gdbarch, current_pc += 2; /* skip the immediate data */ - /* Check if current pc's location is readable. */ + /* Check if current pc's location is readable. */ if (!safe_read_memory_integer (current_pc, 2, byte_order, &return_value)) return -1; @@ -326,15 +331,15 @@ decode_prologue (struct gdbarch *gdbarch, } else { - if (((insn >> 8) == 0xe4) /* ld24 r4, xxxxxx; sub sp, r4 */ + if (((insn >> 8) == 0xe4) /* ld24 r4, xxxxxx; sub sp, r4 */ && safe_read_memory_integer (current_pc + 2, 2, byte_order, &return_value) && read_memory_unsigned_integer (current_pc + 2, 2, byte_order) == 0x0f24) - /* subtract 24 bit sign-extended negative-offset */ { + /* Subtract 24 bit sign-extended negative-offset. */ insn = read_memory_unsigned_integer (current_pc - 2, 4, byte_order); if (insn & 0x00800000) /* sign extend */ @@ -348,7 +353,7 @@ decode_prologue (struct gdbarch *gdbarch, continue; } } - op1 = insn & 0xf000; /* isolate just the first nibble */ + op1 = insn & 0xf000; /* Isolate just the first nibble. */ if ((insn & 0xf0ff) == 0x207f) { /* st reg, @-sp */ @@ -359,7 +364,7 @@ decode_prologue (struct gdbarch *gdbarch, continue; } if ((insn >> 8) == 0x4f) /* addi sp, xx */ - /* add 8 bit sign-extended offset */ + /* Add 8 bit sign-extended offset. */ { int stack_adjust = (signed char) (insn & 0xff); @@ -384,25 +389,25 @@ decode_prologue (struct gdbarch *gdbarch, break; /* end of stack adjustments */ } - /* Nop looks like a branch, continue explicitly */ + /* Nop looks like a branch, continue explicitly. */ if (insn == 0x7000) { after_prologue = current_pc + 2; - continue; /* nop occurs between pushes */ + continue; /* nop occurs between pushes. */ } - /* End of prolog if any of these are trap instructions */ + /* End of prolog if any of these are trap instructions. */ if ((insn & 0xfff0) == 0x10f0) { after_prologue = current_pc; break; } - /* End of prolog if any of these are branch instructions */ + /* End of prolog if any of these are branch instructions. */ if ((op1 == 0x7000) || (op1 == 0xb000) || (op1 == 0xf000)) { after_prologue = current_pc; continue; } - /* Some of the branch instructions are mixed with other types */ + /* Some of the branch instructions are mixed with other types. */ if (op1 == 0x1000) { int subop = insn & 0x0ff0; @@ -424,22 +429,23 @@ decode_prologue (struct gdbarch *gdbarch, if (after_stack_adjust != 0) /* We did not find a "mv fp,sp", but we DID find a stack_adjust. Is it safe to use that as the - end of the prologue? I just don't know. */ + end of the prologue? I just don't know. */ { *pl_endptr = after_stack_adjust; } else if (after_push != 0) /* We did not find a "mv fp,sp", but we DID find a push. Is it safe to use that as the - end of the prologue? I just don't know. */ + end of the prologue? I just don't know. */ { *pl_endptr = after_push; } else /* We reached the end of the loop without finding the end - of the prologue. No way to win -- we should report failure. - The way we do that is to return the original start_pc. - GDB will set a breakpoint at the start of the function (etc.) */ + of the prologue. No way to win -- we should report + failure. The way we do that is to return the original + start_pc. GDB will set a breakpoint at the start of + the function (etc.) */ *pl_endptr = start_pc; } return 0; @@ -455,7 +461,7 @@ decode_prologue (struct gdbarch *gdbarch, } /* decode_prologue */ /* Function: skip_prologue - Find end of function prologue */ + Find end of function prologue. */ #define DEFAULT_SEARCH_LIMIT 128 @@ -467,7 +473,7 @@ m32r_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) struct symtab_and_line sal; LONGEST return_value; - /* See what the symbol table says */ + /* See what the symbol table says. */ if (find_pc_partial_function (pc, NULL, &func_addr, &func_end)) { @@ -488,7 +494,7 @@ m32r_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) else func_end = pc + DEFAULT_SEARCH_LIMIT; - /* If pc's location is not readable, just quit. */ + /* If pc's location is not readable, just quit. */ if (!safe_read_memory_integer (pc, 4, byte_order, &return_value)) return pc; @@ -521,7 +527,7 @@ struct m32r_unwind_cache the saved registers of frame described by FRAME_INFO. This includes special registers such as pc and fp saved in special ways in the stack frame. sp is even more special: the address we return - for it IS the sp for the next frame. */ + for it IS the sp for the next frame. */ static struct m32r_unwind_cache * m32r_frame_unwind_cache (struct frame_info *this_frame, @@ -603,8 +609,8 @@ m32r_frame_unwind_cache (struct frame_info *this_frame, } else if ((op & 0xfff0) == 0x10f0) { - /* end of prologue if this is a trap instruction */ - break; /* end of stack adjustments */ + /* End of prologue if this is a trap instruction. */ + break; /* End of stack adjustments. */ } } @@ -692,7 +698,7 @@ m32r_push_dummy_call (struct gdbarch *gdbarch, struct value *function, int len; int odd_sized_struct; - /* first force sp to a 4-byte alignment */ + /* First force sp to a 4-byte alignment. */ sp = sp & ~3; /* Set the return address. For the m32r, the return breakpoint is @@ -708,10 +714,10 @@ m32r_push_dummy_call (struct gdbarch *gdbarch, struct value *function, argreg++; } - /* Now make sure there's space on the stack */ + /* Now make sure there's space on the stack. */ for (argnum = 0, stack_alloc = 0; argnum < nargs; argnum++) stack_alloc += ((TYPE_LENGTH (value_type (args[argnum])) + 3) & ~3); - sp -= stack_alloc; /* make room on stack for args */ + sp -= stack_alloc; /* Make room on stack for args. */ for (argnum = 0, stack_offset = 0; argnum < nargs; argnum++) { @@ -733,7 +739,7 @@ m32r_push_dummy_call (struct gdbarch *gdbarch, struct value *function, } else if (len < 4) { - /* value gets right-justified in the register or stack word */ + /* Value gets right-justified in the register or stack word. */ memcpy (valbuf + (register_size (gdbarch, argreg) - len), (gdb_byte *) value_contents (args[argnum]), len); val = valbuf; @@ -745,13 +751,13 @@ m32r_push_dummy_call (struct gdbarch *gdbarch, struct value *function, { if (argreg > ARGN_REGNUM) { - /* must go on the stack */ + /* Must go on the stack. */ write_memory (sp + stack_offset, val, 4); stack_offset += 4; } else if (argreg <= ARGN_REGNUM) { - /* there's room in a register */ + /* There's room in a register. */ regval = extract_unsigned_integer (val, register_size (gdbarch, argreg), @@ -793,7 +799,7 @@ m32r_extract_return_value (struct type *type, struct regcache *regcache, store_unsigned_integer (valbuf, (len > 4 ? len - 4 : len), byte_order, tmp); /* Ignore return values more than 8 bytes in size because the m32r - returns anything more than 8 bytes in the stack. */ + returns anything more than 8 bytes in the stack. */ if (len > 4) { regcache_cooked_read_unsigned (regcache, RET1_REGNUM + 1, &tmp); @@ -924,7 +930,7 @@ m32r_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_write_pc (gdbarch, m32r_write_pc); set_gdbarch_unwind_sp (gdbarch, m32r_unwind_sp); - set_gdbarch_num_regs (gdbarch, M32R_NUM_REGS); + set_gdbarch_sp_regnum (gdbarch, M32R_SP_REGNUM); set_gdbarch_register_name (gdbarch, m32r_register_name); set_gdbarch_register_type (gdbarch, m32r_register_type); diff --git a/gdb/m32r-tdep.h b/gdb/m32r-tdep.h index af949d036b0..0e122295d4d 100644 --- a/gdb/m32r-tdep.h +++ b/gdb/m32r-tdep.h @@ -23,10 +23,10 @@ struct gdbarch_tdep { - /* gdbarch target dependent data here. Currently unused for M32R. */ + /* gdbarch target dependent data here. Currently unused for M32R. */ }; -/* m32r register names. */ +/* m32r register names. */ enum m32r_regnum { @@ -40,7 +40,7 @@ enum m32r_regnum SPU_REGNUM = 18, SPI_REGNUM = 19, M32R_PC_REGNUM = 21, - /* m32r calling convention. */ + /* m32r calling convention. */ ARG1_REGNUM = R0_REGNUM, ARGN_REGNUM = R3_REGNUM, RET1_REGNUM = R0_REGNUM, diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c index 7d5e5534503..005a01f5474 100644 --- a/gdb/m68hc11-tdep.c +++ b/gdb/m68hc11-tdep.c @@ -58,10 +58,10 @@ MSYMBOL_IS_RTC Tests the "RTC" bit in a minimal symbol. MSYMBOL_IS_RTI Tests the "RTC" bit in a minimal symbol. */ -#define MSYMBOL_SET_RTC(msym) \ +#define MSYMBOL_SET_RTC(msym) \ MSYMBOL_TARGET_FLAG_1 (msym) = 1 -#define MSYMBOL_SET_RTI(msym) \ +#define MSYMBOL_SET_RTI(msym) \ MSYMBOL_TARGET_FLAG_2 (msym) = 1 #define MSYMBOL_IS_RTC(msym) \ @@ -398,9 +398,8 @@ m68hc11_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, } -/* 68HC11 & 68HC12 prologue analysis. +/* 68HC11 & 68HC12 prologue analysis. */ - */ #define MAX_CODES 12 /* 68HC11 opcodes. */ @@ -673,8 +672,8 @@ m68hc11_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, We limit the search to 128 bytes so that the algorithm is bounded in case of random and wrong code. We also stop and abort if we find an instruction which is not supposed to appear in the - prologue (as generated by gcc 2.95, 2.96). - */ + prologue (as generated by gcc 2.95, 2.96). */ + func_end = pc + 128; found_frame_point = 0; info->size = 0; @@ -767,7 +766,8 @@ m68hc11_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) { ULONGEST pc; - pc = frame_unwind_register_unsigned (next_frame, gdbarch_pc_regnum (gdbarch)); + pc = frame_unwind_register_unsigned (next_frame, + gdbarch_pc_regnum (gdbarch)); return pc; } @@ -775,7 +775,7 @@ m68hc11_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) the saved registers of frame described by FRAME_INFO. This includes special registers such as pc and fp saved in special ways in the stack frame. sp is even more special: the address we return - for it IS the sp for the next frame. */ + for it IS the sp for the next frame. */ static struct m68hc11_unwind_cache * m68hc11_frame_unwind_cache (struct frame_info *this_frame, @@ -851,7 +851,7 @@ m68hc11_frame_unwind_cache (struct frame_info *this_frame, } /* Add 1 here to adjust for the post-decrement nature of the push - instruction.*/ + instruction. */ info->prev_sp = prev_sp; info->base = this_base; @@ -1065,7 +1065,7 @@ m68hc11_print_register (struct gdbarch *gdbarch, struct ui_file *file, V = (l & M6811_V_BIT) != 0; C = (l & M6811_C_BIT) != 0; - /* Print flags following the h8300 */ + /* Print flags following the h8300. */ if ((C | Z) == 0) fprintf_filtered (file, "u> "); else if ((C | Z) == 1) @@ -1439,7 +1439,7 @@ m68hc11_gdbarch_init (struct gdbarch_info info, else elf_flags = 0; - /* try to find a pre-existing architecture */ + /* Try to find a pre-existing architecture. */ for (arches = gdbarch_list_lookup_by_info (arches, &info); arches != NULL; arches = gdbarch_list_lookup_by_info (arches->next, &info)) @@ -1450,7 +1450,7 @@ m68hc11_gdbarch_init (struct gdbarch_info info, return arches->gdbarch; } - /* Need a new architecture. Fill in a target specific vector. */ + /* Need a new architecture. Fill in a target specific vector. */ tdep = (struct gdbarch_tdep *) xmalloc (sizeof (struct gdbarch_tdep)); gdbarch = gdbarch_alloc (&info, tdep); tdep->elf_flags = elf_flags; @@ -1549,7 +1549,8 @@ m68hc11_gdbarch_init (struct gdbarch_info info, return gdbarch; } -extern initialize_file_ftype _initialize_m68hc11_tdep; /* -Wmissing-prototypes */ +/* -Wmissing-prototypes */ +extern initialize_file_ftype _initialize_m68hc11_tdep; void _initialize_m68hc11_tdep (void) diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c index 4533d0a7db4..082cb84ff80 100644 --- a/gdb/m68k-tdep.c +++ b/gdb/m68k-tdep.c @@ -54,7 +54,7 @@ #define P_MOVEL_SP 0x2f00 #define P_MOVEML_SP 0x48e7 -/* Offset from SP to first arg on stack at first instruction of a function */ +/* Offset from SP to first arg on stack at first instruction of a function. */ #define SP_ARG0 (1 * 4) #if !defined (BPT_VECTOR) @@ -171,14 +171,15 @@ static const char *m68k_register_names[] = { }; /* Function: m68k_register_name - Returns the name of the standard m68k register regnum. */ + Returns the name of the standard m68k register regnum. */ static const char * m68k_register_name (struct gdbarch *gdbarch, int regnum) { if (regnum < 0 || regnum >= ARRAY_SIZE (m68k_register_names)) internal_error (__FILE__, __LINE__, - _("m68k_register_name: illegal register number %d"), regnum); + _("m68k_register_name: illegal register number %d"), + regnum); else if (regnum >= M68K_FP0_REGNUM && regnum <= M68K_FPI_REGNUM && gdbarch_tdep (gdbarch)->fpregs_present == 0) return ""; @@ -190,7 +191,8 @@ m68k_register_name (struct gdbarch *gdbarch, int regnum) needs any special handling. */ static int -m68k_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type) +m68k_convert_register_p (struct gdbarch *gdbarch, + int regnum, struct type *type) { if (!gdbarch_tdep (gdbarch)->fpregs_present) return 0; @@ -1002,7 +1004,7 @@ m68k_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame) /* Figure out where the longjmp will land. Slurp the args out of the stack. We expect the first arg to be a pointer to the jmp_buf structure from which we extract the pc (JB_PC) that we will land at. The pc is copied into PC. - This routine returns true on success. */ + This routine returns true on success. */ static int m68k_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc) @@ -1023,7 +1025,7 @@ m68k_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc) buf = alloca (gdbarch_ptr_bit (gdbarch) / TARGET_CHAR_BIT); sp = get_frame_register_unsigned (frame, gdbarch_sp_regnum (gdbarch)); - if (target_read_memory (sp + SP_ARG0, /* Offset of first arg on stack */ + if (target_read_memory (sp + SP_ARG0, /* Offset of first arg on stack. */ buf, gdbarch_ptr_bit (gdbarch) / TARGET_CHAR_BIT)) return 0; @@ -1058,7 +1060,7 @@ m68k_svr4_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) /* Function: m68k_gdbarch_init Initializer function for the m68k gdbarch vector. - Called by gdbarch. Sets up the gdbarch vector(s) for this target. */ + Called by gdbarch. Sets up the gdbarch vector(s) for this target. */ static struct gdbarch * m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) @@ -1136,7 +1138,7 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* The mechanism for returning floating values from function and the type of long double depend on whether we're - on ColdFire or standard m68k. */ + on ColdFire or standard m68k. */ if (info.bfd_arch_info && info.bfd_arch_info->mach != 0) { @@ -1183,7 +1185,7 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_skip_prologue (gdbarch, m68k_skip_prologue); set_gdbarch_breakpoint_from_pc (gdbarch, m68k_local_breakpoint_from_pc); - /* Stack grows down. */ + /* Stack grows down. */ set_gdbarch_inner_than (gdbarch, core_addr_lessthan); set_gdbarch_frame_align (gdbarch, m68k_frame_align); @@ -1223,7 +1225,7 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) tdep->float_return = 0; } - /* Function call & return */ + /* Function call & return. */ set_gdbarch_push_dummy_call (gdbarch, m68k_push_dummy_call); set_gdbarch_return_value (gdbarch, m68k_return_value); diff --git a/gdb/m68klinux-nat.c b/gdb/m68klinux-nat.c index 43c3d6c0426..348f2cf58e1 100644 --- a/gdb/m68klinux-nat.c +++ b/gdb/m68klinux-nat.c @@ -50,7 +50,7 @@ #include "target.h" -/* Prototypes for supply_gregset etc. */ +/* Prototypes for supply_gregset etc. */ #include "gregset.h" /* This table must line up with gdbarch_register_name in "m68k-tdep.c". */ @@ -106,10 +106,11 @@ fetch_register (struct regcache *regcache, int regno) char buf[MAX_REGISTER_SIZE]; int tid; - /* Overload thread id onto process id */ + /* Overload thread id onto process id. */ tid = TIDGET (inferior_ptid); if (tid == 0) - tid = PIDGET (inferior_ptid); /* no thread id, just use process id */ + tid = PIDGET (inferior_ptid); /* no thread id, just use + process id. */ regaddr = 4 * regmap[regno]; for (i = 0; i < register_size (gdbarch, regno); i += sizeof (long)) @@ -127,7 +128,7 @@ fetch_register (struct regcache *regcache, int regno) /* Fetch register values from the inferior. If REGNO is negative, do this for all registers. - Otherwise, REGNO specifies which register (so we can save time). */ + Otherwise, REGNO specifies which register (so we can save time). */ static void old_fetch_inferior_registers (struct regcache *regcache, int regno) @@ -147,7 +148,7 @@ old_fetch_inferior_registers (struct regcache *regcache, int regno) } } -/* Store one register. */ +/* Store one register. */ static void store_register (const struct regcache *regcache, int regno) @@ -158,17 +159,18 @@ store_register (const struct regcache *regcache, int regno) int tid; char buf[MAX_REGISTER_SIZE]; - /* Overload thread id onto process id */ + /* Overload thread id onto process id. */ tid = TIDGET (inferior_ptid); if (tid == 0) - tid = PIDGET (inferior_ptid); /* no thread id, just use process id */ + tid = PIDGET (inferior_ptid); /* no thread id, just use + process id. */ regaddr = 4 * regmap[regno]; - /* Put the contents of regno into a local buffer */ + /* Put the contents of regno into a local buffer. */ regcache_raw_collect (regcache, regno, buf); - /* Store the local buffer into the inferior a chunk at the time. */ + /* Store the local buffer into the inferior a chunk at the time. */ for (i = 0; i < register_size (gdbarch, regno); i += sizeof (long)) { errno = 0; @@ -205,7 +207,7 @@ old_store_inferior_registers (const struct regcache *regcache, int regno) /* Given a pointer to a general register set in /proc format (elf_gregset_t *), unpack the register contents and supply - them as gdb's idea of the current register values. */ + them as gdb's idea of the current register values. */ void supply_gregset (struct regcache *regcache, const elf_gregset_t *gregsetp) @@ -284,8 +286,13 @@ store_regs (const struct regcache *regcache, int tid, int regno) #else -static void fetch_regs (struct regcache *regcache, int tid) {} -static void store_regs (const struct regcache *regcache, int tid, int regno) {} +static void fetch_regs (struct regcache *regcache, int tid) +{ +} + +static void store_regs (const struct regcache *regcache, int tid, int regno) +{ +} #endif @@ -375,8 +382,13 @@ store_fpregs (const struct regcache *regcache, int tid, int regno) #else -static void fetch_fpregs (struct regcache *regcache, int tid) {} -static void store_fpregs (const struct regcache *regcache, int tid, int regno) {} +static void fetch_fpregs (struct regcache *regcache, int tid) +{ +} + +static void store_fpregs (const struct regcache *regcache, int tid, int regno) +{ +} #endif @@ -403,7 +415,7 @@ m68k_linux_fetch_inferior_registers (struct target_ops *ops, /* GNU/Linux LWP ID's are process ID's. */ tid = TIDGET (inferior_ptid); if (tid == 0) - tid = PIDGET (inferior_ptid); /* Not a threaded program. */ + tid = PIDGET (inferior_ptid); /* Not a threaded program. */ /* Use the PTRACE_GETFPXREGS request whenever possible, since it transfers more registers in one system call, and we'll cache the diff --git a/gdb/m88k-tdep.c b/gdb/m88k-tdep.c index 0823d404163..76dcbe14018 100644 --- a/gdb/m88k-tdep.c +++ b/gdb/m88k-tdep.c @@ -68,7 +68,7 @@ m88k_register_name (struct gdbarch *gdbarch, int regnum) } /* Return the GDB type object for the "standard" data type of data in - register REGNUM. */ + register REGNUM. */ static struct type * m88k_register_type (struct gdbarch *gdbarch, int regnum) @@ -859,7 +859,7 @@ m88k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_push_dummy_call (gdbarch, m88k_push_dummy_call); set_gdbarch_dummy_id (gdbarch, m88k_dummy_id); - /* Return value info */ + /* Return value info. */ set_gdbarch_return_value (gdbarch, m88k_return_value); set_gdbarch_addr_bits_remove (gdbarch, m88k_addr_bits_remove); diff --git a/gdb/m88k-tdep.h b/gdb/m88k-tdep.h index 0abbbe5ec77..c68dc7b1ae1 100644 --- a/gdb/m88k-tdep.h +++ b/gdb/m88k-tdep.h @@ -31,7 +31,7 @@ enum m88k_regnum M88K_R3_REGNUM, M88K_R12_REGNUM = 12, M88K_R30_REGNUM = 30, /* Frame pointer. */ - M88K_R31_REGNUM, /* Stack pointer. */ + M88K_R31_REGNUM, /* Stack pointer. */ M88K_EPSR_REGNUM, M88K_FPSR_REGNUM, M88K_FPCR_REGNUM, diff --git a/gdb/machoread.c b/gdb/machoread.c index a5133a2b78d..ad33f63a638 100644 --- a/gdb/machoread.c +++ b/gdb/machoread.c @@ -44,8 +44,8 @@ static int mach_o_debug_level = 0; during the link. Each time an oso (other source) is found in the executable, the reader creates such a structure. They are read after the processing of the - executable. -*/ + executable. */ + typedef struct oso_el { /* Object file name. */ @@ -206,7 +206,7 @@ macho_symtab_read (struct objfile *objfile, if (sym->name == NULL || *sym->name == '\0') { /* Skip names that don't exist (shouldn't happen), or names - that are null strings (may happen). */ + that are null strings (may happen). */ continue; } @@ -215,12 +215,12 @@ macho_symtab_read (struct objfile *objfile, struct minimal_symbol *msym; CORE_ADDR symaddr; - /* Bfd symbols are section relative. */ + /* Bfd symbols are section relative. */ symaddr = sym->value + sym->section->vma; /* Select global/local/weak symbols. Note that bfd puts abs symbols in their own section, so all symbols we are - interested in will have a section. */ + interested in will have a section. */ /* Relocate all non-absolute and non-TLS symbols by the section offset. */ if (sym->section != &bfd_abs_section @@ -258,7 +258,7 @@ macho_symtab_read (struct objfile *objfile, ms_type = mst_unknown; } else - continue; /* Skip this symbol. */ + continue; /* Skip this symbol. */ gdb_assert (sym->section->index < nbr_sections); if (oso_file != NULL diff --git a/gdb/macrocmd.c b/gdb/macrocmd.c index 68330eeccd0..c77156a416a 100644 --- a/gdb/macrocmd.c +++ b/gdb/macrocmd.c @@ -299,7 +299,7 @@ macro_define_command (char *exp, int from_tty) { alloced *= 2; argv = (char **) xrealloc (argv, alloced * sizeof (char *)); - /* Must update new_macro as well... */ + /* Must update new_macro as well... */ new_macro.argv = (const char * const *) argv; } argv[new_macro.argc] = extract_identifier (&exp, 1); diff --git a/gdb/macroexp.c b/gdb/macroexp.c index ddb6b329f4f..a42442417c5 100644 --- a/gdb/macroexp.c +++ b/gdb/macroexp.c @@ -206,7 +206,7 @@ set_token (struct macro_buffer *tok, char *start, char *end) init_shared_buffer (tok, start, end - start); tok->last_token = 0; - /* Presumed; get_identifier may overwrite this. */ + /* Presumed; get_identifier may overwrite this. */ tok->is_identifier = 0; } @@ -704,7 +704,7 @@ struct macro_name_list { particular macro, and otherwise delegates the decision to another function/baton pair. But that makes the linked list of excluded macros chained through untyped baton pointers, which will make it - harder to debug. :( */ + harder to debug. :( */ static int currently_rescanning (struct macro_name_list *list, const char *name) { @@ -1141,7 +1141,7 @@ substitute_args (struct macro_buffer *dest, its expansion to DEST. SRC is the input text following the ID token. We are currently rescanning the expansions of the macros named in NO_LOOP; don't re-expand them. Use LOOKUP_FUNC and - LOOKUP_BATON to find definitions for any nested macro references. + LOOKUP_BATON to find definitions for any nested macro references. Return 1 if we decided to expand it, zero otherwise. (If it's a function-like macro name that isn't followed by an argument list, diff --git a/gdb/macrotab.c b/gdb/macrotab.c index 4a6aacda18b..84c53c257fc 100644 --- a/gdb/macrotab.c +++ b/gdb/macrotab.c @@ -160,7 +160,7 @@ struct macro_key struct macro_table *table; /* The name of the macro. This is in the table's bcache, if it has - one. */ + one. */ const char *name; /* The source file and line number where the definition's scope diff --git a/gdb/main.c b/gdb/main.c index 69f22981442..6be4805b567 100644 --- a/gdb/main.c +++ b/gdb/main.c @@ -186,7 +186,7 @@ get_init_files (char **system_gdbinit, /* If the .gdbinit file in the current directory is the same as the $HOME/.gdbinit file, it should not be sourced. homebuf - and cwdbuf are used in that purpose. Make sure that the stats + and cwdbuf are used in that purpose. Make sure that the stats are zero in case one of them fails (this guarantees that they won't match if either exists). */ @@ -235,7 +235,7 @@ captured_command_loop (void *data) check to detect bad FUNCs code. */ do_cleanups (ALL_CLEANUPS); /* If the command_loop returned, normally (rather than threw an - error) we try to quit. If the quit is aborted, catch_errors() + error) we try to quit. If the quit is aborted, catch_errors() which called this catch the signal and restart the command loop. */ quit_command (NULL, instream == stdin); @@ -515,7 +515,8 @@ captured_main (void *data) break; case 'f': annotation_level = 1; -/* We have probably been invoked from emacs. Disable window interface. */ + /* We have probably been invoked from emacs. Disable + window interface. */ use_windows = 0; break; case 's': @@ -714,7 +715,7 @@ captured_main (void *data) (optind == argc - 1) ? "" : " ..."); } - /* Lookup gdbinit files. Note that the gdbinit file name may be + /* Lookup gdbinit files. Note that the gdbinit file name may be overriden during file initialization, so get_init_files should be called after gdb_init. */ get_init_files (&system_gdbinit, &home_gdbinit, &local_gdbinit); diff --git a/gdb/maint.c b/gdb/maint.c index 52652c5626f..60245f6c4ba 100644 --- a/gdb/maint.c +++ b/gdb/maint.c @@ -117,7 +117,7 @@ maintenance_dump_me (char *args, int from_tty) /* Stimulate the internal error mechanism that GDB uses when an internal problem is detected. Allows testing of the mechanism. Also useful when the user wants to drop a core file but not exit - GDB. */ + GDB. */ static void maintenance_internal_error (char *args, int from_tty) @@ -128,7 +128,7 @@ maintenance_internal_error (char *args, int from_tty) /* Stimulate the internal error mechanism that GDB uses when an internal problem is detected. Allows testing of the mechanism. Also useful when the user wants to drop a core file but not exit - GDB. */ + GDB. */ static void maintenance_internal_warning (char *args, int from_tty) @@ -142,7 +142,7 @@ maintenance_internal_warning (char *args, int from_tty) debuggee's process space, and have gdb fetch and demangle that string. If we have a char* pointer "ptr" that points to a string, we might want to be able to given just the name and have GDB - demangle and print what it points to, etc. (FIXME) */ + demangle and print what it points to, etc. (FIXME) */ static void maintenance_demangle (char *args, int from_tty) @@ -210,12 +210,12 @@ match_substring (const char *string, const char *substr) while ((tok = strstr (string, substr)) != NULL) { - /* Got a partial match. Is it a whole word? */ + /* Got a partial match. Is it a whole word? */ if (tok == string || tok[-1] == ' ' || tok[-1] == '\t') { - /* Token is delimited at the front... */ + /* Token is delimited at the front... */ if (tok[substr_len] == ' ' || tok[substr_len] == '\t' || tok[substr_len] == '\0') @@ -449,8 +449,7 @@ maintenance_print_command (char *arg, int from_tty) /* The "maintenance translate-address" command converts a section and address to a symbol. This can be called in two ways: maintenance translate-address <secname> <addr> - or maintenance translate-address <addr> - */ + or maintenance translate-address <addr>. */ static void maintenance_translate_address (char *arg, int from_tty) @@ -468,14 +467,14 @@ maintenance_translate_address (char *arg, int from_tty) p = arg; if (!isdigit (*p)) - { /* See if we have a valid section name */ - while (*p && !isspace (*p)) /* Find end of section name */ + { /* See if we have a valid section name. */ + while (*p && !isspace (*p)) /* Find end of section name. */ p++; - if (*p == '\000') /* End of command? */ + if (*p == '\000') /* End of command? */ error (_("Need to specify <section-name> and <address>")); *p++ = '\000'; while (isspace (*p)) - p++; /* Skip whitespace */ + p++; /* Skip whitespace. */ ALL_OBJSECTIONS (objfile, sect) { @@ -535,7 +534,7 @@ maintenance_translate_address (char *arg, int from_tty) /* When a command is deprecated the user will be warned the first time the command is used. If possible, a replacement will be - offered. */ + offered. */ static void maintenance_deprecate (char *args, int from_tty) @@ -565,7 +564,7 @@ the command you want to undeprecate.\n")); } -/* You really shouldn't be using this. It is just for the testsuite. +/* You really shouldn't be using this. It is just for the testsuite. Rather, you should use deprecate_cmd() when the command is created in _initialize_blah(). @@ -595,7 +594,7 @@ maintenance_do_deprecate (char *text, int deprecate) if (deprecate) { - /* look for a replacement command */ + /* Look for a replacement command. */ start_ptr = strchr (text, '\"'); if (start_ptr != NULL) { @@ -618,7 +617,7 @@ maintenance_do_deprecate (char *text, int deprecate) Note the MALLOCED_REPLACEMENT test. If the command's replacement string was allocated at compile time we don't want to free the - memory. */ + memory. */ if (alias) { if (alias->flags & MALLOCED_REPLACEMENT) diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index 01e68ab223c..0159b89964d 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -61,17 +61,17 @@ #include "bfd.h" -#include "coff/ecoff.h" /* COFF-like aspects of ecoff files */ +#include "coff/ecoff.h" /* COFF-like aspects of ecoff files. */ #include "libaout.h" /* Private BFD a.out information. */ #include "aout/aout64.h" -#include "aout/stab_gnu.h" /* STABS information */ +#include "aout/stab_gnu.h" /* STABS information. */ #include "expression.h" extern void _initialize_mdebugread (void); -/* Provide a way to test if we have both ECOFF and ELF symbol tables. +/* Provide a way to test if we have both ECOFF and ELF symbol tables. We use this define in order to know whether we should override a symbol's ECOFF section with its ELF section. This is necessary in case the symbol's ELF section could not be represented in ECOFF. */ @@ -119,7 +119,7 @@ struct symloc #define SC_IS_SBSS(sc) ((sc) == scSBss) #define SC_IS_UNDEF(sc) ((sc) == scUndefined || (sc) == scSUndefined) -/* Various complaints about symbol reading that don't abort the process */ +/* Various complaints about symbol reading that don't abort the process. */ static void index_complaint (const char *arg1) { @@ -159,18 +159,18 @@ unexpected_type_code_complaint (const char *arg1) complaint (&symfile_complaints, _("unexpected type code for %s"), arg1); } -/* Macros and extra defs */ +/* Macros and extra defs. */ -/* Puns: hard to find whether -g was used and how */ +/* Puns: hard to find whether -g was used and how. */ #define MIN_GLEVEL GLEVEL_0 #define compare_glevel(a,b) \ (((a) == GLEVEL_3) ? ((b) < GLEVEL_3) : \ ((b) == GLEVEL_3) ? -1 : (int)((b) - (a))) -/* Things that really are local to this module */ +/* Things that really are local to this module. */ -/* Remember what we deduced to be the source language of this psymtab. */ +/* Remember what we deduced to be the source language of this psymtab. */ static enum language psymtab_language = language_unknown; @@ -186,22 +186,22 @@ static const struct ecoff_debug_swap *debug_swap; static struct ecoff_debug_info *debug_info; -/* Pointer to current file decriptor record, and its index */ +/* Pointer to current file decriptor record, and its index. */ static FDR *cur_fdr; static int cur_fd; -/* Index of current symbol */ +/* Index of current symbol. */ static int cur_sdx; /* Note how much "debuggable" this image is. We would like - to see at least one FDR with full symbols */ + to see at least one FDR with full symbols. */ static int max_gdbinfo; static int max_glevel; -/* When examining .o files, report on undefined symbols */ +/* When examining .o files, report on undefined symbols. */ static int n_undef_symbols, n_undef_labels, n_undef_vars, n_undef_procs; @@ -213,7 +213,7 @@ static char stabs_symbol[] = STABS_SYMBOL; static int found_ecoff_debugging_info; -/* Forward declarations */ +/* Forward declarations. */ static int upgrade_type (int, struct type **, int, union aux_ext *, int, char *); @@ -267,7 +267,7 @@ static char *mdebug_next_symbol_text (struct objfile *); /* Exported procedure: Builds a symtab from the PST partial one. Restores the environment in effect when PST was created, delegates most of the work to an ancillary procedure, and sorts - and reorders the symtab list at the end */ + and reorders the symtab list at the end. */ static void mdebug_psymtab_to_symtab (struct partial_symtab *pst) @@ -286,16 +286,16 @@ mdebug_psymtab_to_symtab (struct partial_symtab *pst) psymtab_to_symtab_1 (pst, pst->filename); /* Match with global symbols. This only needs to be done once, - after all of the symtabs and dependencies have been read in. */ + after all of the symtabs and dependencies have been read in. */ scan_file_globals (pst->objfile); if (info_verbose) printf_filtered (_("done.\n")); } -/* File-level interface functions */ +/* File-level interface functions. */ -/* Find a file descriptor given its index RF relative to a file CF */ +/* Find a file descriptor given its index RF relative to a file CF. */ static FDR * get_rfd (int cf, int rf) @@ -306,7 +306,7 @@ get_rfd (int cf, int rf) fdrs = debug_info->fdr; f = fdrs + cf; - /* Object files do not have the RFD table, all refs are absolute */ + /* Object files do not have the RFD table, all refs are absolute. */ if (f->rfdBase == 0) return fdrs + rf; (*debug_swap->swap_rfd_in) (cur_bfd, @@ -317,7 +317,7 @@ get_rfd (int cf, int rf) return fdrs + rfd; } -/* Return a safer print NAME for a file descriptor */ +/* Return a safer print NAME for a file descriptor. */ static char * fdr_name (FDR *f) @@ -385,7 +385,7 @@ mdebug_build_psymtabs (struct objfile *objfile, /* Local utilities */ -/* Map of FDR indexes to partial symtabs */ +/* Map of FDR indexes to partial symtabs. */ struct pst_map { @@ -398,13 +398,13 @@ struct pst_map /* Utility stack, used to nest procedures and blocks properly. It is a doubly linked list, to avoid too many alloc/free. Since we might need it quite a few times it is NOT deallocated - after use. */ + after use. */ static struct parse_stack { struct parse_stack *next, *prev; - struct symtab *cur_st; /* Current symtab. */ - struct block *cur_block; /* Block in it. */ + struct symtab *cur_st; /* Current symtab. */ + struct block *cur_block; /* Block in it. */ /* What are we parsing. stFile, or stBlock are for files and blocks. stProc or stStaticProc means we have seen the start of a @@ -414,28 +414,28 @@ static struct parse_stack int blocktype; - struct type *cur_type; /* Type we parse fields for. */ - int cur_field; /* Field number in cur_type. */ - CORE_ADDR procadr; /* Start addres of this procedure */ - int numargs; /* Its argument count */ + struct type *cur_type; /* Type we parse fields for. */ + int cur_field; /* Field number in cur_type. */ + CORE_ADDR procadr; /* Start addres of this procedure. */ + int numargs; /* Its argument count. */ } *top_stack; /* Top stack ptr */ -/* Enter a new lexical context */ +/* Enter a new lexical context. */ static void push_parse_stack (void) { struct parse_stack *new; - /* Reuse frames if possible */ + /* Reuse frames if possible. */ if (top_stack && top_stack->prev) new = top_stack->prev; else new = (struct parse_stack *) xzalloc (sizeof (struct parse_stack)); - /* Initialize new frame with previous content */ + /* Initialize new frame with previous content. */ if (top_stack) { struct parse_stack *prev = new->prev; @@ -448,7 +448,7 @@ push_parse_stack (void) top_stack = new; } -/* Exit a lexical context */ +/* Exit a lexical context. */ static void pop_parse_stack (void) @@ -463,7 +463,7 @@ pop_parse_stack (void) /* Cross-references might be to things we haven't looked at yet, e.g. type references. To avoid too many type duplications we keep a quick fixup table, an array - of lists of references indexed by file descriptor */ + of lists of references indexed by file descriptor. */ struct mdebug_pending { @@ -482,7 +482,7 @@ struct mdebug_pending static struct mdebug_pending **pending_list; -/* Check whether we already saw symbol SH in file FH */ +/* Check whether we already saw symbol SH in file FH. */ static struct mdebug_pending * is_pending_symbol (FDR *fh, char *sh) @@ -490,14 +490,14 @@ is_pending_symbol (FDR *fh, char *sh) int f_idx = fh - debug_info->fdr; struct mdebug_pending *p; - /* Linear search is ok, list is typically no more than 10 deep */ + /* Linear search is ok, list is typically no more than 10 deep. */ for (p = pending_list[f_idx]; p; p = p->next) if (p->s == sh) break; return p; } -/* Add a new symbol SH of type T */ +/* Add a new symbol SH of type T. */ static void add_pending (FDR *fh, char *sh, struct type *t) @@ -505,7 +505,7 @@ add_pending (FDR *fh, char *sh, struct type *t) int f_idx = fh - debug_info->fdr; struct mdebug_pending *p = is_pending_symbol (fh, sh); - /* Make sure we do not make duplicates */ + /* Make sure we do not make duplicates. */ if (!p) { p = ((struct mdebug_pending *) @@ -519,9 +519,9 @@ add_pending (FDR *fh, char *sh, struct type *t) } -/* Parsing Routines proper. */ +/* Parsing Routines proper. */ -/* Parse a single symbol. Mostly just make up a GDB symbol for it. +/* Parse a single symbol. Mostly just make up a GDB symbol for it. For blocks, procedures and types we open a new lexical context. This is basically just a big switch on the symbol's type. Argument AX is the base pointer of aux symbols for this file (fh->iauxBase). @@ -594,7 +594,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, case stNil: break; - case stGlobal: /* external symbol, goes into global block */ + case stGlobal: /* External symbol, goes into global block. */ class = LOC_STATIC; b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (top_stack->cur_st), GLOBAL_BLOCK); @@ -602,7 +602,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, SYMBOL_VALUE_ADDRESS (s) = (CORE_ADDR) sh->value; goto data; - case stStatic: /* static data, goes into current block. */ + case stStatic: /* Static data, goes into current block. */ class = LOC_STATIC; b = top_stack->cur_block; s = new_symbol (name); @@ -619,7 +619,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, SYMBOL_VALUE_ADDRESS (s) = (CORE_ADDR) sh->value; goto data; - case stLocal: /* local variable, goes into current block */ + case stLocal: /* Local variable, goes into current block. */ b = top_stack->cur_block; s = new_symbol (name); SYMBOL_VALUE (s) = svalue; @@ -631,7 +631,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, else class = LOC_LOCAL; - data: /* Common code for symbols describing data */ + data: /* Common code for symbols describing data. */ SYMBOL_DOMAIN (s) = VAR_DOMAIN; SYMBOL_CLASS (s) = class; add_symbol (s, top_stack->cur_st, b); @@ -642,17 +642,18 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, SYMBOL_TYPE (s) = objfile_type (objfile)->nodebug_data_symbol; else SYMBOL_TYPE (s) = parse_type (cur_fd, ax, sh->index, 0, bigend, name); - /* Value of a data symbol is its memory address */ + /* Value of a data symbol is its memory address. */ break; - case stParam: /* arg to procedure, goes into current block */ + case stParam: /* Arg to procedure, goes into current + block. */ max_gdbinfo++; found_ecoff_debugging_info = 1; top_stack->numargs++; /* Special GNU C++ name. */ if (is_cplus_marker (name[0]) && name[1] == 't' && name[2] == 0) - name = "this"; /* FIXME, not alloc'd in obstack */ + name = "this"; /* FIXME, not alloc'd in obstack. */ s = new_symbol (name); SYMBOL_DOMAIN (s) = VAR_DOMAIN; @@ -683,17 +684,17 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, add_symbol (s, top_stack->cur_st, top_stack->cur_block); break; - case stLabel: /* label, goes into current block */ + case stLabel: /* label, goes into current block. */ s = new_symbol (name); - SYMBOL_DOMAIN (s) = VAR_DOMAIN; /* so that it can be used */ - SYMBOL_CLASS (s) = LOC_LABEL; /* but not misused */ + SYMBOL_DOMAIN (s) = VAR_DOMAIN; /* So that it can be used */ + SYMBOL_CLASS (s) = LOC_LABEL; /* but not misused. */ SYMBOL_VALUE_ADDRESS (s) = (CORE_ADDR) sh->value; SYMBOL_TYPE (s) = objfile_type (objfile)->builtin_int; add_symbol (s, top_stack->cur_st, top_stack->cur_block); break; - case stProc: /* Procedure, usually goes into global block */ - case stStaticProc: /* Static procedure, goes into current block */ + case stProc: /* Procedure, usually goes into global block. */ + case stStaticProc: /* Static procedure, goes into current block. */ /* For stProc symbol records, we need to check the storage class as well, as only (stProc, scText) entries represent "real" procedures - See the Compaq document titled "Object File / @@ -729,7 +730,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, s = new_symbol (name); SYMBOL_DOMAIN (s) = VAR_DOMAIN; SYMBOL_CLASS (s) = LOC_BLOCK; - /* Type of the return value */ + /* Type of the return value. */ if (SC_IS_UNDEF (sh->sc) || sh->sc == scNil) t = objfile_type (objfile)->builtin_int; else @@ -746,8 +747,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, printf("howdy\n")" would fail with the error message "program has no memory available". To avoid this, we patch up the type and make it void* - instead. (davidm@azstarnet.com) - */ + instead. (davidm@azstarnet.com). */ t = make_pointer_type (t, NULL); } } @@ -769,7 +769,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, } add_symbol (s, top_stack->cur_st, b); - /* Make a type for the procedure itself */ + /* Make a type for the procedure itself. */ SYMBOL_TYPE (s) = lookup_function_type (t); /* All functions in C++ have prototypes. For C we don't have enough @@ -777,7 +777,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, if (SYMBOL_LANGUAGE (s) == language_cplus) TYPE_PROTOTYPED (SYMBOL_TYPE (s)) = 1; - /* Create and enter a new lexical context */ + /* Create and enter a new lexical context. */ b = new_block (FUNCTION_BLOCK); SYMBOL_BLOCK_VALUE (s) = b; BLOCK_FUNCTION (b) = s; @@ -785,7 +785,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, BLOCK_SUPERBLOCK (b) = top_stack->cur_block; add_block (b, top_stack->cur_st); - /* Not if we only have partial info */ + /* Not if we only have partial info. */ if (SC_IS_UNDEF (sh->sc) || sh->sc == scNil) break; @@ -807,19 +807,19 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, long max_value; struct field *f; - case stStruct: /* Start a block defining a struct type */ + case stStruct: /* Start a block defining a struct type. */ type_code = TYPE_CODE_STRUCT; goto structured_common; - case stUnion: /* Start a block defining a union type */ + case stUnion: /* Start a block defining a union type. */ type_code = TYPE_CODE_UNION; goto structured_common; - case stEnum: /* Start a block defining an enum type */ + case stEnum: /* Start a block defining an enum type. */ type_code = TYPE_CODE_ENUM; goto structured_common; - case stBlock: /* Either a lexical block, or some type */ + case stBlock: /* Either a lexical block, or some type. */ if (sh->sc != scInfo && !SC_IS_COMMON (sh->sc)) goto case_stBlock_code; /* Lexical block */ @@ -833,7 +833,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, push_parse_stack (); top_stack->blocktype = stBlock; - /* First count the number of fields and the highest value. */ + /* First count the number of fields and the highest value. */ nfields = 0; max_value = 0; for (ext_tsym = ext_sh + external_sym_size; @@ -848,7 +848,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, { case stEnd: /* C++ encodes class types as structures where there the - methods are encoded as stProc. The scope of stProc + methods are encoded as stProc. The scope of stProc symbols also ends with stEnd, thus creating a risk of taking the wrong stEnd symbol record as the end of the current struct, which would cause GDB to undercount @@ -926,14 +926,14 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, /* mips cc puts out a typedef for struct x if it is not yet defined when it encounters struct y { struct x *xp; }; - Just ignore it. */ + Just ignore it. */ break; case stIndirect: /* Irix5 cc puts out a stIndirect for struct x if it is not yet defined when it encounters struct y { struct x *xp; }; - Just ignore it. */ + Just ignore it. */ break; default: @@ -976,7 +976,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, differently from struct/union fields, and that is harder to patch up, but luckily we shouldn't need to. (If there are any enumeration members, we can tell for sure it's an enum - here.) */ + here.) */ if (type_code == TYPE_CODE_UNDEF) { @@ -1016,7 +1016,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, { int unsigned_enum = 1; - /* This is a non-empty enum. */ + /* This is a non-empty enum. */ /* DEC c89 has the number of enumerators in the sh.value field, not the type length, so we have to compensate for that @@ -1061,14 +1061,14 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, unsigned_enum = 0; add_symbol (enum_sym, top_stack->cur_st, top_stack->cur_block); - /* Skip the stMembers that we've handled. */ + /* Skip the stMembers that we've handled. */ count++; f++; } if (unsigned_enum) TYPE_UNSIGNED (t) = 1; } - /* make this the current type */ + /* Make this the current type. */ top_stack->cur_type = t; top_stack->cur_field = 0; @@ -1098,8 +1098,8 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, case_stBlock_code: found_ecoff_debugging_info = 1; - /* beginnning of (code) block. Value of symbol - is the displacement from procedure start */ + /* Beginnning of (code) block. Value of symbol + is the displacement from procedure start. */ push_parse_stack (); /* Do not start a new block if this is the outermost block of a @@ -1139,7 +1139,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, BLOCK_END (top_stack->cur_block) += sh->value; /* size */ - /* Make up special symbol to contain procedure specific info */ + /* Make up special symbol to contain procedure specific info. */ s = new_symbol (MDEBUG_EFI_SYMBOL_NAME); SYMBOL_DOMAIN (s) = LABEL_DOMAIN; SYMBOL_CLASS (s) = LOC_CONST; @@ -1171,7 +1171,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, if (TYPE_NFIELDS (ftype) <= 0) { /* No parameter type information is recorded with the function's - type. Set that from the type of the parameter symbols. */ + type. Set that from the type of the parameter symbols. */ int nparams = top_stack->numargs; int iparams; struct symbol *sym; @@ -1202,9 +1202,9 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, } else if (sh->sc == scText && top_stack->blocktype == stBlock) { - /* End of (code) block. The value of the symbol is the + /* End of (code) block. The value of the symbol is the displacement from the procedure`s start address of the - end of this block. */ + end of this block. */ BLOCK_END (top_stack->cur_block) = sh->value + top_stack->procadr; } else if (sh->sc == scText && top_stack->blocktype == stNil) @@ -1223,7 +1223,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, complaint (&symfile_complaints, _("stEnd with storage class %d not handled"), sh->sc); - pop_parse_stack (); /* restore previous lexical context */ + pop_parse_stack (); /* Restore previous lexical context. */ break; case stMember: /* member of struct or union */ @@ -1259,8 +1259,8 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, else t = pend->t; - /* mips cc puts out a typedef with the name of the struct for forward - declarations. These should not go into the symbol table and + /* Mips cc puts out a typedef with the name of the struct for forward + declarations. These should not go into the symbol table and TYPE_NAME should not be set for them. They can't be distinguished from an intentional typedef to the same name however: @@ -1514,7 +1514,7 @@ basic_type (int bt, struct objfile *objfile) } /* Parse the type information provided in the raw AX entries for - the symbol SH. Return the bitfield size in BS, in case. + the symbol SH. Return the bitfield size in BS, in case. We must byte-swap the AX entries before we use them; BIGEND says whether they are big-endian or little-endian (from fh->fBigendian). */ @@ -1526,7 +1526,7 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs, struct type *tp = 0; enum type_code type_code = TYPE_CODE_UNDEF; - /* Handle undefined types, they have indexNil. */ + /* Handle undefined types, they have indexNil. */ if (aux_index == indexNil) return basic_type (btInt, current_objfile); @@ -1543,7 +1543,7 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs, tp = basic_type (t->bt, current_objfile); if (tp == NULL) { - /* Cannot use builtin types -- build our own */ + /* Cannot use builtin types -- build our own. */ switch (t->bt) { case btStruct: @@ -1562,12 +1562,12 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs, type_code = TYPE_CODE_SET; break; case btIndirect: - /* alpha cc -migrate uses this for typedefs. The true type will + /* alpha cc -migrate uses this for typedefs. The true type will be obtained by crossreferencing below. */ type_code = TYPE_CODE_ERROR; break; case btTypedef: - /* alpha cc uses this for typedefs. The true type will be + /* alpha cc uses this for typedefs. The true type will be obtained by crossreferencing below. */ type_code = TYPE_CODE_ERROR; break; @@ -1577,7 +1577,7 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs, } } - /* Move on to next aux */ + /* Move on to next aux. */ ax++; if (t->fBitfield) @@ -1639,7 +1639,7 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs, /* All these types really point to some (common) MIPS type definition, and only the type-qualifiers fully identify - them. We'll make the same effort at sharing. */ + them. We'll make the same effort at sharing. */ if (t->bt == btStruct || t->bt == btUnion || t->bt == btEnum || @@ -1724,7 +1724,7 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs, else { /* Usually, TYPE_CODE(tp) is already type_code. The main - exception is if we guessed wrong re struct/union/enum. */ + exception is if we guessed wrong re struct/union/enum. */ if (TYPE_CODE (tp) != type_code) { bad_tag_guess_complaint (sym_name); @@ -1750,7 +1750,7 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs, } } - /* Deal with range types */ + /* Deal with range types. */ if (t->bt == btRange) { TYPE_NFIELDS (tp) = 0; @@ -1762,8 +1762,8 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs, ax++; } - /* Parse all the type qualifiers now. If there are more - than 6 the game will continue in the next aux */ + /* Parse all the type qualifiers now. If there are more + than 6 the game will continue in the next aux. */ while (1) { @@ -1798,11 +1798,11 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs, } /* Make up a complex type from a basic one. Type is passed by - reference in TPP and side-effected as necessary. The type + reference in TPP and side-effected as necessary. The type qualifier TQ says how to handle the aux symbols at AX for the symbol SX we are currently analyzing. BIGEND says whether aux symbols are big-endian or little-endian. - Returns the number of aux symbols we parsed. */ + Returns the number of aux symbols we parsed. */ static int upgrade_type (int fd, struct type **tpp, int tq, union aux_ext *ax, int bigend, @@ -1811,7 +1811,7 @@ upgrade_type (int fd, struct type **tpp, int tq, union aux_ext *ax, int bigend, int off; struct type *t; - /* Used in array processing */ + /* Used in array processing. */ int rf, id; FDR *fh; struct type *range; @@ -1834,7 +1834,7 @@ upgrade_type (int fd, struct type **tpp, int tq, union aux_ext *ax, int bigend, case tqArray: off = 0; - /* Determine and record the domain type (type of index) */ + /* Determine and record the domain type (type of index). */ (*debug_swap->swap_rndx_in) (bigend, &ax->a_rndx, &rndx); id = rndx.index; rf = rndx.rfd; @@ -1930,12 +1930,12 @@ parse_procedure (PDR *pr, struct symtab *search_symtab, struct block *b; char *sh_name; - /* Simple rule to find files linked "-x" */ + /* Simple rule to find files linked "-x". */ if (cur_fdr->rss == -1) { if (pr->isym == -1) { - /* Static procedure at address pr->adr. Sigh. */ + /* Static procedure at address pr->adr. Sigh. */ /* FIXME-32x64. assuming pr->adr fits in long. */ complaint (&symfile_complaints, _("can't handle PDR for static proc at 0x%lx"), @@ -2008,11 +2008,11 @@ parse_procedure (PDR *pr, struct symtab *search_symtab, s = new_symbol (sh_name); SYMBOL_DOMAIN (s) = VAR_DOMAIN; SYMBOL_CLASS (s) = LOC_BLOCK; - /* Donno its type, hope int is ok */ + /* Donno its type, hope int is ok. */ SYMBOL_TYPE (s) = lookup_function_type (objfile_type (pst->objfile)->builtin_int); add_symbol (s, top_stack->cur_st, top_stack->cur_block); - /* Wont have symbols for this one */ + /* Won't have symbols for this one. */ b = new_block (2); SYMBOL_BLOCK_VALUE (s) = b; BLOCK_FUNCTION (b) = s; @@ -2068,11 +2068,11 @@ parse_procedure (PDR *pr, struct symtab *search_symtab, SYMBOL_TYPE (s) = objfile_type (pst->objfile)->nodebug_text_symbol; } -/* Parse the external symbol ES. Just call parse_symbol() after +/* Parse the external symbol ES. Just call parse_symbol() after making sure we know where the aux are for it. BIGEND says whether aux entries are big-endian or little-endian. - This routine clobbers top_stack->cur_block and ->cur_st. */ + This routine clobbers top_stack->cur_block and ->cur_st. */ static void parse_external (EXTR *, int, struct section_offsets *, struct objfile *); @@ -2123,7 +2123,7 @@ parse_external (EXTR *es, int bigend, struct section_offsets *section_offsets, break; } n_undef_symbols++; - /* FIXME: Turn this into a complaint? */ + /* FIXME: Turn this into a complaint? */ if (info_verbose) printf_filtered (_("Warning: %s `%s' is undefined (in %s)\n"), what, debug_info->ssext + es->asym.iss, @@ -2166,7 +2166,7 @@ parse_external (EXTR *es, int bigend, struct section_offsets *section_offsets, GDB's linetable LT. MIPS' encoding requires a little bit of magic to get things out. Note also that MIPS' line numbers can go back and forth, apparently we can live - with that and do not need to reorder our linetables */ + with that and do not need to reorder our linetables. */ static void parse_lines (FDR *, PDR *, struct linetable *, int, struct partial_symtab *, CORE_ADDR); @@ -2182,7 +2182,7 @@ parse_lines (FDR *fh, PDR *pr, struct linetable *lt, int maxlines, if (fh->cbLine == 0) return; - /* Scan by procedure descriptors */ + /* Scan by procedure descriptors. */ k = 0; for (j = 0; j < fh->cpd; j++, pr++) { @@ -2190,7 +2190,7 @@ parse_lines (FDR *fh, PDR *pr, struct linetable *lt, int maxlines, CORE_ADDR adr; unsigned char *halt; - /* No code for this one */ + /* No code for this one. */ if (pr->iline == ilineNil || pr->lnLow == -1 || pr->lnHigh == -1) continue; @@ -2222,7 +2222,7 @@ parse_lines (FDR *fh, PDR *pr, struct linetable *lt, int maxlines, } lineno += delta; /* first delta is 0 */ - /* Complain if the line table overflows. Could happen + /* Complain if the line table overflows. Could happen with corrupt binaries. */ if (lt->nitems >= maxlines) { @@ -2352,13 +2352,13 @@ parse_partial_symbols (struct objfile *objfile) int textlow_not_set = 1; int past_first_source_file = 0; - /* List of current psymtab's include files */ + /* List of current psymtab's include files. */ char **psymtab_include_list; int includes_allocated; int includes_used; EXTR *extern_tab; struct pst_map *fdr_to_pst; - /* Index within current psymtab dependency list */ + /* Index within current psymtab dependency list. */ struct partial_symtab **dependency_list; int dependencies_used, dependencies_allocated; struct cleanup *old_chain; @@ -2401,7 +2401,7 @@ parse_partial_symbols (struct objfile *objfile) * Only parse the Local and External symbols, and the Relative FDR. * Fixup enough of the loader symtab to be able to use it. * Allocate space only for the file's portions we need to - * look at. (XXX) + * look at. (XXX) */ max_gdbinfo = 0; @@ -2409,7 +2409,7 @@ parse_partial_symbols (struct objfile *objfile) /* Allocate the map FDR -> PST. Minor hack: -O3 images might claim some global data belongs - to FDR -1. We`ll go along with that */ + to FDR -1. We`ll go along with that. */ fdr_to_pst = (struct pst_map *) xzalloc ((hdr->ifdMax + 1) * sizeof *fdr_to_pst); old_chain = make_cleanup (xfree, fdr_to_pst); @@ -2439,7 +2439,7 @@ parse_partial_symbols (struct objfile *objfile) for (; ext_out < ext_out_end; ext_out += external_ext_size, ext_in++) (*swap_ext_in) (cur_bfd, ext_out, ext_in); - /* Pass 1 over external syms: Presize and partition the list */ + /* Pass 1 over external syms: Presize and partition the list. */ ext_in = ext_block; ext_in_end = ext_in + hdr->iextMax; for (; ext_in < ext_in_end; ext_in++) @@ -2452,7 +2452,7 @@ parse_partial_symbols (struct objfile *objfile) fdr_to_pst[ext_in->ifd].n_globals++; } - /* Pass 1.5 over files: partition out global symbol space */ + /* Pass 1.5 over files: partition out global symbol space. */ s_idx = 0; for (f_idx = -1; f_idx < hdr->ifdMax; f_idx++) { @@ -2473,7 +2473,7 @@ parse_partial_symbols (struct objfile *objfile) Since absolute sections don't get relocated, we end up calculating an address different from that of the symbol's minimal symbol (created earlier from the - Elf symtab). + Elf symtab). To fix this, either : 1) don't create the duplicate symbol @@ -2490,9 +2490,9 @@ parse_partial_symbols (struct objfile *objfile) I've implemented #1 here... Skip the creation of the minimal symbols based on the ECOFF - symbol table. */ + symbol table. */ - /* Pass 2 over external syms: fill in external symbols */ + /* Pass 2 over external syms: fill in external symbols. */ ext_in = ext_block; ext_in_end = ext_in + hdr->iextMax; for (; ext_in < ext_in_end; ext_in++) @@ -2525,10 +2525,10 @@ parse_partial_symbols (struct objfile *objfile) continue; - /* Pass 3 over files, over local syms: fill in static symbols */ + /* Pass 3 over files, over local syms: fill in static symbols. */ name = debug_info->ssext + ext_in->asym.iss; - /* Process ECOFF Symbol Types and Storage Classes */ + /* Process ECOFF Symbol Types and Storage Classes. */ switch (ext_in->asym.st) { case stProc: @@ -2575,24 +2575,23 @@ parse_partial_symbols (struct objfile *objfile) /* Label */ /* On certain platforms, some extra label symbols can be - generated by the linker. One possible usage for this kind + generated by the linker. One possible usage for this kind of symbols is to represent the address of the begining of a - given section. For instance, on Tru64 5.1, the address of + given section. For instance, on Tru64 5.1, the address of the _ftext label is the start address of the .text section. The storage class of these symbols is usually directly - related to the section to which the symbol refers. For + related to the section to which the symbol refers. For instance, on Tru64 5.1, the storage class for the _fdata label is scData, refering to the .data section. It is actually possible that the section associated to the - storage class of the label does not exist. On True64 5.1 + storage class of the label does not exist. On True64 5.1 for instance, the libm.so shared library does not contain any .data section, although it contains a _fpdata label - which storage class is scData... Since these symbols are + which storage class is scData... Since these symbols are usually useless for the debugger user anyway, we just - discard these symbols. - */ + discard these symbols. */ if (SC_IS_TEXT (ext_in->asym.sc)) { @@ -2637,10 +2636,10 @@ parse_partial_symbols (struct objfile *objfile) case stLocal: case stNil: /* The alpha has the section start addresses in stLocal symbols - whose name starts with a `.'. Skip those but complain for all + whose name starts with a `.'. Skip those but complain for all other stLocal symbols. Irix6 puts the section start addresses in stNil symbols, skip - those too. */ + those too. */ if (name[0] == '.') continue; /* Fall through. */ @@ -2653,7 +2652,7 @@ parse_partial_symbols (struct objfile *objfile) objfile); } - /* Pass 3 over files, over local syms: fill in static symbols */ + /* Pass 3 over files, over local syms: fill in static symbols. */ for (f_idx = 0; f_idx < hdr->ifdMax; f_idx++) { struct partial_symtab *save_pst; @@ -2695,7 +2694,7 @@ parse_partial_symbols (struct objfile *objfile) DEBUG_INFO (pst) = debug_info; PENDING_LIST (pst) = pending_list; - /* The way to turn this into a symtab is to call... */ + /* The way to turn this into a symtab is to call... */ pst->read_symtab = mdebug_psymtab_to_symtab; /* Set up language for the pst. @@ -2707,7 +2706,7 @@ parse_partial_symbols (struct objfile *objfile) a header file, which is not what we want. But the FDRs for the header files are after the FDR for the source file, so we can assign the language of the source file to the - following header files. Then we save the language in the private + following header files. Then we save the language in the private pst data so that we can reuse it when building symtabs. */ prev_language = psymtab_language; @@ -2731,7 +2730,7 @@ parse_partial_symbols (struct objfile *objfile) current object file uses encapsulated stabs instead of mips ecoff for local symbols. (It is the second symbol because the first symbol is the stFile used to signal the start of a - file). */ + file). */ processing_gcc_compilation = 0; if (fh->csym >= 2) { @@ -2820,7 +2819,7 @@ parse_partial_symbols (struct objfile *objfile) default: /* FIXME! Shouldn't this use cases for bss, - then have the default be abs? */ + then have the default be abs? */ namestring = debug_info->ss + fh->issBase + sh.iss; sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS (objfile)); @@ -2832,7 +2831,7 @@ parse_partial_symbols (struct objfile *objfile) } continue; } - /* Handle stabs continuation */ + /* Handle stabs continuation. */ { char *stabstring = debug_info->ss + fh->issBase + sh.iss; int len = strlen (stabstring); @@ -2844,10 +2843,10 @@ parse_partial_symbols (struct objfile *objfile) char *stabstring2; int len2; - /* Ignore continuation char from 1st string */ + /* Ignore continuation char from 1st string. */ len--; - /* Read next stabstring */ + /* Read next stabstring. */ cur_sdx++; (*swap_sym_in) (cur_bfd, (((char *) debug_info->external_sym) @@ -2857,7 +2856,7 @@ parse_partial_symbols (struct objfile *objfile) stabstring2 = debug_info->ss + fh->issBase + sh2.iss; len2 = strlen (stabstring2); - /* Concatinate stabstring2 with stabstring1 */ + /* Concatinate stabstring2 with stabstring1. */ if (stabstring && stabstring != debug_info->ss + fh->issBase + sh.iss) stabstring = xrealloc (stabstring, len + len2 + 1); @@ -2891,7 +2890,7 @@ parse_partial_symbols (struct objfile *objfile) case N_BSS: case N_BSS | N_EXT: case N_NBBSS | N_EXT: - case N_SETV | N_EXT: /* FIXME, is this in BSS? */ + case N_SETV | N_EXT: /* FIXME, is this in BSS? */ sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS (objfile)); goto record_it; @@ -2900,7 +2899,7 @@ parse_partial_symbols (struct objfile *objfile) record_it: continue; - /* Standard, local, non-debugger, symbols */ + /* Standard, local, non-debugger, symbols. */ case N_NBTEXT: @@ -2921,7 +2920,7 @@ parse_partial_symbols (struct objfile *objfile) goto record_it; case N_UNDF | N_EXT: - continue; /* Just undefined, not COMMON */ + continue; /* Just undefined, not COMMON. */ case N_UNDF: continue; @@ -2933,7 +2932,7 @@ parse_partial_symbols (struct objfile *objfile) case N_NBBSS: continue; - /* Keep going . . . */ + /* Keep going . . . */ /* * Special symbol types for GNU @@ -2969,7 +2968,7 @@ parse_partial_symbols (struct objfile *objfile) prev_textlow_not_set = textlow_not_set; /* A zero value is probably an indication for the - SunPRO 3.0 compiler. end_psymtab explicitly tests + SunPRO 3.0 compiler. end_psymtab explicitly tests for zero, so don't relocate it. */ if (sh.value == 0 @@ -2984,7 +2983,7 @@ parse_partial_symbols (struct objfile *objfile) past_first_source_file = 1; if (prev_so_symnum != symnum - 1) - { /* Here if prev stab wasn't N_SO */ + { /* Here if prev stab wasn't N_SO. */ first_so_symnum = symnum; if (pst) @@ -2997,13 +2996,14 @@ parse_partial_symbols (struct objfile *objfile) prev_so_symnum = symnum; - /* End the current partial symtab and start a new one */ + /* End the current partial symtab and start a + new one. */ /* SET_NAMESTRING ();*/ namestring = stabstring; /* Null name means end of .o file. Don't start a new - one. */ + one. */ if (*namestring == '\000') continue; @@ -3011,12 +3011,12 @@ parse_partial_symbols (struct objfile *objfile) initial N_SOs. The first one is a directory name; the second the file name. If pst exists, is empty, and has a filename ending in '/', we assume - the previous N_SO was a directory name. */ + the previous N_SO was a directory name. */ p = strrchr (namestring, '/'); if (p && *(p + 1) == '\000') continue; /* Simply ignore directory - name SOs */ + name SOs. */ /* Some other compilers (C++ ones in particular) emit useless SOs for non-existant .c files. We ignore @@ -3035,9 +3035,9 @@ parse_partial_symbols (struct objfile *objfile) { enum language tmp_language; - /* Mark down an include file in the current psymtab */ + /* Mark down an include file in the current psymtab. */ - /* SET_NAMESTRING ();*/ + /* SET_NAMESTRING (); */ namestring = stabstring; tmp_language @@ -3056,7 +3056,7 @@ parse_partial_symbols (struct objfile *objfile) /* In C++, one may expect the same filename to come round many times, when code is coming alternately from the main file and from inline functions in - other files. So I check to see if this is a file + other files. So I check to see if this is a file we've seen before -- either the main source file, or a previously included file. @@ -3095,7 +3095,7 @@ parse_partial_symbols (struct objfile *objfile) } continue; } - case N_LSYM: /* Typedef or automatic variable. */ + case N_LSYM: /* Typedef or automatic variable. */ case N_STSYM: /* Data seg var -- static */ case N_LCSYM: /* BSS " */ case N_ROSYM: /* Read-only data seg var -- static. */ @@ -3111,14 +3111,14 @@ parse_partial_symbols (struct objfile *objfile) case N_PC: /* I may or may not need this; I suspect not. */ case N_M2C: /* I suspect that I can ignore this - here. */ - case N_SCOPE: /* Same. */ + here. */ + case N_SCOPE: /* Same. */ - /* SET_NAMESTRING ();*/ + /* SET_NAMESTRING (); */ namestring = stabstring; p = (char *) strchr (namestring, ':'); if (!p) - continue; /* Not a debugging symbol. */ + continue; /* Not a debugging symbol. */ @@ -3149,8 +3149,9 @@ parse_partial_symbols (struct objfile *objfile) case 'G': sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile)); - /* The addresses in these entries are reported to be - wrong. See the code that reads 'G's for symtabs. */ + /* The addresses in these entries are reported + to be wrong. See the code that reads 'G's + for symtabs. */ add_psymbol_to_list (namestring, p - namestring, 1, VAR_DOMAIN, LOC_STATIC, &objfile->global_psymbols, @@ -3190,7 +3191,7 @@ parse_partial_symbols (struct objfile *objfile) goto check_enum; case 't': if (p != namestring) /* a name is there, not - just :T... */ + just :T... */ { add_psymbol_to_list (namestring, p - namestring, 1, VAR_DOMAIN, LOC_TYPEDEF, @@ -3202,7 +3203,7 @@ parse_partial_symbols (struct objfile *objfile) /* If this is an enumerated type, we need to add all the enum constants to the partial symbol table. This does not cover enums without names, - e.g. "enum {a, b} c;" in C, but fortunately + e.g. "enum {a, b} c;" in C, but fortunately those are rare. There is no way for GDB to find those from the enum type without spending too much time on it. Thus to solve this problem, @@ -3403,10 +3404,10 @@ parse_partial_symbols (struct objfile *objfile) element. Hopefully, I can ignore this. */ case N_ENTRY: /* Alternate entry point; can - ignore. */ + ignore. */ case N_MAIN: /* Can definitely ignore this. */ - case N_CATCH: /* These are GNU C++ extensions */ - case N_EHDECL: /* that can safely be ignored here. */ + case N_CATCH: /* These are GNU C++ extensions. */ + case N_EHDECL: /* that can safely be ignored here. */ case N_LENG: case N_BCOMM: case N_ECOMM: @@ -3421,10 +3422,10 @@ parse_partial_symbols (struct objfile *objfile) case N_ALIAS: /* SunPro F77: alias name, ignore for now. */ - case N_OBJ: /* useless types from Solaris */ + case N_OBJ: /* Useless types from Solaris. */ case N_OPT: /* These symbols aren't interesting; don't worry about - them */ + them. */ continue; @@ -3433,7 +3434,7 @@ parse_partial_symbols (struct objfile *objfile) probably some new type we don't know about yet. */ complaint (&symfile_complaints, _("unknown symbol type %s"), - hex_string (type_code)); /*CUR_SYMBOL_TYPE*/ + hex_string (type_code)); /* CUR_SYMBOL_TYPE */ continue; } if (stabstring @@ -3467,7 +3468,7 @@ parse_partial_symbols (struct objfile *objfile) || (sh.index == indexNil && (sh.st != stStatic || sh.sc == scAbs))) { - /* FIXME, premature? */ + /* FIXME, premature? */ cur_sdx++; continue; } @@ -3520,7 +3521,7 @@ parse_partial_symbols (struct objfile *objfile) /* Should not happen, but does when cross-compiling with the MIPS compiler. FIXME -- pull later. */ index_complaint (name); - new_sdx = cur_sdx + 1; /* Don't skip at all */ + new_sdx = cur_sdx + 1; /* Don't skip at all. */ } else new_sdx = AUX_GET_ISYM (fh->fBigendian, @@ -3534,7 +3535,7 @@ parse_partial_symbols (struct objfile *objfile) complaint (&symfile_complaints, _("bad proc end in aux found from symbol %s"), name); - new_sdx = cur_sdx + 1; /* Don't skip backward */ + new_sdx = cur_sdx + 1; /* Don't skip backward. */ } /* For stProc symbol records, we need to check the @@ -3548,7 +3549,7 @@ parse_partial_symbols (struct objfile *objfile) goto skip; /* Usually there is a local and a global stProc symbol - for a function. This means that the function name + for a function. This means that the function name has already been entered into the mimimal symbol table while processing the global symbols in pass 2 above. One notable exception is the PROGRAM name from @@ -3607,7 +3608,7 @@ parse_partial_symbols (struct objfile *objfile) break; case stIndirect: /* Irix5 forward declaration */ - /* Skip forward declarations from Irix5 cc */ + /* Skip forward declarations from Irix5 cc. */ goto skip; case stTypedef: /* Typedef */ @@ -3627,7 +3628,7 @@ parse_partial_symbols (struct objfile *objfile) case stEnum: case stBlock: /* { }, str, un, enum */ /* Do not create a partial symbol for cc unnamed aggregates - and gcc empty aggregates. */ + and gcc empty aggregates. */ if ((sh.sc == scInfo || SC_IS_COMMON (sh.sc)) && sh.iss != 0 @@ -3641,14 +3642,14 @@ parse_partial_symbols (struct objfile *objfile) } handle_psymbol_enumerators (objfile, fh, sh.st, sh.value); - /* Skip over the block */ + /* Skip over the block. */ new_sdx = sh.index; if (new_sdx <= cur_sdx) { - /* This happens with the Ultrix kernel. */ + /* This happens with the Ultrix kernel. */ complaint (&symfile_complaints, _("bad aux index at block symbol %s"), name); - new_sdx = cur_sdx + 1; /* Don't skip backward */ + new_sdx = cur_sdx + 1; /* Don't skip backward. */ } cur_sdx = new_sdx; continue; @@ -3661,7 +3662,7 @@ parse_partial_symbols (struct objfile *objfile) case stLocal: /* Local variables */ /* Normally these are skipped because we skip over all blocks we see. However, these can occur - as visible symbols in a .h file that contains code. */ + as visible symbols in a .h file that contains code. */ goto skip; default: @@ -3673,16 +3674,16 @@ parse_partial_symbols (struct objfile *objfile) cur_sdx++; continue; } - /* Use this gdb symbol */ + /* Use this gdb symbol. */ add_psymbol_to_list (name, strlen (name), 1, VAR_DOMAIN, class, &objfile->static_psymbols, 0, sh.value, psymtab_language, objfile); skip: - cur_sdx++; /* Go to next file symbol */ + cur_sdx++; /* Go to next file symbol. */ } - /* Now do enter the external symbols. */ + /* Now do enter the external symbols. */ ext_ptr = &extern_tab[fdr_to_pst[f_idx].globals_offset]; cur_sdx = fdr_to_pst[f_idx].n_globals; PST_PRIVATE (save_pst)->extern_count = cur_sdx; @@ -3762,7 +3763,7 @@ parse_partial_symbols (struct objfile *objfile) } } - /* Link pst to FDR. end_psymtab returns NULL if the psymtab was + /* Link pst to FDR. end_psymtab returns NULL if the psymtab was empty and put on the free list. */ fdr_to_pst[f_idx].pst = end_psymtab (save_pst, psymtab_include_list, includes_used, @@ -3801,7 +3802,7 @@ parse_partial_symbols (struct objfile *objfile) } } - /* Now scan the FDRs for dependencies */ + /* Now scan the FDRs for dependencies. */ for (f_idx = 0; f_idx < hdr->ifdMax; f_idx++) { fh = f_idx + debug_info->fdr; @@ -3810,7 +3811,7 @@ parse_partial_symbols (struct objfile *objfile) if (pst == (struct partial_symtab *) NULL) continue; - /* This should catch stabs-in-ecoff. */ + /* This should catch stabs-in-ecoff. */ if (fh->crfd <= 1) continue; @@ -3926,7 +3927,7 @@ handle_psymbol_enumerators (struct objfile *objfile, FDR *fh, int stype, } } -/* Get the next symbol. OBJFILE is unused. */ +/* Get the next symbol. OBJFILE is unused. */ static char * mdebug_next_symbol_text (struct objfile *objfile) @@ -3989,7 +3990,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, const char *filename) wrap_here (""); /* Flush output */ gdb_flush (gdb_stdout); } - /* We only pass the filename for debug purposes */ + /* We only pass the filename for debug purposes. */ psymtab_to_symtab_1 (pst->dependencies[i], pst->dependencies[i]->filename); } @@ -4000,7 +4001,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, const char *filename) && pst->textlow == 0 && pst->texthigh == 0) return; - /* Now read the symbols for this symtab */ + /* Now read the symbols for this symtab. */ cur_bfd = CUR_BFD (pst); debug_swap = DEBUG_SWAP (pst); @@ -4017,7 +4018,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, const char *filename) : debug_info->fdr + cur_fd); cur_fdr = fh; - /* See comment in parse_partial_symbols about the @stabs sentinel. */ + /* See comment in parse_partial_symbols about the @stabs sentinel. */ processing_gcc_compilation = 0; if (fh != (FDR *) NULL && fh->csym >= 2) { @@ -4042,9 +4043,9 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, const char *filename) /* This symbol table contains stabs-in-ecoff entries. */ - /* Parse local symbols first */ + /* Parse local symbols first. */ - if (fh->csym <= 2) /* FIXME, this blows psymtab->symtab ptr */ + if (fh->csym <= 2) /* FIXME, this blows psymtab->symtab ptr. */ { current_objfile = NULL; return; @@ -4075,7 +4076,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, const char *filename) it here instead of in process_one_symbol, so we can keep a handle to its symtab. The symtab would otherwise be ended twice, once in - process_one_symbol, and once after this loop. */ + process_one_symbol, and once after this loop. */ if (type_code == N_SO && last_source_file && previous_stab_code != (unsigned char) N_SO @@ -4105,7 +4106,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, const char *filename) if (type_code == N_FUN) { /* Make up special symbol to contain - procedure specific info */ + procedure specific info. */ struct mdebug_extra_func_info *e = ((struct mdebug_extra_func_info *) obstack_alloc (¤t_objfile->objfile_obstack, @@ -4131,7 +4132,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, const char *filename) } else { - /* Handle encoded stab line number. */ + /* Handle encoded stab line number. */ valu += ANOFFSET (pst->section_offsets, SECT_OFF_TEXT (pst->objfile)); record_line (current_subfile, sh.index, @@ -4140,7 +4141,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, const char *filename) } else if (sh.st == stProc || sh.st == stStaticProc || sh.st == stStatic || sh.st == stEnd) - /* These are generated by gcc-2.x, do not complain */ + /* These are generated by gcc-2.x, do not complain. */ ; else complaint (&symfile_complaints, @@ -4225,7 +4226,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, const char *filename) lines = LINETABLE (st); - /* Get a new lexical context */ + /* Get a new lexical context. */ push_parse_stack (); top_stack->cur_st = st; @@ -4244,7 +4245,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, const char *filename) char *sym_ptr; char *sym_end; - /* Parse local symbols first */ + /* Parse local symbols first. */ sym_ptr = ((char *) debug_info->external_sym + fh->isymBase * external_sym_size); sym_end = sym_ptr + fh->csym * external_sym_size; @@ -4313,8 +4314,8 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, const char *filename) LINETABLE (st) = lines; /* .. and our share of externals. - XXX use the global list to speed up things here. how? - FIXME, Maybe quit once we have found the right number of ext's? */ + XXX use the global list to speed up things here. How? + FIXME, Maybe quit once we have found the right number of ext's? */ top_stack->cur_st = st; top_stack->cur_block = BLOCKVECTOR_BLOCK (BLOCKVECTOR (top_stack->cur_st), @@ -4352,7 +4353,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, const char *filename) current_objfile = NULL; } -/* Ancillary parsing procedures. */ +/* Ancillary parsing procedures. */ /* Return 1 if the symbol pointed to by SH has a cross reference to an opaque aggregate type, else 0. */ @@ -4387,12 +4388,12 @@ has_opaque_xref (FDR *fh, SYMR *sh) /* Lookup the type at relative index RN. Return it in TPP if found and in any event come up with its name PNAME. BIGEND says whether aux symbols are big-endian or not (from fh->fBigendian). - Return value says how many aux symbols we ate. */ + Return value says how many aux symbols we ate. */ static int cross_ref (int fd, union aux_ext *ax, struct type **tpp, enum type_code type_code, - /* Use to alloc new type if none is found. */ + /* Use to alloc new type if none is found. */ char **pname, int bigend, char *sym_name) { RNDXR rn[1]; @@ -4408,7 +4409,7 @@ cross_ref (int fd, union aux_ext *ax, struct type **tpp, (*debug_swap->swap_rndx_in) (bigend, &ax->a_rndx, rn); - /* Escape index means 'the next one' */ + /* Escape index means 'the next one'. */ if (rn->rfd == 0xfff) { result++; @@ -4431,7 +4432,7 @@ cross_ref (int fd, union aux_ext *ax, struct type **tpp, } /* mips cc uses an escaped rn->index of 0 for struct return types - of procedures that were compiled without -g. These will always remain + of procedures that were compiled without -g. These will always remain undefined. */ if (rn->rfd == 0xfff && rn->index == 0) { @@ -4492,12 +4493,12 @@ cross_ref (int fd, union aux_ext *ax, struct type **tpp, two cases: a) forward declarations of structs/unions/enums which are not defined in this compilation unit. - For these the type will be void. This is a bad design decision + For these the type will be void. This is a bad design decision as cross referencing across compilation units is impossible due to the missing name. b) forward declarations of structs/unions/enums/typedefs which are defined later in this file or in another file in the same - compilation unit. Irix5 cc uses a stIndirect symbol for this. + compilation unit. Irix5 cc uses a stIndirect symbol for this. Simply cross reference those again to get the true type. The forward references are not entered in the pending list and in the symbol table. */ @@ -4528,10 +4529,10 @@ cross_ref (int fd, union aux_ext *ax, struct type **tpp, break; case btTypedef: - /* Follow a forward typedef. This might recursively + /* Follow a forward typedef. This might recursively call cross_ref till we get a non typedef'ed type. FIXME: This is not correct behaviour, but gdb currently - cannot handle typedefs without type copying. Type + cannot handle typedefs without type copying. Type copying is impossible as we might have mutual forward references between two files and the copied type would not get filled in when we later parse its definition. */ @@ -4556,10 +4557,10 @@ cross_ref (int fd, union aux_ext *ax, struct type **tpp, } else if (sh.st == stTypedef) { - /* Parse the type for a normal typedef. This might recursively call + /* Parse the type for a normal typedef. This might recursively call cross_ref till we get a non typedef'ed type. FIXME: This is not correct behaviour, but gdb currently - cannot handle typedefs without type copying. But type copying is + cannot handle typedefs without type copying. But type copying is impossible as we might have mutual forward references between two files and the copied type would not get filled in when we later parse its definition. */ @@ -4582,13 +4583,13 @@ cross_ref (int fd, union aux_ext *ax, struct type **tpp, add_pending (fh, esh, *tpp); } - /* We used one auxent normally, two if we got a "next one" rf. */ + /* We used one auxent normally, two if we got a "next one" rf. */ return result; } /* Quick&dirty lookup procedure, to avoid the MI ones that require - keeping the symtab sorted */ + keeping the symtab sorted. */ static struct symbol * mylookup_symbol (char *name, struct block *block, @@ -4624,7 +4625,7 @@ add_symbol (struct symbol *s, struct symtab *symtab, struct block *b) dict_add_symbol (BLOCK_DICT (b), s); } -/* Add a new block B to a symtab S */ +/* Add a new block B to a symtab S. */ static void add_block (struct block *b, struct symtab *s) @@ -4651,7 +4652,7 @@ add_block (struct block *b, struct symtab *s) a prologue than mips_skip_prologue). But due to the compressed line table format there are line number entries for the same line which are needed to bridge the gap to the next - line number entry. These entries have a bogus address info with them + line number entry. These entries have a bogus address info with them and we are unable to tell them from intended duplicate line number entries. This is another reason why -ggdb debugging format is preferable. */ @@ -4660,13 +4661,13 @@ static int add_line (struct linetable *lt, int lineno, CORE_ADDR adr, int last) { /* DEC c89 sometimes produces zero linenos which confuse gdb. - Change them to something sensible. */ + Change them to something sensible. */ if (lineno == 0) lineno = 1; if (last == 0) - last = -2; /* make sure we record first line */ + last = -2; /* Make sure we record first line. */ - if (last == lineno) /* skip continuation lines */ + if (last == lineno) /* Skip continuation lines. */ return lineno; lt->item[lt->nitems].line = lineno; @@ -4674,9 +4675,9 @@ add_line (struct linetable *lt, int lineno, CORE_ADDR adr, int last) return lineno; } -/* Sorting and reordering procedures */ +/* Sorting and reordering procedures. */ -/* Blocks with a smaller low bound should come first */ +/* Blocks with a smaller low bound should come first. */ static int compare_blocks (const void *arg1, const void *arg2) @@ -4693,7 +4694,7 @@ compare_blocks (const void *arg1, const void *arg2) /* Sort the blocks of a symtab S. Reorder the blocks in the blockvector by code-address, - as required by some MI search routines */ + as required by some MI search routines. */ static void sort_blocks (struct symtab *s) @@ -4741,10 +4742,10 @@ sort_blocks (struct symtab *s) } -/* Constructor/restructor/destructor procedures */ +/* Constructor/restructor/destructor procedures. */ /* Allocate a new symtab for NAME. Needs an estimate of how many - linenumbers MAXLINES we'll put in it */ + linenumbers MAXLINES we'll put in it. */ static struct symtab * new_symtab (const char *name, int maxlines, struct objfile *objfile) @@ -4753,7 +4754,7 @@ new_symtab (const char *name, int maxlines, struct objfile *objfile) LINETABLE (s) = new_linetable (maxlines); - /* All symtabs must have at least two blocks */ + /* All symtabs must have at least two blocks. */ BLOCKVECTOR (s) = new_bvect (2); BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK) = new_block (NON_FUNCTION_BLOCK); @@ -4767,7 +4768,7 @@ new_symtab (const char *name, int maxlines, struct objfile *objfile) return (s); } -/* Allocate a new partial_symtab NAME */ +/* Allocate a new partial_symtab NAME. */ static struct partial_symtab * new_psymtab (char *name, struct objfile *objfile) @@ -4777,7 +4778,7 @@ new_psymtab (char *name, struct objfile *objfile) psymtab = allocate_psymtab (name, objfile); psymtab->section_offsets = objfile->section_offsets; - /* Keep a backpointer to the file's symbols */ + /* Keep a backpointer to the file's symbols. */ psymtab->read_symtab_private = obstack_alloc (&objfile->objfile_obstack, sizeof (struct symloc)); @@ -4787,7 +4788,7 @@ new_psymtab (char *name, struct objfile *objfile) DEBUG_INFO (psymtab) = debug_info; PENDING_LIST (psymtab) = pending_list; - /* The way to turn this into a symtab is to call... */ + /* The way to turn this into a symtab is to call... */ psymtab->read_symtab = mdebug_psymtab_to_symtab; return (psymtab); } @@ -4808,7 +4809,7 @@ new_linetable (int size) return l; } -/* Oops, too big. Shrink it. This was important with the 2.4 linetables, +/* Oops, too big. Shrink it. This was important with the 2.4 linetables, I am not so sure about the 3.4 ones. Since the struct linetable already includes one item, we subtract one when @@ -4823,7 +4824,7 @@ shrink_linetable (struct linetable *lt) * sizeof (lt->item)))); } -/* Allocate and zero a new blockvector of NBLOCKS blocks. */ +/* Allocate and zero a new blockvector of NBLOCKS blocks. */ static struct blockvector * new_bvect (int nblocks) @@ -4860,7 +4861,7 @@ new_block (enum block_type type) return retval; } -/* Create a new symbol with printname NAME */ +/* Create a new symbol with printname NAME. */ static struct symbol * new_symbol (char *name) @@ -4875,7 +4876,7 @@ new_symbol (char *name) return s; } -/* Create a new type with printname NAME */ +/* Create a new type with printname NAME. */ static struct type * new_type (char *name) diff --git a/gdb/mdebugread.h b/gdb/mdebugread.h index d70fdf9a006..71427cbd8c0 100644 --- a/gdb/mdebugread.h +++ b/gdb/mdebugread.h @@ -29,8 +29,8 @@ struct mdebug_extra_func_info { - long numargs; /* number of args to procedure (was iopt) */ - PDR pdr; /* Procedure descriptor record */ + long numargs; /* Number of args to procedure (was iopt). */ + PDR pdr; /* Procedure descriptor record. */ }; /* Special symbol found in blocks associated with routines. We can diff --git a/gdb/memattr.c b/gdb/memattr.c index 99b1265a521..abf1d00ef3e 100644 --- a/gdb/memattr.c +++ b/gdb/memattr.c @@ -176,7 +176,7 @@ create_mem_region (CORE_ADDR lo, CORE_ADDR hi, struct mem_region new; int i, ix; - /* lo == hi is a useless empty region */ + /* lo == hi is a useless empty region. */ if (lo >= hi && hi != 0) { printf_unfiltered (_("invalid memory region: low >= high\n")); @@ -302,7 +302,7 @@ invalidate_target_mem_regions (void) mem_region_list = NULL; } -/* Clear memory region list */ +/* Clear memory region list. */ static void mem_clear (void) @@ -542,7 +542,7 @@ mem_info_command (char *args, int from_tty) } -/* Enable the memory region number NUM. */ +/* Enable the memory region number NUM. */ static void mem_enable (int num) @@ -596,7 +596,7 @@ mem_enable_command (char *args, int from_tty) } -/* Disable the memory region number NUM. */ +/* Disable the memory region number NUM. */ static void mem_disable (int num) @@ -649,7 +649,7 @@ mem_disable_command (char *args, int from_tty) } } -/* Delete the memory region number NUM. */ +/* Delete the memory region number NUM. */ static void mem_delete (int num) diff --git a/gdb/memattr.h b/gdb/memattr.h index cf41c979c36..55967306868 100644 --- a/gdb/memattr.h +++ b/gdb/memattr.h @@ -25,7 +25,7 @@ enum mem_access_mode { - MEM_NONE, /* Memory that is not physically present. */ + MEM_NONE, /* Memory that is not physically present. */ MEM_RW, /* read/write */ MEM_RO, /* read only */ MEM_WO, /* write only */ @@ -51,7 +51,7 @@ enum mem_access_width the mem_region structure. FIXME: It would be useful if there was a mechanism for targets to - add their own attributes. For example, the number of wait states. */ + add their own attributes. For example, the number of wait states. */ struct mem_attrib { @@ -66,9 +66,9 @@ struct mem_attrib /* enables host-side caching of memory region data */ int cache; - /* enables memory verification. after a write, memory is re-read - to verify that the write was successful. */ - int verify; + /* Enables memory verification. After a write, memory is re-read + to verify that the write was successful. */ + int verify; /* Block size. Only valid if mode == MEM_FLASH. */ int blocksize; @@ -82,13 +82,14 @@ struct mem_region If 0, upper bound is "infinity". */ CORE_ADDR hi; - /* Item number of this memory region. */ + /* Item number of this memory region. */ int number; - /* Status of this memory region (enabled if non-zero, otherwise disabled) */ + /* Status of this memory region (enabled if non-zero, otherwise + disabled). */ int enabled_p; - /* Attributes for this region */ + /* Attributes for this region. */ struct mem_attrib attrib; }; diff --git a/gdb/memory-map.h b/gdb/memory-map.h index 7b7f2e48256..64a711f94ce 100644 --- a/gdb/memory-map.h +++ b/gdb/memory-map.h @@ -26,7 +26,8 @@ /* Parses XML memory map passed as argument and returns the memory regions it describes. On any error, emits error message and - returns 0. Does not throw. Ownership of result is passed to the caller. */ + returns 0. Does not throw. Ownership of result is passed to the + caller. */ VEC(mem_region_s) *parse_memory_map (const char *memory_map); #endif diff --git a/gdb/mep-tdep.c b/gdb/mep-tdep.c index 5ed904ff270..067d131153b 100644 --- a/gdb/mep-tdep.c +++ b/gdb/mep-tdep.c @@ -1271,7 +1271,7 @@ mep_pseudo_register_write (struct gdbarch *gdbarch, /* Disassembly. */ /* The mep disassembler needs to know about the section in order to - work correctly. */ + work correctly. */ static int mep_gdb_print_insn (bfd_vma pc, disassemble_info * info) { @@ -1325,7 +1325,7 @@ mep_gdb_print_insn (bfd_vma pc, disassemble_info * info) Every bundle is four bytes long, and naturally aligned, and can hold one or two instructions: - 16-bit core instruction; 16-bit coprocessor instruction - These execute in parallel. + These execute in parallel. - 32-bit core instruction - 32-bit coprocessor instruction @@ -1333,9 +1333,9 @@ mep_gdb_print_insn (bfd_vma pc, disassemble_info * info) Every bundle is eight bytes long, and naturally aligned, and can hold one or two instructions: - 16-bit core instruction; 48-bit (!) coprocessor instruction - These execute in parallel. + These execute in parallel. - 32-bit core instruction; 32-bit coprocessor instruction - These execute in parallel. + These execute in parallel. - 64-bit coprocessor instruction Now, the MeP manual doesn't define any 48- or 64-bit coprocessor @@ -1825,7 +1825,7 @@ mep_analyze_prologue (struct gdbarch *gdbarch, body, gcc 4.x will use a BRA instruction to branch to the loop condition checking code. This BRA instruction is marked as part of the prologue. We therefore set next_pc - to this branch target and also stop the prologue scan. + to this branch target and also stop the prologue scan. The instructions at and beyond the branch target should no longer be associated with the prologue. @@ -2145,7 +2145,7 @@ mep_extract_return_value (struct gdbarch *arch, else offset = 0; - /* Return values that do fit in a single register are returned in R0. */ + /* Return values that do fit in a single register are returned in R0. */ regcache_cooked_read_part (regcache, MEP_R0_REGNUM, offset, TYPE_LENGTH (type), valbuf); @@ -2180,7 +2180,7 @@ mep_store_return_value (struct gdbarch *arch, /* Return values larger than a single register are returned in memory, pointed to by R0. Unfortunately, we can't count on R0 - pointing to the return buffer, so we raise an error here. */ + pointing to the return buffer, so we raise an error here. */ else error ("GDB cannot set return values larger than four bytes; " "the Media Processor's\n" @@ -2209,7 +2209,7 @@ mep_return_value (struct gdbarch *gdbarch, struct type *func_type, { /* Return values larger than a single register are returned in memory, pointed to by R0. Unfortunately, we can't count on R0 - pointing to the return buffer, so we raise an error here. */ + pointing to the return buffer, so we raise an error here. */ error ("GDB cannot set return values larger than four bytes; " "the Media Processor's\n" "calling conventions do not provide enough information " @@ -2246,15 +2246,15 @@ mep_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp) 4.2.1 Core register conventions - Parameters should be evaluated from left to right, and they - should be held in $1,$2,$3,$4 in order. The fifth parameter or - after should be held in the stack. If the size is larger than 4 + should be held in $1,$2,$3,$4 in order. The fifth parameter or + after should be held in the stack. If the size is larger than 4 bytes in the first four parameters, the pointer should be held in - the registers instead. If the size is larger than 4 bytes in the + the registers instead. If the size is larger than 4 bytes in the fifth parameter or after, the pointer should be held in the stack. - - Return value of a function should be held in register $0. If the + - Return value of a function should be held in register $0. If the size of return value is larger than 4 bytes, $1 should hold the - pointer pointing memory that would hold the return value. In this + pointer pointing memory that would hold the return value. In this case, the first parameter should be held in $2, the second one in $3, and the third one in $4, and the forth parameter or after should be held in the stack. diff --git a/gdb/microblaze-rom.c b/gdb/microblaze-rom.c index 1bd2b9cda7c..3e05ea84247 100644 --- a/gdb/microblaze-rom.c +++ b/gdb/microblaze-rom.c @@ -31,7 +31,7 @@ static char *picobug_inits[] = static struct target_ops picobug_ops; static struct monitor_ops picobug_cmds; -/* Picobug only supports a subset of registers from MCore. In reality, +/* Picobug only supports a subset of registers from MCore. In reality, it doesn't support ss1, either. */ static char *picobug_regnames[] = { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", @@ -81,7 +81,7 @@ picobug_dumpregs (struct regcache *regcache) { if (strchr (p, '-')) { - /* got a range. either r0-r7, r8-r15 or ss0-ss4. */ + /* Got a range. Either r0-r7, r8-r15 or ss0-ss4. */ if (strncmp (p, "r0", 2) == 0 || strncmp (p, "r8", 2) == 0) { int rn = (p[1] == '0' ? 0 : 8); @@ -98,7 +98,7 @@ picobug_dumpregs (struct regcache *regcache) } else if (strncmp (p, "ss", 2) == 0) { - /* get the next five values, ignoring the first. */ + /* Get the next five values, ignoring the first. */ int rn; p = strtok (NULL, " \t\r\n"); for (rn = 39; rn < 43; rn++) diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c index 60b05623da7..1e994a2d6cf 100644 --- a/gdb/microblaze-tdep.c +++ b/gdb/microblaze-tdep.c @@ -49,19 +49,19 @@ This set also needs to be verified if it is complete. */ #define IS_RETURN(op) (op == rtsd || op == rtid) #define IS_UPDATE_SP(op, rd, ra) \ - ((op == addik || op == addi) && rd == REG_SP && ra == REG_SP) + ((op == addik || op == addi) && rd == REG_SP && ra == REG_SP) #define IS_SPILL_SP(op, rd, ra) \ - ((op == swi || op == sw) && rd == REG_SP && ra == REG_SP) + ((op == swi || op == sw) && rd == REG_SP && ra == REG_SP) #define IS_SPILL_REG(op, rd, ra) \ - ((op == swi || op == sw) && rd != REG_SP && ra == REG_SP) + ((op == swi || op == sw) && rd != REG_SP && ra == REG_SP) #define IS_ALSO_SPILL_REG(op, rd, ra, rb) \ - ((op == swi || op == sw) && rd != REG_SP && ra == 0 && rb == REG_SP) + ((op == swi || op == sw) && rd != REG_SP && ra == 0 && rb == REG_SP) #define IS_SETUP_FP(op, ra, rb) \ - ((op == add || op == addik || op == addk) && ra == REG_SP && rb == 0) + ((op == add || op == addik || op == addk) && ra == REG_SP && rb == 0) #define IS_SPILL_REG_FP(op, rd, ra, fpregnum) \ - ((op == swi || op == sw) && rd != REG_SP && ra == fpregnum && ra != 0) + ((op == swi || op == sw) && rd != REG_SP && ra == fpregnum && ra != 0) #define IS_SAVE_HIDDEN_PTR(op, rd, ra, rb) \ - ((op == add || op == addik) && ra == MICROBLAZE_FIRST_ARGREG && rb == 0) + ((op == add || op == addik) && ra == MICROBLAZE_FIRST_ARGREG && rb == 0) /* The registers of the Xilinx microblaze processor. */ @@ -221,7 +221,7 @@ microblaze_alloc_frame_cache (void) /* Analyze the prologue to determine where registers are saved, the end of the prologue, etc. Return the address of the first line - of "real" code (i.e., the end of the prologue). */ + of "real" code (i.e., the end of the prologue). */ static CORE_ADDR microblaze_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, @@ -237,7 +237,7 @@ microblaze_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, int save_hidden_pointer_found = 0; int non_stack_instruction_found = 0; - /* Find the start of this function. */ + /* Find the start of this function. */ find_pc_partial_function (pc, &name, &func_addr, &func_end); if (func_addr < pc) pc = func_addr; @@ -257,7 +257,7 @@ microblaze_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, If we're about to return, our frame has already been deallocated. If we are stopped at the first instruction of a prologue, - then our frame has not yet been set up. */ + then our frame has not yet been set up. */ /* Get the first insn from memory. */ @@ -331,7 +331,7 @@ microblaze_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, else if (IS_SETUP_FP(op, ra, rb)) { /* We have a frame pointer. Note the register which is - acting as the frame pointer. */ + acting as the frame pointer. */ flags |= MICROBLAZE_MY_FRAME_IN_FP; flags &= ~MICROBLAZE_MY_FRAME_IN_SP; cache->fp_regnum = rd; @@ -376,7 +376,7 @@ microblaze_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, /* When optimizations are enabled, it is not guaranteed that prologue instructions are not mixed in with other instructions from the - program. Some programs show this behavior at -O2. This can be + program. Some programs show this behavior at -O2. This can be avoided by adding -fno-schedule-insns2 switch as of now (edk 8.1) In such cases, we scan the function until we see the first control instruction. */ @@ -391,7 +391,7 @@ microblaze_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, continue; /* continue if imm. */ } - /* This is not a prologue insn, so stop here. */ + /* This is not a prologue insn, so stop here. */ microblaze_debug ("insn is not a prologue insn -- ending scan\n"); break; } @@ -509,7 +509,8 @@ microblaze_frame_prev_register (struct frame_info *this_frame, regnum = 15; if (regnum == MICROBLAZE_SP_REGNUM) regnum = 1; - return trad_frame_get_prev_register (this_frame, cache->saved_regs, regnum); + return trad_frame_get_prev_register (this_frame, + cache->saved_regs, regnum); } else return trad_frame_get_prev_register (this_frame, cache->saved_regs, @@ -527,7 +528,8 @@ static const struct frame_unwind microblaze_frame_unwind = }; static CORE_ADDR -microblaze_frame_base_address (struct frame_info *next_frame, void **this_cache) +microblaze_frame_base_address (struct frame_info *next_frame, + void **this_cache) { struct microblaze_frame_cache *cache = microblaze_frame_cache (next_frame, this_cache); @@ -581,8 +583,7 @@ microblaze_extract_return_value (struct type *type, struct regcache *regcache, Longs are stored in r3 (most significant word) and r4 (least significant word). - Small structures are always returned on stack. -*/ + Small structures are always returned on stack. */ static void microblaze_store_return_value (struct type *type, struct regcache *regcache, @@ -720,7 +721,7 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Hook in ABI-specific overrides, if they have been registered. */ gdbarch_init_osabi (info, gdbarch); - /* Unwind the frame. */ + /* Unwind the frame. */ dwarf2_append_unwinders (gdbarch); frame_unwind_append_unwinder (gdbarch, µblaze_frame_unwind); frame_base_append_sniffer (gdbarch, dwarf2_frame_base_sniffer); diff --git a/gdb/minsyms.c b/gdb/minsyms.c index 77159a53c05..8497991f04a 100644 --- a/gdb/minsyms.c +++ b/gdb/minsyms.c @@ -35,7 +35,7 @@ Even when a file contains enough debugging information to build a full symbol table, these minimal symbols are still useful for quickly mapping between names and addresses, and vice versa. They are also sometimes used - to figure out what full symbol table entries need to be read in. */ + to figure out what full symbol table entries need to be read in. */ #include "defs.h" @@ -205,7 +205,7 @@ lookup_minimal_symbol (const char *name, const char *sfile, sfile = p + 1; } - /* For C++, canonicalize the input name. */ + /* For C++, canonicalize the input name. */ modified_name = name; if (current_language->la_language == language_cplus) { @@ -267,9 +267,9 @@ lookup_minimal_symbol (const char *name, const char *sfile, case mst_solib_trampoline: /* If a trampoline symbol is found, we prefer to - keep looking for the *real* symbol. If the + keep looking for the *real* symbol. If the actual symbol is not found, then we'll use the - trampoline entry. */ + trampoline entry. */ if (trampoline_symbol == NULL) trampoline_symbol = msymbol; break; @@ -489,7 +489,7 @@ lookup_minimal_symbol_by_pc_section_1 (CORE_ADDR pc, a binary search. Note that a minimal symbol table always consists of at least two symbols, a "real" symbol and the terminating "null symbol". If there are no real symbols, then there is no - minimal symbol table at all. */ + minimal symbol table at all. */ if (objfile->minimal_symbol_count > 0) { @@ -515,15 +515,15 @@ lookup_minimal_symbol_by_pc_section_1 (CORE_ADDR pc, terminates. In essence, we are iterating the test interval down until the pc value is pushed out of it from the high end. - Warning: this code is trickier than it would appear at first. */ + Warning: this code is trickier than it would appear at first. */ - /* Should also require that pc is <= end of objfile. FIXME! */ + /* Should also require that pc is <= end of objfile. FIXME! */ if (pc >= SYMBOL_VALUE_ADDRESS (&msymbol[lo])) { while (SYMBOL_VALUE_ADDRESS (&msymbol[hi]) > pc) { - /* pc is still strictly less than highest address */ - /* Note "new" will always be >= lo */ + /* pc is still strictly less than highest address. */ + /* Note "new" will always be >= lo. */ new = (lo + hi) / 2; if ((SYMBOL_VALUE_ADDRESS (&msymbol[new]) >= pc) || (lo == new)) @@ -662,7 +662,7 @@ lookup_minimal_symbol_by_pc_section_1 (CORE_ADDR pc, /* The minimal symbol indexed by hi now is the best one in this objfile's minimal symbol table. See if it is the best one - overall. */ + overall. */ if (hi >= 0 && ((best_symbol == NULL) || @@ -693,7 +693,7 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc, struct obj_section *section) } /* Backward compatibility: search through the minimal symbol table - for a matching PC (no section given) */ + for a matching PC (no section given). */ struct minimal_symbol * lookup_minimal_symbol_by_pc (CORE_ADDR pc) @@ -733,7 +733,7 @@ lookup_minimal_symbol_and_objfile (const char *name, } -/* Return leading symbol character for a BFD. If BFD is NULL, +/* Return leading symbol character for a BFD. If BFD is NULL, return the leading symbol character from the main objfile. */ static int get_symbol_leading_char (bfd *); @@ -750,7 +750,7 @@ get_symbol_leading_char (bfd *abfd) /* Prepare to start collecting minimal symbols. Note that presetting msym_bunch_index to BUNCH_SIZE causes the first call to save a minimal - symbol to allocate the memory for the first bunch. */ + symbol to allocate the memory for the first bunch. */ void init_minimal_symbol_collection (void) @@ -816,7 +816,7 @@ prim_record_minimal_symbol_full (const char *name, int name_len, int copy_name, return (NULL); /* It's safe to strip the leading char here once, since the name - is also stored stripped in the minimal symbol table. */ + is also stored stripped in the minimal symbol table. */ if (name[0] == get_symbol_leading_char (objfile->obfd)) { ++name; @@ -858,7 +858,7 @@ prim_record_minimal_symbol_full (const char *name, int name_len, int copy_name, MSYMBOL_SIZE (msymbol) = 0; /* The hash pointers must be cleared! If they're not, - add_minsym_to_hash_table will NOT add this msymbol to the hash table. */ + add_minsym_to_hash_table will NOT add this msymbol to the hash table. */ msymbol->hash_next = NULL; msymbol->demangled_hash_next = NULL; @@ -884,7 +884,7 @@ prim_record_minimal_symbol_and_info (const char *name, CORE_ADDR address, } /* Compare two minimal symbols by address and return a signed result based - on unsigned comparisons, so that we sort into unsigned numeric order. + on unsigned comparisons, so that we sort into unsigned numeric order. Within groups with the same address, sort by name. */ static int @@ -898,11 +898,11 @@ compare_minimal_symbols (const void *fn1p, const void *fn2p) if (SYMBOL_VALUE_ADDRESS (fn1) < SYMBOL_VALUE_ADDRESS (fn2)) { - return (-1); /* addr 1 is less than addr 2 */ + return (-1); /* addr 1 is less than addr 2. */ } else if (SYMBOL_VALUE_ADDRESS (fn1) > SYMBOL_VALUE_ADDRESS (fn2)) { - return (1); /* addr 1 is greater than addr 2 */ + return (1); /* addr 1 is greater than addr 2. */ } else /* addrs are equal: sort by name */ @@ -913,11 +913,11 @@ compare_minimal_symbols (const void *fn1p, const void *fn2p) if (name1 && name2) /* both have names */ return strcmp (name1, name2); else if (name2) - return 1; /* fn1 has no name, so it is "less" */ - else if (name1) /* fn2 has no name, so it is "less" */ + return 1; /* fn1 has no name, so it is "less". */ + else if (name1) /* fn2 has no name, so it is "less". */ return -1; else - return (0); /* neither has a name, so they're equal. */ + return (0); /* Neither has a name, so they're equal. */ } } @@ -927,7 +927,7 @@ compare_minimal_symbols (const void *fn1p, const void *fn2p) FIXME: We could allocate the minimal symbol bunches on their own obstack and then simply blow the obstack away when we are done with - it. Is it worth the extra trouble though? */ + it. Is it worth the extra trouble though? */ static void do_discard_minimal_symbols_cleanup (void *arg) @@ -1020,7 +1020,7 @@ compact_minimal_symbols (struct minimal_symbol *msymbol, int mcount, /* Build (or rebuild) the minimal symbol hash tables. This is necessary after compacting or sorting the table since the entries move around - thus causing the internal minimal_symbol pointers to become jumbled. */ + thus causing the internal minimal_symbol pointers to become jumbled. */ static void build_minimal_symbol_hash_tables (struct objfile *objfile) @@ -1028,14 +1028,14 @@ build_minimal_symbol_hash_tables (struct objfile *objfile) int i; struct minimal_symbol *msym; - /* Clear the hash tables. */ + /* Clear the hash tables. */ for (i = 0; i < MINIMAL_SYMBOL_HASH_SIZE; i++) { objfile->msymbol_hash[i] = 0; objfile->msymbol_demangled_hash[i] = 0; } - /* Now, (re)insert the actual entries. */ + /* Now, (re)insert the actual entries. */ for (i = objfile->minimal_symbol_count, msym = objfile->msymbols; i > 0; i--, msym++) @@ -1071,7 +1071,7 @@ build_minimal_symbol_hash_tables (struct objfile *objfile) to demangle it, and if successful, record it as a language_cplus symbol and cache the demangled form on the symbol obstack. Symbols which don't demangle are marked as language_unknown symbols, which inhibits future - attempts to demangle them if we later add more minimal symbols. */ + attempts to demangle them if we later add more minimal symbols. */ void install_minimal_symbols (struct objfile *objfile) @@ -1105,7 +1105,7 @@ install_minimal_symbols (struct objfile *objfile) to the new contiguous array of symbols. Note that we start with the current, possibly partially filled bunch (thus we use the current msym_bunch_index for the first bunch we copy over), and thereafter - each bunch is full. */ + each bunch is full. */ mcount = objfile->minimal_symbol_count; @@ -1137,7 +1137,7 @@ install_minimal_symbols (struct objfile *objfile) to some symbol in the middle of it. Zero out the fields in the "null symbol" allocated at the end of the array. Note that the symbol count does *not* include this null symbol, which is why it - is indexed by mcount and not mcount-1. */ + is indexed by mcount and not mcount-1. */ SYMBOL_LINKAGE_NAME (&msymbols[mcount]) = NULL; SYMBOL_VALUE_ADDRESS (&msymbols[mcount]) = 0; @@ -1180,7 +1180,7 @@ install_minimal_symbols (struct objfile *objfile) /* Now build the hash tables; we can't do this incrementally at an earlier point since we weren't finished with the obstack yet. (And if the msymbol obstack gets moved, all the internal - pointers to other msymbols need to be adjusted.) */ + pointers to other msymbols need to be adjusted.) */ build_minimal_symbol_hash_tables (objfile); } } @@ -1221,7 +1221,7 @@ lookup_solib_trampoline_symbol_by_pc (CORE_ADDR pc) We may fail to find the right function if a function with the same name is defined in more than one shared library, but this - is considered bad programming style. We could return 0 if we find + is considered bad programming style. We could return 0 if we find a duplicate function in case this matters someday. */ CORE_ADDR diff --git a/gdb/mips-irix-tdep.c b/gdb/mips-irix-tdep.c index 1edba6c50b2..c49e0839d1a 100644 --- a/gdb/mips-irix-tdep.c +++ b/gdb/mips-irix-tdep.c @@ -69,7 +69,7 @@ mips_irix_elf_osabi_sniffer (bfd *abfd) /* When elfosabi is ELFOSABI_NONE (0), then the ELF structures in the file are conforming to the base specification for that machine (there are no OS-specific extensions). In order to determine the - real OS in use we must look for OS notes that have been added. + real OS in use we must look for OS notes that have been added. For IRIX, we simply look for sections named with .MIPS. as prefixes. */ diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c index ed1a67e5f3e..2b90113d933 100644 --- a/gdb/mips-linux-nat.c +++ b/gdb/mips-linux-nat.c @@ -182,7 +182,8 @@ supply_fpregset (struct regcache *regcache, const gdb_fpregset_t *fpregsetp) if (mips_isa_regsize (get_regcache_arch (regcache)) == 4) mips_supply_fpregset (regcache, (const mips_elf_fpregset_t *) fpregsetp); else - mips64_supply_fpregset (regcache, (const mips64_elf_fpregset_t *) fpregsetp); + mips64_supply_fpregset (regcache, + (const mips64_elf_fpregset_t *) fpregsetp); } void @@ -192,7 +193,8 @@ fill_fpregset (const struct regcache *regcache, if (mips_isa_regsize (get_regcache_arch (regcache)) == 4) mips_fill_fpregset (regcache, (mips_elf_fpregset_t *) fpregsetp, regno); else - mips64_fill_fpregset (regcache, (mips64_elf_fpregset_t *) fpregsetp, regno); + mips64_fill_fpregset (regcache, + (mips64_elf_fpregset_t *) fpregsetp, regno); } @@ -262,7 +264,8 @@ mips64_linux_regsets_fetch_registers (struct regcache *regcache, int regno) using PTRACE_SETREGS et al. */ static void -mips64_linux_regsets_store_registers (const struct regcache *regcache, int regno) +mips64_linux_regsets_store_registers (const struct regcache *regcache, + int regno) { struct gdbarch *gdbarch = get_regcache_arch (regcache); int is_fp; @@ -393,12 +396,12 @@ enum pt_watch_style { #define MAX_DEBUG_REGISTER 8 -/* A value of zero in a watchlo indicates that it is available. */ +/* A value of zero in a watchlo indicates that it is available. */ struct mips32_watch_regs { uint32_t watchlo[MAX_DEBUG_REGISTER]; - /* Lower 16 bits of watchhi. */ + /* Lower 16 bits of watchhi. */ uint16_t watchhi[MAX_DEBUG_REGISTER]; /* Valid mask and I R W bits. * bit 0 -- 1 if W bit is usable. @@ -710,7 +713,7 @@ mips_linux_can_use_hw_breakpoint (int type, int cnt, int ot) /* Target to_stopped_by_watchpoint implementation. Return 1 if stopped by watchpoint. The watchhi R and W bits indicate the watch - register triggered. */ + register triggered. */ static int mips_linux_stopped_by_watchpoint (void) diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c index e0592853d46..be346d75844 100644 --- a/gdb/mips-linux-tdep.c +++ b/gdb/mips-linux-tdep.c @@ -413,7 +413,8 @@ mips64_fill_gregset (const struct regcache *regcache, mips64_fill_gregset (regcache, gregsetp, mips_regnum (gdbarch)->lo); mips64_fill_gregset (regcache, gregsetp, mips_regnum (gdbarch)->hi); mips64_fill_gregset (regcache, gregsetp, mips_regnum (gdbarch)->pc); - mips64_fill_gregset (regcache, gregsetp, mips_regnum (gdbarch)->badvaddr); + mips64_fill_gregset (regcache, gregsetp, + mips_regnum (gdbarch)->badvaddr); mips64_fill_gregset (regcache, gregsetp, MIPS_PS_REGNUM); mips64_fill_gregset (regcache, gregsetp, mips_regnum (gdbarch)->cause); mips64_fill_gregset (regcache, gregsetp, MIPS_RESTART_REGNUM); @@ -538,7 +539,8 @@ mips64_fill_fpregset (const struct regcache *regcache, } else { - to = (gdb_byte *) (*fpregsetp + regno - gdbarch_fp0_regnum (gdbarch)); + to = (gdb_byte *) (*fpregsetp + regno + - gdbarch_fp0_regnum (gdbarch)); regcache_raw_collect (regcache, regno, to); } } diff --git a/gdb/mips-linux-tdep.h b/gdb/mips-linux-tdep.h index 7b87175a8d9..d8be23017fe 100644 --- a/gdb/mips-linux-tdep.h +++ b/gdb/mips-linux-tdep.h @@ -87,9 +87,12 @@ typedef mips64_elf_fpreg_t mips64_elf_fpregset_t[MIPS64_ELF_NFPREG]; #define MIPS64_EF_SIZE 304 void mips64_supply_gregset (struct regcache *, const mips64_elf_gregset_t *); -void mips64_fill_gregset (const struct regcache *, mips64_elf_gregset_t *, int); -void mips64_supply_fpregset (struct regcache *, const mips64_elf_fpregset_t *); -void mips64_fill_fpregset (const struct regcache *, mips64_elf_fpregset_t *, int); +void mips64_fill_gregset (const struct regcache *, + mips64_elf_gregset_t *, int); +void mips64_supply_fpregset (struct regcache *, + const mips64_elf_fpregset_t *); +void mips64_fill_fpregset (const struct regcache *, + mips64_elf_fpregset_t *, int); enum { /* The Linux kernel stores an error code from any interrupted diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index f5ba61f1655..1ab2e135945 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -185,9 +185,11 @@ mips_fpa0_regnum (struct gdbarch *gdbarch) == MIPS_ABI_EABI32 \ || gdbarch_tdep (gdbarch)->mips_abi == MIPS_ABI_EABI64) -#define MIPS_LAST_FP_ARG_REGNUM(gdbarch) (gdbarch_tdep (gdbarch)->mips_last_fp_arg_regnum) +#define MIPS_LAST_FP_ARG_REGNUM(gdbarch) \ + (gdbarch_tdep (gdbarch)->mips_last_fp_arg_regnum) -#define MIPS_LAST_ARG_REGNUM(gdbarch) (gdbarch_tdep (gdbarch)->mips_last_arg_regnum) +#define MIPS_LAST_ARG_REGNUM(gdbarch) \ + (gdbarch_tdep (gdbarch)->mips_last_arg_regnum) #define MIPS_FPU_TYPE(gdbarch) (gdbarch_tdep (gdbarch)->mips_fpu_type) @@ -233,7 +235,7 @@ mips_isa_regsize (struct gdbarch *gdbarch) / gdbarch_bfd_arch_info (gdbarch)->bits_per_byte); } -/* Return the currently configured (or set) saved register size. */ +/* Return the currently configured (or set) saved register size. */ unsigned int mips_abi_regsize (struct gdbarch *gdbarch) @@ -370,7 +372,7 @@ static CORE_ADDR heuristic_proc_start (struct gdbarch *, CORE_ADDR); static void reinit_frame_cache_sfunc (char *, int, struct cmd_list_element *); -/* The list of available "set mips " and "show mips " commands */ +/* The list of available "set mips " and "show mips " commands. */ static struct cmd_list_element *setmipscmdlist = NULL; static struct cmd_list_element *showmipscmdlist = NULL; @@ -724,7 +726,8 @@ mips_convert_register_gpreg_case_p (struct gdbarch *gdbarch, int regnum, } static int -mips_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type) +mips_convert_register_p (struct gdbarch *gdbarch, + int regnum, struct type *type) { return mips_convert_register_float_case_p (gdbarch, regnum, type) || mips_convert_register_gpreg_case_p (gdbarch, regnum, type); @@ -911,7 +914,7 @@ mips_pseudo_register_type (struct gdbarch *gdbarch, int regnum) return rawtype; } -/* Should the upper word of 64-bit addresses be zeroed? */ +/* Should the upper word of 64-bit addresses be zeroed? */ enum auto_boolean mask_address_var = AUTO_BOOLEAN_AUTO; static int @@ -927,7 +930,8 @@ mips_mask_address_p (struct gdbarch_tdep *tdep) case AUTO_BOOLEAN_AUTO: return tdep->default_mask_address_p; default: - internal_error (__FILE__, __LINE__, _("mips_mask_address_p: bad switch")); + internal_error (__FILE__, __LINE__, + _("mips_mask_address_p: bad switch")); return -1; } } @@ -965,7 +969,7 @@ mips_pc_is_mips16 (CORE_ADDR memaddr) { struct minimal_symbol *sym; - /* If bit 0 of the address is set, assume this is a MIPS16 address. */ + /* If bit 0 of the address is set, assume this is a MIPS16 address. */ if (is_mips16_addr (memaddr)) return 1; @@ -980,7 +984,7 @@ mips_pc_is_mips16 (CORE_ADDR memaddr) } /* MIPS believes that the PC has a sign extended value. Perhaps the - all registers should be sign extended for simplicity? */ + all registers should be sign extended for simplicity? */ static CORE_ADDR mips_read_pc (struct regcache *regcache) @@ -1061,7 +1065,7 @@ mips_fetch_instruction (struct gdbarch *gdbarch, CORE_ADDR addr) return extract_unsigned_integer (buf, instlen, byte_order); } -/* These the fields of 32 bit mips instructions */ +/* These are the fields of 32 bit mips instructions. */ #define mips32_op(x) (x >> 26) #define itype_op(x) (x >> 26) #define itype_rs(x) ((x >> 21) & 0x1f) @@ -1093,7 +1097,8 @@ mips32_next_pc (struct frame_info *frame, CORE_ADDR pc) unsigned long inst; int op; inst = mips_fetch_instruction (gdbarch, pc); - if ((inst & 0xe0000000) != 0) /* Not a special, jump or branch instruction */ + if ((inst & 0xe0000000) != 0) /* Not a special, jump or branch + instruction. */ { if (itype_op (inst) >> 2 == 5) /* BEQL, BNEL, BLEZL, BGTZL: bits 0101xx */ @@ -1130,13 +1135,13 @@ mips32_next_pc (struct frame_info *frame, CORE_ADDR pc) pc += 8; } else - pc += 4; /* Not a branch, next instruction is easy */ + pc += 4; /* Not a branch, next instruction is easy. */ } else - { /* This gets way messy */ + { /* This gets way messy. */ - /* Further subdivide into SPECIAL, REGIMM and other */ - switch (op = itype_op (inst) & 0x07) /* extract bits 28,27,26 */ + /* Further subdivide into SPECIAL, REGIMM and other. */ + switch (op = itype_op (inst) & 0x07) /* Extract bits 28,27,26. */ { case 0: /* SPECIAL */ op = rtype_funct (inst); @@ -1144,7 +1149,7 @@ mips32_next_pc (struct frame_info *frame, CORE_ADDR pc) { case 8: /* JR */ case 9: /* JALR */ - /* Set PC to that address */ + /* Set PC to that address. */ pc = get_frame_register_signed (frame, rtype_rs (inst)); break; case 12: /* SYSCALL */ @@ -1163,7 +1168,7 @@ mips32_next_pc (struct frame_info *frame, CORE_ADDR pc) } break; /* end SPECIAL */ - case 1: /* REGIMM */ + case 1: /* REGIMM */ { op = itype_rt (inst); /* branch condition */ switch (op) @@ -1198,7 +1203,7 @@ mips32_next_pc (struct frame_info *frame, CORE_ADDR pc) { unsigned long reg; reg = jtype_target (inst) << 2; - /* Upper four bits get never changed... */ + /* Upper four bits get never changed... */ pc = reg + ((pc + 4) & ~(CORE_ADDR) 0x0fffffff); } break; @@ -1206,7 +1211,7 @@ mips32_next_pc (struct frame_info *frame, CORE_ADDR pc) { unsigned long reg; reg = jtype_target (inst) << 2; - pc = reg + ((pc + 4) & ~(CORE_ADDR) 0x0fffffff) + 1; /* yes, +1 */ + pc = reg + ((pc + 4) & ~(CORE_ADDR) 0x0fffffff) + 1; /* yes, +1 */ /* Add 1 to indicate 16 bit mode - Invert ISA mode */ } break; /* The new PC will be alternate mode */ @@ -1246,16 +1251,14 @@ mips32_next_pc (struct frame_info *frame, CORE_ADDR pc) } /* mips32_next_pc */ /* Decoding the next place to set a breakpoint is irregular for the - mips 16 variant, but fortunately, there fewer instructions. We have to cope - ith extensions for 16 bit instructions and a pair of actual 32 bit instructions. - We dont want to set a single step instruction on the extend instruction - either. - */ + mips 16 variant, but fortunately, there fewer instructions. We have + to cope ith extensions for 16 bit instructions and a pair of actual + 32 bit instructions. We dont want to set a single step instruction + on the extend instruction either. */ /* Lots of mips16 instruction formats */ /* Predicting jumps requires itype,ritype,i8type - and their extensions extItype,extritype,extI8type - */ + and their extensions extItype,extritype,extI8type. */ enum mips16_inst_fmts { itype, /* 0 immediate 5,10 */ @@ -1282,11 +1285,11 @@ enum mips16_inst_fmts extshift64type /* 21 5,5,1,1,1,1,1,1,5,1,1,1,3,5 */ }; /* I am heaping all the fields of the formats into one structure and - then, only the fields which are involved in instruction extension */ + then, only the fields which are involved in instruction extension. */ struct upk_mips16 { CORE_ADDR offset; - unsigned int regx; /* Function in i8 type */ + unsigned int regx; /* Function in i8 type. */ unsigned int regy; }; @@ -1300,7 +1303,7 @@ extended_offset (unsigned int extension) CORE_ADDR value; value = (extension >> 21) & 0x3f; /* * extract 15:11 */ value = value << 6; - value |= (extension >> 16) & 0x1f; /* extrace 10:5 */ + value |= (extension >> 16) & 0x1f; /* extract 10:5 */ value = value << 5; value |= extension & 0x01f; /* extract 4:0 */ return value; @@ -1318,7 +1321,7 @@ fetch_mips_16 (struct gdbarch *gdbarch, CORE_ADDR pc) { enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); gdb_byte buf[8]; - pc &= 0xfffffffe; /* clear the low order bit */ + pc &= 0xfffffffe; /* Clear the low order bit. */ target_read_memory (pc, buf, 2); return extract_unsigned_integer (buf, 2, byte_order); } @@ -1346,7 +1349,7 @@ unpack_mips16 (struct gdbarch *gdbarch, CORE_ADDR pc, else { value = inst & 0x7ff; - /* FIXME : Consider sign extension */ + /* FIXME : Consider sign extension. */ } offset = value; regx = -1; @@ -1355,19 +1358,19 @@ unpack_mips16 (struct gdbarch *gdbarch, CORE_ADDR pc, break; case ritype: case i8type: - { /* A register identifier and an offset */ + { /* A register identifier and an offset. */ /* Most of the fields are the same as I type but the - immediate value is of a different length */ + immediate value is of a different length. */ CORE_ADDR value; if (extension) { value = extended_offset (extension); - value = value << 8; /* from the original instruction */ + value = value << 8; /* from the original instruction */ value |= inst & 0xff; /* eleven bits from instruction */ regx = (extension >> 8) & 0x07; /* or i8 funct */ - if (value & 0x4000) /* test the sign bit , bit 26 */ + if (value & 0x4000) /* Test the sign bit, bit 26. */ { - value &= ~0x3fff; /* remove the sign bit */ + value &= ~0x3fff; /* Remove the sign bit. */ value = -value; } } @@ -1375,10 +1378,10 @@ unpack_mips16 (struct gdbarch *gdbarch, CORE_ADDR pc, { value = inst & 0xff; /* 8 bits */ regx = (inst >> 8) & 0x07; /* or i8 funct */ - /* FIXME: Do sign extension , this format needs it */ - if (value & 0x80) /* THIS CONFUSES ME */ + /* FIXME: Do sign extension, this format needs it. */ + if (value & 0x80) /* THIS CONFUSES ME. */ { - value &= 0xef; /* remove the sign bit */ + value &= 0xef; /* Remove the sign bit. */ value = -value; } } @@ -1392,7 +1395,8 @@ unpack_mips16 (struct gdbarch *gdbarch, CORE_ADDR pc, unsigned int nexthalf; value = ((inst & 0x1f) << 5) | ((inst >> 5) & 0x1f); value = value << 16; - nexthalf = mips_fetch_instruction (gdbarch, pc + 2); /* low bit still set */ + nexthalf = mips_fetch_instruction (gdbarch, pc + 2); /* low bit + still set. */ value |= nexthalf; offset = value; regx = -1; @@ -1436,13 +1440,14 @@ extended_mips16_next_pc (struct frame_info *frame, CORE_ADDR pc, pc += (offset << 1) + 2; break; } - case 3: /* JAL , JALX - Watch out, these are 32 bit instruction */ + case 3: /* JAL , JALX - Watch out, these are 32 bit + instructions. */ { struct upk_mips16 upk; unpack_mips16 (gdbarch, pc, extension, insn, jalxtype, &upk); pc = add_offset_16 (pc, upk.offset); if ((insn >> 10) & 0x01) /* Exchange mode */ - pc = pc & ~0x01; /* Clear low bit, indicate 32 bit mode */ + pc = pc & ~0x01; /* Clear low bit, indicate 32 bit mode. */ else pc |= 0x01; break; @@ -1503,7 +1508,7 @@ extended_mips16_next_pc (struct frame_info *frame, CORE_ADDR pc, break; case 1: reg = 31; - break; /* Function return instruction */ + break; /* Function return instruction. */ case 2: reg = upk.regx; break; @@ -1520,7 +1525,7 @@ extended_mips16_next_pc (struct frame_info *frame, CORE_ADDR pc, case 30: /* This is an instruction extension. Fetch the real instruction (which follows the extension) and decode things based on - that. */ + that. */ { pc += 2; pc = extended_mips16_next_pc (frame, pc, insn, @@ -1547,7 +1552,7 @@ mips16_next_pc (struct frame_info *frame, CORE_ADDR pc) /* The mips_next_pc function supports single_step when the remote target monitor or stub is not developed enough to do a single_step. It works by decoding the current instruction and predicting where a - branch will go. This isnt hard because all the data is available. + branch will go. This isnt hard because all the data is available. The MIPS32 and MIPS16 variants are quite different. */ static CORE_ADDR mips_next_pc (struct frame_info *frame, CORE_ADDR pc) @@ -1600,7 +1605,7 @@ mips16_get_imm (unsigned short prev_inst, /* previous instruction */ unsigned short inst, /* current instruction */ int nbits, /* number of bits in imm field */ int scale, /* scale factor to be applied to imm */ - int is_signed) /* is the imm field signed? */ + int is_signed) /* is the imm field signed? */ { int offset; @@ -1636,12 +1641,12 @@ mips16_scan_prologue (struct gdbarch *gdbarch, struct mips_frame_cache *this_cache) { CORE_ADDR cur_pc; - CORE_ADDR frame_addr = 0; /* Value of $r17, used as frame pointer */ + CORE_ADDR frame_addr = 0; /* Value of $r17, used as frame pointer. */ CORE_ADDR sp; long frame_offset = 0; /* Size of stack frame. */ long frame_adjust = 0; /* Offset of FP from SP. */ int frame_reg = MIPS_SP_REGNUM; - unsigned short prev_inst = 0; /* saved copy of previous instruction */ + unsigned short prev_inst = 0; /* saved copy of previous instruction. */ unsigned inst = 0; /* current instruction */ unsigned entry_inst = 0; /* the entry instruction */ unsigned save_inst = 0; /* the save instruction */ @@ -1669,7 +1674,7 @@ mips16_scan_prologue (struct gdbarch *gdbarch, the immediate offset extension from it in mips16_get_imm. */ prev_inst = inst; - /* Fetch and decode the instruction. */ + /* Fetch and decode the instruction. */ inst = (unsigned short) mips_fetch_instruction (gdbarch, cur_pc); /* Normally we ignore extend instructions. However, if it is @@ -1690,7 +1695,7 @@ mips16_scan_prologue (struct gdbarch *gdbarch, || (inst & 0xff00) == 0xfb00) /* daddiu sp */ { offset = mips16_get_imm (prev_inst, inst, 8, 8, 1); - if (offset < 0) /* negative stack adjustment? */ + if (offset < 0) /* Negative stack adjustment? */ frame_offset -= offset; else /* Exit loop if a positive stack adjustment is found, which @@ -1746,10 +1751,10 @@ mips16_scan_prologue (struct gdbarch *gdbarch, } else if ((inst & 0xf81f) == 0xe809 && (inst & 0x700) != 0x700) /* entry */ - entry_inst = inst; /* save for later processing */ + entry_inst = inst; /* Save for later processing. */ else if ((inst & 0xff80) == 0x6480) /* save */ { - save_inst = inst; /* save for later processing */ + save_inst = inst; /* Save for later processing. */ if (prev_extend_bytes) /* extend */ save_inst |= prev_inst << 16; } @@ -1775,7 +1780,7 @@ mips16_scan_prologue (struct gdbarch *gdbarch, (before the prologue). But the value of the sp parameter to this function is the new SP (after the prologue has been executed). So we can't calculate those offsets until we've seen the entire prologue, - and can calculate what the old SP must have been. */ + and can calculate what the old SP must have been. */ if (entry_inst != 0) { int areg_count = (entry_inst >> 8) & 7; @@ -1913,7 +1918,7 @@ mips16_scan_prologue (struct gdbarch *gdbarch, gdbarch_num_regs (gdbarch) + frame_reg) + frame_offset - frame_adjust); /* FIXME: brobecker/2004-10-10: Just as in the mips32 case, we should - be able to get rid of the assignment below, evetually. But it's + be able to get rid of the assignment below, evetually. But it's still needed for now. */ this_cache->saved_regs[gdbarch_num_regs (gdbarch) + mips_regnum (gdbarch)->pc] @@ -2056,7 +2061,7 @@ reset_saved_regs (struct gdbarch *gdbarch, struct mips_frame_cache *this_cache) } } -/* Analyze the function prologue from START_PC to LIMIT_PC. Builds +/* Analyze the function prologue from START_PC to LIMIT_PC. Builds the associated FRAME_CACHE if not null. Return the address of the first instruction past the prologue. */ @@ -2067,7 +2072,8 @@ mips32_scan_prologue (struct gdbarch *gdbarch, struct mips_frame_cache *this_cache) { CORE_ADDR cur_pc; - CORE_ADDR frame_addr = 0; /* Value of $r30. Used by gcc for frame-pointer */ + CORE_ADDR frame_addr = 0; /* Value of $r30. Used by gcc for + frame-pointer. */ CORE_ADDR sp; long frame_offset; int frame_reg = MIPS_SP_REGNUM; @@ -2098,7 +2104,7 @@ restart: unsigned long inst, high_word, low_word; int reg; - /* Fetch the instruction. */ + /* Fetch the instruction. */ inst = (unsigned long) mips_fetch_instruction (gdbarch, cur_pc); /* Save some code by pre-extracting some useful fields. */ @@ -2106,11 +2112,11 @@ restart: low_word = inst & 0xffff; reg = high_word & 0x1f; - if (high_word == 0x27bd /* addiu $sp,$sp,-i */ + if (high_word == 0x27bd /* addiu $sp,$sp,-i */ || high_word == 0x23bd /* addi $sp,$sp,-i */ || high_word == 0x67bd) /* daddiu $sp,$sp,-i */ { - if (low_word & 0x8000) /* negative stack adjustment? */ + if (low_word & 0x8000) /* Negative stack adjustment? */ frame_offset += 0x10000 - low_word; else /* Exit loop if a positive stack adjustment is found, which @@ -2146,7 +2152,7 @@ restart: alloca_adjust = (unsigned) (frame_addr - (sp + low_word)); if (alloca_adjust > 0) { - /* FP > SP + frame_size. This may be because of + /* FP > SP + frame_size. This may be because of an alloca or somethings similar. Fix sp to "pre-alloca" value, and try again. */ sp += alloca_adjust; @@ -2176,7 +2182,7 @@ restart: alloca_adjust = (unsigned) (frame_addr - sp); if (alloca_adjust > 0) { - /* FP > SP + frame_size. This may be because of + /* FP > SP + frame_size. This may be because of an alloca or somethings similar. Fix sp to "pre-alloca" value, and try again. */ sp = frame_addr; @@ -2208,7 +2214,7 @@ restart: } /* The instructions below load $at or $t0 with an immediate value in preparation for a stack adjustment via - subu $sp,$sp,[$at,$t0]. These instructions could also + subu $sp,$sp,[$at,$t0]. These instructions could also initialize a local variable, so we accept them only before a stack adjustment instruction was seen. */ else if (!seen_sp_adjust @@ -2271,7 +2277,7 @@ restart: end_prologue_addr = cur_pc; /* In a frameless function, we might have incorrectly - skipped some load immediate instructions. Undo the skipping + skipped some load immediate instructions. Undo the skipping if the load immediate was not followed by a stack adjustment. */ if (load_immediate_bytes && !seen_sp_adjust) end_prologue_addr -= load_immediate_bytes; @@ -2589,14 +2595,14 @@ deal_with_atomic_sequence (struct gdbarch *gdbarch, { case 0: /* SPECIAL */ if (rtype_funct (insn) >> 1 == 4) /* JR, JALR */ - return 0; /* fallback to the standard single-step code. */ + return 0; /* fallback to the standard single-step code. */ break; case 1: /* REGIMM */ is_branch = ((itype_rt (insn) & 0xc0) == 0); /* B{LT,GE}Z* */ break; case 2: /* J */ case 3: /* JAL */ - return 0; /* fallback to the standard single-step code. */ + return 0; /* fallback to the standard single-step code. */ case 4: /* BEQ */ case 5: /* BNE */ case 6: /* BLEZ */ @@ -2637,7 +2643,7 @@ deal_with_atomic_sequence (struct gdbarch *gdbarch, breaks[0] = loc; /* Check for duplicated breakpoints. Check also for a breakpoint - placed (branch instruction's destination) in the atomic sequence */ + placed (branch instruction's destination) in the atomic sequence. */ if (last_breakpoint && pc <= breaks[1] && breaks[1] <= breaks[0]) last_breakpoint = 0; @@ -2671,7 +2677,7 @@ mips_software_single_step (struct frame_info *frame) } /* Test whether the PC points to the return instruction at the - end of a function. */ + end of a function. */ static int mips_about_to_return (struct gdbarch *gdbarch, CORE_ADDR pc) @@ -2715,7 +2721,7 @@ heuristic_proc_start (struct gdbarch *gdbarch, CORE_ADDR pc) inf = current_inferior (); - /* search back for previous return */ + /* Search back for previous return. */ for (start_pc -= instlen;; start_pc -= instlen) if (start_pc < fence) { @@ -2767,7 +2773,7 @@ heuristic-fence-post' command.\n", entry addiu sp,-n daddiu sp,-n - extend -n followed by 'addiu sp,+n' or 'daddiu sp,+n' */ + extend -n followed by 'addiu sp,+n' or 'daddiu sp,+n'. */ inst = mips_fetch_instruction (gdbarch, start_pc); if ((inst & 0xff80) == 0x6480) /* save */ { @@ -2811,7 +2817,7 @@ struct mips_objfile_private floating-point register (assuming that there is space)? When there is no FPU, FP are not even considered as possible candidates for FP registers and, consequently this returns false - forces FP - arguments into integer registers. */ + arguments into integer registers. */ static int fp_register_arg_p (struct gdbarch *gdbarch, enum type_code typecode, @@ -2828,7 +2834,7 @@ fp_register_arg_p (struct gdbarch *gdbarch, enum type_code typecode, } /* On o32, argument passing in GPRs depends on the alignment of the type being - passed. Return 1 if this type must be aligned to a doubleword boundary. */ + passed. Return 1 if this type must be aligned to a doubleword boundary. */ static int mips_type_needs_double_align (struct type *type) @@ -2918,7 +2924,8 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, { if (mips_debug) fprintf_unfiltered (gdb_stdlog, - "mips_eabi_push_dummy_call: struct_return reg=%d %s\n", + "mips_eabi_push_dummy_call: " + "struct_return reg=%d %s\n", argreg, paddress (gdbarch, struct_addr)); regcache_cooked_write_unsigned (regcache, argreg++, struct_addr); } @@ -3068,7 +3075,7 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, struct value *function, || fp_register_arg_p (gdbarch, typecode, arg_type)) { /* Should shorter than int integer values be - promoted to int before being stored? */ + promoted to int before being stored? */ int longword_offset = 0; CORE_ADDR addr; stack_used_p = 1; @@ -3322,7 +3329,8 @@ mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, { if (mips_debug) fprintf_unfiltered (gdb_stdlog, - "mips_n32n64_push_dummy_call: struct_return reg=%d %s\n", + "mips_n32n64_push_dummy_call: " + "struct_return reg=%d %s\n", argreg, paddress (gdbarch, struct_addr)); regcache_cooked_write_unsigned (regcache, argreg++, struct_addr); } @@ -3422,7 +3430,7 @@ mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, if (argreg > MIPS_LAST_ARG_REGNUM (gdbarch)) { /* Should shorter than int integer values be - promoted to int before being stored? */ + promoted to int before being stored? */ int longword_offset = 0; CORE_ADDR addr; stack_used_p = 1; @@ -3773,7 +3781,8 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, { if (mips_debug) fprintf_unfiltered (gdb_stdlog, - "mips_o32_push_dummy_call: struct_return reg=%d %s\n", + "mips_o32_push_dummy_call: " + "struct_return reg=%d %s\n", argreg, paddress (gdbarch, struct_addr)); regcache_cooked_write_unsigned (regcache, argreg++, struct_addr); stack_offset += MIPS32_REGSIZE; @@ -3833,7 +3842,8 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, if (mips_debug) fprintf_unfiltered (gdb_stdlog, " - fpreg=%d val=%s", float_argreg, phex (regval, 4)); - regcache_cooked_write_unsigned (regcache, float_argreg++, regval); + regcache_cooked_write_unsigned (regcache, + float_argreg++, regval); if (mips_debug) fprintf_unfiltered (gdb_stdlog, " - reg=%d val=%s", argreg, phex (regval, 4)); @@ -3845,7 +3855,8 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, if (mips_debug) fprintf_unfiltered (gdb_stdlog, " - fpreg=%d val=%s", float_argreg, phex (regval, 4)); - regcache_cooked_write_unsigned (regcache, float_argreg++, regval); + regcache_cooked_write_unsigned (regcache, + float_argreg++, regval); if (mips_debug) fprintf_unfiltered (gdb_stdlog, " - reg=%d val=%s", @@ -3862,7 +3873,8 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, if (mips_debug) fprintf_unfiltered (gdb_stdlog, " - fpreg=%d val=%s", float_argreg, phex (regval, len)); - regcache_cooked_write_unsigned (regcache, float_argreg++, regval); + regcache_cooked_write_unsigned (regcache, + float_argreg++, regval); /* Although two FP registers are reserved for each argument, only one corresponding integer register is reserved. */ @@ -3911,7 +3923,7 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, || odd_sized_struct) { /* Should shorter than int integer values be - promoted to int before being stored? */ + promoted to int before being stored? */ int longword_offset = 0; CORE_ADDR addr; stack_used_p = 1; @@ -4234,7 +4246,8 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, { if (mips_debug) fprintf_unfiltered (gdb_stdlog, - "mips_o64_push_dummy_call: struct_return reg=%d %s\n", + "mips_o64_push_dummy_call: " + "struct_return reg=%d %s\n", argreg, paddress (gdbarch, struct_addr)); regcache_cooked_write_unsigned (regcache, argreg++, struct_addr); stack_offset += MIPS64_REGSIZE; @@ -4326,7 +4339,7 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, || odd_sized_struct) { /* Should shorter than int integer values be - promoted to int before being stored? */ + promoted to int before being stored? */ int longword_offset = 0; CORE_ADDR addr; stack_used_p = 1; @@ -4381,7 +4394,7 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, big endian targets. It does not seem to be necessary to do the - same for integral types. */ + same for integral types. */ if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG && partial_len < MIPS64_REGSIZE @@ -4454,7 +4467,7 @@ mips_o64_return_value (struct gdbarch *gdbarch, struct type *func_type, else { /* A scalar extract each part but least-significant-byte - justified. */ + justified. */ int offset; int regnum; for (offset = 0, regnum = MIPS_V0_REGNUM; @@ -4501,7 +4514,7 @@ mips_o64_return_value (struct gdbarch *gdbarch, struct type *func_type, Note that this code only deals with "live" registers at the top of the stack. We will attempt to deal with saved registers later, when - the raw/cooked register interface is in place. (We need a general + the raw/cooked register interface is in place. (We need a general interface that can deal with dynamic saved register sizes -- fp regs could be 32 bits wide in one frame and 64 on the frame above and below). */ @@ -4585,13 +4598,14 @@ mips_read_fp_register_double (struct frame_info *frame, int regno, static void mips_print_fp_register (struct ui_file *file, struct frame_info *frame, int regnum) -{ /* do values for FP (float) regs */ +{ /* Do values for FP (float) regs. */ struct gdbarch *gdbarch = get_frame_arch (frame); gdb_byte *raw_buffer; - double doub, flt1; /* doubles extracted from raw hex data */ + double doub, flt1; /* Doubles extracted from raw hex data. */ int inv1, inv2; - raw_buffer = alloca (2 * register_size (gdbarch, mips_regnum (gdbarch)->fp0)); + raw_buffer = alloca (2 * register_size (gdbarch, + mips_regnum (gdbarch)->fp0)); fprintf_filtered (file, "%s:", gdbarch_register_name (gdbarch, regnum)); fprintf_filtered (file, "%*s", @@ -4605,7 +4619,8 @@ mips_print_fp_register (struct ui_file *file, struct frame_info *frame, /* 4-byte registers: Print hex and floating. Also print even numbered registers as doubles. */ mips_read_fp_register_single (frame, regnum, raw_buffer); - flt1 = unpack_double (builtin_type (gdbarch)->builtin_float, raw_buffer, &inv1); + flt1 = unpack_double (builtin_type (gdbarch)->builtin_float, + raw_buffer, &inv1); get_formatted_print_options (&opts, 'x'); print_scalar_formatted (raw_buffer, @@ -4723,20 +4738,21 @@ print_fp_register_row (struct ui_file *file, struct frame_info *frame, } -/* Print a row's worth of GP (int) registers, with name labels above */ +/* Print a row's worth of GP (int) registers, with name labels above. */ static int print_gp_register_row (struct ui_file *file, struct frame_info *frame, int start_regnum) { struct gdbarch *gdbarch = get_frame_arch (frame); - /* do values for GP (int) regs */ + /* Do values for GP (int) regs. */ gdb_byte raw_buffer[MAX_REGISTER_SIZE]; - int ncols = (mips_abi_regsize (gdbarch) == 8 ? 4 : 8); /* display cols per row */ + int ncols = (mips_abi_regsize (gdbarch) == 8 ? 4 : 8); /* display cols + per row. */ int col, byte; int regnum; - /* For GP registers, we print a separate row of names above the vals */ + /* For GP registers, we print a separate row of names above the vals. */ for (col = 0, regnum = start_regnum; col < ncols && regnum < gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch); @@ -4746,7 +4762,7 @@ print_gp_register_row (struct ui_file *file, struct frame_info *frame, continue; /* unused register */ if (TYPE_CODE (register_type (gdbarch, regnum)) == TYPE_CODE_FLT) - break; /* end the row: reached FP register */ + break; /* End the row: reached FP register. */ /* Large registers are handled separately. */ if (register_size (gdbarch, regnum) > mips_abi_regsize (gdbarch)) { @@ -4769,14 +4785,14 @@ print_gp_register_row (struct ui_file *file, struct frame_info *frame, if (col == 0) return regnum; - /* print the R0 to R31 names */ + /* Print the R0 to R31 names. */ if ((start_regnum % gdbarch_num_regs (gdbarch)) < MIPS_NUMREGS) fprintf_filtered (file, "\n R%-4d", start_regnum % gdbarch_num_regs (gdbarch)); else fprintf_filtered (file, "\n "); - /* now print the values in hex, 4 or 8 to the row */ + /* Now print the values in hex, 4 or 8 to the row. */ for (col = 0, regnum = start_regnum; col < ncols && regnum < gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch); @@ -4786,7 +4802,7 @@ print_gp_register_row (struct ui_file *file, struct frame_info *frame, continue; /* unused register */ if (TYPE_CODE (register_type (gdbarch, regnum)) == TYPE_CODE_FLT) - break; /* end row: reached FP register */ + break; /* End row: reached FP register. */ if (register_size (gdbarch, regnum) > mips_abi_regsize (gdbarch)) break; /* End row: large register. */ @@ -4799,7 +4815,7 @@ print_gp_register_row (struct ui_file *file, struct frame_info *frame, byte < (mips_abi_regsize (gdbarch) - register_size (gdbarch, regnum)); byte++) printf_filtered (" "); - /* Now print the register value in hex, endian order. */ + /* Now print the register value in hex, endian order. */ if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) for (byte = register_size (gdbarch, regnum) - register_size (gdbarch, regnum); @@ -4812,19 +4828,19 @@ print_gp_register_row (struct ui_file *file, struct frame_info *frame, fprintf_filtered (file, " "); col++; } - if (col > 0) /* ie. if we actually printed anything... */ + if (col > 0) /* ie. if we actually printed anything... */ fprintf_filtered (file, "\n"); return regnum; } -/* MIPS_DO_REGISTERS_INFO(): called by "info register" command */ +/* MIPS_DO_REGISTERS_INFO(): called by "info register" command. */ static void mips_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, struct frame_info *frame, int regnum, int all) { - if (regnum != -1) /* do one specified register */ + if (regnum != -1) /* Do one specified register. */ { gdb_assert (regnum >= gdbarch_num_regs (gdbarch)); if (*(gdbarch_register_name (gdbarch, regnum)) == '\0') @@ -4834,7 +4850,7 @@ mips_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, fprintf_filtered (file, "\n"); } else - /* do all (or most) registers */ + /* Do all (or most) registers. */ { regnum = gdbarch_num_regs (gdbarch); while (regnum < gdbarch_num_regs (gdbarch) @@ -4843,10 +4859,10 @@ mips_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, if (TYPE_CODE (register_type (gdbarch, regnum)) == TYPE_CODE_FLT) { - if (all) /* true for "INFO ALL-REGISTERS" command */ + if (all) /* True for "INFO ALL-REGISTERS" command. */ regnum = print_fp_register_row (file, frame, regnum); else - regnum += MIPS_NUMREGS; /* skip floating point regs */ + regnum += MIPS_NUMREGS; /* Skip floating point regs. */ } else regnum = print_gp_register_row (file, frame, regnum); @@ -5023,7 +5039,7 @@ mips_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc) return mips32_in_function_epilogue_p (gdbarch, pc); } -/* Root of all "set mips "/"show mips " commands. This will eventually be +/* Root of all "set mips "/"show mips " commands. This will eventually be used for all MIPS-specific commands. */ static void @@ -5070,9 +5086,9 @@ show_mipsfpu_command (char *args, int from_tty) internal_error (__FILE__, __LINE__, _("bad switch")); } if (mips_fpu_type_auto) - printf_unfiltered - ("The MIPS floating-point coprocessor is set automatically (currently %s)\n", - fpu); + printf_unfiltered ("The MIPS floating-point coprocessor " + "is set automatically (currently %s)\n", + fpu); else printf_unfiltered ("The MIPS floating-point coprocessor is assumed to be %s\n", fpu); @@ -5082,8 +5098,8 @@ show_mipsfpu_command (char *args, int from_tty) static void set_mipsfpu_command (char *args, int from_tty) { - printf_unfiltered - ("\"set mipsfpu\" must be followed by \"double\", \"single\",\"none\" or \"auto\".\n"); + printf_unfiltered ("\"set mipsfpu\" must be followed by \"double\", " + "\"single\",\"none\" or \"auto\".\n"); show_mipsfpu_command (args, from_tty); } @@ -5215,15 +5231,16 @@ gdb_print_insn_mips_n64 (bfd_vma memaddr, struct disassemble_info *info) return gdb_print_insn_mips (memaddr, info); } -/* This function implements gdbarch_breakpoint_from_pc. It uses the program - counter value to determine whether a 16- or 32-bit breakpoint should be used. - It returns a pointer to a string of bytes that encode a breakpoint - instruction, stores the length of the string to *lenptr, and adjusts pc (if - necessary) to point to the actual memory location where the breakpoint - should be inserted. */ +/* This function implements gdbarch_breakpoint_from_pc. It uses the + program counter value to determine whether a 16- or 32-bit breakpoint + should be used. It returns a pointer to a string of bytes that encode a + breakpoint instruction, stores the length of the string to *lenptr, and + adjusts pc (if necessary) to point to the actual memory location where + the breakpoint should be inserted. */ static const gdb_byte * -mips_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr) +mips_breakpoint_from_pc (struct gdbarch *gdbarch, + CORE_ADDR *pcptr, int *lenptr) { if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) { @@ -5243,7 +5260,7 @@ mips_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr) static gdb_byte pmon_big_breakpoint[] = { 0, 0, 0, 0xd }; static gdb_byte idt_big_breakpoint[] = { 0, 0, 0x0a, 0xd }; /* Likewise, IRIX appears to expect a different breakpoint, - although this is not apparent until you try to use pthreads. */ + although this is not apparent until you try to use pthreads. */ static gdb_byte irix_big_breakpoint[] = { 0, 0, 0, 0xd }; *lenptr = sizeof (big_breakpoint); @@ -5369,9 +5386,9 @@ mips_skip_mips16_trampoline_code (struct frame_info *frame, CORE_ADDR pc) { inst = mips_fetch_instruction (gdbarch, target_pc); if ((inst & 0xffff0000) == 0x3c010000) /* lui $at */ - pc = (inst << 16) & 0xffff0000; /* high word */ + pc = (inst << 16) & 0xffff0000; /* high word */ else if ((inst & 0xffff0000) == 0x24210000) /* addiu $at */ - return pc | (inst & 0xffff); /* low word */ + return pc | (inst & 0xffff); /* low word */ } /* Couldn't find the lui/addui pair, so return stub address. */ @@ -5519,7 +5536,8 @@ mips_register_sim_regno (struct gdbarch *gdbarch, int regnum) if (gdbarch_register_name (gdbarch, gdbarch_num_regs (gdbarch) + regnum) != NULL && gdbarch_register_name (gdbarch, - gdbarch_num_regs (gdbarch) + regnum)[0] != '\0') + gdbarch_num_regs (gdbarch) + + regnum)[0] != '\0') return regnum; else return LEGACY_SIM_REGNO_IGNORE; @@ -5842,7 +5860,8 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Also used when doing an architecture lookup. */ if (gdbarch_debug) fprintf_unfiltered (gdb_stdlog, - "mips_gdbarch_init: mips64_transfers_32bit_regs_p = %d\n", + "mips_gdbarch_init: " + "mips64_transfers_32bit_regs_p = %d\n", mips64_transfers_32bit_regs_p); /* Determine the MIPS FPU type. */ @@ -5911,7 +5930,7 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) return NULL; } - /* try to find a pre-existing architecture */ + /* Try to find a pre-existing architecture. */ for (arches = gdbarch_list_lookup_by_info (arches, &info); arches != NULL; arches = gdbarch_list_lookup_by_info (arches->next, &info)) @@ -6139,8 +6158,7 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) Note that for o32 and eabi32, pointers are always 32 bits regardless of any -mlongXX option. For all others, pointers and - longs are the same, as set by -mlongXX or set by defaults. - */ + longs are the same, as set by -mlongXX or set by defaults. */ if (info.abfd != NULL) { @@ -6208,7 +6226,7 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) mips_dwarf_dwarf2_ecoff_reg_to_regnum); set_gdbarch_register_sim_regno (gdbarch, mips_register_sim_regno); - /* MIPS version of CALL_DUMMY */ + /* MIPS version of CALL_DUMMY. */ /* NOTE: cagney/2003-08-05: Eventually call dummy location will be replaced by a command, and all targets will default to on stack @@ -6252,7 +6270,8 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_skip_trampoline_code (gdbarch, mips_skip_trampoline_code); - set_gdbarch_single_step_through_delay (gdbarch, mips_single_step_through_delay); + set_gdbarch_single_step_through_delay (gdbarch, + mips_single_step_through_delay); /* Virtual tables. */ set_gdbarch_vbit_in_delta (gdbarch, 1); @@ -6281,7 +6300,8 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Override the normal target description methods to handle our dual real and pseudo registers. */ set_gdbarch_register_name (gdbarch, mips_register_name); - set_gdbarch_register_reggroup_p (gdbarch, mips_tdesc_register_reggroup_p); + set_gdbarch_register_reggroup_p (gdbarch, + mips_tdesc_register_reggroup_p); num_regs = gdbarch_num_regs (gdbarch); set_gdbarch_num_pseudo_regs (gdbarch, num_regs); @@ -6355,9 +6375,9 @@ show_mips_abi (struct ui_file *file, else { /* Probably shouldn't happen... */ - fprintf_filtered - (file, - "The (auto detected) MIPS ABI \"%s\" is in use even though the user setting was \"%s\".\n", + fprintf_filtered (file, + "The (auto detected) MIPS ABI \"%s\" is in use " + "even though the user setting was \"%s\".\n", actual_abi_str, mips_abi_strings[global_abi]); } } @@ -6405,7 +6425,8 @@ mips_dump_tdep (struct gdbarch *gdbarch, struct ui_file *file) "mips_dump_tdep: tdep->mips_abi = %d (%s)\n", tdep->mips_abi, mips_abi_strings[tdep->mips_abi]); fprintf_unfiltered (file, - "mips_dump_tdep: mips_mask_address_p() %d (default %d)\n", + "mips_dump_tdep: " + "mips_mask_address_p() %d (default %d)\n", mips_mask_address_p (tdep), tdep->default_mask_address_p); } @@ -6427,7 +6448,7 @@ mips_dump_tdep (struct gdbarch *gdbarch, struct ui_file *file) : "???")); } -extern initialize_file_ftype _initialize_mips_tdep; /* -Wmissing-prototypes */ +extern initialize_file_ftype _initialize_mips_tdep; /* -Wmissing-prototypes */ void _initialize_mips_tdep (void) @@ -6452,7 +6473,7 @@ _initialize_mips_tdep (void) mips_tdesc_gp64 = allocate_target_description (); set_tdesc_property (mips_tdesc_gp64, PROPERTY_GP64, ""); - /* Add root prefix command for all "set mips"/"show mips" commands */ + /* Add root prefix command for all "set mips"/"show mips" commands. */ add_prefix_cmd ("mips", no_class, set_mips_command, _("Various MIPS specific commands."), &setmipscmdlist, "set mips ", 0, &setlist); @@ -6461,7 +6482,7 @@ _initialize_mips_tdep (void) _("Various MIPS specific commands."), &showmipscmdlist, "show mips ", 0, &showlist); - /* Allow the user to override the ABI. */ + /* Allow the user to override the ABI. */ add_setshow_enum_cmd ("abi", class_obscure, mips_abi_strings, &mips_abi_string, _("\ Set the MIPS ABI used by this program."), _("\ @@ -6516,7 +6537,8 @@ If you are debugging a stripped executable, GDB needs to search through the\n\ program for the start of a function. This command sets the distance of the\n\ search. The only need to set it is when debugging a stripped executable."), reinit_frame_cache_sfunc, - NULL, /* FIXME: i18n: The distance searched for the start of a function is %s. */ + NULL, /* FIXME: i18n: The distance searched for + the start of a function is %s. */ &setlist, &showlist); /* Allow the user to control whether the upper bits of 64-bit @@ -6542,16 +6564,19 @@ Use \"on\" to enable backward compatibility with older MIPS 64 GDB+target\n\ that would transfer 32 bits for some registers (e.g. SR, FSR) and\n\ 64 bits for others. Use \"off\" to disable compatibility mode"), set_mips64_transfers_32bit_regs, - NULL, /* FIXME: i18n: Compatibility with 64-bit MIPS target that transfers 32-bit quantities is %s. */ + NULL, /* FIXME: i18n: Compatibility with 64-bit + MIPS target that transfers 32-bit + quantities is %s. */ &setlist, &showlist); - /* Debug this files internals. */ + /* Debug this files internals. */ add_setshow_zinteger_cmd ("mips", class_maintenance, &mips_debug, _("\ Set mips debugging."), _("\ Show mips debugging."), _("\ When non-zero, mips specific debugging is enabled."), NULL, - NULL, /* FIXME: i18n: Mips debugging is currently %s. */ + NULL, /* FIXME: i18n: Mips debugging is + currently %s. */ &setdebuglist, &showdebuglist); } diff --git a/gdb/mips-tdep.h b/gdb/mips-tdep.h index 27fe6567213..445eb05c2cd 100644 --- a/gdb/mips-tdep.h +++ b/gdb/mips-tdep.h @@ -23,7 +23,7 @@ struct gdbarch; -/* All the possible MIPS ABIs. */ +/* All the possible MIPS ABIs. */ enum mips_abi { MIPS_ABI_UNKNOWN = 0, @@ -67,7 +67,7 @@ enum mips_fpu_type MIPS_FPU_NONE /* No floating point. */ }; -/* MIPS specific per-architecture information */ +/* MIPS specific per-architecture information. */ struct gdbarch_tdep { /* from the elf header */ @@ -117,7 +117,7 @@ enum MIPS_ZERO_REGNUM = 0, /* Read-only register, always 0. */ MIPS_AT_REGNUM = 1, MIPS_V0_REGNUM = 2, /* Function integer return value. */ - MIPS_A0_REGNUM = 4, /* Loc of first arg during a subr call */ + MIPS_A0_REGNUM = 4, /* Loc of first arg during a subr call. */ MIPS_T9_REGNUM = 25, /* Contains address of callee in PIC. */ MIPS_SP_REGNUM = 29, MIPS_RA_REGNUM = 31, @@ -128,13 +128,13 @@ enum MIPS_EMBED_CAUSE_REGNUM = 36, MIPS_EMBED_PC_REGNUM = 37, MIPS_EMBED_FP0_REGNUM = 38, - MIPS_UNUSED_REGNUM = 73, /* Never used, FIXME */ + MIPS_UNUSED_REGNUM = 73, /* Never used, FIXME. */ MIPS_FIRST_EMBED_REGNUM = 74, /* First CP0 register for embedded use. */ MIPS_PRID_REGNUM = 89, /* Processor ID. */ MIPS_LAST_EMBED_REGNUM = 89 /* Last one. */ }; -/* Defined in mips-tdep.c and used in remote-mips.c */ +/* Defined in mips-tdep.c and used in remote-mips.c. */ extern void deprecated_mips_set_processor_regs_hack (void); /* Instruction sizes and other useful constants. */ @@ -153,7 +153,7 @@ extern int mips_software_single_step (struct frame_info *frame); function. */ extern int mips_pc_is_mips16 (bfd_vma memaddr); -/* Return the currently configured (or set) saved register size. */ +/* Return the currently configured (or set) saved register size. */ extern unsigned int mips_abi_regsize (struct gdbarch *gdbarch); /* Target descriptions which only indicate the size of general diff --git a/gdb/mipsnbsd-nat.c b/gdb/mipsnbsd-nat.c index 58ac5720cf5..d85b6d9b564 100644 --- a/gdb/mipsnbsd-nat.c +++ b/gdb/mipsnbsd-nat.c @@ -57,7 +57,8 @@ mipsnbsd_fetch_inferior_registers (struct target_ops *ops, return; } - if (regno == -1 || regno >= gdbarch_fp0_regnum (get_regcache_arch (regcache))) + if (regno == -1 + || regno >= gdbarch_fp0_regnum (get_regcache_arch (regcache))) { struct fpreg fpregs; @@ -92,7 +93,8 @@ mipsnbsd_store_inferior_registers (struct target_ops *ops, return; } - if (regno == -1 || regno >= gdbarch_fp0_regnum (get_regcache_arch (regcache))) + if (regno == -1 + || regno >= gdbarch_fp0_regnum (get_regcache_arch (regcache))) { struct fpreg fpregs; diff --git a/gdb/mipsnbsd-tdep.c b/gdb/mipsnbsd-tdep.c index 035cd96b4d5..3a7c8570e77 100644 --- a/gdb/mipsnbsd-tdep.c +++ b/gdb/mipsnbsd-tdep.c @@ -173,7 +173,8 @@ mipsnbsd_fill_reg (const struct regcache *regcache, char *regs, int regno) } void -mipsnbsd_supply_fpreg (struct regcache *regcache, const char *fpregs, int regno) +mipsnbsd_supply_fpreg (struct regcache *regcache, + const char *fpregs, int regno) { struct gdbarch *gdbarch = get_regcache_arch (regcache); int i; diff --git a/gdb/mipsread.c b/gdb/mipsread.c index ac1d15d3bcb..697f784ed56 100644 --- a/gdb/mipsread.c +++ b/gdb/mipsread.c @@ -92,7 +92,7 @@ mipscoff_symfile_read (struct objfile *objfile, int symfile_flags) read_alphacoff_dynamic_symtab (objfile->section_offsets, objfile); /* Install any minimal symbols that have been collected as the current - minimal symbols for this objfile. */ + minimal symbols for this objfile. */ install_minimal_symbols (objfile); do_cleanups (back_to); @@ -110,7 +110,7 @@ mipscoff_symfile_finish (struct objfile *objfile) standard COFF section. The ELF format for the symbols differs from the format defined in elf/external.h. It seems that a normal ELF 32-bit format is used, and the representation only changes because - longs are 64-bit on the alpha. In addition, the handling of + longs are 64-bit on the alpha. In addition, the handling of text/data section indices for symbols is different from the ELF ABI. As the BFD linker currently does not support dynamic linking on the alpha, there seems to be no reason to pollute BFD with @@ -341,7 +341,7 @@ read_alphacoff_dynamic_symtab (struct section_offsets *section_offsets, } else { - /* Symbols defined in the executable itself. We only care + /* Symbols defined in the executable itself. We only care about them if this is a stripped executable, otherwise they have been retrieved from the normal symbol table already. */ @@ -393,15 +393,14 @@ read_alphacoff_dynamic_symtab (struct section_offsets *section_offsets, static const struct sym_fns ecoff_sym_fns = { bfd_target_ecoff_flavour, - mipscoff_new_init, /* sym_new_init: init anything gbl to entire symtab */ - mipscoff_symfile_init, /* sym_init: read initial info, setup for sym_read() */ - mipscoff_symfile_read, /* sym_read: read a symbol file into symtab */ - mipscoff_symfile_finish, /* sym_finish: finished with file, cleanup */ - default_symfile_offsets, /* sym_offsets: dummy FIXME til implem sym reloc */ - default_symfile_segments, /* sym_segments: Get segment information from - a file. */ - NULL, /* sym_read_linetable */ - default_symfile_relocate, /* sym_relocate: Relocate a debug section. */ + mipscoff_new_init, /* init anything gbl to entire symtab */ + mipscoff_symfile_init, /* read initial info, setup for sym_read() */ + mipscoff_symfile_read, /* read a symbol file into symtab */ + mipscoff_symfile_finish, /* finished with file, cleanup */ + default_symfile_offsets, /* dummy FIXME til implem sym reloc */ + default_symfile_segments, /* Get segment information from a file. */ + NULL, + default_symfile_relocate, /* Relocate a debug section. */ &psym_functions }; diff --git a/gdb/mn10300-linux-tdep.c b/gdb/mn10300-linux-tdep.c index 0b7229fa3ba..373275ccdba 100644 --- a/gdb/mn10300-linux-tdep.c +++ b/gdb/mn10300-linux-tdep.c @@ -83,7 +83,7 @@ typedef struct Given a section name and size, create a struct reg object with a supply_register and a collect_register method. */ -/* Copy register value of REGNUM from regset to regcache. +/* Copy register value of REGNUM from regset to regcache. If REGNUM is -1, do this for all gp registers in regset. */ static void @@ -240,8 +240,8 @@ am33_supply_gregset_method (const struct regset *regset, return; } -/* Copy fp register value of REGNUM from regset to regcache. - If REGNUM is -1, do this for all fp registers in regset. */ +/* Copy fp register value of REGNUM from regset to regcache. + If REGNUM is -1, do this for all fp registers in regset. */ static void am33_supply_fpregset_method (const struct regset *regset, @@ -265,7 +265,8 @@ am33_supply_fpregset_method (const struct regset *regset, else if (regnum == E_FPCR_REGNUM) regcache_raw_supply (regcache, E_FPCR_REGNUM, &fpregset->fpcr); - else if (E_FS0_REGNUM <= regnum && regnum < E_FS0_REGNUM + MN10300_ELF_NFPREG) + else if (E_FS0_REGNUM <= regnum + && regnum < E_FS0_REGNUM + MN10300_ELF_NFPREG) regcache_raw_supply (regcache, regnum, &fpregset->fpregs[regnum - E_FS0_REGNUM]); @@ -692,7 +693,8 @@ am33_linux_sigframe_cache_init (const struct tramp_frame *self, sc_base + AM33_SIGCONTEXT_PC); fpubase = get_frame_memory_unsigned (this_frame, - sc_base + AM33_SIGCONTEXT_FPUCONTEXT, 4); + sc_base + AM33_SIGCONTEXT_FPUCONTEXT, + 4); if (fpubase) { for (i = 0; i < 32; i++) diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c index 7cd22c6d65b..5b83b226a3d 100644 --- a/gdb/mn10300-tdep.c +++ b/gdb/mn10300-tdep.c @@ -25,7 +25,7 @@ #include "regcache.h" #include "gdb_string.h" #include "gdb_assert.h" -#include "gdbcore.h" /* for write_memory_unsigned_integer */ +#include "gdbcore.h" /* For write_memory_unsigned_integer. */ #include "value.h" #include "gdbtypes.h" #include "frame.h" @@ -1142,7 +1142,8 @@ mn10300_frame_this_id (struct frame_info *this_frame, void **this_prologue_cache, struct frame_id *this_id) { - *this_id = frame_id_build (mn10300_frame_base (this_frame, this_prologue_cache), + *this_id = frame_id_build (mn10300_frame_base (this_frame, + this_prologue_cache), get_frame_func (this_frame)); } @@ -1263,7 +1264,7 @@ mn10300_push_dummy_call (struct gdbarch *gdbarch, else regs_used = 0; - /* Push all arguments onto the stack. */ + /* Push all arguments onto the stack. */ for (argnum = 0; argnum < nargs; argnum++) { /* FIXME what about structs? Unions? */ @@ -1332,7 +1333,7 @@ mn10300_push_dummy_call (struct gdbarch *gdbarch, Note that we don't update the return value though because that's the value of the stack just after pushing the arguments, but prior to performing the call. This value is needed in order to - construct the frame ID of the dummy call. */ + construct the frame ID of the dummy call. */ { CORE_ADDR func_addr = find_function_addr (target_func, NULL); CORE_ADDR unwound_sp @@ -1436,7 +1437,7 @@ mn10300_gdbarch_init (struct gdbarch_info info, set_gdbarch_inner_than (gdbarch, core_addr_lessthan); /* Breakpoints. */ set_gdbarch_breakpoint_from_pc (gdbarch, mn10300_breakpoint_from_pc); - /* decr_pc_after_break? */ + /* decr_pc_after_break? */ /* Disassembly. */ set_gdbarch_print_insn (gdbarch, print_insn_mn10300); @@ -1456,7 +1457,7 @@ mn10300_gdbarch_init (struct gdbarch_info info, return gdbarch; } -/* Dump out the mn10300 specific architecture information. */ +/* Dump out the mn10300 specific architecture information. */ static void mn10300_dump_tdep (struct gdbarch *gdbarch, struct ui_file *file) diff --git a/gdb/mn10300-tdep.h b/gdb/mn10300-tdep.h index b6f4fb729dd..37994007a8d 100644 --- a/gdb/mn10300-tdep.h +++ b/gdb/mn10300-tdep.h @@ -63,7 +63,7 @@ enum movm_register_bits { movm_d2_bit = 0x80 }; -/* Values for frame_info.status */ +/* Values for frame_info.status. */ enum frame_kind { MY_FRAME_IN_SP = 0x1, @@ -71,7 +71,7 @@ enum frame_kind { NO_MORE_FRAMES = 0x4 }; -/* mn10300 private data */ +/* mn10300 private data. */ struct gdbarch_tdep { int am33_mode; diff --git a/gdb/monitor.c b/gdb/monitor.c index 8f2f793052e..79fa1ba88d8 100644 --- a/gdb/monitor.c +++ b/gdb/monitor.c @@ -22,9 +22,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* This file was derived from various remote-* modules. It is a collection +/* This file was derived from various remote-* modules. It is a collection of generic support functions so GDB can talk directly to a ROM based - monitor. This saves use from having to hack an exception based handler + monitor. This saves use from having to hack an exception based handler into existence, and makes for quick porting. This module talks to a debug monitor called 'MONITOR', which @@ -71,13 +71,13 @@ static int from_hex (int a); static struct monitor_ops *current_monitor; -static int hashmark; /* flag set by "set hash" */ +static int hashmark; /* flag set by "set hash". */ static int timeout = 30; -static int in_monitor_wait = 0; /* Non-zero means we are in monitor_wait() */ +static int in_monitor_wait = 0; /* Non-zero means we are in monitor_wait(). */ -static void (*ofunc) (); /* Old SIGINT signal handler */ +static void (*ofunc) (); /* Old SIGINT signal handler. */ static CORE_ADDR *breakaddr; @@ -87,7 +87,7 @@ static CORE_ADDR *breakaddr; static struct serial *monitor_desc = NULL; -/* Pointer to regexp pattern matching data */ +/* Pointer to regexp pattern matching data. */ static struct re_pattern_buffer register_pattern; static char register_fastmap[256]; @@ -106,7 +106,7 @@ static int dump_reg_flag; /* Non-zero means do a dump_registers cmd when static int first_time = 0; /* Is this the first time we're executing after gaving created the - child proccess? */ + child proccess? */ /* This is the ptid we use while we're connected to a monitor. Its @@ -118,7 +118,7 @@ static ptid_t monitor_ptid; #define TARGET_BUF_SIZE 2048 /* Monitor specific debugging information. Typically only useful to - the developer of a new monitor interface. */ + the developer of a new monitor interface. */ static void monitor_debug (const char *fmt, ...) ATTRIBUTE_PRINTF (1, 2); @@ -126,7 +126,7 @@ static int monitor_debug_p = 0; /* NOTE: This file alternates between monitor_debug_p and remote_debug when determining if debug information is printed. Perhaps this - could be simplified. */ + could be simplified. */ static void monitor_debug (const char *fmt, ...) @@ -144,7 +144,7 @@ monitor_debug (const char *fmt, ...) /* Convert a string into a printable representation, Return # byte in the new string. When LEN is >0 it specifies the size of the - string. Otherwize strlen(oldstr) is used. */ + string. Otherwize strlen(oldstr) is used. */ static void monitor_printable_string (char *newstr, char *oldstr, int len) @@ -253,8 +253,7 @@ fromhex (int a) If it is a '%s' format, the argument is a string; otherwise the argument is assumed to be a long integer. - %% is also turned into a single %. - */ + %% is also turned into a single %. */ static void monitor_vsprintf (char *sndbuf, char *pattern, va_list args) @@ -441,7 +440,7 @@ readchar (int timeout) { c &= 0x7f; /* This seems to interfere with proper function of the - input stream */ + input stream. */ if (monitor_debug_p || remote_debug) { char buf[2]; @@ -453,7 +452,7 @@ readchar (int timeout) } - /* Canonicialize \n\r combinations into one \r */ + /* Canonicialize \n\r combinations into one \r. */ if ((current_monitor->flags & MO_HANDLE_NL) != 0) { if ((c == '\r' && state == last_nl) @@ -480,8 +479,8 @@ readchar (int timeout) if (c == SERIAL_TIMEOUT) #if 0 - /* I fail to see how detaching here can be useful */ - if (in_monitor_wait) /* Watchdog went off */ + /* I fail to see how detaching here can be useful. */ + if (in_monitor_wait) /* Watchdog went off. */ { target_mourn_inferior (); error (_("GDB serial timeout has expired. Target detached.")); @@ -535,7 +534,7 @@ monitor_expect (char *string, char *buf, int buflen) else c = readchar (timeout); - /* Don't expect any ^C sent to be echoed */ + /* Don't expect any ^C sent to be echoed. */ if (*p == '\003' || c == *p) { @@ -575,7 +574,7 @@ monitor_expect (char *string, char *buf, int buflen) p, since we know no prefix can be longer than that. Note that we can use STRING itself, along with C, as a record - of what we've received so far. :) */ + of what we've received so far. :) */ int i; for (i = (p - string) - 1; i >= 0; i--) @@ -583,7 +582,7 @@ monitor_expect (char *string, char *buf, int buflen) { /* Is this prefix a suffix of what we've read so far? In other words, does - string[0 .. i-1] == string[p - i, p - 1]? */ + string[0 .. i-1] == string[p - i, p - 1]? */ if (! memcmp (string, p - i, i)) { p = string + i + 1; @@ -619,10 +618,10 @@ monitor_expect_regexp (struct re_pattern_buffer *pat, char *buf, int buflen) int retval; if (p - mybuf >= buflen) - { /* Buffer about to overflow */ + { /* Buffer about to overflow. */ /* On overflow, we copy the upper half of the buffer to the lower half. Not - great, but it usually works... */ + great, but it usually works... */ memcpy (mybuf, mybuf + buflen / 2, buflen / 2); p = mybuf + buflen / 2; @@ -709,7 +708,7 @@ compile_pattern (char *pattern, struct re_pattern_buffer *compiled_pattern, re_compile_fastmap (compiled_pattern); } -/* Open a connection to a remote debugger. NAME is the filename used +/* Open a connection to a remote debugger. NAME is the filename used for communication. */ void @@ -731,7 +730,7 @@ monitor_open (char *args, struct monitor_ops *mon_ops, int from_tty) target_preopen (from_tty); - /* Setup pattern for register dump */ + /* Setup pattern for register dump. */ if (mon_ops->register_pattern) compile_pattern (mon_ops->register_pattern, ®ister_pattern, @@ -773,7 +772,7 @@ monitor_open (char *args, struct monitor_ops *mon_ops, int from_tty) serial_flush_input (monitor_desc); - /* some systems only work with 2 stop bits */ + /* some systems only work with 2 stop bits. */ serial_setstopbits (monitor_desc, mon_ops->stopbits); @@ -792,11 +791,11 @@ monitor_open (char *args, struct monitor_ops *mon_ops, int from_tty) } } - /* wake up the monitor and see if it's alive */ + /* wake up the monitor and see if it's alive. */ for (p = mon_ops->init; *p != NULL; p++) { /* Some of the characters we send may not be echoed, - but we hope to get a prompt at the end of it all. */ + but we hope to get a prompt at the end of it all. */ if ((current_monitor->flags & MO_NO_ECHO_ON_OPEN) == 0) monitor_printf (*p); @@ -818,7 +817,7 @@ monitor_open (char *args, struct monitor_ops *mon_ops, int from_tty) memset (breakaddr, 0, mon_ops->num_breakpoints * sizeof (CORE_ADDR)); } - /* Remove all breakpoints */ + /* Remove all breakpoints. */ if (mon_ops->clr_all_break) { @@ -841,7 +840,7 @@ monitor_open (char *args, struct monitor_ops *mon_ops, int from_tty) inferior_appeared (inf, ptid_get_pid (inferior_ptid)); add_thread_silent (inferior_ptid); - /* Give monitor_wait something to read */ + /* Give monitor_wait something to read. */ monitor_printf (current_monitor->line_term); @@ -857,7 +856,7 @@ monitor_close (int quitting) if (monitor_desc) serial_close (monitor_desc); - /* Free breakpoint memory */ + /* Free breakpoint memory. */ if (breakaddr != NULL) { xfree (breakaddr); @@ -876,7 +875,7 @@ monitor_close (int quitting) static void monitor_detach (struct target_ops *ops, char *args, int from_tty) { - pop_target (); /* calls monitor_close to do the real work */ + pop_target (); /* calls monitor_close to do the real work. */ if (from_tty) printf_unfiltered (_("Ending remote %s debugging\n"), target_shortname); } @@ -921,7 +920,7 @@ monitor_supply_register (struct regcache *regcache, int regno, char *valstr) error (_("monitor_supply_register (%d): bad value from monitor: %s."), regno, valstr); - /* supply register stores in target byte order, so swap here */ + /* supply register stores in target byte order, so swap here. */ store_unsigned_integer (regbuf, register_size (gdbarch, regno), byte_order, val); @@ -937,7 +936,7 @@ static void monitor_resume (struct target_ops *ops, ptid_t ptid, int step, enum target_signal sig) { - /* Some monitors require a different command when starting a program */ + /* Some monitors require a different command when starting a program. */ monitor_debug ("MON resume\n"); if (current_monitor->flags & MO_RUN_FIRST_TIME && first_time == 1) { @@ -1072,7 +1071,7 @@ monitor_wait_filter (char *buf, while (resp_len < 0); /* Print any output characters that were preceded by ^O. */ - /* FIXME - This would be great as a user settabgle flag */ + /* FIXME - This would be great as a user settabgle flag. */ if (monitor_debug_p || remote_debug || current_monitor->flags & MO_PRINT_PROGRAM_OUTPUT) { @@ -1105,11 +1104,11 @@ monitor_wait (struct target_ops *ops, monitor_debug ("MON wait\n"); #if 0 - /* This is somthing other than a maintenance command */ + /* This is somthing other than a maintenance command. */ in_monitor_wait = 1; timeout = watchdog > 0 ? watchdog : -1; #else - timeout = -1; /* Don't time out -- user program is running. */ + timeout = -1; /* Don't time out -- user program is running. */ #endif ofunc = (void (*)()) signal (SIGINT, monitor_interrupt); @@ -1119,7 +1118,7 @@ monitor_wait (struct target_ops *ops, else monitor_wait_filter (buf, sizeof (buf), &resp_len, status); -#if 0 /* Transferred to monitor wait filter */ +#if 0 /* Transferred to monitor wait filter. */ do { resp_len = monitor_expect_prompt (buf, sizeof (buf)); @@ -1132,7 +1131,7 @@ monitor_wait (struct target_ops *ops, while (resp_len < 0); /* Print any output characters that were preceded by ^O. */ - /* FIXME - This would be great as a user settabgle flag */ + /* FIXME - This would be great as a user settabgle flag. */ if (monitor_debug_p || remote_debug || current_monitor->flags & MO_PRINT_PROGRAM_OUTPUT) { @@ -1172,7 +1171,7 @@ monitor_wait (struct target_ops *ops, return inferior_ptid; } -/* Fetch register REGNO, or all registers if REGNO is -1. Returns +/* Fetch register REGNO, or all registers if REGNO is -1. Returns errno value. */ static void @@ -1200,7 +1199,7 @@ monitor_fetch_register (struct regcache *regcache, int regno) return; } - /* send the register examine command */ + /* Send the register examine command. */ monitor_printf (current_monitor->getreg.cmd, name); @@ -1221,7 +1220,7 @@ monitor_fetch_register (struct regcache *regcache, int regno) } } - /* Skip leading spaces and "0x" if MO_HEX_PREFIX flag is set */ + /* Skip leading spaces and "0x" if MO_HEX_PREFIX flag is set. */ if (current_monitor->flags & MO_HEX_PREFIX) { int c; @@ -1255,7 +1254,7 @@ monitor_fetch_register (struct regcache *regcache, int regno) regbuf[i] = c; } - regbuf[i] = '\000'; /* terminate the number */ + regbuf[i] = '\000'; /* Terminate the number. */ monitor_debug ("REGVAL '%s'\n", regbuf); /* If TERM is present, we wait for that to show up. Also, (if TERM @@ -1266,8 +1265,8 @@ monitor_fetch_register (struct regcache *regcache, int regno) if (current_monitor->getreg.term) { monitor_debug ("EXP getreg.term\n"); - monitor_expect (current_monitor->getreg.term, NULL, 0); /* get - response */ + monitor_expect (current_monitor->getreg.term, NULL, 0); /* Get + response. */ } if (current_monitor->getreg.term_cmd) @@ -1276,16 +1275,16 @@ monitor_fetch_register (struct regcache *regcache, int regno) monitor_printf (current_monitor->getreg.term_cmd); } if (!current_monitor->getreg.term || /* Already expected or */ - current_monitor->getreg.term_cmd) /* ack expected */ - monitor_expect_prompt (NULL, 0); /* get response */ + current_monitor->getreg.term_cmd) /* ack expected. */ + monitor_expect_prompt (NULL, 0); /* Get response. */ monitor_supply_register (regcache, regno, regbuf); } -/* Sometimes, it takes several commands to dump the registers */ +/* Sometimes, it takes several commands to dump the registers. */ /* This is a primitive for use by variations of monitor interfaces in - case they need to compose the operation. - */ + case they need to compose the operation. */ + int monitor_dump_reg_block (struct regcache *regcache, char *block_cmd) { @@ -1300,7 +1299,7 @@ monitor_dump_reg_block (struct regcache *regcache, char *block_cmd) /* Read the remote registers into the block regs. */ -/* Call the specific function if it has been provided */ +/* Call the specific function if it has been provided. */ static void monitor_dump_regs (struct regcache *regcache) @@ -1309,15 +1308,15 @@ monitor_dump_regs (struct regcache *regcache) int resp_len; if (current_monitor->dumpregs) - (*(current_monitor->dumpregs)) (regcache); /* call supplied function */ - else if (current_monitor->dump_registers) /* default version */ + (*(current_monitor->dumpregs)) (regcache); /* Call supplied function. */ + else if (current_monitor->dump_registers) /* Default version. */ { monitor_printf (current_monitor->dump_registers); resp_len = monitor_expect_prompt (buf, sizeof (buf)); parse_register_dump (regcache, buf, resp_len); } else - /* Need some way to read registers */ + /* Need some way to read registers. */ internal_error (__FILE__, __LINE__, _("failed internal consistency check")); } @@ -1368,7 +1367,7 @@ monitor_store_register (struct regcache *regcache, int regno) regcache_cooked_read_unsigned (regcache, regno, &val); monitor_debug ("MON storeg %d %s\n", regno, phex (val, reg_size)); - /* send the register deposit command */ + /* Send the register deposit command. */ if (current_monitor->flags & MO_REGISTER_VALUE_FIRST) monitor_printf (current_monitor->setreg.cmd, val, name); @@ -1394,7 +1393,7 @@ monitor_store_register (struct regcache *regcache, int regno) } else monitor_expect_prompt (NULL, 0); - if (current_monitor->setreg.term_cmd) /* Mode exit required */ + if (current_monitor->setreg.term_cmd) /* Mode exit required. */ { monitor_debug ("EXP setreg_termcmd\n"); monitor_printf ("%s", current_monitor->setreg.term_cmd); @@ -1428,7 +1427,7 @@ monitor_store_registers (struct target_ops *ops, static void monitor_prepare_to_store (struct regcache *regcache) { - /* Do nothing, since we can store individual regs */ + /* Do nothing, since we can store individual regs. */ } static void @@ -1458,7 +1457,7 @@ monitor_write_memory (CORE_ADDR memaddr, char *myaddr, int len) if (myaddr[i] != 0) break; - if (i > 4) /* More than 4 zeros is worth doing */ + if (i > 4) /* More than 4 zeros is worth doing. */ { monitor_debug ("MON FILL %d\n", i); if (current_monitor->flags & MO_FILL_USES_ADDR) @@ -1526,9 +1525,9 @@ monitor_write_memory (CORE_ADDR memaddr, char *myaddr, int len) monitor_printf ("%x\r", val); } if (current_monitor->setmem.term_cmd) - { /* Emit this to get out of the memory editing state */ + { /* Emit this to get out of the memory editing state. */ monitor_printf ("%s", current_monitor->setmem.term_cmd); - /* Drop through to expecting a prompt */ + /* Drop through to expecting a prompt. */ } } else @@ -1548,7 +1547,7 @@ monitor_write_memory_bytes (CORE_ADDR memaddr, char *myaddr, int len) if (len == 0) return 0; - /* Enter the sub mode */ + /* Enter the sub mode. */ monitor_printf (current_monitor->setmem.cmdb, memaddr); monitor_expect_prompt (NULL, 0); while (len) @@ -1558,11 +1557,11 @@ monitor_write_memory_bytes (CORE_ADDR memaddr, char *myaddr, int len) myaddr++; memaddr++; written++; - /* If we wanted to, here we could validate the address */ + /* If we wanted to, here we could validate the address. */ monitor_expect_prompt (NULL, 0); len--; } - /* Now exit the sub mode */ + /* Now exit the sub mode. */ monitor_printf (current_monitor->getreg.term_cmd); monitor_expect_prompt (NULL, 0); return written; @@ -1585,7 +1584,7 @@ longlongendswap (unsigned char *a) i++, j--; } } -/* Format 32 chars of long long value, advance the pointer */ +/* Format 32 chars of long long value, advance the pointer. */ static char *hexlate = "0123456789abcdef"; static char * longlong_hexchars (unsigned long long value, @@ -1611,16 +1610,16 @@ longlong_hexchars (unsigned long long value, dp = (unsigned long long *) scan; *dp = value; } - longlongendswap (disbuf); /* FIXME: ONly on big endian hosts */ + longlongendswap (disbuf); /* FIXME: ONly on big endian hosts. */ while (scan < limit) { - c = *scan++; /* a byte of our long long value */ + c = *scan++; /* A byte of our long long value. */ if (leadzero) { if (c == 0) continue; else - leadzero = 0; /* henceforth we print even zeroes */ + leadzero = 0; /* Henceforth we print even zeroes. */ } nib = c >> 4; /* high nibble bits */ *outbuff++ = hexlate[nib]; @@ -1634,12 +1633,12 @@ longlong_hexchars (unsigned long long value, /* I am only going to call this when writing virtual byte streams. - Which possably entails endian conversions - */ + Which possably entails endian conversions. */ + static int monitor_write_memory_longlongs (CORE_ADDR memaddr, char *myaddr, int len) { - static char hexstage[20]; /* At least 16 digits required, plus null */ + static char hexstage[20]; /* At least 16 digits required, plus null. */ char *endstring; long long *llptr; long long value; @@ -1654,16 +1653,16 @@ monitor_write_memory_longlongs (CORE_ADDR memaddr, char *myaddr, int len) { value = *llptr; endstring = longlong_hexchars (*llptr, hexstage); - *endstring = '\0'; /* NUll terminate for printf */ + *endstring = '\0'; /* NUll terminate for printf. */ monitor_printf ("%s\r", hexstage); llptr++; memaddr += 8; written += 8; - /* If we wanted to, here we could validate the address */ + /* If we wanted to, here we could validate the address. */ monitor_expect_prompt (NULL, 0); len -= 8; } - /* Now exit the sub mode */ + /* Now exit the sub mode. */ monitor_printf (current_monitor->getreg.term_cmd); monitor_expect_prompt (NULL, 0); return written; @@ -1681,9 +1680,8 @@ monitor_write_memory_longlongs (CORE_ADDR memaddr, char *myaddr, int len) MO_SETMEM_INTERACTIVE ! MO_NO_ECHO_ON_SETMEM To use this, the you have to patch the monitor_cmds block with - this function. Otherwise, its not tuned up for use by all - monitor variations. - */ + this function. Otherwise, its not tuned up for use by all + monitor variations. */ static int monitor_write_memory_block (CORE_ADDR memaddr, char *myaddr, int len) @@ -1691,7 +1689,7 @@ monitor_write_memory_block (CORE_ADDR memaddr, char *myaddr, int len) int written; written = 0; - /* FIXME: This would be a good place to put the zero test */ + /* FIXME: This would be a good place to put the zero test. */ #if 1 if ((len > 8) && (((len & 0x07)) == 0) && current_monitor->setmem.cmdll) { @@ -1759,7 +1757,7 @@ monitor_read_memory_single (CORE_ADDR memaddr, char *myaddr, int len) /* Now, read the appropriate number of hex digits for this loc, skipping spaces. */ - /* Skip leading spaces and "0x" if MO_HEX_PREFIX flag is set. */ + /* Skip leading spaces and "0x" if MO_HEX_PREFIX flag is set. */ if (current_monitor->flags & MO_HEX_PREFIX) { int c; @@ -1796,7 +1794,7 @@ monitor_read_memory_single (CORE_ADDR memaddr, char *myaddr, int len) } membuf[i] = c; } - membuf[i] = '\000'; /* terminate the number */ + membuf[i] = '\000'; /* Terminate the number. */ } /* If TERM is present, we wait for that to show up. Also, (if TERM is @@ -1805,8 +1803,8 @@ monitor_read_memory_single (CORE_ADDR memaddr, char *myaddr, int len) if (current_monitor->getmem.term) { - monitor_expect (current_monitor->getmem.term, NULL, 0); /* get - response */ + monitor_expect (current_monitor->getmem.term, NULL, 0); /* Get + response. */ if (current_monitor->getmem.term_cmd) { @@ -1815,7 +1813,7 @@ monitor_read_memory_single (CORE_ADDR memaddr, char *myaddr, int len) } } else - monitor_expect_prompt (NULL, 0); /* get response */ + monitor_expect_prompt (NULL, 0); /* Get response. */ p = membuf; val = strtoul (membuf, &p, 16); @@ -1825,7 +1823,7 @@ monitor_read_memory_single (CORE_ADDR memaddr, char *myaddr, int len) "bad value from monitor", memaddr, 0, membuf, 0); - /* supply register stores in target byte order, so swap here */ + /* supply register stores in target byte order, so swap here. */ store_unsigned_integer (myaddr, len, byte_order, val); @@ -1865,9 +1863,8 @@ monitor_read_memory (CORE_ADDR memaddr, char *myaddr, int len) len = min (len, 16); /* Some dumpers align the first data with the preceeding 16 - byte boundary. Some print blanks and start at the - requested boundary. EXACT_DUMPADDR - */ + byte boundary. Some print blanks and start at the + requested boundary. EXACT_DUMPADDR */ dumpaddr = (current_monitor->flags & MO_EXACT_DUMPADDR) ? memaddr : memaddr & ~0x0f; @@ -1876,7 +1873,7 @@ monitor_read_memory (CORE_ADDR memaddr, char *myaddr, int len) if (((memaddr ^ (memaddr + len - 1)) & ~0xf) != 0) len = ((memaddr + len) & ~0xf) - memaddr; - /* send the memory examine command */ + /* Send the memory examine command. */ if (current_monitor->flags & MO_GETMEM_NEEDS_RANGE) monitor_printf (current_monitor->getmem.cmdb, memaddr, memaddr + len); @@ -1893,7 +1890,7 @@ monitor_read_memory (CORE_ADDR memaddr, char *myaddr, int len) if (current_monitor->getmem.term) { resp_len = monitor_expect (current_monitor->getmem.term, - buf, sizeof buf); /* get response */ + buf, sizeof buf); /* Get response. */ if (resp_len <= 0) monitor_error ("monitor_read_memory", @@ -1908,7 +1905,7 @@ monitor_read_memory (CORE_ADDR memaddr, char *myaddr, int len) } } else - resp_len = monitor_expect_prompt (buf, sizeof buf); /* get response */ + resp_len = monitor_expect_prompt (buf, sizeof buf); /* Get response. */ p = buf; @@ -1970,20 +1967,21 @@ monitor_read_memory (CORE_ADDR memaddr, char *myaddr, int len) ++dumpaddr; ++p; } - ++p; /* skip a blank or other non hex char */ + ++p; /* Skip a blank or other non hex char. */ c = *p; } if (fetched == 0) error (_("Failed to read via monitor")); if (monitor_debug_p || remote_debug) fprintf_unfiltered (gdb_stdlog, "\n"); - return fetched; /* Return the number of bytes actually read */ + return fetched; /* Return the number of bytes actually + read. */ } monitor_debug ("MON scanning bytes\n"); for (i = len; i > 0; i--) { - /* Skip non-hex chars, but bomb on end of string and newlines */ + /* Skip non-hex chars, but bomb on end of string and newlines. */ while (1) { @@ -2016,8 +2014,8 @@ monitor_read_memory (CORE_ADDR memaddr, char *myaddr, int len) } /* Transfer LEN bytes between target address MEMADDR and GDB address - MYADDR. Returns 0 for success, errno code for failure. TARGET is - unused. */ + MYADDR. Returns 0 for success, errno code for failure. TARGET is + unused. */ static int monitor_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int write, @@ -2043,7 +2041,7 @@ monitor_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int write, static void monitor_kill (struct target_ops *ops) { - return; /* ignore attempts to kill target system */ + return; /* Ignore attempts to kill target system. */ } /* All we actually do is set the PC to the start address of exec_bfd. */ @@ -2070,7 +2068,7 @@ static void monitor_mourn_inferior (struct target_ops *ops) { unpush_target (targ_ops); - generic_mourn_inferior (); /* Do all the proper things now */ + generic_mourn_inferior (); /* Do all the proper things now. */ delete_thread_silent (monitor_ptid); } @@ -2129,7 +2127,7 @@ monitor_remove_breakpoint (struct gdbarch *gdbarch, if (breakaddr[i] == addr) { breakaddr[i] = 0; - /* some monitors remove breakpoints based on the address */ + /* Some monitors remove breakpoints based on the address. */ if (current_monitor->flags & MO_CLR_BREAK_USES_ADDR) monitor_printf (current_monitor->clr_break, addr); else if (current_monitor->flags & MO_CLR_BREAK_1_BASED) @@ -2173,7 +2171,7 @@ monitor_wait_srec_ack (void) return 1; } -/* monitor_load -- download a file. */ +/* monitor_load -- download a file. */ static void monitor_load (char *file, int from_tty) @@ -2183,12 +2181,12 @@ monitor_load (char *file, int from_tty) if (current_monitor->load_routine) current_monitor->load_routine (monitor_desc, file, hashmark); else - { /* The default is ascii S-records */ + { /* The default is ascii S-records. */ int n; unsigned long load_offset; char buf[128]; - /* enable user to specify address for downloading as 2nd arg to load */ + /* Enable user to specify address for downloading as 2nd arg to load. */ n = sscanf (file, "%s 0x%lx", buf, &load_offset); if (n > 1) file = buf; @@ -2207,7 +2205,7 @@ monitor_load (char *file, int from_tty) monitor_expect_prompt (NULL, 0); } - /* Finally, make the PC point at the start address */ + /* Finally, make the PC point at the start address. */ if (exec_bfd) regcache_write_pc (get_current_regcache (), bfd_get_start_address (exec_bfd)); @@ -2238,7 +2236,7 @@ monitor_stop (ptid_t ptid) } /* Put a COMMAND string out to MONITOR. Output from MONITOR is placed - in OUTPUT until the prompt is seen. FIXME: We read the characters + in OUTPUT until the prompt is seen. FIXME: We read the characters ourseleves here cause of a nasty echo. */ static void @@ -2261,7 +2259,7 @@ monitor_rcmd (char *command, resp_len = monitor_expect_prompt (buf, sizeof buf); - fputs_unfiltered (buf, outbuf); /* Output the response */ + fputs_unfiltered (buf, outbuf); /* Output the response. */ } /* Convert hex digit A to a number. */ @@ -2350,7 +2348,7 @@ init_base_monitor_ops (void) monitor_ops.to_magic = OPS_MAGIC; } /* init_base_monitor_ops */ -/* Init the target_ops structure pointed at by OPS */ +/* Init the target_ops structure pointed at by OPS. */ void init_monitor_ops (struct target_ops *ops) diff --git a/gdb/monitor.h b/gdb/monitor.h index c0b5113ff29..0e9cae3994d 100644 --- a/gdb/monitor.h +++ b/gdb/monitor.h @@ -16,8 +16,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 MONITOR_H #define MONITOR_H @@ -80,13 +79,13 @@ struct regrw_cmd struct monitor_ops { int flags; /* See below */ - char **init; /* List of init commands. NULL terminated. */ + char **init; /* List of init commands. NULL terminated. */ char *cont; /* continue command */ char *step; /* single step */ char *stop; /* Interrupt program string */ - char *set_break; /* set a breakpoint. If NULL, monitor + char *set_break; /* set a breakpoint. If NULL, monitor implementation sets its own - to_insert_breakpoint method. */ + to_insert_breakpoint method. */ char *clr_break; /* clear a breakpoint */ char *clr_all_break; /* Clear all breakpoints */ char *fill; /* Memory fill cmd (addr len val) */ @@ -129,11 +128,11 @@ struct monitor_ops }; /* The monitor ops magic number, used to detect if an ops structure doesn't - have the right number of entries filled in. */ + have the right number of entries filled in. */ #define MONITOR_OPS_MAGIC 600925 -/* Flag definitions. */ +/* Flag definitions. */ /* If set, then clear breakpoint command uses address, otherwise it uses an index returned by the monitor. */ @@ -141,7 +140,7 @@ struct monitor_ops #define MO_CLR_BREAK_USES_ADDR 0x1 /* If set, then memory fill command uses STARTADDR, ENDADDR+1, VALUE - as args, else it uses STARTADDR, LENGTH, VALUE as args. */ + as args, else it uses STARTADDR, LENGTH, VALUE as args. */ #define MO_FILL_USES_ADDR 0x2 @@ -150,35 +149,35 @@ struct monitor_ops #define MO_NEED_REGDUMP_AFTER_CONT 0x4 -/* getmem needs start addr and end addr */ +/* getmem needs start addr and end addr. */ #define MO_GETMEM_NEEDS_RANGE 0x8 -/* getmem can only read one loc at a time */ +/* getmem can only read one loc at a time. */ #define MO_GETMEM_READ_SINGLE 0x10 -/* handle \r\n combinations */ +/* handle \r\n combinations. */ #define MO_HANDLE_NL 0x20 -/* don't expect echos in monitor_open */ +/* don't expect echos in monitor_open. */ #define MO_NO_ECHO_ON_OPEN 0x40 -/* If set, send break to stop monitor */ +/* If set, send break to stop monitor. */ #define MO_SEND_BREAK_ON_STOP 0x80 -/* If set, target sends an ACK after each S-record */ +/* If set, target sends an ACK after each S-record. */ #define MO_SREC_ACK 0x100 -/* Allow 0x prefix on addresses retured from monitor */ +/* Allow 0x prefix on addresses retured from monitor. */ #define MO_HEX_PREFIX 0x200 -/* Some monitors require a different command when starting a program */ +/* Some monitors require a different command when starting a program. */ #define MO_RUN_FIRST_TIME 0x400 @@ -186,7 +185,7 @@ struct monitor_ops #define MO_NO_ECHO_ON_SETMEM 0x800 -/* If set, then register store command expects value BEFORE regname */ +/* If set, then register store command expects value BEFORE regname. */ #define MO_REGISTER_VALUE_FIRST 0x1000 @@ -228,17 +227,17 @@ struct monitor_ops #define MO_PRINT_PROGRAM_OUTPUT 0x200000 /* Some dump bytes commands align the first data with the preceeding - 16 byte boundary. Some print blanks and start at the exactly the - requested boundary. */ + 16 byte boundary. Some print blanks and start at the exactly the + requested boundary. */ #define MO_EXACT_DUMPADDR 0x400000 /* Rather entering and exiting the write memory dialog for each word byte, we can save time by transferring the whole block without exiting - the memory editing mode. You only need to worry about this + the memory editing mode. You only need to worry about this if you are doing memory downloading. - This engages a new write function registered with dcache. - */ + This engages a new write function registered with dcache. */ + #define MO_HAS_BLOCKWRITES 0x800000 #define SREC_SIZE 160 diff --git a/gdb/moxie-tdep.c b/gdb/moxie-tdep.c index 32bacc7c313..84d495fcfb6 100644 --- a/gdb/moxie-tdep.c +++ b/gdb/moxie-tdep.c @@ -245,7 +245,7 @@ moxie_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) /* Found a function. */ sym = lookup_symbol (func_name, NULL, VAR_DOMAIN, NULL); /* Don't use line number debug info for assembly source - files. */ + files. */ if (sym && SYMBOL_LANGUAGE (sym) != language_asm) { sal = find_pc_line (func_addr, 0); @@ -513,7 +513,7 @@ moxie_process_readu (CORE_ADDR addr, char *buf, /* Parse the current instruction and record the values of the registers and memory that will be changed in current instruction to "record_arch_list". - Return -1 if something wrong. */ + Return -1 if something wrong. */ int moxie_process_record (struct gdbarch *gdbarch, struct regcache *regcache, @@ -848,7 +848,7 @@ moxie_process_record (struct gdbarch *gdbarch, struct regcache *regcache, ptr = extract_unsigned_integer ((gdb_byte *) & ptr, 4, byte_order); - /* String length is at 0x12($fp) */ + /* String length is at 0x12($fp). */ regcache_raw_read (regcache, MOXIE_FP_REGNUM, (gdb_byte *) & tmpu32); tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32, diff --git a/gdb/moxie-tdep.h b/gdb/moxie-tdep.h index 1726ff8fa29..6c2fea1de93 100644 --- a/gdb/moxie-tdep.h +++ b/gdb/moxie-tdep.h @@ -22,7 +22,7 @@ struct gdbarch_tdep { - /* gdbarch target dependent data here. Currently unused for MOXIE. */ + /* gdbarch target dependent data here. Currently unused for MOXIE. */ }; enum moxie_regnum diff --git a/gdb/mt-tdep.c b/gdb/mt-tdep.c index eb7ab11296f..f67ddfa719f 100644 --- a/gdb/mt-tdep.c +++ b/gdb/mt-tdep.c @@ -456,7 +456,7 @@ mt_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) instruction in the instruction set. The BP for ms1 is defined as 0x68000000 (BREAK). - The BP for ms2 is defined as 0x69000000 (illegal) */ + The BP for ms2 is defined as 0x69000000 (illegal). */ static const gdb_byte * mt_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *bp_addr, @@ -483,7 +483,7 @@ mt_select_coprocessor (struct gdbarch *gdbarch, unsigned index, base; gdb_byte copro[4]; - /* Get the copro pseudo regnum. */ + /* Get the copro pseudo regnum. */ regcache_raw_read (regcache, MT_COPRO_REGNUM, copro); base = ((extract_signed_integer (&copro[0], 2, byte_order) * MT_COPRO_PSEUDOREG_DIM_2) @@ -877,7 +877,7 @@ mt_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct mt_unwind_cache { - /* The previous frame's inner most stack address. + /* The previous frame's inner most stack address. Used as this frame ID's stack_addr. */ CORE_ADDR prev_sp; CORE_ADDR frame_base; @@ -915,7 +915,7 @@ mt_frame_unwind_cache (struct frame_info *this_frame, info->frameless_p = 1; info->saved_regs = trad_frame_alloc_saved_regs (this_frame); - /* Grab the frame-relative values of SP and FP, needed below. + /* Grab the frame-relative values of SP and FP, needed below. The frame_saved_register function will find them on the stack or in the registers as appropriate. */ sp = get_frame_register_unsigned (this_frame, MT_SP_REGNUM); @@ -933,17 +933,17 @@ mt_frame_unwind_cache (struct frame_info *this_frame, for (next_addr = start_addr; next_addr < end_addr; next_addr += 4) { instr = get_frame_memory_unsigned (this_frame, next_addr, 4); - if (delayed_store) /* previous instr was a push */ + if (delayed_store) /* Previous instr was a push. */ { upper_half = delayed_store >> 16; regnum = upper_half & 0xf; offset = delayed_store & 0xffff; switch (upper_half & 0xfff0) { - case 0x43c0: /* push using frame pointer */ + case 0x43c0: /* push using frame pointer. */ info->saved_regs[regnum].addr = offset; break; - case 0x43d0: /* push using stack pointer */ + case 0x43d0: /* push using stack pointer. */ info->saved_regs[regnum].addr = offset; break; default: /* lint */ @@ -957,7 +957,8 @@ mt_frame_unwind_cache (struct frame_info *this_frame, case 0x12000000: /* NO-OP */ continue; case 0x12ddc000: /* copy sp into fp */ - info->frameless_p = 0; /* Record that the frame pointer is in use. */ + info->frameless_p = 0; /* Record that the frame + pointer is in use. */ continue; default: upper_half = instr >> 16; @@ -990,9 +991,9 @@ mt_frame_unwind_cache (struct frame_info *this_frame, keep scanning until we reach it (or we reach end_addr). */ if (prologue_end_addr && (prologue_end_addr > (next_addr + 4))) - continue; /* Keep scanning, recording saved_regs etc. */ + continue; /* Keep scanning, recording saved_regs etc. */ else - break; /* Quit scanning: breakpoint can be set here. */ + break; /* Quit scanning: breakpoint can be set here. */ } } @@ -1185,7 +1186,7 @@ mt_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_unwind_pc (gdbarch, mt_unwind_pc); set_gdbarch_unwind_sp (gdbarch, mt_unwind_sp); - /* Methods for saving / extracting a dummy frame's ID. + /* Methods for saving / extracting a dummy frame's ID. The ID's stack address must match the SP value returned by PUSH_DUMMY_CALL, and saved by generic_save_dummy_frame_tos. */ set_gdbarch_dummy_id (gdbarch, mt_dummy_id); |