From 1777feb0fea5ec350a86eecf81f71ccc60d4cf6f Mon Sep 17 00:00:00 2001 From: Michael Snyder Date: Sun, 9 Jan 2011 03:08:57 +0000 Subject: [PATCH] 2011-01-08 Michael Snyder * h8300-tdep.c: Comment cleanup, mostly periods and spaces. * hppa-hpux-tdep.c: Ditto. * hppa-linux-nat.c: Ditto. * hppa-linux-tdep.c: Ditto. * hppanbsd-tdep.c: Ditto. * hppa-tdep.c: Ditto. * hppa-tdep.h: Ditto. * hpux-thread.c: Ditto. * i386-cygwin-tdep.c: Ditto. * i386-darwin-nat.c: Ditto. * i386gnu-nat.c: Ditto. * i386-linux-nat.c: Ditto. * i386-linux-tdep.c: Ditto. * i386-nat.c: Ditto. * i386-nat.h: Ditto. * i386nbsd-tdep.c: Ditto. * i386-sol2-nat.c: Ditto. * i386-stub.c: Ditto. * i386-tdep.c: Ditto. * i386-tdep.h: Ditto. * i387-tdep.c: Ditto. * ia64-linux-nat.c: Ditto. * ia64-linux-tdep.c: Ditto. * ia64-tdep.c: Ditto. * infcall.c: Ditto. * infcall.h: Ditto. * infcmd.c: Ditto. * inferior.c: Ditto. * inferior.h: Ditto. * infloop.c: Ditto. * inflow.c: Ditto. * infrun.c: Ditto. * interps.c: Ditto. * interps.h: Ditto. * iq2000-tdep.c: Ditto. * irix5-nat.c: Ditto. * jit.c: Ditto. * jit.h: Ditto. * jv-exp.y: Ditto. * jv-lang.c: Ditto. * jv-lang.h: Ditto. * jv-typeprint.c: Ditto. * jv-valprint.c: Ditto. * language.c: Ditto. * language.h: Ditto. * linespec.c: Ditto. * linux-fork.c: Ditto. * linux-nat.c: Ditto. * linux-thread-db.c: Ditto. * lm32-tdep.c: Ditto. --- gdb/ChangeLog | 53 +++++++++ gdb/h8300-tdep.c | 21 ++-- gdb/hppa-hpux-tdep.c | 74 ++++++------ gdb/hppa-linux-nat.c | 8 +- gdb/hppa-linux-tdep.c | 22 ++-- gdb/hppa-tdep.c | 97 ++++++++-------- gdb/hppa-tdep.h | 19 +-- gdb/hppanbsd-tdep.c | 5 +- gdb/hpux-thread.c | 27 ++--- gdb/i386-cygwin-tdep.c | 2 +- gdb/i386-darwin-nat.c | 34 ++++-- gdb/i386-linux-nat.c | 34 ++++-- gdb/i386-linux-tdep.c | 7 +- gdb/i386-nat.c | 9 +- gdb/i386-nat.h | 2 +- gdb/i386-sol2-nat.c | 4 +- gdb/i386-stub.c | 4 +- gdb/i386-tdep.c | 61 +++++----- gdb/i386-tdep.h | 11 +- gdb/i386gnu-nat.c | 6 +- gdb/i386nbsd-tdep.c | 6 +- gdb/i387-tdep.c | 8 +- gdb/ia64-linux-nat.c | 43 +++---- gdb/ia64-linux-tdep.c | 11 +- gdb/ia64-tdep.c | 257 ++++++++++++++++++++++++----------------- gdb/inf-loop.c | 20 ++-- gdb/infcall.c | 18 +-- gdb/infcall.h | 2 +- gdb/infcmd.c | 105 +++++++++-------- gdb/inferior.c | 2 +- gdb/inferior.h | 28 ++--- gdb/inflow.c | 12 +- gdb/infrun.c | 140 +++++++++++----------- gdb/interps.c | 38 +++--- gdb/interps.h | 2 +- gdb/iq2000-tdep.c | 61 +++++----- gdb/irix5-nat.c | 13 ++- gdb/jit.c | 33 +++--- gdb/jit.h | 39 ++++--- gdb/jv-exp.y | 32 ++--- gdb/jv-lang.c | 90 ++++++++------- gdb/jv-lang.h | 6 +- gdb/jv-typeprint.c | 8 +- gdb/jv-valprint.c | 22 ++-- gdb/language.c | 92 +++++++-------- gdb/language.h | 74 ++++++------ gdb/linespec.c | 91 +++++++-------- gdb/linux-fork.c | 4 +- gdb/linux-nat.c | 46 ++++---- gdb/linux-thread-db.c | 5 +- gdb/lm32-tdep.c | 16 +-- 51 files changed, 1002 insertions(+), 822 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 966a84a6b06..9c823a661c1 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,56 @@ +2011-01-08 Michael Snyder + + * h8300-tdep.c: Comment cleanup, mostly periods and spaces. + * hppa-hpux-tdep.c: Ditto. + * hppa-linux-nat.c: Ditto. + * hppa-linux-tdep.c: Ditto. + * hppanbsd-tdep.c: Ditto. + * hppa-tdep.c: Ditto. + * hppa-tdep.h: Ditto. + * hpux-thread.c: Ditto. + * i386-cygwin-tdep.c: Ditto. + * i386-darwin-nat.c: Ditto. + * i386gnu-nat.c: Ditto. + * i386-linux-nat.c: Ditto. + * i386-linux-tdep.c: Ditto. + * i386-nat.c: Ditto. + * i386-nat.h: Ditto. + * i386nbsd-tdep.c: Ditto. + * i386-sol2-nat.c: Ditto. + * i386-stub.c: Ditto. + * i386-tdep.c: Ditto. + * i386-tdep.h: Ditto. + * i387-tdep.c: Ditto. + * ia64-linux-nat.c: Ditto. + * ia64-linux-tdep.c: Ditto. + * ia64-tdep.c: Ditto. + * infcall.c: Ditto. + * infcall.h: Ditto. + * infcmd.c: Ditto. + * inferior.c: Ditto. + * inferior.h: Ditto. + * infloop.c: Ditto. + * inflow.c: Ditto. + * infrun.c: Ditto. + * interps.c: Ditto. + * interps.h: Ditto. + * iq2000-tdep.c: Ditto. + * irix5-nat.c: Ditto. + * jit.c: Ditto. + * jit.h: Ditto. + * jv-exp.y: Ditto. + * jv-lang.c: Ditto. + * jv-lang.h: Ditto. + * jv-typeprint.c: Ditto. + * jv-valprint.c: Ditto. + * language.c: Ditto. + * language.h: Ditto. + * linespec.c: Ditto. + * linux-fork.c: Ditto. + * linux-nat.c: Ditto. + * linux-thread-db.c: Ditto. + * lm32-tdep.c: Ditto. + 2011-01-08 Mike Frysinger * bfin-tdep.h (BFIN_A0_DOT_W_REGNUM): Fix typo in name. diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c index 4c9ed153dd1..ed4103d9a25 100644 --- a/gdb/h8300-tdep.c +++ b/gdb/h8300-tdep.c @@ -71,7 +71,7 @@ struct h8300_frame_cache CORE_ADDR sp_offset; CORE_ADDR pc; - /* Flag showing that a frame has been created in the prologue code. */ + /* Flag showing that a frame has been created in the prologue code. */ int uses_fp; /* Saved registers. */ @@ -147,7 +147,7 @@ h8300_init_frame_cache (struct gdbarch *gdbarch, #define IS_MOVW_Rn16_SP(x) (((x) & 0xfff0) == 0x6fe0) #define IS_MOVW_EXT(x) ((x) == 0x78e0) #define IS_MOVW_Rn24_SP(x) (((x) & 0xfff0) == 0x6ba0) -/* Same instructions as mov.w, just prefixed with 0x0100 */ +/* Same instructions as mov.w, just prefixed with 0x0100. */ #define IS_MOVL_PRE(x) ((x) == 0x0100) #define IS_MOVL_Rn16_SP(x) (((x) & 0xfff0) == 0x6fe0) #define IS_MOVL_EXT(x) ((x) == 0x78e0) @@ -815,7 +815,7 @@ static int h8300_use_struct_convention (struct type *value_type) { /* Types of 1, 2 or 4 bytes are returned in R0/R1, everything else on the - stack. */ + stack. */ if (TYPE_CODE (value_type) == TYPE_CODE_STRUCT || TYPE_CODE (value_type) == TYPE_CODE_UNION) @@ -829,7 +829,7 @@ static int h8300h_use_struct_convention (struct type *value_type) { /* Types of 1, 2 or 4 bytes are returned in R0, INT types of 8 bytes are - returned in R0/R1, everything else on the stack. */ + returned in R0/R1, everything else on the stack. */ if (TYPE_CODE (value_type) == TYPE_CODE_STRUCT || TYPE_CODE (value_type) == TYPE_CODE_UNION) return 1; @@ -856,7 +856,7 @@ h8300_store_return_value (struct type *type, struct regcache *regcache, switch (len) { case 1: - case 2: /* short... */ + case 2: /* short... */ val = extract_unsigned_integer (valbuf, len, byte_order); regcache_cooked_write_unsigned (regcache, E_RET0_REGNUM, val); break; @@ -866,8 +866,9 @@ h8300_store_return_value (struct type *type, struct regcache *regcache, (val >> 16) & 0xffff); regcache_cooked_write_unsigned (regcache, E_RET1_REGNUM, val & 0xffff); break; - case 8: /* long long, double and long double are all defined - as 4 byte types so far so this shouldn't happen. */ + case 8: /* long long, double and long double + are all defined as 4 byte types so + far so this shouldn't happen. */ error ("I don't know how to return an 8 byte value."); break; } @@ -944,7 +945,7 @@ static const char * h8300_register_name (struct gdbarch *gdbarch, int regno) { /* The register names change depending on which h8300 processor - type is selected. */ + type is selected. */ static char *register_names[] = { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "sp", "", "pc", "cycles", "tick", "inst", @@ -1335,7 +1336,7 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* * Miscelany */ - /* Stack grows up. */ + /* Stack grows up. */ set_gdbarch_inner_than (gdbarch, core_addr_lessthan); set_gdbarch_breakpoint_from_pc (gdbarch, h8300_breakpoint_from_pc); @@ -1358,7 +1359,7 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) } -extern initialize_file_ftype _initialize_h8300_tdep; /* -Wmissing-prototypes */ +extern initialize_file_ftype _initialize_h8300_tdep; /* -Wmissing-prototypes */ void _initialize_h8300_tdep (void) diff --git a/gdb/hppa-hpux-tdep.c b/gdb/hppa-hpux-tdep.c index b434c0664ac..4e21c69f5f6 100644 --- a/gdb/hppa-hpux-tdep.c +++ b/gdb/hppa-hpux-tdep.c @@ -164,7 +164,7 @@ hppa64_hpux_in_solib_call_trampoline (struct gdbarch *gdbarch, /* PA64 has a completely different stub/trampoline scheme. Is it better? Maybe. It's certainly harder to determine with any certainty that we are in a stub because we can not refer to the - unwinders to help. + unwinders to help. The heuristic is simple. Try to lookup the current PC value in th minimal symbol table. If that fails, then assume we are not in a @@ -192,7 +192,7 @@ hppa64_hpux_in_solib_call_trampoline (struct gdbarch *gdbarch, return 0; /* We might be in a stub. Peek at the instructions. Stubs are 3 - instructions long. */ + instructions long. */ insn = read_memory_integer (pc, 4, byte_order); /* Find out where we think we are within the stub. */ @@ -325,7 +325,8 @@ hppa_hpux_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc) the PLT entry for this function, not the address of the function itself. Bit 31 has meaning too, but only for MPE. */ if (pc & 0x2) - pc = (CORE_ADDR) read_memory_integer (pc & ~0x3, word_size, byte_order); + pc = (CORE_ADDR) read_memory_integer (pc & ~0x3, word_size, + byte_order); } if (pc == hppa_symbol_address("$$dyncall_external")) { @@ -344,25 +345,25 @@ hppa_hpux_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc) /* If this isn't a linker stub, then return now. */ /* elz: attention here! (FIXME) because of a compiler/linker error, some stubs which should have a non zero stub_unwind.stub_type - have unfortunately a value of zero. So this function would return here - as if we were not in a trampoline. To fix this, we go look at the partial + have unfortunately a value of zero. So this function would return here + as if we were not in a trampoline. To fix this, we go look at the partial symbol information, which reports this guy as a stub. (FIXME): Unfortunately, we are not that lucky: it turns out that the - partial symbol information is also wrong sometimes. This is because + partial symbol information is also wrong sometimes. This is because when it is entered (somread.c::som_symtab_read()) it can happen that if the type of the symbol (from the som) is Entry, and the symbol is - in a shared library, then it can also be a trampoline. This would - be OK, except that I believe the way they decide if we are ina shared library - does not work. SOOOO..., even if we have a regular function w/o trampolines - its minimal symbol can be assigned type mst_solib_trampoline. + in a shared library, then it can also be a trampoline. This would be OK, + except that I believe the way they decide if we are ina shared library + does not work. SOOOO..., even if we have a regular function w/o + trampolines its minimal symbol can be assigned type mst_solib_trampoline. Also, if we find that the symbol is a real stub, then we fix the unwind descriptor, and define the stub type to be EXPORT. - Hopefully this is correct most of the times. */ + Hopefully this is correct most of the times. */ if (u->stub_unwind.stub_type == 0) { /* elz: NOTE (FIXME!) once the problem with the unwind information is fixed - we can delete all the code which appears between the lines */ + we can delete all the code which appears between the lines. */ /*--------------------------------------------------------------------------*/ msym = lookup_minimal_symbol_by_pc (pc); @@ -375,10 +376,10 @@ hppa_hpux_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc) struct minimal_symbol *msymbol; int function_found = 0; - /* go look if there is another minimal symbol with the same name as - this one, but with type mst_text. This would happen if the msym + /* Go look if there is another minimal symbol with the same name as + this one, but with type mst_text. This would happen if the msym is an actual trampoline, in which case there would be another - symbol with the same name corresponding to the real function */ + symbol with the same name corresponding to the real function. */ ALL_MSYMBOLS (objfile, msymbol) { @@ -392,14 +393,14 @@ hppa_hpux_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc) } if (function_found) - /* the type of msym is correct (mst_solib_trampoline), but - the unwind info is wrong, so set it to the correct value */ + /* The type of msym is correct (mst_solib_trampoline), but + the unwind info is wrong, so set it to the correct value. */ u->stub_unwind.stub_type = EXPORT; else - /* the stub type info in the unwind is correct (this is not a + /* The stub type info in the unwind is correct (this is not a trampoline), but the msym type information is wrong, it - should be mst_text. So we need to fix the msym, and also - get out of this function */ + should be mst_text. So we need to fix the msym, and also + get out of this function. */ { MSYMBOL_TYPE (msym) = mst_text; return orig_pc == pc ? 0 : pc & ~0x3; @@ -436,10 +437,12 @@ hppa_hpux_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc) /* Yup. See if the previous instruction loaded a value into %r1. If so compute and return the jump address. */ if ((prev_inst & 0xffe00000) == 0x20200000) - return (hppa_extract_21 (prev_inst) + hppa_extract_17 (curr_inst)) & ~0x3; + return (hppa_extract_21 (prev_inst) + + hppa_extract_17 (curr_inst)) & ~0x3; else { - warning (_("Unable to find ldil X,%%r1 before ble Y(%%sr4,%%r1).")); + warning (_("Unable to find ldil X,%%r1 " + "before ble Y(%%sr4,%%r1).")); return orig_pc == pc ? 0 : pc & ~0x3; } } @@ -479,7 +482,8 @@ hppa_hpux_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc) return orig_pc == pc ? 0 : pc & ~0x3; } - libsym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (stubsym), NULL, NULL); + libsym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (stubsym), + NULL, NULL); if (libsym == NULL) { warning (_("Unable to find library symbol for %s."), @@ -574,7 +578,8 @@ hppa_skip_permanent_breakpoint (struct regcache *regcache) regcache_cooked_write_unsigned (regcache, HPPA_PCOQ_HEAD_REGNUM, pcoq_tail); regcache_cooked_write_unsigned (regcache, HPPA_PCSQ_HEAD_REGNUM, pcsq_tail); - regcache_cooked_write_unsigned (regcache, HPPA_PCOQ_TAIL_REGNUM, pcoq_tail + 4); + regcache_cooked_write_unsigned (regcache, + HPPA_PCOQ_TAIL_REGNUM, pcoq_tail + 4); /* We can leave the tail's space the same, since there's no jump. */ } @@ -647,22 +652,22 @@ hppa_hpux_sigtramp_frame_unwind_cache (struct frame_info *this_frame, off = scptr; - /* See /usr/include/machine/save_state.h for the structure of the save_state_t - structure. */ + /* See /usr/include/machine/save_state.h for the structure of the + save_state_t structure. */ flag = read_memory_unsigned_integer (scptr + HPPA_HPUX_SS_FLAGS_OFFSET, 4, byte_order); if (!(flag & HPPA_HPUX_SS_WIDEREGS)) { - /* Narrow registers. */ + /* Narrow registers. */ off = scptr + HPPA_HPUX_SS_NARROW_OFFSET; incr = 4; szoff = 0; } else { - /* Wide registers. */ + /* Wide registers. */ off = scptr + HPPA_HPUX_SS_WIDE_OFFSET + 8; incr = 8; szoff = (tdep->bytes_per_address == 4 ? 4 : 0); @@ -708,7 +713,8 @@ hppa_hpux_sigtramp_frame_prev_register (struct frame_info *this_frame, struct hppa_hpux_sigtramp_unwind_cache *info = hppa_hpux_sigtramp_frame_unwind_cache (this_frame, this_prologue_cache); - return hppa_frame_prev_register_helper (this_frame, info->saved_regs, regnum); + return hppa_frame_prev_register_helper (this_frame, + info->saved_regs, regnum); } static int @@ -1087,7 +1093,7 @@ hppa_hpux_find_dummy_bpaddr (CORE_ADDR addr) if (sec) { /* First try the lowest address in the section; we can use it as long - as it is "regular" code (i.e. not a stub) */ + as it is "regular" code (i.e. not a stub). */ u = find_unwind_entry (obj_section_addr (sec)); if (!u || u->stub_unwind.stub_type == 0) return obj_section_addr (sec); @@ -1195,9 +1201,7 @@ hppa_hpux_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, - point the sequence at the trampoline - set the return address of the trampoline to the current space (see hppa_hpux_find_dummy_call_bpaddr) - - set the continuing address of the "dummy code" as the sequence. - -*/ + - set the continuing address of the "dummy code" as the sequence. */ if (IS_32BIT_TARGET (gdbarch)) { @@ -1446,8 +1450,8 @@ hppa_hpux_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame) /* Given the current value of the pc, check to see if it is inside a stub, and if so, change the value of the pc to point to the caller of the stub. THIS_FRAME is the current frame in the current list of frames. - BASE contains to stack frame base of the current frame. - SAVE_REGS is the register file stored in the frame cache. */ + BASE contains to stack frame base of the current frame. + SAVE_REGS is the register file stored in the frame cache. */ static void hppa_hpux_unwind_adjust_stub (struct frame_info *this_frame, CORE_ADDR base, struct trad_frame_saved_reg *saved_regs) diff --git a/gdb/hppa-linux-nat.c b/gdb/hppa-linux-nat.c index 0ac4da9a5c7..cb5a2c6aaa4 100644 --- a/gdb/hppa-linux-nat.c +++ b/gdb/hppa-linux-nat.c @@ -35,7 +35,7 @@ #include "hppa-tdep.h" -/* Prototypes for supply_gregset etc. */ +/* Prototypes for supply_gregset etc. */ #include "gregset.h" /* These must match the order of the register names. @@ -239,7 +239,7 @@ fetch_register (struct regcache *regcache, int regno) regcache_raw_supply (regcache, regno, &val); } -/* Store one register. */ +/* Store one register. */ static void store_register (const struct regcache *regcache, int regno) @@ -346,7 +346,7 @@ fill_gregset (const struct regcache *regcache, /* Given a pointer to a floating point register set in /proc format (fpregset_t *), unpack the register contents and supply them as gdb's - idea of the current floating point register values. */ + idea of the current floating point register values. */ void supply_fpregset (struct regcache *regcache, const gdb_fpregset_t *fpregsetp) @@ -365,7 +365,7 @@ supply_fpregset (struct regcache *regcache, const gdb_fpregset_t *fpregsetp) /* Given a pointer to a floating point register set in /proc format (fpregset_t *), update the register specified by REGNO from gdb's idea of the current floating point register set. If REGNO is -1, update - them all. */ + them all. */ void fill_fpregset (const struct regcache *regcache, diff --git a/gdb/hppa-linux-tdep.c b/gdb/hppa-linux-tdep.c index e04482907cc..355f8f9d099 100644 --- a/gdb/hppa-linux-tdep.c +++ b/gdb/hppa-linux-tdep.c @@ -56,7 +56,8 @@ hppa_linux_target_write_pc (struct regcache *regcache, CORE_ADDR v) { /* Probably this should be done by the kernel, but it isn't. */ regcache_cooked_write_unsigned (regcache, HPPA_PCOQ_HEAD_REGNUM, v | 0x3); - regcache_cooked_write_unsigned (regcache, HPPA_PCOQ_TAIL_REGNUM, (v + 4) | 0x3); + regcache_cooked_write_unsigned (regcache, + HPPA_PCOQ_TAIL_REGNUM, (v + 4) | 0x3); } /* An instruction to match. */ @@ -169,7 +170,7 @@ hppa_linux_sigtramp_find_sigcontext (struct gdbarch *gdbarch, CORE_ADDR pc) if (insns_match_pattern (gdbarch, pc, hppa_sigtramp, dummy)) { /* sigaltstack case: we have no way of knowing which offset to - use in this case; default to new kernel handling. If this is + use in this case; default to new kernel handling. If this is wrong the unwinding will fail. */ try = 2; sp = pc - pcoffs[try]; @@ -182,8 +183,8 @@ hppa_linux_sigtramp_find_sigcontext (struct gdbarch *gdbarch, CORE_ADDR pc) /* sp + sfoffs[try] points to a struct rt_sigframe, which contains a struct siginfo and a struct ucontext. struct ucontext contains - a struct sigcontext. Return an offset to this sigcontext here. Too - bad we cannot include system specific headers :-(. + a struct sigcontext. Return an offset to this sigcontext here. Too + bad we cannot include system specific headers :-(. sizeof(struct siginfo) == 128 offsetof(struct ucontext, uc_mcontext) == 24. */ return sp + sfoffs[try] + 128 + 24; @@ -252,7 +253,7 @@ hppa_linux_sigtramp_frame_unwind_cache (struct frame_info *this_frame, scptr += 4; } - /* IASQ/IAOQ. */ + /* IASQ/IAOQ. */ info->saved_regs[HPPA_PCSQ_HEAD_REGNUM].addr = scptr; scptr += 4; info->saved_regs[HPPA_PCSQ_TAIL_REGNUM].addr = scptr; @@ -330,7 +331,8 @@ static const struct frame_unwind hppa_linux_sigtramp_frame_unwind = { d_un.d_ptr value is the global pointer. */ static CORE_ADDR -hppa_linux_find_global_pointer (struct gdbarch *gdbarch, struct value *function) +hppa_linux_find_global_pointer (struct gdbarch *gdbarch, + struct value *function) { enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); struct obj_section *faddr_sect; @@ -395,7 +397,7 @@ hppa_linux_find_global_pointer (struct gdbarch *gdbarch, struct value *function) break; global_pointer = extract_unsigned_integer (buf, sizeof (buf), byte_order); - /* The payoff... */ + /* The payoff... */ return global_pointer; } @@ -562,6 +564,8 @@ hppa_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) void _initialize_hppa_linux_tdep (void) { - gdbarch_register_osabi (bfd_arch_hppa, 0, GDB_OSABI_LINUX, hppa_linux_init_abi); - gdbarch_register_osabi (bfd_arch_hppa, bfd_mach_hppa20w, GDB_OSABI_LINUX, hppa_linux_init_abi); + gdbarch_register_osabi (bfd_arch_hppa, 0, GDB_OSABI_LINUX, + hppa_linux_init_abi); + gdbarch_register_osabi (bfd_arch_hppa, bfd_mach_hppa20w, + GDB_OSABI_LINUX, hppa_linux_init_abi); } diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index 6557745fdd4..334870fe507 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -30,7 +30,7 @@ #include "osabi.h" #include "gdb_assert.h" #include "arch-utils.h" -/* For argument passing to the inferior */ +/* For argument passing to the inferior. */ #include "symtab.h" #include "dis-asm.h" #include "trad-frame.h" @@ -57,7 +57,7 @@ static const int hppa64_num_regs = 96; by hppa-hpux-tdep.c and shared with pa64solib.c and somsolib.c. */ const struct objfile_data *hppa_objfile_priv_data = NULL; -/* Get at various relevent fields of an instruction word. */ +/* Get at various relevent fields of an instruction word. */ #define MASK_5 0x1f #define MASK_11 0x7ff #define MASK_14 0x3fff @@ -68,10 +68,10 @@ const struct objfile_data *hppa_objfile_priv_data = NULL; #define STUB_UNWIND_ENTRY_SIZE 8 /* Routines to extract various sized constants out of hppa - instructions. */ + instructions. */ /* This assumes that no garbage lies outside of the lower bits of - value. */ + value. */ static int hppa_sign_extend (unsigned val, unsigned bits) @@ -79,7 +79,7 @@ hppa_sign_extend (unsigned val, unsigned bits) return (int) (val >> (bits - 1) ? (-1 << bits) | val : val); } -/* For many immediate values the sign bit is the low bit! */ +/* For many immediate values the sign bit is the low bit! */ static int hppa_low_hppa_sign_extend (unsigned val, unsigned bits) @@ -88,7 +88,7 @@ hppa_low_hppa_sign_extend (unsigned val, unsigned bits) } /* Extract the bits at positions between FROM and TO, using HP's numbering - (MSB = 0). */ + (MSB = 0). */ int hppa_get_field (unsigned word, int from, int to) @@ -96,7 +96,7 @@ hppa_get_field (unsigned word, int from, int to) return ((word) >> (31 - (to)) & ((1 << ((to) - (from) + 1)) - 1)); } -/* extract the immediate field from a ld{bhw}s instruction */ +/* Extract the immediate field from a ld{bhw}s instruction. */ int hppa_extract_5_load (unsigned word) @@ -104,7 +104,7 @@ hppa_extract_5_load (unsigned word) return hppa_low_hppa_sign_extend (word >> 16 & MASK_5, 5); } -/* extract the immediate field from a break instruction */ +/* Extract the immediate field from a break instruction. */ unsigned hppa_extract_5r_store (unsigned word) @@ -112,7 +112,7 @@ hppa_extract_5r_store (unsigned word) return (word & MASK_5); } -/* extract the immediate field from a {sr}sm instruction */ +/* Extract the immediate field from a {sr}sm instruction. */ unsigned hppa_extract_5R_store (unsigned word) @@ -120,7 +120,7 @@ hppa_extract_5R_store (unsigned word) return (word >> 16 & MASK_5); } -/* extract a 14 bit immediate field */ +/* Extract a 14 bit immediate field. */ int hppa_extract_14 (unsigned word) @@ -128,7 +128,7 @@ hppa_extract_14 (unsigned word) return hppa_low_hppa_sign_extend (word & MASK_14, 14); } -/* extract a 21 bit constant */ +/* Extract a 21 bit constant. */ int hppa_extract_21 (unsigned word) @@ -150,7 +150,7 @@ hppa_extract_21 (unsigned word) } /* extract a 17 bit constant from branch instructions, returning the - 19 bit signed value. */ + 19 bit signed value. */ int hppa_extract_17 (unsigned word) @@ -222,8 +222,8 @@ record_text_segment_lowaddr (bfd *abfd, asection *section, void *data) static void internalize_unwinds (struct objfile *objfile, struct unwind_table_entry *table, - asection *section, unsigned int entries, unsigned int size, - CORE_ADDR text_offset) + asection *section, unsigned int entries, + unsigned int size, CORE_ADDR text_offset) { /* We will read the unwind entries into temporary memory, then fill in the actual unwind table. */ @@ -237,7 +237,7 @@ internalize_unwinds (struct objfile *objfile, struct unwind_table_entry *table, CORE_ADDR low_text_segment_address; /* For ELF targets, then unwinds are supposed to - be segment relative offsets instead of absolute addresses. + be segment relative offsets instead of absolute addresses. Note that when loading a shared library (text_offset != 0) the unwinds are already relative to the text_offset that will be @@ -305,7 +305,7 @@ internalize_unwinds (struct objfile *objfile, struct unwind_table_entry *table, table[i].reserved2 = (tmp >> 27) & 0x1; table[i].Total_frame_size = tmp & 0x7ffffff; - /* Stub unwinds are handled elsewhere. */ + /* Stub unwinds are handled elsewhere. */ table[i].stub_unwind.stub_type = 0; table[i].stub_unwind.padding = 0; } @@ -340,7 +340,7 @@ read_unwind_info (struct objfile *objfile) /* For reasons unknown the HP PA64 tools generate multiple unwinder sections in a single executable. So we just iterate over every section in the BFD looking for unwinder sections intead of trying - to do a lookup with bfd_get_section_by_name. + to do a lookup with bfd_get_section_by_name. First determine the total size of the unwind tables so that we can allocate memory in a nice big hunk. */ @@ -418,7 +418,7 @@ read_unwind_info (struct objfile *objfile) /* Clear out the next unwind entry. */ memset (&ui->table[index], 0, sizeof (struct unwind_table_entry)); - /* Convert offset & size into region_start and region_end. + /* Convert offset & size into region_start and region_end. Stuff away the stub type into "reserved" fields. */ ui->table[index].region_start = bfd_get_32 (objfile->obfd, (bfd_byte *) buf); @@ -464,7 +464,7 @@ find_unwind_entry (CORE_ADDR pc) fprintf_unfiltered (gdb_stdlog, "{ find_unwind_entry %s -> ", hex_string (pc)); - /* A function at address 0? Not in HP-UX! */ + /* A function at address 0? Not in HP-UX! */ if (pc == (CORE_ADDR) 0) { if (hppa_debug) @@ -489,7 +489,7 @@ find_unwind_entry (CORE_ADDR pc) ui = ((struct hppa_objfile_private *) priv)->unwind_info; } - /* First, check the cache */ + /* First, check the cache. */ if (ui->cache && pc >= ui->cache->region_start @@ -501,7 +501,7 @@ find_unwind_entry (CORE_ADDR pc) return ui->cache; } - /* Not in the cache, do a binary search */ + /* Not in the cache, do a binary search. */ first = 0; last = ui->last; @@ -533,7 +533,7 @@ find_unwind_entry (CORE_ADDR pc) } /* The epilogue is defined here as the area either on the `bv' instruction - itself or an instruction which destroys the function's stack frame. + itself or an instruction which destroys the function's stack frame. We do not assume that the epilogue is at the end of a function as we can also have return sequences in the middle of a function. */ @@ -715,7 +715,7 @@ hppa32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, for (write_pass = 0; write_pass < 2; write_pass++) { CORE_ADDR struct_ptr = 0; - /* The first parameter goes into sp-36, each stack slot is 4-bytes. + /* The first parameter goes into sp-36, each stack slot is 4-bytes. struct_ptr is adjusted for each argument below, so the first argument will end up at sp-36. */ CORE_ADDR param_ptr = 32; @@ -829,7 +829,7 @@ hppa32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, } /* If a structure has to be returned, set up register 28 to hold its - address */ + address. */ if (struct_return) regcache_cooked_write_unsigned (regcache, 28, struct_addr); @@ -1035,7 +1035,7 @@ hppa64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, { /* "Aggregates larger than 8 bytes are aligned on a 16-byte boundary, possibly leaving an unused argument - slot, which is filled with garbage. If necessary, + slot, which is filled with garbage. If necessary, they are padded on the right (with garbage), to a multiple of 8 bytes." */ offset = align_up (offset, 16); @@ -1306,7 +1306,7 @@ hppa_write_pc (struct regcache *regcache, CORE_ADDR pc) } /* For the given instruction (INST), return any adjustment it makes - to the stack pointer or zero for no adjustment. + to the stack pointer or zero for no adjustment. This only handles instructions commonly found in prologues. */ @@ -1398,7 +1398,7 @@ inst_saves_gr (unsigned long inst) && ((inst >> 6) & 0xf) == 0xb)) return hppa_extract_5R_store (inst); - /* Does it look like a stwm? GCC & HPC may use this in prologues. */ + /* Does it look like a stwm? GCC & HPC may use this in prologues. */ if ((inst >> 26) == 0x1b) return hppa_extract_5R_store (inst); @@ -1424,12 +1424,12 @@ inst_saves_gr (unsigned long inst) static int inst_saves_fr (unsigned long inst) { - /* is this an FSTD ? */ + /* Is this an FSTD? */ if ((inst & 0xfc00dfc0) == 0x2c001200) return hppa_extract_5r_store (inst); if ((inst & 0xfc000002) == 0x70000002) return hppa_extract_5R_store (inst); - /* is this an FSTW ? */ + /* Is this an FSTW? */ if ((inst & 0xfc00df80) == 0x24001200) return hppa_extract_5r_store (inst); if ((inst & 0xfc000002) == 0x7c000000) @@ -1438,7 +1438,7 @@ inst_saves_fr (unsigned long inst) } /* Advance PC across any function entry prologue instructions - to reach some "real" code. + to reach some "real" code. Use information in the unwind table to determine what exactly should be in the prologue. */ @@ -1464,7 +1464,7 @@ restart: if (!u) return pc; - /* If we are not at the beginning of a function, then return now. */ + /* If we are not at the beginning of a function, then return now. */ if ((pc & ~0x3) != u->region_start) return pc; @@ -1714,7 +1714,7 @@ after_prologue (CORE_ADDR pc) is within the function bounds. In that case we return the end of the source line. Second is the end of the source line extends beyond the bounds of the current function. We need to use the slow code to - examine instructions in that case. + examine instructions in that case. Anything else is simply a bug elsewhere. Fixing it here is absolutely the wrong thing to do. In fact, it should be entirely possible for this @@ -1728,10 +1728,10 @@ after_prologue (CORE_ADDR pc) /* To skip prologues, I use this predicate. Returns either PC itself if the code at PC does not look like a function prologue; otherwise - returns an address that (if we're lucky) follows the prologue. + returns an address that (if we're lucky) follows the prologue. hppa_skip_prologue is called by gdb to place a breakpoint in a function. - It doesn't necessarily skips all the insns in the prologue. In fact + It doesn't necessarily skips all the insns in the prologue. In fact we might not want to skip all the insns because a prologue insn may appear in the delay slot of the first branch, and we don't want to skip over the branch in that case. */ @@ -1866,7 +1866,7 @@ hppa_frame_cache (struct frame_info *this_frame, void **this_cache) skip_prologue_using_sal, in case we stepped into a function without symbol information. hppa_skip_prologue also bounds the returned pc by the passed in pc, so it will not return a pc in the next - function. + function. We used to call hppa_skip_prologue to find the end of the prologue, but if some non-prologue instructions get scheduled into the prologue, @@ -1877,9 +1877,9 @@ hppa_frame_cache (struct frame_info *this_frame, void **this_cache) /* We used to use get_frame_func to locate the beginning of the function to pass to skip_prologue. However, when objects are compiled without debug symbols, get_frame_func can return the wrong - function (or 0). We can do better than that by using unwind records. + function (or 0). We can do better than that by using unwind records. This only works if the Region_description of the unwind record - indicates that it includes the entry point of the function. + indicates that it includes the entry point of the function. HP compilers sometimes generate unwind records for regions that do not include the entry or exit point of a function. GNU tools do not do this. */ @@ -1971,7 +1971,8 @@ hppa_frame_cache (struct frame_info *this_frame, void **this_cache) CORE_ADDR offset; if ((inst >> 26) == 0x1c) - offset = (inst & 0x1 ? -1 << 13 : 0) | (((inst >> 4) & 0x3ff) << 3); + offset = (inst & 0x1 ? -1 << 13 : 0) + | (((inst >> 4) & 0x3ff) << 3); else if ((inst >> 26) == 0x03) offset = hppa_low_hppa_sign_extend (inst & 0x1f, 5); else @@ -1981,7 +1982,8 @@ hppa_frame_cache (struct frame_info *this_frame, void **this_cache) if (u->Save_SP) cache->saved_regs[reg].addr = offset; else - cache->saved_regs[reg].addr = (u->Total_frame_size << 3) + offset; + cache->saved_regs[reg].addr + = (u->Total_frame_size << 3) + offset; } } @@ -2021,7 +2023,7 @@ hppa_frame_cache (struct frame_info *this_frame, void **this_cache) } } - /* Quit if we hit any kind of branch the previous iteration. */ + /* Quit if we hit any kind of branch the previous iteration. */ if (final_iteration) break; /* We want to look precisely one instruction beyond the branch @@ -2206,7 +2208,8 @@ hppa_frame_prev_register (struct frame_info *this_frame, { struct hppa_frame_cache *info = hppa_frame_cache (this_frame, this_cache); - return hppa_frame_prev_register_helper (this_frame, info->saved_regs, regnum); + return hppa_frame_prev_register_helper (this_frame, + info->saved_regs, regnum); } static int @@ -2322,10 +2325,11 @@ static struct value * hppa_fallback_frame_prev_register (struct frame_info *this_frame, void **this_cache, int regnum) { - struct hppa_frame_cache *info = - hppa_fallback_frame_cache (this_frame, this_cache); + struct hppa_frame_cache *info + = hppa_fallback_frame_cache (this_frame, this_cache); - return hppa_frame_prev_register_helper (this_frame, info->saved_regs, regnum); + return hppa_frame_prev_register_helper (this_frame, + info->saved_regs, regnum); } static const struct frame_unwind hppa_fallback_frame_unwind = @@ -2404,7 +2408,8 @@ hppa_stub_frame_prev_register (struct frame_info *this_frame, if (info == NULL) error (_("Requesting registers from null frame.")); - return hppa_frame_prev_register_helper (this_frame, info->saved_regs, regnum); + return hppa_frame_prev_register_helper (this_frame, + info->saved_regs, regnum); } static int @@ -3143,7 +3148,7 @@ _initialize_hppa_tdep (void) _("Print unwind table entry at given address."), &maintenanceprintlist); - /* Debug this files internals. */ + /* Debug this files internals. */ add_setshow_boolean_cmd ("hppa", class_maintenance, &hppa_debug, _("\ Set whether hppa target specific debugging information should be displayed."), _("\ diff --git a/gdb/hppa-tdep.h b/gdb/hppa-tdep.h index ad3688f4607..4afb0302aa5 100644 --- a/gdb/hppa-tdep.h +++ b/gdb/hppa-tdep.h @@ -59,16 +59,17 @@ enum hppa_regnum HPPA_CCR_REGNUM = 54, /* Coprocessor Configuration Register */ HPPA_TR0_REGNUM = 57, /* Temporary Registers (cr24 -> cr31) */ HPPA_CR26_REGNUM = 59, - HPPA_CR27_REGNUM = 60, /* Base register for thread-local storage, cr27 */ + HPPA_CR27_REGNUM = 60, /* Base register for thread-local + storage, cr27 */ HPPA_FP0_REGNUM = 64, /* First floating-point. */ HPPA_FP4_REGNUM = 72, HPPA64_FP4_REGNUM = 68, HPPA_FP31R_REGNUM = 127, /* Last floating-point. */ - HPPA_ARG0_REGNUM = 26, /* The first argument of a callee. */ - HPPA_ARG1_REGNUM = 25, /* The second argument of a callee. */ - HPPA_ARG2_REGNUM = 24, /* The third argument of a callee. */ - HPPA_ARG3_REGNUM = 23 /* The fourth argument of a callee. */ + HPPA_ARG0_REGNUM = 26, /* The first argument of a callee. */ + HPPA_ARG1_REGNUM = 25, /* The second argument of a callee. */ + HPPA_ARG2_REGNUM = 24, /* The third argument of a callee. */ + HPPA_ARG3_REGNUM = 23 /* The fourth argument of a callee. */ }; /* Instruction size. */ @@ -155,8 +156,8 @@ struct unwind_table_entry /* This is *NOT* part of an actual unwind_descriptor in an object file. It is *ONLY* part of the "internalized" descriptors that - we create from those in a file. - */ + we create from those in a file. */ + struct { unsigned int stub_type:4; /* 0..3 */ @@ -201,13 +202,13 @@ struct hppa_unwind_info { struct unwind_table_entry *table; /* Pointer to unwind info */ struct unwind_table_entry *cache; /* Pointer to last entry we found */ - int last; /* Index of last entry */ + int last; /* Index of last entry */ }; struct hppa_objfile_private { struct hppa_unwind_info *unwind_info; /* a pointer */ - struct so_list *so_info; /* a pointer */ + struct so_list *so_info; /* a pointer */ CORE_ADDR dp; int dummy_call_sequence_reg; diff --git a/gdb/hppanbsd-tdep.c b/gdb/hppanbsd-tdep.c index e35c84ee406..36856122ca6 100644 --- a/gdb/hppanbsd-tdep.c +++ b/gdb/hppanbsd-tdep.c @@ -164,8 +164,9 @@ static int hppanbsd_reg_offset[] = REGCACHE. If REGNUM is -1, do this for all registers in REGSET. */ static void -hppanbsd_supply_gregset (const struct regset *regset, struct regcache *regcache, - int regnum, const void *gregs, size_t len) +hppanbsd_supply_gregset (const struct regset *regset, + struct regcache *regcache, + int regnum, const void *gregs, size_t len) { const gdb_byte *regs = gregs; size_t offset; diff --git a/gdb/hpux-thread.c b/gdb/hpux-thread.c index d994c207845..478b3db400d 100644 --- a/gdb/hpux-thread.c +++ b/gdb/hpux-thread.c @@ -24,12 +24,10 @@ provide access to the HPUX user-mode thread implementation. HPUX threads are true user-mode threads, which are invoked via the cma_* - and pthread_* (DCE and Posix respectivly) interfaces. These are mostly + and pthread_* (DCE and Posix respectively) interfaces. These are mostly implemented in user-space, with all thread context kept in various structures that live in the user's heap. For the most part, the kernel has - no knowlege of these threads. - - */ + no knowlege of these threads. */ #include "defs.h" @@ -114,7 +112,8 @@ find_tcb (ptid_t ptid) tcb_ptr = cma__base (queue_ptr, threads, cma__t_int_tcb); - read_memory ((CORE_ADDR) tcb_ptr, (char *) &cached_tcb, sizeof cached_tcb); + read_memory ((CORE_ADDR) tcb_ptr, (char *) &cached_tcb, + sizeof cached_tcb); if (cached_tcb.header.type == cma__c_obj_tcb) if (cma_thread_get_unique (&cached_tcb.prolog.client_thread) == thread) @@ -145,7 +144,7 @@ hpux_thread_attach (struct target_ops *ops, char *args, int from_tty) { deprecated_child_ops.to_attach (&deprecated_child_ops, args, from_tty); - /* XXX - might want to iterate over all the threads and register them. */ + /* XXX - might want to iterate over all the threads and register them. */ } /* Take a program previously attached to and detaches it. @@ -189,8 +188,8 @@ hpux_thread_resume (struct target_ops *ops, to a LWP id, and vice versa on the way out. */ static ptid_t -hpux_thread_wait (struct target_ops *ops, - ptid_t ptid, struct target_waitstatus *ourstatus, int options) +hpux_thread_wait (struct target_ops *ops, ptid_t ptid, + struct target_waitstatus *ourstatus, int options) { ptid_t rtnval; struct cleanup *old_chain; @@ -289,7 +288,7 @@ hpux_thread_fetch_registers (struct target_ops *ops, sp = (CORE_ADDR) tcb_ptr->static_ctx.sp - 160; if (regno == HPPA_FLAGS_REGNUM) - /* Flags must be 0 to avoid bogus value for SS_INSYSCALL */ + /* Flags must be 0 to avoid bogus value for SS_INSYSCALL. */ memset (buf, '\000', register_size (gdbarch, regno)); else if (regno == HPPA_SP_REGNUM) store_unsigned_integer (buf, sizeof sp, byte_order, sp); @@ -356,7 +355,7 @@ hpux_thread_store_registers (struct target_ops *ops, if (regno == HPPA_FLAGS_REGNUM) { - /* Let lower layer handle this... */ + /* Let lower layer handle this... */ deprecated_child_ops.to_store_registers (&deprecated_child_ops, regcache, regno); } @@ -411,7 +410,8 @@ hpux_thread_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, inferior_ptid = main_ptid; retval = - deprecated_child_ops.deprecated_xfer_memory (memaddr, myaddr, len, dowrite, attribs, target); + deprecated_child_ops.deprecated_xfer_memory (memaddr, myaddr, len, + dowrite, attribs, target); do_cleanups (old_chain); @@ -501,7 +501,8 @@ hpux_thread_mourn_inferior (void) deprecated_child_ops.to_mourn_inferior (&deprecated_child_ops); } -/* Mark our target-struct as eligible for stray "run" and "attach" commands. */ +/* Mark our target-struct as eligible for stray "run" and "attach" + commands. */ static int hpux_thread_can_run (void) @@ -521,7 +522,7 @@ hpux_thread_stop (ptid_t ptid) deprecated_child_ops.to_stop (ptid); } -/* Convert a pid to printable form. */ +/* Convert a pid to printable form. */ char * hpux_pid_to_str (ptid_t ptid) diff --git a/gdb/i386-cygwin-tdep.c b/gdb/i386-cygwin-tdep.c index 2bb216b99cc..6fd06b553d2 100644 --- a/gdb/i386-cygwin-tdep.c +++ b/gdb/i386-cygwin-tdep.c @@ -266,7 +266,7 @@ i386_cygwin_osabi_sniffer (bfd *abfd) char *target_name = bfd_get_target (abfd); /* Interix also uses pei-i386. - We need a way to distinguish between the two. */ + We need a way to distinguish between the two. */ if (strcmp (target_name, "pei-i386") == 0) return GDB_OSABI_CYGWIN; diff --git a/gdb/i386-darwin-nat.c b/gdb/i386-darwin-nat.c index 73cf12837f5..a3d925f0dcf 100644 --- a/gdb/i386-darwin-nat.c +++ b/gdb/i386-darwin-nat.c @@ -69,7 +69,9 @@ i386_darwin_fetch_inferior_registers (struct target_ops *ops, &gp_count); if (ret != KERN_SUCCESS) { - printf_unfiltered (_("Error calling thread_get_state for GP registers for thread 0x%ulx"), current_thread); + printf_unfiltered (_("Error calling thread_get_state for " + "GP registers for thread 0x%ulx"), + current_thread); MACH_CHECK_ERROR (ret); } amd64_supply_native_gregset (regcache, &gp_regs.uts, -1); @@ -87,7 +89,9 @@ i386_darwin_fetch_inferior_registers (struct target_ops *ops, &fp_count); if (ret != KERN_SUCCESS) { - printf_unfiltered (_("Error calling thread_get_state for float registers for thread 0x%ulx"), current_thread); + printf_unfiltered (_("Error calling thread_get_state for " + "float registers for thread 0x%ulx"), + current_thread); MACH_CHECK_ERROR (ret); } amd64_supply_fxsave (regcache, -1, &fp_regs.ufs.fs64.__fpu_fcw); @@ -109,7 +113,9 @@ i386_darwin_fetch_inferior_registers (struct target_ops *ops, &gp_count); if (ret != KERN_SUCCESS) { - printf_unfiltered (_("Error calling thread_get_state for GP registers for thread 0x%ulx"), current_thread); + printf_unfiltered (_("Error calling thread_get_state for " + "GP registers for thread 0x%ulx"), + current_thread); MACH_CHECK_ERROR (ret); } for (i = 0; i < I386_NUM_GREGS; i++) @@ -132,7 +138,9 @@ i386_darwin_fetch_inferior_registers (struct target_ops *ops, &fp_count); if (ret != KERN_SUCCESS) { - printf_unfiltered (_("Error calling thread_get_state for float registers for thread 0x%ulx"), current_thread); + printf_unfiltered (_("Error calling thread_get_state for " + "float registers for thread 0x%ulx"), + current_thread); MACH_CHECK_ERROR (ret); } i387_supply_fxsave (regcache, -1, &fp_regs.__fpu_fcw); @@ -293,7 +301,9 @@ i386_darwin_dr_set (int regnum, uint32_t value) if (ret != KERN_SUCCESS) { - printf_unfiltered (_("Error reading debug registers thread 0x%x via thread_get_state\n"), (int) current_thread); + printf_unfiltered (_("Error reading debug registers " + "thread 0x%x via thread_get_state\n"), + (int) current_thread); MACH_CHECK_ERROR (ret); } @@ -330,7 +340,9 @@ i386_darwin_dr_set (int regnum, uint32_t value) if (ret != KERN_SUCCESS) { - printf_unfiltered (_("Error writing debug registers thread 0x%x via thread_get_state\n"), (int) current_thread); + printf_unfiltered (_("Error writing debug registers " + "thread 0x%x via thread_get_state\n"), + (int) current_thread); MACH_CHECK_ERROR (ret); } } @@ -355,7 +367,9 @@ i386_darwin_dr_get (int regnum) if (ret != KERN_SUCCESS) { - printf_unfiltered (_("Error reading debug registers thread 0x%x via thread_get_state\n"), (int) current_thread); + printf_unfiltered (_("Error reading debug registers " + "thread 0x%x via thread_get_state\n"), + (int) current_thread); MACH_CHECK_ERROR (ret); } @@ -542,7 +556,8 @@ darwin_set_sstep (thread_t thread, int enable) return; if ((regs.uts.ts32.__eflags & X86_EFLAGS_T) == bit) return; - regs.uts.ts32.__eflags = (regs.uts.ts32.__eflags & ~X86_EFLAGS_T) | bit; + regs.uts.ts32.__eflags + = (regs.uts.ts32.__eflags & ~X86_EFLAGS_T) | bit; kret = thread_set_state (thread, x86_THREAD_STATE, (thread_state_t) ®s, count); MACH_CHECK_ERROR (kret); @@ -557,7 +572,8 @@ darwin_set_sstep (thread_t thread, int enable) return; if ((regs.uts.ts64.__rflags & X86_EFLAGS_T) == bit) return; - regs.uts.ts64.__rflags = (regs.uts.ts64.__rflags & ~X86_EFLAGS_T) | bit; + regs.uts.ts64.__rflags + = (regs.uts.ts64.__rflags & ~X86_EFLAGS_T) | bit; kret = thread_set_state (thread, x86_THREAD_STATE, (thread_state_t) ®s, count); MACH_CHECK_ERROR (kret); diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c index ed555ef4e2b..c3cbbccba03 100644 --- a/gdb/i386-linux-nat.c +++ b/gdb/i386-linux-nat.c @@ -170,7 +170,7 @@ fetch_register (struct regcache *regcache, int regno) regcache_raw_supply (regcache, regno, &val); } -/* Store one register. */ +/* Store one register. */ static void store_register (const struct regcache *regcache, int regno) @@ -216,8 +216,8 @@ supply_gregset (struct regcache *regcache, const elf_gregset_t *gregsetp) if (I386_LINUX_ORIG_EAX_REGNUM < gdbarch_num_regs (get_regcache_arch (regcache))) - regcache_raw_supply (regcache, I386_LINUX_ORIG_EAX_REGNUM, - regp + i386_linux_gregset_reg_offset[I386_LINUX_ORIG_EAX_REGNUM]); + regcache_raw_supply (regcache, I386_LINUX_ORIG_EAX_REGNUM, regp + + i386_linux_gregset_reg_offset[I386_LINUX_ORIG_EAX_REGNUM]); } /* Fill register REGNO (if it is a general-purpose register) in @@ -239,8 +239,8 @@ fill_gregset (const struct regcache *regcache, if ((regno == -1 || regno == I386_LINUX_ORIG_EAX_REGNUM) && I386_LINUX_ORIG_EAX_REGNUM < gdbarch_num_regs (get_regcache_arch (regcache))) - regcache_raw_collect (regcache, I386_LINUX_ORIG_EAX_REGNUM, - regp + i386_linux_gregset_reg_offset[I386_LINUX_ORIG_EAX_REGNUM]); + regcache_raw_collect (regcache, I386_LINUX_ORIG_EAX_REGNUM, regp + + i386_linux_gregset_reg_offset[I386_LINUX_ORIG_EAX_REGNUM]); } #ifdef HAVE_PTRACE_GETREGS @@ -352,8 +352,15 @@ 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 @@ -473,8 +480,17 @@ store_fpxregs (const struct regcache *regcache, int tid, int regno) #else -static int fetch_fpxregs (struct regcache *regcache, int tid) { return 0; } -static int store_fpxregs (const struct regcache *regcache, int tid, int regno) { return 0; } +static int +fetch_fpxregs (struct regcache *regcache, int tid) +{ + return 0; +} + +static int +store_fpxregs (const struct regcache *regcache, int tid, int regno) +{ + return 0; +} #endif /* HAVE_PTRACE_GETFPXREGS */ diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c index 673dbfdbce8..7c3962ec79e 100644 --- a/gdb/i386-linux-tdep.c +++ b/gdb/i386-linux-tdep.c @@ -603,7 +603,8 @@ i386_linux_core_read_xcr0 (struct gdbarch *gdbarch, I386_LINUX_XSAVE_XCR0_OFFSET, 8)) { - warning (_("Couldn't read `xcr0' bytes from `.reg-xstate' section in core file.")); + warning (_("Couldn't read `xcr0' bytes from " + "`.reg-xstate' section in core file.")); return 0; } @@ -860,7 +861,7 @@ i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) tdep->i386_sysenter_record = i386_linux_intx80_sysenter_record; /* N_FUN symbols in shared libaries have 0 for their values and need - to be relocated. */ + to be relocated. */ set_gdbarch_sofun_address_maybe_missing (gdbarch, 1); /* GNU/Linux uses SVR4-style shared libraries. */ @@ -914,7 +915,7 @@ _initialize_i386_linux_tdep (void) gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_LINUX, i386_linux_init_abi); - /* Initialize the Linux target description */ + /* Initialize the Linux target description. */ initialize_tdesc_i386_linux (); initialize_tdesc_i386_mmx_linux (); initialize_tdesc_i386_avx_linux (); diff --git a/gdb/i386-nat.c b/gdb/i386-nat.c index 900fb403843..0606ce13d62 100644 --- a/gdb/i386-nat.c +++ b/gdb/i386-nat.c @@ -46,7 +46,7 @@ struct i386_dr_low_type i386_dr_low; /* Debug registers' indices. */ #define DR_NADDR 4 /* The number of debug address registers. */ #define DR_STATUS 6 /* Index of debug status register (DR6). */ -#define DR_CONTROL 7 /* Index of debug control register (DR7). */ +#define DR_CONTROL 7 /* Index of debug control register (DR7). */ /* DR7 Debug Control register fields. */ @@ -269,7 +269,8 @@ i386_length_and_rw_bits (int len, enum target_hw_bp_type type) break; case hw_read: internal_error (__FILE__, __LINE__, - _("The i386 doesn't support data-read watchpoints.\n")); + _("The i386 doesn't support " + "data-read watchpoints.\n")); case hw_access: rw = DR_RW_READ; break; @@ -386,7 +387,7 @@ i386_remove_aligned_watchpoint (CORE_ADDR addr, unsigned len_rw_bits) && dr_mirror[i] == addr && I386_DR_GET_RW_LEN (i) == len_rw_bits) { - if (--dr_ref_count[i] == 0) /* no longer in use? */ + if (--dr_ref_count[i] == 0) /* no longer in use? */ { /* Reset our mirror. */ dr_mirror[i] = 0; @@ -548,7 +549,7 @@ i386_region_ok_for_watchpoint (CORE_ADDR addr, int len) } /* If the inferior has some watchpoint that triggered, set the - address associated with that watchpoint and return non-zero. + address associated with that watchpoint and return non-zero. Otherwise, return zero. */ static int diff --git a/gdb/i386-nat.h b/gdb/i386-nat.h index 10fdc3be3c5..819c6b8e656 100644 --- a/gdb/i386-nat.h +++ b/gdb/i386-nat.h @@ -42,7 +42,7 @@ extern void i386_use_watchpoints (struct target_ops *); whether a given region can be watched, etc. In addition, each target should provide several low-level functions - regrouped into i386_dr_low_type struct below. These functions + regrouped into i386_dr_low_type struct below. These functions that will be called to insert watchpoints and hardware breakpoints into the inferior, remove them, and check their status. These functions are: diff --git a/gdb/i386-sol2-nat.c b/gdb/i386-sol2-nat.c index 8d5d7415cce..ad5b733bad4 100644 --- a/gdb/i386-sol2-nat.c +++ b/gdb/i386-sol2-nat.c @@ -60,7 +60,7 @@ static int amd64_sol2_gregset64_reg_offset[] = { 8 * 8, /* %rdi */ 10 * 8, /* %rbp */ 20 * 8, /* %rsp */ - 7 * 8, /* %r8 ... */ + 7 * 8, /* %r8 ... */ 6 * 8, 5 * 8, 4 * 8, @@ -142,7 +142,7 @@ _initialize_amd64_sol2_nat (void) /* Fill in the generic procfs methods. */ t = procfs_target (); -#ifdef NEW_PROC_API /* Solaris 6 and above can do HW watchpoints */ +#ifdef NEW_PROC_API /* Solaris 6 and above can do HW watchpoints. */ procfs_use_watchpoints (t); #endif diff --git a/gdb/i386-stub.c b/gdb/i386-stub.c index 6b91296291f..04996b75cf6 100644 --- a/gdb/i386-stub.c +++ b/gdb/i386-stub.c @@ -532,7 +532,7 @@ putpacket (unsigned char *buffer) int count; char ch; - /* $#. */ + /* $#. */ do { putDebugChar ('$'); @@ -942,7 +942,7 @@ set_debug_traps (void) /* This function will generate a breakpoint exception. It is used at the beginning of a program to sync up with a debugger and can be used otherwise as a quick means to stop program execution and "break" into - the debugger. */ + the debugger. */ void breakpoint (void) diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 06ccca045a3..57e27ca8ad0 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -445,17 +445,17 @@ i386_skip_prefixes (gdb_byte *insn, size_t max_len) static int i386_absolute_jmp_p (const gdb_byte *insn) { - /* jmp far (absolute address in operand) */ + /* jmp far (absolute address in operand). */ if (insn[0] == 0xea) return 1; if (insn[0] == 0xff) { - /* jump near, absolute indirect (/4) */ + /* jump near, absolute indirect (/4). */ if ((insn[1] & 0x38) == 0x20) return 1; - /* jump far, absolute indirect (/5) */ + /* jump far, absolute indirect (/5). */ if ((insn[1] & 0x38) == 0x28) return 1; } @@ -466,17 +466,17 @@ i386_absolute_jmp_p (const gdb_byte *insn) static int i386_absolute_call_p (const gdb_byte *insn) { - /* call far, absolute */ + /* call far, absolute. */ if (insn[0] == 0x9a) return 1; if (insn[0] == 0xff) { - /* Call near, absolute indirect (/2) */ + /* Call near, absolute indirect (/2). */ if ((insn[1] & 0x38) == 0x10) return 1; - /* Call far, absolute indirect (/3) */ + /* Call far, absolute indirect (/3). */ if ((insn[1] & 0x38) == 0x18) return 1; } @@ -489,9 +489,9 @@ i386_ret_p (const gdb_byte *insn) { switch (insn[0]) { - case 0xc2: /* ret near, pop N bytes */ + case 0xc2: /* ret near, pop N bytes. */ case 0xc3: /* ret near */ - case 0xca: /* ret far, pop N bytes */ + case 0xca: /* ret far, pop N bytes. */ case 0xcb: /* ret far */ case 0xcf: /* iret */ return 1; @@ -507,7 +507,7 @@ i386_call_p (const gdb_byte *insn) if (i386_absolute_call_p (insn)) return 1; - /* call near, relative */ + /* call near, relative. */ if (insn[0] == 0xe8) return 1; @@ -736,7 +736,7 @@ i386_relocate_instruction (struct gdbarch *gdbarch, /* Where "ret" in the original code will return to. */ ret_addr = oldloc + insn_length; - push_buf[0] = 0x68; /* pushq $... */ + push_buf[0] = 0x68; /* pushq $... */ memcpy (&push_buf[1], &ret_addr, 4); /* Push the push. */ append_insns (to, 5, push_buf); @@ -1157,7 +1157,7 @@ i386_match_insn (CORE_ADDR pc, struct i386_insn *skip_insns) struct i386_insn i386_frame_setup_skip_insns[] = { - /* Check for `movb imm8, r' and `movl imm32, r'. + /* Check for `movb imm8, r' and `movl imm32, r'. ??? Should we handle 16-bit operand-sizes here? */ @@ -2171,7 +2171,8 @@ i386_extract_return_value (struct gdbarch *gdbarch, struct type *type, } else internal_error (__FILE__, __LINE__, - _("Cannot extract return value of %d bytes long."), len); + _("Cannot extract return value of %d bytes long."), + len); } } @@ -2467,7 +2468,7 @@ i386_mmx_type (struct gdbarch *gdbarch) } /* Return the GDB type object for the "standard" data type of data in - register REGNUM. */ + register REGNUM. */ static struct type * i386_pseudo_register_type (struct gdbarch *gdbarch, int regnum) @@ -2531,7 +2532,7 @@ i386_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, { regnum -= tdep->ymm0_regnum; - /* Extract (always little endian). Read lower 128bits. */ + /* Extract (always little endian). Read lower 128bits. */ regcache_raw_read (regcache, I387_XMM0_REGNUM (tdep) + regnum, raw_buf); @@ -2671,7 +2672,8 @@ i386_next_regnum (int regnum) needs any special handling. */ static int -i386_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type) +i386_convert_register_p (struct gdbarch *gdbarch, + int regnum, struct type *type) { int len = TYPE_LENGTH (type); @@ -3235,7 +3237,7 @@ struct i386_record_s }; /* Parse "modrm" part in current memory address that irp->addr point to - Return -1 if something wrong. */ + Return -1 if something wrong. */ static int i386_record_modrm (struct i386_record_s *irp) @@ -3260,7 +3262,7 @@ i386_record_modrm (struct i386_record_s *irp) /* Get the memory address that current instruction write to and set it to the argument "addr". - Return -1 if something wrong. */ + Return -1 if something wrong. */ static int i386_record_lea_modrm_addr (struct i386_record_s *irp, uint64_t *addr) @@ -3493,7 +3495,7 @@ i386_record_lea_modrm_addr (struct i386_record_s *irp, uint64_t *addr) /* Record the value of the memory that willbe changed in current instruction to "record_arch_list". - Return -1 if something wrong. */ + Return -1 if something wrong. */ static int i386_record_lea_modrm (struct i386_record_s *irp) @@ -3531,7 +3533,7 @@ Do you want to stop the program?"), } /* Record the push operation to "record_arch_list". - Return -1 if something wrong. */ + Return -1 if something wrong. */ static int i386_record_push (struct i386_record_s *irp, int size) @@ -3556,9 +3558,9 @@ i386_record_push (struct i386_record_s *irp, int size) #define I386_SAVE_FPU_ENV 0xfffe #define I386_SAVE_FPU_ENV_REG_STACK 0xffff -/* Record the value of floating point registers which will be changed by the - current instruction to "record_arch_list". Return -1 if something is wrong. -*/ +/* Record the value of floating point registers which will be changed + by the current instruction to "record_arch_list". Return -1 if + something is wrong. */ static int i386_record_floats (struct gdbarch *gdbarch, struct i386_record_s *ir, @@ -3620,7 +3622,7 @@ static int i386_record_floats (struct gdbarch *gdbarch, /* 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. */ #define I386_RECORD_ARCH_LIST_ADD_REG(regnum) \ record_arch_list_add_reg (ir.regcache, ir.regmap[(regnum)]) @@ -3753,7 +3755,7 @@ i386_process_record (struct gdbarch *gdbarch, struct regcache *regcache, else if (ir.regmap[X86_RECORD_R8_REGNUM]) ir.aflag = 2; - /* now check op code */ + /* Now check op code. */ opcode = (uint32_t) opcode8; reswitch: switch (opcode) @@ -4636,7 +4638,7 @@ Do you want to stop the program?"), ir.reg |= ((opcode & 7) << 3); if (ir.mod != 3) { - /* Memory. */ + /* Memory. */ uint64_t addr64; if (i386_record_lea_modrm_addr (&ir, &addr64)) @@ -6456,7 +6458,8 @@ reswitch_prefix_add: || opcode == 0x0f17 || opcode == 0x660f17) goto no_support; ir.rm |= ir.rex_b; - if (!i386_xmm_regnum_p (gdbarch, I387_XMM0_REGNUM (tdep) + ir.rm)) + if (!i386_xmm_regnum_p (gdbarch, + I387_XMM0_REGNUM (tdep) + ir.rm)) goto no_support; record_arch_list_add_reg (ir.regcache, I387_XMM0_REGNUM (tdep) + ir.rm); @@ -6688,7 +6691,8 @@ reswitch_prefix_add: if (ir.mod == 3) { ir.rm |= ir.rex_b; - if (!i386_xmm_regnum_p (gdbarch, I387_XMM0_REGNUM (tdep) + ir.rm)) + if (!i386_xmm_regnum_p (gdbarch, + I387_XMM0_REGNUM (tdep) + ir.rm)) goto no_support; record_arch_list_add_reg (ir.regcache, I387_XMM0_REGNUM (tdep) + ir.rm); @@ -6791,7 +6795,8 @@ i386_fast_tracepoint_valid_at (struct gdbarch *gdbarch, /* Return a bit of target-specific detail to add to the caller's generic failure message. */ if (msg) - *msg = xstrprintf (_("; instruction is only %d bytes long, need at least %d bytes for the jump"), + *msg = xstrprintf (_("; instruction is only %d bytes long, " + "need at least %d bytes for the jump"), len, jumplen); return 0; } diff --git a/gdb/i386-tdep.h b/gdb/i386-tdep.h index 6851195c15c..bb2f2c73884 100644 --- a/gdb/i386-tdep.h +++ b/gdb/i386-tdep.h @@ -157,8 +157,8 @@ struct gdbarch_tdep int num_xmm_regs; /* Bits of the extended control register 0 (the XFEATURE_ENABLED_MASK - register), excluding the x87 bit, which are supported by this GDB. - */ + register), excluding the x87 bit, which are supported by this GDB. */ + uint64_t xcr0; /* Offset of XCR0 in XSAVE extended state. */ @@ -320,8 +320,8 @@ extern void i386_pseudo_register_write (struct gdbarch *gdbarch, /* Segment selectors. */ #define I386_SEL_RPL 0x0003 /* Requester's Privilege Level mask. */ -#define I386_SEL_UPL 0x0003 /* User Privilige Level. */ -#define I386_SEL_KPL 0x0000 /* Kernel Privilige Level. */ +#define I386_SEL_UPL 0x0003 /* User Privilige Level. */ +#define I386_SEL_KPL 0x0000 /* Kernel Privilige Level. */ /* The length of the longest i386 instruction (according to include/asm-i386/kprobes.h in Linux 2.6. */ @@ -330,7 +330,8 @@ extern void i386_pseudo_register_write (struct gdbarch *gdbarch, /* Functions exported from i386-tdep.c. */ extern CORE_ADDR i386_pe_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc, char *name); -extern CORE_ADDR i386_skip_main_prologue (struct gdbarch *gdbarch, CORE_ADDR pc); +extern CORE_ADDR i386_skip_main_prologue (struct gdbarch *gdbarch, + CORE_ADDR pc); /* Return whether the THIS_FRAME corresponds to a sigtramp routine. */ extern int i386_sigtramp_p (struct frame_info *this_frame); diff --git a/gdb/i386gnu-nat.c b/gdb/i386gnu-nat.c index 5937284cf00..808972939dc 100644 --- a/gdb/i386gnu-nat.c +++ b/gdb/i386gnu-nat.c @@ -232,7 +232,8 @@ gnu_store_registers (struct target_ops *ops, state = proc_get_state (thread, 1); if (!state) { - warning (_("Couldn't store registers into %s"), proc_string (thread)); + warning (_("Couldn't store registers into %s"), + proc_string (thread)); return; } @@ -259,7 +260,8 @@ gnu_store_registers (struct target_ops *ops, regcache_raw_supply (regcache, check_regno, REG_ADDR (state, check_regno)); else - warning (_("... also writing this register! Suspicious...")); + warning (_("... also writing this register! " + "Suspicious...")); } } diff --git a/gdb/i386nbsd-tdep.c b/gdb/i386nbsd-tdep.c index 5ca3c23e6c6..3923ac47bcf 100644 --- a/gdb/i386nbsd-tdep.c +++ b/gdb/i386nbsd-tdep.c @@ -246,7 +246,7 @@ i386nbsd_sigtramp_cache_init (const struct tramp_frame *self, reg_offset = i386nbsd_sc_reg_offset; num_regs = ARRAY_SIZE (i386nbsd_sc_reg_offset); - /* Read in the sigcontext address */ + /* Read in the sigcontext address. */ base = read_memory_unsigned_integer (sp + 8, 4, byte_order); } else @@ -254,7 +254,7 @@ i386nbsd_sigtramp_cache_init (const struct tramp_frame *self, reg_offset = i386nbsd_mc_reg_offset; num_regs = ARRAY_SIZE (i386nbsd_mc_reg_offset); - /* Read in the ucontext address */ + /* Read in the ucontext address. */ base = read_memory_unsigned_integer (sp + 8, 4, byte_order); /* offsetof(ucontext_t, uc_mcontext) == 36 */ base += 36; @@ -285,7 +285,7 @@ i386nbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) /* NetBSD uses -freg-struct-return by default. */ tdep->struct_return = reg_struct_return; - /* NetBSD uses tramp_frame sniffers for signal trampolines. */ + /* NetBSD uses tramp_frame sniffers for signal trampolines. */ tdep->sigcontext_addr= 0; tdep->sigtramp_start = 0; tdep->sigtramp_end = 0; diff --git a/gdb/i387-tdep.c b/gdb/i387-tdep.c index c0dd349b9a9..7ec7f535c13 100644 --- a/gdb/i387-tdep.c +++ b/gdb/i387-tdep.c @@ -253,7 +253,8 @@ i387_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, break; } - get_frame_register (frame, (fpreg + 8 - top) % 8 + I387_ST0_REGNUM (tdep), + get_frame_register (frame, + (fpreg + 8 - top) % 8 + I387_ST0_REGNUM (tdep), raw); fputs_filtered ("0x", file); @@ -287,7 +288,8 @@ i387_print_float_info (struct gdbarch *gdbarch, struct ui_file *file, needs any special handling. */ int -i387_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type) +i387_convert_register_p (struct gdbarch *gdbarch, int regnum, + struct type *type) { if (i386_fp_regnum_p (gdbarch, regnum)) { @@ -957,7 +959,7 @@ i387_collect_xsave (const struct regcache *regcache, int regnum, gdb_byte raw[I386_MAX_REGISTER_SIZE]; gdb_byte *xstate_bv_p = XSAVE_XSTATE_BV_ADDR (regs); unsigned int xstate_bv = 0; - /* The supported bits in `xstat_bv' are 1 byte. */ + /* The supported bits in `xstat_bv' are 1 byte. */ unsigned int clear_bv = (~(*xstate_bv_p)) & tdep->xcr0; gdb_byte *p; diff --git a/gdb/ia64-linux-nat.c b/gdb/ia64-linux-nat.c index b04b4c234e9..0f88e141f2a 100644 --- a/gdb/ia64-linux-nat.c +++ b/gdb/ia64-linux-nat.c @@ -40,7 +40,7 @@ #include #include -/* Prototypes for supply_gregset etc. */ +/* Prototypes for supply_gregset etc. */ #include "gregset.h" /* These must match the order of the register names. @@ -51,7 +51,7 @@ static int u_offsets[] = { /* general registers */ - -1, /* gr0 not available; i.e, it's always zero */ + -1, /* gr0 not available; i.e, it's always zero. */ PT_R1, PT_R2, PT_R3, @@ -83,7 +83,7 @@ static int u_offsets[] = PT_R29, PT_R30, PT_R31, - /* gr32 through gr127 not directly available via the ptrace interface */ + /* gr32 through gr127 not directly available via the ptrace interface. */ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -91,7 +91,7 @@ static int u_offsets[] = -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* Floating point registers */ - -1, -1, /* f0 and f1 not available (f0 is +0.0 and f1 is +1.0) */ + -1, -1, /* f0 and f1 not available (f0 is +0.0 and f1 is +1.0). */ PT_F2, PT_F3, PT_F4, @@ -218,7 +218,7 @@ static int u_offsets[] = PT_F125, PT_F126, PT_F127, - /* predicate registers - we don't fetch these individually */ + /* Predicate registers - we don't fetch these individually. */ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -236,14 +236,14 @@ static int u_offsets[] = PT_B5, PT_B6, PT_B7, - /* virtual frame pointer and virtual return address pointer */ + /* Virtual frame pointer and virtual return address pointer. */ -1, -1, /* other registers */ PT_PR, PT_CR_IIP, /* ip */ PT_CR_IPSR, /* psr */ PT_CFM, /* cfm */ - /* kernel registers not visible via ptrace interface (?) */ + /* kernel registers not visible via ptrace interface (?) */ -1, -1, -1, -1, -1, -1, -1, -1, /* hole */ -1, -1, -1, -1, -1, -1, -1, -1, @@ -252,7 +252,7 @@ static int u_offsets[] = PT_AR_BSPSTORE, PT_AR_RNAT, -1, - -1, /* Not available: FCR, IA32 floating control register */ + -1, /* Not available: FCR, IA32 floating control register. */ -1, -1, -1, /* Not available: EFLAG */ -1, /* Not available: CSD */ @@ -273,7 +273,7 @@ static int u_offsets[] = -1, -1, -1, -1, -1, -1, -1, -1, -1, PT_AR_PFS, PT_AR_LC, - -1, /* Not available: EC, the Epilog Count register */ + -1, /* Not available: EC, the Epilog Count register. */ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -282,7 +282,7 @@ static int u_offsets[] = -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* nat bits - not fetched directly; instead we obtain these bits from - either rnat or unat or from memory. */ + either rnat or unat or from memory. */ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -375,7 +375,7 @@ supply_gregset (struct regcache *regcache, const gregset_t *gregsetp) } /* FIXME: NAT collection bits are at index 32; gotta deal with these - somehow... */ + somehow... */ regcache_raw_supply (regcache, IA64_PR_REGNUM, regp + 33); @@ -415,7 +415,7 @@ fill_gregset (const struct regcache *regcache, gregset_t *gregsetp, int regno) COPY_REG (regi - IA64_GR0_REGNUM, regi); } - /* FIXME: NAT collection bits at index 32? */ + /* FIXME: NAT collection bits at index 32? */ COPY_REG (33, IA64_PR_REGNUM); @@ -441,7 +441,7 @@ fill_gregset (const struct regcache *regcache, gregset_t *gregsetp, int regno) /* Given a pointer to a floating point register set in /proc format (fpregset_t *), unpack the register contents and supply them as gdb's - idea of the current floating point register values. */ + idea of the current floating point register values. */ void supply_fpregset (struct regcache *regcache, const fpregset_t *fpregsetp) @@ -459,7 +459,7 @@ supply_fpregset (struct regcache *regcache, const fpregset_t *fpregsetp) /* Given a pointer to a floating point register set in /proc format (fpregset_t *), update the register specified by REGNO from gdb's idea of the current floating point register set. If REGNO is -1, update - them all. */ + them all. */ void fill_fpregset (const struct regcache *regcache, @@ -488,7 +488,7 @@ enable_watchpoints_in_psr (ptid_t ptid) if (!(psr & IA64_PSR_DB)) { psr |= IA64_PSR_DB; /* Set the db bit - this enables hardware - watchpoints and breakpoints. */ + watchpoints and breakpoints. */ regcache_cooked_write_unsigned (regcache, IA64_PSR_REGNUM, psr); } } @@ -508,7 +508,8 @@ store_debug_register (ptid_t ptid, int idx, long val) } static void -store_debug_register_pair (ptid_t ptid, int idx, long *dbr_addr, long *dbr_mask) +store_debug_register_pair (ptid_t ptid, int idx, long *dbr_addr, + long *dbr_mask) { if (dbr_addr) store_debug_register (ptid, 2 * idx, *dbr_addr); @@ -547,7 +548,7 @@ ia64_linux_insert_watchpoint (CORE_ADDR addr, int len, int rw, dbr_mask = debug_registers[idx * 2 + 1]; if ((dbr_mask & (0x3UL << 62)) == 0) { - /* Exit loop if both r and w bits clear */ + /* Exit loop if both r and w bits clear. */ break; } } @@ -650,7 +651,7 @@ ia64_linux_stopped_data_address (struct target_ops *ops, CORE_ADDR *addr_p) regcache_cooked_read_unsigned (regcache, IA64_PSR_REGNUM, &psr); psr |= IA64_PSR_DD; /* Set the dd bit - this will disable the watchpoint - for the next instruction */ + for the next instruction. */ regcache_cooked_write_unsigned (regcache, IA64_PSR_REGNUM, psr); *addr_p = (CORE_ADDR)siginfo_p->si_addr; @@ -792,8 +793,8 @@ ia64_linux_store_registers (struct target_ops *ops, static LONGEST (*super_xfer_partial) (struct target_ops *, enum target_object, - const char *, gdb_byte *, const gdb_byte *, - ULONGEST, LONGEST); + const char *, gdb_byte *, + const gdb_byte *, ULONGEST, LONGEST); static LONGEST ia64_linux_xfer_partial (struct target_ops *ops, @@ -848,7 +849,7 @@ _initialize_ia64_linux_nat (void) This PSR bit is set in ia64_linux_stopped_by_watchpoint when the code there has determined that a hardware watchpoint has indeed been hit. The CPU will then be able to execute one instruction - without triggering a watchpoint. */ + without triggering a watchpoint. */ t->to_have_steppable_watchpoint = 1; t->to_can_use_hw_breakpoint = ia64_linux_can_use_hw_breakpoint; diff --git a/gdb/ia64-linux-tdep.c b/gdb/ia64-linux-tdep.c index 1c4856b51be..ce8053bc913 100644 --- a/gdb/ia64-linux-tdep.c +++ b/gdb/ia64-linux-tdep.c @@ -31,12 +31,12 @@ /* The sigtramp code is in a non-readable (executable-only) region of memory called the ``gate page''. The addresses in question were determined by examining the system headers. They are - overly generous to allow for different pages sizes. */ + overly generous to allow for different pages sizes. */ #define GATE_AREA_START 0xa000000000000100LL #define GATE_AREA_END 0xa000000000020000LL -/* Offset to sigcontext structure from frame of handler */ +/* Offset to sigcontext structure from frame of handler. */ #define IA64_LINUX_SIGCONTEXT_OFFSET 192 static int @@ -48,7 +48,7 @@ ia64_linux_pc_in_sigtramp (CORE_ADDR pc) /* IA-64 GNU/Linux specific function which, given a frame address and a register number, returns the address at which that register may be found. 0 is returned for registers which aren't stored in the the - sigcontext structure. */ + sigcontext structure. */ static CORE_ADDR ia64_linux_sigcontext_register_address (struct gdbarch *gdbarch, @@ -58,7 +58,8 @@ ia64_linux_sigcontext_register_address (struct gdbarch *gdbarch, char buf[8]; CORE_ADDR sigcontext_addr = 0; - /* The address of the sigcontext area is found at offset 16 in the sigframe. */ + /* The address of the sigcontext area is found at offset 16 in the + sigframe. */ read_memory (sp + 16, buf, 8); sigcontext_addr = extract_unsigned_integer (buf, 8, byte_order); @@ -79,7 +80,7 @@ ia64_linux_sigcontext_register_address (struct gdbarch *gdbarch, return sigcontext_addr + 56; /* user mask only */ /* sc_ar_rsc is provided, from which we could compute bspstore, but I don't think it's worth it. Anyway, if we want it, it's at offset - 64 */ + 64. */ case IA64_BSP_REGNUM : return sigcontext_addr + 72; case IA64_RNAT_REGNUM : diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c index f6de6369909..3e31a96348f 100644 --- a/gdb/ia64-tdep.c +++ b/gdb/ia64-tdep.c @@ -102,11 +102,11 @@ typedef enum instruction_type is set to six (which is how it was set up initially). -- objdump displays pretty disassembly dumps with this value. For our purposes, we'll set bytes_per_line to SLOT_MULTIPLIER. This is okay since we - never want to also display the raw bytes the way objdump does. */ + never want to also display the raw bytes the way objdump does. */ #define SLOT_MULTIPLIER 1 -/* Length in bytes of an instruction bundle */ +/* Length in bytes of an instruction bundle. */ #define BUNDLE_LEN 16 @@ -132,11 +132,15 @@ static int sp_regnum = IA64_GR12_REGNUM; static int fp_regnum = IA64_VFP_REGNUM; static int lr_regnum = IA64_VRAP_REGNUM; -/* NOTE: we treat the register stack registers r32-r127 as pseudo-registers because - they may not be accessible via the ptrace register get/set interfaces. */ -enum pseudo_regs { FIRST_PSEUDO_REGNUM = NUM_IA64_RAW_REGS, VBOF_REGNUM = IA64_NAT127_REGNUM + 1, V32_REGNUM, +/* NOTE: we treat the register stack registers r32-r127 as + pseudo-registers because they may not be accessible via the ptrace + register get/set interfaces. */ + +enum pseudo_regs { FIRST_PSEUDO_REGNUM = NUM_IA64_RAW_REGS, + VBOF_REGNUM = IA64_NAT127_REGNUM + 1, V32_REGNUM, V127_REGNUM = V32_REGNUM + 95, - VP0_REGNUM, VP16_REGNUM = VP0_REGNUM + 16, VP63_REGNUM = VP0_REGNUM + 63, LAST_PSEUDO_REGNUM }; + VP0_REGNUM, VP16_REGNUM = VP0_REGNUM + 16, + VP63_REGNUM = VP0_REGNUM + 63, LAST_PSEUDO_REGNUM }; /* Array of register names; There should be ia64_num_regs strings in the initializer. */ @@ -259,20 +263,21 @@ struct ia64_frame_cache CORE_ADDR cfm; /* cfm value for current frame */ CORE_ADDR prev_cfm; /* cfm value for previous frame */ int frameless; - int sof; /* Size of frame (decoded from cfm value) */ - int sol; /* Size of locals (decoded from cfm value) */ - int sor; /* Number of rotating registers. (decoded from cfm value) */ + int sof; /* Size of frame (decoded from cfm value). */ + int sol; /* Size of locals (decoded from cfm value). */ + int sor; /* Number of rotating registers (decoded from + cfm value). */ CORE_ADDR after_prologue; /* Address of first instruction after the last prologue instruction; Note that there may be instructions from the function's body - intermingled with the prologue. */ + intermingled with the prologue. */ int mem_stack_frame_size; /* Size of the memory stack frame (may be zero), - or -1 if it has not been determined yet. */ + or -1 if it has not been determined yet. */ int fp_reg; /* Register number (if any) used a frame pointer for this frame. 0 if no register is being used - as the frame pointer. */ + as the frame pointer. */ /* Saved registers. */ CORE_ADDR saved_regs[NUM_IA64_RAW_REGS]; @@ -394,7 +399,7 @@ extract_bit_field (const char *bundle, int from, int len) return result; } -/* Replace the specified bits in an instruction bundle */ +/* Replace the specified bits in an instruction bundle. */ static void replace_bit_field (char *bundle, long long val, int from, int len) @@ -444,7 +449,7 @@ replace_bit_field (char *bundle, long long val, int from, int len) } /* Return the contents of slot N (for N = 0, 1, or 2) in - and instruction bundle */ + and instruction bundle. */ static long long slotN_contents (char *bundle, int slotnum) @@ -452,7 +457,7 @@ slotN_contents (char *bundle, int slotnum) return extract_bit_field (bundle, 5+41*slotnum, 41); } -/* Store an instruction in an instruction bundle */ +/* Store an instruction in an instruction bundle. */ static void replace_slotN_contents (char *bundle, long long instr, int slotnum) @@ -684,7 +689,8 @@ ia64_memory_insert_breakpoint (struct gdbarch *gdbarch, /* Store the whole bundle, except for the initial skipped bytes by the slot number interpreted as bytes offset in PLACED_ADDRESS. */ - memcpy (bp_tgt->shadow_contents, bundle + shadow_slotnum, bp_tgt->shadow_len); + memcpy (bp_tgt->shadow_contents, bundle + shadow_slotnum, + bp_tgt->shadow_len); /* Re-read the same bundle as above except that, this time, read it in order to compute the new bundle inside which we will be inserting the @@ -812,7 +818,8 @@ ia64_memory_remove_breakpoint (struct gdbarch *gdbarch, make a match for permanent breakpoints. */ static const gdb_byte * -ia64_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr) +ia64_breakpoint_from_pc (struct gdbarch *gdbarch, + CORE_ADDR *pcptr, int *lenptr) { CORE_ADDR addr = *pcptr; static gdb_byte bundle[BUNDLE_LEN]; @@ -901,7 +908,7 @@ ia64_write_pc (struct regcache *regcache, CORE_ADDR new_pc) #define IS_NaT_COLLECTION_ADDR(addr) ((((addr) >> 3) & 0x3f) == 0x3f) /* Returns the address of the slot that's NSLOTS slots away from - the address ADDR. NSLOTS may be positive or negative. */ + the address ADDR. NSLOTS may be positive or negative. */ static CORE_ADDR rse_address_add(CORE_ADDR addr, int nslots) { @@ -929,15 +936,16 @@ ia64_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, if (regnum >= V32_REGNUM && regnum <= V127_REGNUM) { #ifdef HAVE_LIBUNWIND_IA64_H - /* First try and use the libunwind special reg accessor, otherwise fallback to - standard logic. */ + /* First try and use the libunwind special reg accessor, + otherwise fallback to standard logic. */ if (!libunwind_is_initialized () || libunwind_get_reg_special (gdbarch, regcache, regnum, buf) != 0) #endif { - /* The fallback position is to assume that r32-r127 are found sequentially - in memory starting at $bof. This isn't always true, but without libunwind, - this is the best we can do. */ + /* The fallback position is to assume that r32-r127 are + found sequentially in memory starting at $bof. This + isn't always true, but without libunwind, this is the + best we can do. */ ULONGEST cfm; ULONGEST bsp; CORE_ADDR reg; @@ -945,7 +953,8 @@ ia64_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, regcache_cooked_read_unsigned (regcache, IA64_CFM_REGNUM, &cfm); /* The bsp points at the end of the register frame so we - subtract the size of frame from it to get start of register frame. */ + subtract the size of frame from it to get start of + register frame. */ bsp = rse_address_add (bsp, -(cfm & 0x7f)); if ((cfm & 0x7f) > regnum - V32_REGNUM) @@ -995,7 +1004,8 @@ ia64_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, the nat collection from rnat. Otherwise, we fetch the nat collection from the computed address. */ if (nat_addr >= bsp) - regcache_cooked_read_unsigned (regcache, IA64_RNAT_REGNUM, &nat_collection); + regcache_cooked_read_unsigned (regcache, IA64_RNAT_REGNUM, + &nat_collection); else nat_collection = read_memory_integer (nat_addr, 8, byte_order); nat_bit = (gr_addr >> 3) & 0x3f; @@ -1008,7 +1018,7 @@ ia64_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, else if (regnum == VBOF_REGNUM) { /* A virtual register frame start is provided for user convenience. - It can be calculated as the bsp - sof (sizeof frame). */ + It can be calculated as the bsp - sof (sizeof frame). */ ULONGEST bsp, vbsp; ULONGEST cfm; CORE_ADDR reg; @@ -1033,10 +1043,10 @@ ia64_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache, if (VP16_REGNUM <= regnum && regnum <= VP63_REGNUM) { /* Fetch predicate register rename base from current frame - marker for this frame. */ + marker for this frame. */ int rrb_pr = (cfm >> 32) & 0x3f; - /* Adjust the register number to account for register rotation. */ + /* Adjust the register number to account for register rotation. */ regnum = VP16_REGNUM + ((regnum - VP16_REGNUM) + rrb_pr) % 48; } @@ -1067,14 +1077,15 @@ ia64_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, if ((cfm & 0x7f) > regnum - V32_REGNUM) { ULONGEST reg_addr = rse_address_add (bsp, (regnum - V32_REGNUM)); - write_memory (reg_addr, (void *)buf, 8); + write_memory (reg_addr, (void *) buf, 8); } } else if (IA64_NAT0_REGNUM <= regnum && regnum <= IA64_NAT31_REGNUM) { ULONGEST unatN_val, unat, unatN_mask; regcache_cooked_read_unsigned (regcache, IA64_UNAT_REGNUM, &unat); - unatN_val = extract_unsigned_integer (buf, register_size (gdbarch, regnum), + unatN_val = extract_unsigned_integer (buf, register_size (gdbarch, + regnum), byte_order); unatN_mask = (1LL << (regnum - IA64_NAT0_REGNUM)); if (unatN_val == 0) @@ -1099,7 +1110,8 @@ ia64_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, if ((cfm & 0x7f) > regnum - V32_REGNUM) gr_addr = rse_address_add (bsp, (regnum - V32_REGNUM)); - natN_val = extract_unsigned_integer (buf, register_size (gdbarch, regnum), + natN_val = extract_unsigned_integer (buf, register_size (gdbarch, + regnum), byte_order); if (gr_addr != 0 && (natN_val == 0 || natN_val == 1)) @@ -1114,12 +1126,14 @@ ia64_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, collection from the computed address. */ if (nat_addr >= bsp) { - regcache_cooked_read_unsigned (regcache, IA64_RNAT_REGNUM, &nat_collection); + regcache_cooked_read_unsigned (regcache, IA64_RNAT_REGNUM, + &nat_collection); if (natN_val) nat_collection |= natN_mask; else nat_collection &= ~natN_mask; - regcache_cooked_write_unsigned (regcache, IA64_RNAT_REGNUM, nat_collection); + regcache_cooked_write_unsigned (regcache, IA64_RNAT_REGNUM, + nat_collection); } else { @@ -1148,10 +1162,10 @@ ia64_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, if (VP16_REGNUM <= regnum && regnum <= VP63_REGNUM) { /* Fetch predicate register rename base from current frame - marker for this frame. */ + marker for this frame. */ int rrb_pr = (cfm >> 32) & 0x3f; - /* Adjust the register number to account for register rotation. */ + /* Adjust the register number to account for register rotation. */ regnum = VP16_REGNUM + ((regnum - VP16_REGNUM) + rrb_pr) % 48; } @@ -1357,8 +1371,8 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, /* Verify that the current cfm matches what we think is the function start. If we have somehow jumped within a function, we do not want to interpret the prologue and calculate the - addresses of various registers such as the return address. - We will instead treat the frame as frameless. */ + addresses of various registers such as the return address. + We will instead treat the frame as frameless. */ if (!this_frame || (sof == (cache->cfm & 0x7f) && sol == ((cache->cfm >> 7) & 0x7f))) @@ -1384,7 +1398,7 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, int qp = (int) (instr & 0x0000000003fLL); if (qp == 0 && rN == 2 && imm == 0 && rM == 12 && fp_reg == 0) { - /* mov r2, r12 - beginning of leaf routine */ + /* mov r2, r12 - beginning of leaf routine. */ fp_reg = rN; last_prologue_pc = next_pc; } @@ -1401,7 +1415,7 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, } /* Loop, looking for prologue instructions, keeping track of - where preserved registers were spilled. */ + where preserved registers were spilled. */ while (pc < lim_pc) { next_pc = fetch_instruction (pc, &it, &instr); @@ -1410,7 +1424,7 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, if (it == B && ((instr & 0x1e1f800003fLL) != 0x04000000000LL)) { - /* Exit loop upon hitting a non-nop branch instruction. */ + /* Exit loop upon hitting a non-nop branch instruction. */ if (trust_limit) lim_pc = pc; break; @@ -1470,11 +1484,11 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, adds r2, spilloffset, r12 Get ready for stf.spill or st8.spill instructions. - The address to start spilling at is loaded into r2. + The address to start spilling at is loaded into r2. FIXME: Why r2? That's what gcc currently uses; it could well be different for other compilers. */ - /* Hmm... whether or not this will work will depend on + /* Hmm... whether or not this will work will depend on where the pc is. If it's still early in the prologue this'll be wrong. FIXME */ if (this_frame) @@ -1493,7 +1507,7 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, else if (qp == 0 && rM >= 32 && rM < 40 && !instores[rM-32] && rN < 256 && imm == 0) { - /* mov rN, rM where rM is an input register */ + /* mov rN, rM where rM is an input register. */ reg_contents[rN] = rM; last_prologue_pc = next_pc; } @@ -1525,7 +1539,7 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, if ((instr & 0x1efc0000000LL) == 0x0eec0000000LL) spill_addr += imm; else - spill_addr = 0; /* last one; must be done */ + spill_addr = 0; /* last one; must be done. */ last_prologue_pc = next_pc; } } @@ -1542,7 +1556,7 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, if (qp == 0 && isScratch (rN) && arM == 36 /* ar.unat */) { /* We have something like "mov.m r3 = ar.unat". Remember the - r3 (or whatever) and watch for a store of this register... */ + r3 (or whatever) and watch for a store of this register... */ unat_save_reg = rN; last_prologue_pc = next_pc; } @@ -1575,16 +1589,16 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, /* We've found a spill of either the UNAT register or the PR register. (Well, not exactly; what we've actually found is a spill of the register that UNAT or PR was moved to). - Record that fact and move on... */ + Record that fact and move on... */ if (rM == unat_save_reg) { - /* Track UNAT register */ + /* Track UNAT register. */ cache->saved_regs[IA64_UNAT_REGNUM] = spill_addr; unat_save_reg = 0; } else { - /* Track PR register */ + /* Track PR register. */ cache->saved_regs[IA64_PR_REGNUM] = spill_addr; pr_save_reg = 0; } @@ -1592,12 +1606,12 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, /* st8 [rN] = rM, imm9 */ spill_addr += imm9(instr); else - spill_addr = 0; /* must be done spilling */ + spill_addr = 0; /* Must be done spilling. */ last_prologue_pc = next_pc; } else if (qp == 0 && 32 <= rM && rM < 40 && !instores[rM-32]) { - /* Allow up to one store of each input register. */ + /* Allow up to one store of each input register. */ instores[rM-32] = 1; last_prologue_pc = next_pc; } @@ -1618,8 +1632,8 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, st8 [rN] = rM Note that the st8 case is handled in the clause above. - Advance over stores of input registers. One store per input - register is permitted. */ + Advance over stores of input registers. One store per input + register is permitted. */ int rM = (int) ((instr & 0x000000fe000LL) >> 13); int qp = (int) (instr & 0x0000000003fLL); int indirect = rM < 256 ? reg_contents[rM] : 0; @@ -1644,7 +1658,7 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, stfd [rN] = fM Advance over stores of floating point input registers. Again - one store per register is permitted */ + one store per register is permitted. */ int fM = (int) ((instr & 0x000000fe000LL) >> 13); int qp = (int) (instr & 0x0000000003fLL); if (qp == 0 && 8 <= fM && fM < 16 && !infpstores[fM - 8]) @@ -1667,13 +1681,13 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, { /* We've found a spill of one of the preserved general purpose regs. Record the spill address and advance the spill - register if appropriate. */ + register if appropriate. */ cache->saved_regs[IA64_GR0_REGNUM + rM] = spill_addr; if ((instr & 0x1efc0000000LL) == 0x0aec0000000LL) /* st8.spill [rN] = rM, imm9 */ spill_addr += imm9(instr); else - spill_addr = 0; /* Done spilling */ + spill_addr = 0; /* Done spilling. */ last_prologue_pc = next_pc; } } @@ -1692,7 +1706,7 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, /* Extract the size of the rotating portion of the stack frame and the register rename base from the current - frame marker. */ + frame marker. */ cfm = cache->cfm; sor = cache->sor; sof = cache->sof; @@ -1718,7 +1732,7 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, cache->saved_regs[IA64_VFP_REGNUM] = addr; } - /* For the previous argument registers we require the previous bof. + /* For the previous argument registers we require the previous bof. If we can't find the previous cfm, then we can do nothing. */ cfm = 0; if (cache->saved_regs[IA64_CFM_REGNUM] != 0) @@ -1754,7 +1768,8 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, addr += 8; } if (i < sor) - cache->saved_regs[IA64_GR32_REGNUM + ((i + (sor - rrb_gr)) % sor)] + cache->saved_regs[IA64_GR32_REGNUM + + ((i + (sor - rrb_gr)) % sor)] = addr; else cache->saved_regs[IA64_GR32_REGNUM + i] = addr; @@ -1784,7 +1799,8 @@ ia64_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) cache.cfm = 0; cache.bsp = 0; - /* Call examine_prologue with - as third argument since we don't have a next frame pointer to send. */ + /* Call examine_prologue with - as third argument since we don't + have a next frame pointer to send. */ return examine_prologue (pc, pc+1024, 0, &cache); } @@ -1851,7 +1867,8 @@ ia64_frame_this_id (struct frame_info *this_frame, void **this_cache, (*this_id) = frame_id_build_special (cache->base, cache->pc, cache->bsp); if (gdbarch_debug >= 1) fprintf_unfiltered (gdb_stdlog, - "regular frame id: code %s, stack %s, special %s, this_frame %s\n", + "regular frame id: code %s, stack %s, " + "special %s, this_frame %s\n", paddress (gdbarch, this_id->code_addr), paddress (gdbarch, this_id->stack_addr), paddress (gdbarch, cache->bsp), @@ -2135,26 +2152,37 @@ ia64_sigtramp_frame_init_saved_regs (struct frame_info *this_frame, { int regno; - cache->saved_regs[IA64_VRAP_REGNUM] = - tdep->sigcontext_register_address (gdbarch, cache->base, IA64_IP_REGNUM); - cache->saved_regs[IA64_CFM_REGNUM] = - tdep->sigcontext_register_address (gdbarch, cache->base, IA64_CFM_REGNUM); - cache->saved_regs[IA64_PSR_REGNUM] = - tdep->sigcontext_register_address (gdbarch, cache->base, IA64_PSR_REGNUM); - cache->saved_regs[IA64_BSP_REGNUM] = - tdep->sigcontext_register_address (gdbarch, cache->base, IA64_BSP_REGNUM); - cache->saved_regs[IA64_RNAT_REGNUM] = - tdep->sigcontext_register_address (gdbarch, cache->base, IA64_RNAT_REGNUM); - cache->saved_regs[IA64_CCV_REGNUM] = - tdep->sigcontext_register_address (gdbarch, cache->base, IA64_CCV_REGNUM); - cache->saved_regs[IA64_UNAT_REGNUM] = - tdep->sigcontext_register_address (gdbarch, cache->base, IA64_UNAT_REGNUM); - cache->saved_regs[IA64_FPSR_REGNUM] = - tdep->sigcontext_register_address (gdbarch, cache->base, IA64_FPSR_REGNUM); - cache->saved_regs[IA64_PFS_REGNUM] = - tdep->sigcontext_register_address (gdbarch, cache->base, IA64_PFS_REGNUM); - cache->saved_regs[IA64_LC_REGNUM] = - tdep->sigcontext_register_address (gdbarch, cache->base, IA64_LC_REGNUM); + cache->saved_regs[IA64_VRAP_REGNUM] + = tdep->sigcontext_register_address (gdbarch, cache->base, + IA64_IP_REGNUM); + cache->saved_regs[IA64_CFM_REGNUM] + = tdep->sigcontext_register_address (gdbarch, cache->base, + IA64_CFM_REGNUM); + cache->saved_regs[IA64_PSR_REGNUM] + = tdep->sigcontext_register_address (gdbarch, cache->base, + IA64_PSR_REGNUM); + cache->saved_regs[IA64_BSP_REGNUM] + = tdep->sigcontext_register_address (gdbarch, cache->base, + IA64_BSP_REGNUM); + cache->saved_regs[IA64_RNAT_REGNUM] + = tdep->sigcontext_register_address (gdbarch, cache->base, + IA64_RNAT_REGNUM); + cache->saved_regs[IA64_CCV_REGNUM] + = tdep->sigcontext_register_address (gdbarch, cache->base, + IA64_CCV_REGNUM); + cache->saved_regs[IA64_UNAT_REGNUM] + = tdep->sigcontext_register_address (gdbarch, cache->base, + IA64_UNAT_REGNUM); + cache->saved_regs[IA64_FPSR_REGNUM] + = tdep->sigcontext_register_address (gdbarch, cache->base, + IA64_FPSR_REGNUM); + cache->saved_regs[IA64_PFS_REGNUM] + = tdep->sigcontext_register_address (gdbarch, cache->base, + IA64_PFS_REGNUM); + cache->saved_regs[IA64_LC_REGNUM] + = tdep->sigcontext_register_address (gdbarch, cache->base, + IA64_LC_REGNUM); + for (regno = IA64_GR1_REGNUM; regno <= IA64_GR31_REGNUM; regno++) cache->saved_regs[regno] = tdep->sigcontext_register_address (gdbarch, cache->base, regno); @@ -2213,7 +2241,8 @@ ia64_sigtramp_frame_this_id (struct frame_info *this_frame, cache->bsp); if (gdbarch_debug >= 1) fprintf_unfiltered (gdb_stdlog, - "sigtramp frame id: code %s, stack %s, special %s, this_frame %s\n", + "sigtramp frame id: code %s, stack %s, " + "special %s, this_frame %s\n", paddress (gdbarch, this_id->code_addr), paddress (gdbarch, this_id->stack_addr), paddress (gdbarch, cache->bsp), @@ -2447,9 +2476,10 @@ ia64_access_reg (unw_addr_space_t as, unw_regnum_t uw_regnum, unw_word_t *val, break; case UNW_IA64_AR_BSP: - /* Libunwind expects to see the beginning of the current register - frame so we must account for the fact that ptrace() will return a value - for bsp that points *after* the current register frame. */ + /* Libunwind expects to see the beginning of the current + register frame so we must account for the fact that + ptrace() will return a value for bsp that points *after* + the current register frame. */ get_frame_register (this_frame, IA64_BSP_REGNUM, buf); bsp = extract_unsigned_integer (buf, 8, byte_order); get_frame_register (this_frame, IA64_CFM_REGNUM, buf); @@ -2483,8 +2513,8 @@ ia64_access_reg (unw_addr_space_t as, unw_regnum_t uw_regnum, unw_word_t *val, /* Libunwind callback accessor function for floating-point registers. */ static int -ia64_access_fpreg (unw_addr_space_t as, unw_regnum_t uw_regnum, unw_fpreg_t *val, - int write, void *arg) +ia64_access_fpreg (unw_addr_space_t as, unw_regnum_t uw_regnum, + unw_fpreg_t *val, int write, void *arg) { int regnum = ia64_uw2gdb_regnum (uw_regnum); struct frame_info *this_frame = arg; @@ -2499,8 +2529,8 @@ ia64_access_fpreg (unw_addr_space_t as, unw_regnum_t uw_regnum, unw_fpreg_t *val /* Libunwind callback accessor function for top-level rse registers. */ static int -ia64_access_rse_reg (unw_addr_space_t as, unw_regnum_t uw_regnum, unw_word_t *val, - int write, void *arg) +ia64_access_rse_reg (unw_addr_space_t as, unw_regnum_t uw_regnum, + unw_word_t *val, int write, void *arg) { int regnum = ia64_uw2gdb_regnum (uw_regnum); unw_word_t bsp, sof, sol, cfm, psr, ip; @@ -2526,9 +2556,10 @@ ia64_access_rse_reg (unw_addr_space_t as, unw_regnum_t uw_regnum, unw_word_t *va break; case UNW_IA64_AR_BSP: - /* Libunwind expects to see the beginning of the current register - frame so we must account for the fact that ptrace() will return a value - for bsp that points *after* the current register frame. */ + /* Libunwind expects to see the beginning of the current + register frame so we must account for the fact that + ptrace() will return a value for bsp that points *after* + the current register frame. */ regcache_cooked_read (regcache, IA64_BSP_REGNUM, buf); bsp = extract_unsigned_integer (buf, 8, byte_order); regcache_cooked_read (regcache, IA64_CFM_REGNUM, buf); @@ -2709,7 +2740,7 @@ ia64_find_unwind_table (struct objfile *objfile, unw_word_t ip, /* Verify that the segment that contains the IP also contains the static unwind table. If not, we may be in the Linux kernel's - DSO gate page in which case the unwind table is another segment. + DSO gate page in which case the unwind table is another segment. Otherwise, we are dealing with runtime-generated code, for which we have no info here. */ segbase = p_text->p_vaddr + load_base; @@ -2881,7 +2912,8 @@ ia64_libunwind_frame_this_id (struct frame_info *this_frame, void **this_cache, if (gdbarch_debug >= 1) fprintf_unfiltered (gdb_stdlog, - "libunwind frame id: code %s, stack %s, special %s, this_frame %s\n", + "libunwind frame id: code %s, stack %s, " + "special %s, this_frame %s\n", paddress (gdbarch, id.code_addr), paddress (gdbarch, id.stack_addr), paddress (gdbarch, bsp), @@ -2947,7 +2979,7 @@ ia64_libunwind_frame_prev_register (struct frame_info *this_frame, register stack frame. This corresponds to what the hardware bsp register will be if we pop the frame back which is why we might have been called. We know that libunwind will pass us back the - beginning of the current frame so we should just add sof to it. */ + beginning of the current frame so we should just add sof to it. */ prev_bsp = extract_unsigned_integer (value_contents_all (val), 8, byte_order); cfm_val = libunwind_frame_prev_register (this_frame, this_cache, @@ -3013,7 +3045,8 @@ ia64_libunwind_sigtramp_frame_this_id (struct frame_info *this_frame, if (gdbarch_debug >= 1) fprintf_unfiltered (gdb_stdlog, - "libunwind sigtramp frame id: code %s, stack %s, special %s, this_frame %s\n", + "libunwind sigtramp frame id: code %s, " + "stack %s, special %s, this_frame %s\n", paddress (gdbarch, id.code_addr), paddress (gdbarch, id.stack_addr), paddress (gdbarch, bsp), @@ -3085,8 +3118,8 @@ static unw_accessors_t ia64_unw_accessors = /* Set of special libunwind callback acccessor functions specific for accessing the rse registers. At the top of the stack, we want libunwind to figure out - how to read r32 - r127. Though usually they are found sequentially in memory - starting from $bof, this is not always true. */ + how to read r32 - r127. Though usually they are found sequentially in + memory starting from $bof, this is not always true. */ static unw_accessors_t ia64_unw_rse_accessors = { ia64_find_proc_info_x, @@ -3099,7 +3132,8 @@ static unw_accessors_t ia64_unw_rse_accessors = /* get_proc_name */ }; -/* Set of ia64 gdb libunwind-frame callbacks and data for generic libunwind-frame code to use. */ +/* Set of ia64 gdb libunwind-frame callbacks and data for generic + libunwind-frame code to use. */ static struct libunwind_descr ia64_libunwind_descr = { ia64_gdb2uw_regnum, @@ -3156,7 +3190,7 @@ ia64_extract_return_value (struct type *type, struct regcache *regcache, { regcache_cooked_read (regcache, regnum, from); convert_typed_floating (from, ia64_ext_type (gdbarch), - (char *)valbuf + offset, float_elt_type); + (char *)valbuf + offset, float_elt_type); offset += TYPE_LENGTH (float_elt_type); regnum++; } @@ -3400,7 +3434,7 @@ ia64_find_global_pointer (struct gdbarch *gdbarch, CORE_ADDR faddr) global_pointer = extract_unsigned_integer (buf, sizeof (buf), byte_order); - /* The payoff... */ + /* The payoff... */ return global_pointer; } @@ -3665,7 +3699,8 @@ ia64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, char val_buf[8]; memset (val_buf, 0, 8); - memcpy (val_buf, value_contents (arg) + argoffset, (len > 8) ? 8 : len); + memcpy (val_buf, value_contents (arg) + argoffset, + (len > 8) ? 8 : len); if (slotnum < rseslots) write_memory (rse_address_add (bsp, slotnum), val_buf, 8); @@ -3686,8 +3721,9 @@ ia64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, while (len > 0 && floatreg < IA64_FR16_REGNUM) { char to[MAX_REGISTER_SIZE]; - convert_typed_floating (value_contents (arg) + argoffset, float_elt_type, - to, ia64_ext_type (gdbarch)); + convert_typed_floating (value_contents (arg) + argoffset, + float_elt_type, to, + ia64_ext_type (gdbarch)); regcache_cooked_write (regcache, floatreg, (void *)to); floatreg++; argoffset += TYPE_LENGTH (float_elt_type); @@ -3699,7 +3735,8 @@ ia64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, /* Store the struct return value in r8 if necessary. */ if (struct_return) { - regcache_cooked_write_unsigned (regcache, IA64_GR8_REGNUM, (ULONGEST)struct_addr); + regcache_cooked_write_unsigned (regcache, IA64_GR8_REGNUM, + (ULONGEST) struct_addr); } global_pointer = ia64_find_global_pointer (gdbarch, func_addr); @@ -3793,7 +3830,8 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_ptr_bit (gdbarch, 64); set_gdbarch_num_regs (gdbarch, NUM_IA64_RAW_REGS); - set_gdbarch_num_pseudo_regs (gdbarch, LAST_PSEUDO_REGNUM - FIRST_PSEUDO_REGNUM); + set_gdbarch_num_pseudo_regs (gdbarch, + LAST_PSEUDO_REGNUM - FIRST_PSEUDO_REGNUM); set_gdbarch_sp_regnum (gdbarch, sp_regnum); set_gdbarch_fp0_regnum (gdbarch, IA64_FR0_REGNUM); @@ -3812,8 +3850,10 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_return_value (gdbarch, ia64_return_value); - set_gdbarch_memory_insert_breakpoint (gdbarch, ia64_memory_insert_breakpoint); - set_gdbarch_memory_remove_breakpoint (gdbarch, ia64_memory_remove_breakpoint); + set_gdbarch_memory_insert_breakpoint (gdbarch, + ia64_memory_insert_breakpoint); + set_gdbarch_memory_remove_breakpoint (gdbarch, + ia64_memory_remove_breakpoint); set_gdbarch_breakpoint_from_pc (gdbarch, ia64_breakpoint_from_pc); set_gdbarch_read_pc (gdbarch, ia64_read_pc); set_gdbarch_write_pc (gdbarch, ia64_write_pc); @@ -3840,7 +3880,8 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_inner_than (gdbarch, core_addr_lessthan); set_gdbarch_print_insn (gdbarch, ia64_print_insn); - set_gdbarch_convert_from_func_ptr_addr (gdbarch, ia64_convert_from_func_ptr_addr); + set_gdbarch_convert_from_func_ptr_addr (gdbarch, + ia64_convert_from_func_ptr_addr); /* The virtual table contains 16-byte descriptors, not pointers to descriptors. */ diff --git a/gdb/inf-loop.c b/gdb/inf-loop.c index 42a16e04554..ea5a2ed0947 100644 --- a/gdb/inf-loop.c +++ b/gdb/inf-loop.c @@ -16,11 +16,11 @@ 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 . */ + along with this program. If not, see . */ #include "defs.h" -#include "inferior.h" /* For fetch_inferior_event. */ -#include "target.h" /* For enum inferior_event_type. */ +#include "inferior.h" /* For fetch_inferior_event. */ +#include "target.h" /* For enum inferior_event_type. */ #include "event-loop.h" #include "event-top.h" #include "inf-loop.h" @@ -37,10 +37,10 @@ inferior_event_handler_wrapper (gdb_client_data client_data) inferior_event_handler (INF_QUIT_REQ, client_data); } -/* General function to handle events in the inferior. So far it just +/* General function to handle events in the inferior. So far it just takes care of detecting errors reported by select() or poll(), otherwise it assumes that all is OK, and goes on reading data from - the fd. This however may not always be what we want to do. */ + the fd. This however may not always be what we want to do. */ void inferior_event_handler (enum inferior_event_type event_type, gdb_client_data client_data) @@ -62,7 +62,7 @@ inferior_event_handler (enum inferior_event_type event_type, /* Use catch errors for now, until the inner layers of fetch_inferior_event (i.e. readchar) can return meaningful error status. If an error occurs while getting an event from - the target, just get rid of the target. */ + the target, just get rid of the target. */ if (!catch_errors (fetch_inferior_event_wrapper, client_data, "", RETURN_MASK_ALL)) { @@ -78,7 +78,7 @@ inferior_event_handler (enum inferior_event_type event_type, if (!non_stop) { - /* Unregister the inferior from the event loop. This is done + /* Unregister the inferior from the event loop. This is done so that when the inferior is not running we don't get distracted by spurious inferior output. */ if (target_has_execution) @@ -142,7 +142,7 @@ inferior_event_handler (enum inferior_event_type event_type, case INF_EXEC_CONTINUE: /* Is there anything left to do for the command issued to - complete? */ + complete? */ if (non_stop) do_all_intermediate_continuations_thread (inferior_thread ()); @@ -151,9 +151,9 @@ inferior_event_handler (enum inferior_event_type event_type, break; case INF_QUIT_REQ: - /* FIXME: ezannoni 1999-10-04. This call should really be a + /* FIXME: ezannoni 1999-10-04. This call should really be a target vector entry, so that it can be used for any kind of - targets. */ + targets. */ async_remote_interrupt_twice (NULL); break; diff --git a/gdb/infcall.c b/gdb/infcall.c index 81b6085726d..75de56cadac 100644 --- a/gdb/infcall.c +++ b/gdb/infcall.c @@ -88,7 +88,7 @@ show_coerce_float_to_double_p (struct ui_file *file, int from_tty, the stack and restore the context to what as it was before the call. - The default is to stop in the frame where the signal was received. */ + The default is to stop in the frame where the signal was received. */ int unwind_on_signal_p = 0; static void @@ -264,7 +264,7 @@ find_function_addr (struct value *function, struct type **retval_type) else if (code == TYPE_CODE_INT) { /* Handle the case of functions lacking debugging info. - Their values are characters since their addresses are char */ + Their values are characters since their addresses are char. */ if (TYPE_LENGTH (ftype) == 1) funaddr = value_as_address (value_addr (function)); else @@ -373,7 +373,7 @@ run_inferior_call (struct thread_info *call_thread, CORE_ADDR real_pc) disable_watchpoints_before_interactive_call_start (); - /* We want stop_registers, please... */ + /* We want stop_registers, please... */ call_thread->control.proceed_to_finish = 1; if (target_can_async_p ()) @@ -436,7 +436,7 @@ cleanup_delete_std_terminate_breakpoint (void *ignore) May fail to return, if a breakpoint or signal is hit during the execution of the function. - ARGS is modified to contain coerced values. */ + ARGS is modified to contain coerced values. */ struct value * call_function_by_hand (struct value *function, int nargs, struct value **args) @@ -549,7 +549,7 @@ call_function_by_hand (struct value *function, int nargs, struct value **args) If the generic dummy frame ends up empty (because nothing is pushed) GDB won't be able to correctly perform back traces. If a target is having trouble with backtraces, first thing to - do is add FRAME_ALIGN() to the architecture vector. If that + do is add FRAME_ALIGN() to the architecture vector. If that fails, try dummy_id(). If the ABI specifies a "Red Zone" (see the doco) the code @@ -682,7 +682,7 @@ call_function_by_hand (struct value *function, int nargs, struct value **args) /* Reserve space for the return structure to be written on the stack, if necessary. Make certain that the value is correctly - aligned. */ + aligned. */ if (struct_return || lang_struct_return) { @@ -700,7 +700,7 @@ call_function_by_hand (struct value *function, int nargs, struct value **args) else { /* Stack grows upward. Align the frame, allocate space, and - then again, re-align the frame??? */ + then again, re-align the frame??? */ if (gdbarch_frame_align_p (gdbarch)) sp = gdbarch_frame_align (gdbarch, sp); struct_addr = sp; @@ -898,11 +898,11 @@ When the function is done executing, GDB will silently stop."), { /* We stopped inside the FUNCTION because of a random signal. Further execution of the FUNCTION is not - allowed. */ + allowed. */ if (unwind_on_signal_p) { - /* The user wants the context restored. */ + /* The user wants the context restored. */ /* We must get back to the frame we were before the dummy call. */ diff --git a/gdb/infcall.h b/gdb/infcall.h index 82c045f8640..5eda7cda8c7 100644 --- a/gdb/infcall.h +++ b/gdb/infcall.h @@ -34,7 +34,7 @@ extern CORE_ADDR find_function_addr (struct value *function, representing what the function returned. May fail to return, if a breakpoint or signal is hit during the execution of the function. - ARGS is modified to contain coerced values. */ + ARGS is modified to contain coerced values. */ extern struct value *call_function_by_hand (struct value *function, int nargs, struct value **args); diff --git a/gdb/infcmd.c b/gdb/infcmd.c index c940acf9d55..500bdd78347 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -129,7 +129,7 @@ void _initialize_infcmd (void); /* Scratch area where string containing arguments to give to the program will be stored by 'set args'. As soon as anything is stored, notice_args_set will move it into per-inferior storage. - Arguments are separated by spaces. Empty string (pointer to '\0') + Arguments are separated by spaces. Empty string (pointer to '\0') means no args. */ static char *inferior_args_scratch; @@ -165,7 +165,7 @@ enum stop_stack_kind stop_stack_dummy; int stopped_by_random_signal; -/* Accessor routines. */ +/* Accessor routines. */ /* Set the io terminal for the current inferior. Ownership of TERMINAL_NAME is not transferred. */ @@ -360,8 +360,8 @@ construct_inferior_arguments (int argc, char **argv) /* This function detects whether or not a '&' character (indicating background execution) has been added as *the last* of the arguments ARGS - of a command. If it has, it removes it and returns 1. Otherwise it - does nothing and returns 0. */ + of a command. If it has, it removes it and returns 1. Otherwise it + does nothing and returns 0. */ static int strip_bg_char (char **args) { @@ -473,7 +473,7 @@ Start it from the beginning? "))) } } -/* Implement the "run" command. If TBREAK_AT_MAIN is set, then insert +/* Implement the "run" command. If TBREAK_AT_MAIN is set, then insert a temporary breakpoint at the begining of the main program before running the program. */ @@ -532,19 +532,19 @@ run_command_1 (char *args, int from_tty, int tbreak_at_main) int async_exec = strip_bg_char (&args); /* If we get a request for running in the bg but the target - doesn't support it, error out. */ + doesn't support it, error out. */ if (async_exec && !target_can_async_p ()) error (_("Asynchronous execution not supported on this target.")); /* If we don't get a request of running in the bg, then we need - to simulate synchronous (fg) execution. */ + to simulate synchronous (fg) execution. */ if (!async_exec && target_can_async_p ()) { - /* Simulate synchronous execution */ + /* Simulate synchronous execution. */ async_disable_stdin (); } - /* If there were other args, beside '&', process them. */ + /* If there were other args, beside '&', process them. */ if (args) set_inferior_args (args); } @@ -653,7 +653,7 @@ ensure_valid_thread (void) } /* If the user is looking at trace frames, any resumption of execution - is likely to mix up recorded and live target data. So simply + is likely to mix up recorded and live target data. So simply disallow those commands. */ void @@ -700,20 +700,20 @@ continue_command (char *args, int from_tty) int all_threads = 0; ERROR_NO_INFERIOR; - /* Find out whether we must run in the background. */ + /* Find out whether we must run in the background. */ if (args != NULL) async_exec = strip_bg_char (&args); /* If we must run in the background, but the target can't do it, - error out. */ + error out. */ if (async_exec && !target_can_async_p ()) error (_("Asynchronous execution not supported on this target.")); /* If we are not asked to run in the bg, then prepare to run in the - foreground, synchronously. */ + foreground, synchronously. */ if (!async_exec && target_can_async_p ()) { - /* Simulate synchronous execution */ + /* Simulate synchronous execution. */ async_disable_stdin (); } @@ -848,21 +848,21 @@ step_1 (int skip_subroutines, int single_inst, char *count_string) async_exec = strip_bg_char (&count_string); /* If we get a request for running in the bg but the target - doesn't support it, error out. */ + doesn't support it, error out. */ if (async_exec && !target_can_async_p ()) error (_("Asynchronous execution not supported on this target.")); /* If we don't get a request of running in the bg, then we need - to simulate synchronous (fg) execution. */ + to simulate synchronous (fg) execution. */ if (!async_exec && target_can_async_p ()) { - /* Simulate synchronous execution */ + /* Simulate synchronous execution. */ async_disable_stdin (); } count = count_string ? parse_and_eval_long (count_string) : 1; - if (!single_inst || skip_subroutines) /* leave si command alone */ + if (!single_inst || skip_subroutines) /* Leave si command alone. */ { struct thread_info *tp = inferior_thread (); @@ -926,9 +926,9 @@ struct step_1_continuation_args /* Called after we are done with one step operation, to check whether we need to step again, before we print the prompt and return control - to the user. If count is > 1, we will need to do one more call to - proceed(), via step_once(). Basically it is like step_once and - step_1_continuation are co-recursive. */ + to the user. If count is > 1, we will need to do one more call to + proceed(), via step_once(). Basically it is like step_once and + step_1_continuation are co-recursive. */ static void step_1_continuation (void *args) { @@ -1072,12 +1072,12 @@ jump_command (char *arg, int from_tty) ensure_valid_thread (); ensure_not_running (); - /* Find out whether we must run in the background. */ + /* Find out whether we must run in the background. */ if (arg != NULL) async_exec = strip_bg_char (&arg); /* If we must run in the background, but the target can't do it, - error out. */ + error out. */ if (async_exec && !target_can_async_p ()) error (_("Asynchronous execution not supported on this target.")); @@ -1096,9 +1096,9 @@ jump_command (char *arg, int from_tty) if (sal.symtab == 0 && sal.pc == 0) error (_("No source file has been specified.")); - resolve_sal_pc (&sal); /* May error out */ + resolve_sal_pc (&sal); /* May error out. */ - /* See if we are trying to jump to another function. */ + /* See if we are trying to jump to another function. */ fn = get_frame_function (get_current_frame ()); sfn = find_pc_function (sal.pc); if (fn != NULL && sfn != fn) @@ -1136,10 +1136,10 @@ jump_command (char *arg, int from_tty) } /* If we are not asked to run in the bg, then prepare to run in the - foreground, synchronously. */ + foreground, synchronously. */ if (!async_exec && target_can_async_p ()) { - /* Simulate synchronous execution */ + /* Simulate synchronous execution. */ async_disable_stdin (); } @@ -1148,7 +1148,7 @@ jump_command (char *arg, int from_tty) } -/* Go to line or address in current procedure */ +/* Go to line or address in current procedure. */ static void go_command (char *line_no, int from_tty) { @@ -1261,7 +1261,7 @@ until_next_command (int from_tty) /* Step until either exited from this function or greater than the current line (if in symbolic section) or pc (if - not). */ + not). */ pc = get_frame_pc (frame); func = find_pc_function (pc); @@ -1312,20 +1312,20 @@ until_command (char *arg, int from_tty) ensure_valid_thread (); ensure_not_running (); - /* Find out whether we must run in the background. */ + /* Find out whether we must run in the background. */ if (arg != NULL) async_exec = strip_bg_char (&arg); /* If we must run in the background, but the target can't do it, - error out. */ + error out. */ if (async_exec && !target_can_async_p ()) error (_("Asynchronous execution not supported on this target.")); /* If we are not asked to run in the bg, then prepare to run in the - foreground, synchronously. */ + foreground, synchronously. */ if (!async_exec && target_can_async_p ()) { - /* Simulate synchronous execution */ + /* Simulate synchronous execution. */ async_disable_stdin (); } @@ -1437,7 +1437,7 @@ print_return_value (struct type *func_type, struct type *value_type) impossible to do all the stuff as part of the finish_command function itself. The only chance we have to complete this command is in fetch_inferior_event, which is called by the event loop as - soon as it detects that the target has stopped. This function is + soon as it detects that the target has stopped. This function is called via the cmd_continuation pointer. */ struct finish_command_continuation_args @@ -1816,7 +1816,7 @@ set_environment_command (char *arg, int from_tty) if (arg == 0) error_no_arg (_("environment variable and value")); - /* Find seperation between variable name and value */ + /* Find seperation between variable name and value. */ p = (char *) strchr (arg, '='); val = (char *) strchr (arg, ' '); @@ -1824,7 +1824,7 @@ set_environment_command (char *arg, int from_tty) { /* We have both a space and an equals. If the space is before the equals, walk forward over the spaces til we see a nonspace - (possibly the equals). */ + (possibly the equals). */ if (p > val) while (*val == ' ') val++; @@ -1844,11 +1844,11 @@ set_environment_command (char *arg, int from_tty) { nullset = 1; if (p == 0) - p = arg + strlen (arg); /* So that savestring below will work */ + p = arg + strlen (arg); /* So that savestring below will work. */ } else { - /* Not setting variable value to null */ + /* Not setting variable value to null. */ val = p + 1; while (*val == ' ' || *val == '\t') val++; @@ -1887,7 +1887,7 @@ unset_environment_command (char *var, int from_tty) unset_in_environ (current_inferior ()->environment, var); } -/* Handle the execution path (PATH variable) */ +/* Handle the execution path (PATH variable). */ static const char path_var_name[] = "PATH"; @@ -1910,7 +1910,7 @@ path_command (char *dirname, int from_tty) dont_repeat (); env = get_in_environ (current_inferior ()->environment, path_var_name); - /* Can be null if path is not set */ + /* Can be null if path is not set. */ if (!env) env = ""; exec_path = xstrdup (env); @@ -1922,7 +1922,7 @@ path_command (char *dirname, int from_tty) } -/* Print out the machine register regnum. If regnum is -1, print all +/* Print out the machine register regnum. If regnum is -1, print all registers (print_all == 1) or all non-float and non-vector registers (print_all == 0). @@ -2203,7 +2203,7 @@ kill_command (char *arg, int from_tty) { /* FIXME: This should not really be inferior_ptid (or target_has_execution). It should be a distinct flag that indicates that a target is active, cuz - some targets don't have processes! */ + some targets don't have processes! */ if (ptid_equal (inferior_ptid, null_ptid)) error (_("The program is not being run.")); @@ -2215,7 +2215,7 @@ kill_command (char *arg, int from_tty) with their threads. */ if (!have_inferiors ()) { - init_thread_list (); /* Destroy thread info */ + init_thread_list (); /* Destroy thread info. */ /* Killing off the inferior can leave us with a core file. If so, print the state we are left in. */ @@ -2280,8 +2280,7 @@ proceed_after_attach (int pid) * This only needs to be done if we are attaching to a process. */ -/* - attach_command -- +/* attach_command -- takes a program started up outside of gdb and ``attaches'' to it. This stops it cold in its tracks and allows us to start debugging it. and wait for the trace-trap that results from attaching. */ @@ -2310,8 +2309,8 @@ attach_command_post_wait (char *args, int from_tty, int async_exec) Attempt to qualify the filename against the source path. (If that fails, we'll just fall back on the original - filename. Not much more we can do...) - */ + filename. Not much more we can do...) */ + if (!source_full_path_of (exec_file, &full_exec_path)) full_exec_path = xstrdup (exec_file); @@ -2434,7 +2433,7 @@ attach_command (char *args, int from_tty) async_exec = strip_bg_char (&args); /* If we get a request for running in the bg but the target - doesn't support it, error out. */ + doesn't support it, error out. */ if (async_exec && !target_can_async_p ()) error (_("Asynchronous execution not supported on this target.")); } @@ -2443,7 +2442,7 @@ attach_command (char *args, int from_tty) to simulate synchronous (fg) execution. */ if (!async_exec && target_can_async_p ()) { - /* Simulate synchronous execution */ + /* Simulate synchronous execution. */ async_disable_stdin (); make_cleanup ((make_cleanup_ftype *)async_enable_stdin, NULL); } @@ -2480,7 +2479,7 @@ attach_command (char *args, int from_tty) { struct inferior *inferior = current_inferior (); - /* Careful here. See comments in inferior.h. Basically some + /* Careful here. See comments in inferior.h. Basically some OSes don't ignore SIGSTOPs on continue requests anymore. We need a way for handle_inferior_event to reset the stop_signal variable after an attach, and this is what @@ -2623,7 +2622,7 @@ detach_command (char *args, int from_tty) static void disconnect_command (char *args, int from_tty) { - dont_repeat (); /* Not for the faint of heart */ + dont_repeat (); /* Not for the faint of heart. */ target_disconnect (args, from_tty); no_shared_libraries (NULL, from_tty); init_thread_list (); @@ -2665,7 +2664,7 @@ interrupt_target_command (char *args, int from_tty) { int all_threads = 0; - dont_repeat (); /* Not for the faint of heart */ + dont_repeat (); /* Not for the faint of heart. */ if (args != NULL && strncmp (args, "-a", sizeof ("-a") - 1) == 0) @@ -2730,7 +2729,7 @@ _initialize_infcmd (void) { struct cmd_list_element *c = NULL; - /* add the filename of the terminal connected to inferior I/O */ + /* Add the filename of the terminal connected to inferior I/O. */ add_setshow_filename_cmd ("inferior-tty", class_run, &inferior_io_terminal_scratch, _("\ Set terminal for future runs of program being debugged."), _("\ diff --git a/gdb/inferior.c b/gdb/inferior.c index 103883ef883..081849eba03 100644 --- a/gdb/inferior.c +++ b/gdb/inferior.c @@ -830,7 +830,7 @@ add_inferior_command (char *args, int from_tty) if (exec != NULL) { /* Switch over temporarily, while reading executable and - symbols.q */ + symbols.q. */ set_current_program_space (inf->pspace); set_current_inferior (inf); switch_to_thread (null_ptid); diff --git a/gdb/inferior.h b/gdb/inferior.h index 7052d6f8cab..7cebcbf6bfa 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -67,7 +67,7 @@ extern struct regcache * or a "don't care" condition, i.e, "run all threads." */ extern ptid_t minus_one_ptid; -/* The null or zero ptid, often used to indicate no process. */ +/* The null or zero ptid, often used to indicate no process. */ extern ptid_t null_ptid; /* Attempt to find and return an existing ptid with the given PID, LWP, @@ -75,19 +75,19 @@ extern ptid_t null_ptid; that. */ ptid_t ptid_build (int pid, long lwp, long tid); -/* Find/Create a ptid from just a pid. */ +/* Find/Create a ptid from just a pid. */ ptid_t pid_to_ptid (int pid); -/* Fetch the pid (process id) component from a ptid. */ +/* Fetch the pid (process id) component from a ptid. */ int ptid_get_pid (ptid_t ptid); -/* Fetch the lwp (lightweight process) component from a ptid. */ +/* Fetch the lwp (lightweight process) component from a ptid. */ long ptid_get_lwp (ptid_t ptid); -/* Fetch the tid (thread id) component from a ptid. */ +/* Fetch the tid (thread id) component from a ptid. */ long ptid_get_tid (ptid_t ptid); -/* Compare two ptids to see if they are equal */ +/* Compare two ptids to see if they are equal. */ extern int ptid_equal (ptid_t p1, ptid_t p2); /* Return true if PTID represents a process id. */ @@ -118,16 +118,16 @@ extern void set_inferior_io_terminal (const char *terminal_name); extern const char *get_inferior_io_terminal (void); /* Collected pid, tid, etc. of the debugged inferior. When there's - no inferior, PIDGET (inferior_ptid) will be 0. */ + no inferior, PIDGET (inferior_ptid) will be 0. */ extern ptid_t inferior_ptid; /* Are we simulating synchronous execution? This is used in async gdb to implement the 'run', 'continue' etc commands, which will not - redisplay the prompt until the execution is actually over. */ + redisplay the prompt until the execution is actually over. */ extern int sync_execution; -/* Inferior environment. */ +/* Inferior environment. */ extern void clear_proceed_status (void); @@ -316,10 +316,10 @@ enum step_over_calls_kind setting up a remote connection; it is like STOP_QUIETLY_NO_SIGSTOP except that there is no need to hide a signal. */ -/* It is also used after attach, due to attaching to a process. This +/* It is also used after attach, due to attaching to a process. This is a bit trickier. When doing an attach, the kernel stops the debuggee with a SIGSTOP. On newer GNU/Linux kernels (>= 2.5.61) - the handling of SIGSTOP for a ptraced process has changed. Earlier + the handling of SIGSTOP for a ptraced process has changed. Earlier versions of the kernel would ignore these SIGSTOPs, while now SIGSTOP is treated like any other signal, i.e. it is not muffled. @@ -327,7 +327,7 @@ enum step_over_calls_kind the global variable stop_signal (which stores the signal from the attach, SIGSTOP) to the ptrace(PTRACE_CONT,...) call. This is problematic, because the kernel doesn't ignore such SIGSTOP - now. I.e. it is reported back to gdb, which in turn presents it + now. I.e. it is reported back to gdb, which in turn presents it back to the user. To avoid the problem, we use STOP_QUIETLY_NO_SIGSTOP, which allows @@ -374,7 +374,7 @@ void displaced_step_dump_bytes (struct ui_file *file, /* If STARTUP_WITH_SHELL is set, GDB's "run" will attempts to start up the debugee under a shell. - This is in order for argument-expansion to occur. E.g., + This is in order for argument-expansion to occur. E.g., (gdb) run * The "*" gets expanded by the shell into a list of files. While this is a nice feature, it turns out to interact badly @@ -387,7 +387,7 @@ void displaced_step_dump_bytes (struct ui_file *file, be 1 if target is not started up with a shell, 2 if it is. - RT If you disable this, you need to decrement - START_INFERIOR_TRAPS_EXPECTED in tm.h. */ + START_INFERIOR_TRAPS_EXPECTED in tm.h. */ #define STARTUP_WITH_SHELL 1 #if !defined(START_INFERIOR_TRAPS_EXPECTED) #define START_INFERIOR_TRAPS_EXPECTED 2 diff --git a/gdb/inflow.c b/gdb/inflow.c index d7d8c77e2ce..99c25f2c082 100644 --- a/gdb/inflow.c +++ b/gdb/inflow.c @@ -409,8 +409,8 @@ terminal_ours_1 (int output_only) mode, to avoid flushing input. We need to do the same thing regardless of output_only, because we don't have separate terminal_is_ours and terminal_is_ours_for_output flags. It's OK, - though, since readline will deal with raw mode when/if it needs to. - */ + though, since readline will deal with raw mode when/if it needs + to. */ serial_noflush_set_tty_state (stdin_serial, our_terminal_info.ttystate, tinfo->ttystate); @@ -566,7 +566,7 @@ child_terminal_info (char *args, int from_tty) #ifndef O_ACCMODE #define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR) #endif - /* (O_ACCMODE) parens are to avoid Ultrix header file bug */ + /* (O_ACCMODE) parens are to avoid Ultrix header file bug. */ switch (flags & (O_ACCMODE)) { case O_RDONLY: @@ -661,7 +661,7 @@ new_tty (void) #ifdef TIOCNOTTY /* Disconnect the child process from our controlling terminal. On some systems (SVR4 for example), this may cause a SIGTTOU, so temporarily - ignore SIGTTOU. */ + ignore SIGTTOU. */ tty = open ("/dev/tty", O_RDWR); if (tty > 0) { @@ -732,7 +732,7 @@ new_tty_postfork (void) /* Call set_sigint_trap when you need to pass a signal on to an attached - process when handling SIGINT */ + process when handling SIGINT. */ static void pass_signal (int signo) @@ -867,7 +867,7 @@ _initialize_inflow (void) #ifdef _SC_JOB_CONTROL job_control = sysconf (_SC_JOB_CONTROL); #else - job_control = 0; /* have to assume the worst */ + job_control = 0; /* Have to assume the worst. */ #endif /* _SC_JOB_CONTROL */ #endif /* _POSIX_JOB_CONTROL */ #endif /* HAVE_TERMIOS */ diff --git a/gdb/infrun.c b/gdb/infrun.c index a6d00380360..664d91b24d7 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -110,7 +110,7 @@ show_step_stop_if_no_debug (struct ui_file *file, int from_tty, fprintf_filtered (file, _("Mode of the step operation is %s.\n"), value); } -/* In asynchronous mode, but simulating synchronous execution. */ +/* In asynchronous mode, but simulating synchronous execution. */ int sync_execution = 0; @@ -292,7 +292,7 @@ static unsigned char *signal_program; (flags)[signum] = 0; \ } while (0) -/* Value to pass to target_resume() to cause all threads to resume */ +/* Value to pass to target_resume() to cause all threads to resume. */ #define RESUME_ALL minus_one_ptid @@ -473,7 +473,7 @@ follow_fork (void) over from WAIT_PID" logic above. */ nullify_last_target_wait_ptid (); - /* If we followed the child, switch to it... */ + /* If we followed the child, switch to it... */ if (follow_child) { switch_to_thread (child); @@ -606,7 +606,7 @@ handle_vfork_child_exec_or_exit (int exec) struct program_space *pspace; struct address_space *aspace; - /* follow-fork child, detach-on-fork on */ + /* follow-fork child, detach-on-fork on. */ old_chain = make_cleanup_restore_current_thread (); @@ -701,7 +701,7 @@ handle_vfork_child_exec_or_exit (int exec) inf->aspace = pspace->aspace; /* Put back inferior_ptid. We'll continue mourning this - inferior. */ + inferior. */ do_cleanups (old_chain); resume_parent = inf->vfork_parent->pid; @@ -750,7 +750,7 @@ show_follow_exec_mode_string (struct ui_file *file, int from_tty, fprintf_filtered (file, _("Follow exec mode is \"%s\".\n"), value); } -/* EXECD_PATHNAME is assumed to be non-NULL. */ +/* EXECD_PATHNAME is assumed to be non-NULL. */ static void follow_exec (ptid_t pid, char *execd_pathname) @@ -777,14 +777,14 @@ follow_exec (ptid_t pid, char *execd_pathname) And, we DON'T want to call delete_breakpoints() here, since that may write the bp's "shadow contents" (the instruction value that was overwritten witha TRAP instruction). Since - we now have a new a.out, those shadow contents aren't valid. */ + we now have a new a.out, those shadow contents aren't valid. */ mark_breakpoints_out (); update_breakpoints_after_exec (); /* If there was one, it's gone now. We cannot truly step-to-next - statement through an exec(). */ + statement through an exec(). */ th->control.step_resume_breakpoint = NULL; th->control.exception_resume_breakpoint = NULL; th->control.step_range_start = 0; @@ -798,13 +798,13 @@ follow_exec (ptid_t pid, char *execd_pathname) with scheduler-locking on in all-stop mode. */ th->stop_requested = 0; - /* What is this a.out's name? */ + /* What is this a.out's name? */ printf_unfiltered (_("%s is executing new program: %s\n"), target_pid_to_str (inferior_ptid), execd_pathname); /* We've followed the inferior through an exec. Therefore, the - inferior has essentially been killed & reborn. */ + inferior has essentially been killed & reborn. */ gdb_flush (gdb_stdout); @@ -849,7 +849,7 @@ follow_exec (ptid_t pid, char *execd_pathname) gdb_assert (current_program_space == inf->pspace); - /* That a.out is now the one to use. */ + /* That a.out is now the one to use. */ exec_file_attach (execd_pathname, 0); /* SYMFILE_DEFER_BP_RESET is used as the proper displacement for PIE @@ -874,13 +874,13 @@ follow_exec (ptid_t pid, char *execd_pathname) /* Reinsert all breakpoints. (Those which were symbolic have been reset to the proper address in the new a.out, thanks - to symbol_file_command...) */ + to symbol_file_command...). */ insert_breakpoints (); /* The next resume of this inferior should bring it to the shlib startup breakpoints. (If the user had also set bp's on "main" from the old (parent) process, then they'll auto- - matically get reset there in the new process.) */ + matically get reset there in the new process.). */ } /* Non-zero if we just simulating a single-step. This is needed @@ -903,7 +903,7 @@ static int stepping_past_singlestep_breakpoint; is finished, we need to switch to deferred_step_ptid, and step it. The use case is when one thread has hit a breakpoint, and then the user - has switched to another thread and issued 'step'. We need to step over + has switched to another thread and issued 'step'. We need to step over breakpoint in the thread which hit the breakpoint, but then continue stepping the thread user has selected. */ static ptid_t deferred_step_ptid; @@ -1560,7 +1560,7 @@ maybe_software_singlestep (struct gdbarch *gdbarch, CORE_ADDR pc) { hw_step = 0; /* Do not pull these breakpoints until after a `wait' in - `wait_for_inferior' */ + `wait_for_inferior'. */ singlestep_breakpoints_inserted_p = 1; singlestep_ptid = inferior_ptid; singlestep_pc = pc; @@ -1734,7 +1734,7 @@ a command like `return' or `jump' to continue execution.")); || (scheduler_mode == schedlock_step && (step || singlestep_breakpoints_inserted_p))) { - /* User-settable 'scheduler' mode requires solo thread resume. */ + /* User-settable 'scheduler' mode requires solo thread resume. */ resume_ptid = inferior_ptid; } @@ -1856,7 +1856,7 @@ clear_proceed_status (void) event. If a step-over is required return TRUE and set the current thread to the old thread. Otherwise return FALSE. - This should be suitable for any targets that support threads. */ + This should be suitable for any targets that support threads. */ static int prepare_to_proceed (int step) @@ -1913,7 +1913,7 @@ prepare_to_proceed (int step) /* We return 1 to indicate that there is a breakpoint here, so we need to step over it before continuing to avoid - hitting it straight away. */ + hitting it straight away. */ return 1; } } @@ -2021,7 +2021,7 @@ proceed (CORE_ADDR addr, enum target_signal siggnal, int step) prepare_to_proceed checks the current thread against the thread that reported the most recent event. If a step-over is required it returns TRUE and sets the current thread to - the old thread. */ + the old thread. */ if (prepare_to_proceed (step)) oneproc = 1; } @@ -2122,7 +2122,7 @@ proceed (CORE_ADDR addr, enum target_signal siggnal, int step) /* Wait for it to stop (if not standalone) and in any case decode why it stopped, and act accordingly. */ /* Do this only if we are not using the event loop, or if the target - does not support asynchronous execution. */ + does not support asynchronous execution. */ if (!target_can_async_p ()) { wait_for_inferior (0); @@ -2142,20 +2142,20 @@ start_remote (int from_tty) inferior = current_inferior (); inferior->control.stop_soon = STOP_QUIETLY_REMOTE; - /* Always go on waiting for the target, regardless of the mode. */ + /* Always go on waiting for the target, regardless of the mode. */ /* FIXME: cagney/1999-09-23: At present it isn't possible to indicate to wait_for_inferior that a target should timeout if nothing is returned (instead of just blocking). Because of this, targets expecting an immediate response need to, internally, set things up so that the target_wait() is forced to eventually - timeout. */ + timeout. */ /* FIXME: cagney/1999-09-24: It isn't possible for target_open() to differentiate to its caller what the state of the target is after the initial open has been performed. Here we're assuming that the target has stopped. It should be possible to eventually have target_open() return to the caller an indication that the target is currently running and GDB state should be set to the same as - for an async run. */ + for an async run. */ wait_for_inferior (0); /* Now that the inferior has stopped, do any bookkeeping like @@ -2394,7 +2394,7 @@ delete_step_thread_step_resume_breakpoint (void) iterate_over_threads (delete_step_resume_breakpoint_callback, NULL); } -/* A cleanup wrapper. */ +/* A cleanup wrapper. */ static void delete_step_thread_step_resume_breakpoint_cleanup (void *arg) @@ -2483,7 +2483,7 @@ prepare_for_detach (void) target_wait because they can be loaded from the target while in target_wait. This makes remote debugging a bit more efficient for those targets that provide critical registers - as part of their normal status mechanism. */ + as part of their normal status mechanism. */ registers_changed (); @@ -2569,7 +2569,7 @@ wait_for_inferior (int treat_exec_as_sigtrap) because they can be loaded from the target while in target_wait. This makes remote debugging a bit more efficient for those targets that provide critical registers as part of their normal - status mechanism. */ + status mechanism. */ overlay_cache_invalid = 1; registers_changed (); @@ -2611,14 +2611,14 @@ wait_for_inferior (int treat_exec_as_sigtrap) do_cleanups (old_cleanups); } -/* Asynchronous version of wait_for_inferior. It is called by the +/* Asynchronous version of wait_for_inferior. It is called by the event loop whenever a change of state is detected on the file - descriptor corresponding to the target. It can be called more than - once to complete a single execution command. In such cases we need - to keep the state in a global variable ECSS. If it is the last time + descriptor corresponding to the target. It can be called more than + once to complete a single execution command. In such cases we need + to keep the state in a global variable ECSS. If it is the last time that this function is called for a single execution command, then report to the user that the inferior has stopped, and do the - necessary cleanups. */ + necessary cleanups. */ void fetch_inferior_event (void *client_data) @@ -2645,7 +2645,7 @@ fetch_inferior_event (void *client_data) because they can be loaded from the target while in target_wait. This makes remote debugging a bit more efficient for those targets that provide critical registers as part of their normal - status mechanism. */ + status mechanism. */ overlay_cache_invalid = 1; registers_changed (); @@ -3021,14 +3021,14 @@ handle_inferior_event (struct execution_control_state *ecs) else stop_soon = NO_STOP_QUIETLY; - /* Cache the last pid/waitstatus. */ + /* Cache the last pid/waitstatus. */ target_last_wait_ptid = ecs->ptid; target_last_waitstatus = ecs->ws; /* Always clear state belonging to the previous time we stopped. */ stop_stack_dummy = STOP_NONE; - /* If it's a new process, add it to the thread database */ + /* If it's a new process, add it to the thread database. */ ecs->new_thread_event = (!ptid_equal (ecs->ptid, inferior_ptid) && !ptid_equal (ecs->ptid, minus_one_ptid) @@ -3207,7 +3207,7 @@ handle_inferior_event (struct execution_control_state *ecs) set_current_inferior (find_inferior_pid (ptid_get_pid (ecs->ptid))); set_current_program_space (current_inferior ()->pspace); handle_vfork_child_exec_or_exit (0); - target_terminal_ours (); /* Must do this before mourn anyway */ + target_terminal_ours (); /* Must do this before mourn anyway. */ print_exited_reason (ecs->ws.value.integer); /* Record the exit code in the convenience variable $_exitcode, so @@ -3230,13 +3230,13 @@ handle_inferior_event (struct execution_control_state *ecs) set_current_program_space (current_inferior ()->pspace); handle_vfork_child_exec_or_exit (0); stop_print_frame = 0; - target_terminal_ours (); /* Must do this before mourn anyway */ + target_terminal_ours (); /* Must do this before mourn anyway. */ /* Note: By definition of TARGET_WAITKIND_SIGNALLED, we shouldn't reach here unless the inferior is dead. However, for years target_kill() was called here, which hints that fatal signals aren't really fatal on some systems. If that's true, then some changes - may be needed. */ + may be needed. */ target_mourn_inferior (); print_signal_exited_reason (ecs->ws.value.sig); @@ -3246,7 +3246,7 @@ handle_inferior_event (struct execution_control_state *ecs) return; /* The following are the only cases in which we keep going; - the above cases end in a continue or goto. */ + the above cases end in a continue or goto. */ case TARGET_WAITKIND_FORKED: case TARGET_WAITKIND_VFORKED: if (debug_infrun) @@ -3281,7 +3281,7 @@ handle_inferior_event (struct execution_control_state *ecs) if (singlestep_breakpoints_inserted_p) { - /* Pull the single step breakpoints out of the target. */ + /* Pull the single step breakpoints out of the target. */ remove_single_step_breakpoints (); singlestep_breakpoints_inserted_p = 0; } @@ -3418,7 +3418,7 @@ handle_inferior_event (struct execution_control_state *ecs) if (debug_infrun) fprintf_unfiltered (gdb_stdlog, "infrun: TARGET_WAITKIND_SYSCALL_ENTRY\n"); - /* Getting the current syscall number */ + /* Getting the current syscall number. */ if (handle_syscall_event (ecs) != 0) return; goto process_event_stop_test; @@ -3601,7 +3601,7 @@ handle_inferior_event (struct execution_control_state *ecs) get_regcache_aspace (get_thread_regcache (ecs->ptid)); /* Check if a regular breakpoint has been hit before checking - for a potential single step breakpoint. Otherwise, GDB will + for a potential single step breakpoint. Otherwise, GDB will not see this breakpoint hit when stepping onto breakpoints. */ if (regular_breakpoint_inserted_here_p (aspace, stop_pc)) { @@ -3694,11 +3694,11 @@ handle_inferior_event (struct execution_control_state *ecs) context_switch (ecs->ptid); /* Saw a breakpoint, but it was hit by the wrong thread. - Just continue. */ + Just continue. */ if (singlestep_breakpoints_inserted_p) { - /* Pull the single step breakpoints out of the target. */ + /* Pull the single step breakpoints out of the target. */ remove_single_step_breakpoints (); singlestep_breakpoints_inserted_p = 0; } @@ -3715,7 +3715,7 @@ handle_inferior_event (struct execution_control_state *ecs) the bp's: On HP-UX's that use ttrace, we can't change the address space of a vforking child process until the child exits (well, okay, not - then either :-) or execs. */ + then either :-) or execs. */ if (remove_status != 0) error (_("Cannot step over breakpoint hit in wrong thread")); else @@ -3761,7 +3761,7 @@ handle_inferior_event (struct execution_control_state *ecs) if (singlestep_breakpoints_inserted_p) { - /* Pull the single step breakpoints out of the target. */ + /* Pull the single step breakpoints out of the target. */ remove_single_step_breakpoints (); singlestep_breakpoints_inserted_p = 0; } @@ -3842,7 +3842,7 @@ handle_inferior_event (struct execution_control_state *ecs) { /* We're trying to step off a breakpoint. Turns out that we're also on an instruction that needs to be stepped multiple - times before it's been fully executing. E.g., architectures + times before it's been fully executing. E.g., architectures with a delay slot. It needs to be stepped twice, once for the instruction and once for the delay slot. */ int step_through_delay @@ -3997,7 +3997,7 @@ handle_inferior_event (struct execution_control_state *ecs) /* When we reach this point, we've pretty much decided that the reason for stopping must've been a random - (unexpected) signal. */ + (unexpected) signal. */ else ecs->random_signal = 1; @@ -4379,7 +4379,7 @@ process_event_stop_test: if (ecs->event_thread->stepping_through_solib_after_catch) { #if defined(SOLIB_ADD) - /* Have we reached our destination? If not, keep going. */ + /* Have we reached our destination? If not, keep going. */ if (SOLIB_IN_DYNAMIC_LINKER (PIDGET (ecs->ptid), stop_pc)) { if (debug_infrun) @@ -4393,7 +4393,7 @@ process_event_stop_test: if (debug_infrun) fprintf_unfiltered (gdb_stdlog, "infrun: step past dynamic linker\n"); /* Else, stop and report the catchpoint(s) whose triggering - caused us to begin stepping. */ + caused us to begin stepping. */ ecs->event_thread->stepping_through_solib_after_catch = 0; bpstat_clear (&ecs->event_thread->control.stop_bpstat); ecs->event_thread->control.stop_bpstat @@ -4757,7 +4757,7 @@ process_event_stop_test: /* Only proceed through if we know where it's going. */ if (real_stop_pc) { - /* And put the step-breakpoint there and go until there. */ + /* And put the step-breakpoint there and go until there. */ struct symtab_and_line sr_sal; init_sal (&sr_sal); /* initialize to zeroes */ @@ -5307,7 +5307,7 @@ stop_stepping (struct execution_control_state *ecs) /* This function handles various cases where we need to continue waiting for the inferior. */ -/* (Used to be the keep_going: label in the old wait_for_inferior) */ +/* (Used to be the keep_going: label in the old wait_for_inferior). */ static void keep_going (struct execution_control_state *ecs) @@ -5390,7 +5390,7 @@ keep_going (struct execution_control_state *ecs) halts the simulation handing control to GDB; GDB, noteing that the break-point isn't valid, returns control back to the simulator; the simulator then delivers the hardware - equivalent of a SIGNAL_TRAP to the program being debugged. */ + equivalent of a SIGNAL_TRAP to the program being debugged. */ if (ecs->event_thread->suspend.stop_signal == TARGET_SIGNAL_TRAP && !signal_program[ecs->event_thread->suspend.stop_signal]) @@ -5492,7 +5492,7 @@ print_exited_reason (int exitstatus) } /* Signal received, print why the inferior has stopped. The signal table - tells us to print about it. */ + tells us to print about it. */ static void print_signal_received_reason (enum target_signal siggnal) @@ -5642,7 +5642,7 @@ normal_stop (void) /* Select innermost stack frame - i.e., current frame is frame 0, and current location is based on that. Don't do this on return from a stack dummy routine, - or if the program has exited. */ + or if the program has exited. */ if (!stop_stack_dummy) { @@ -5652,7 +5652,7 @@ normal_stop (void) we have changed functions or hit a breakpoint. Print source line if we have one. bpstat_print() contains the logic deciding in detail - what to print, based on the event(s) that just occurred. */ + what to print, based on the event(s) that just occurred. */ /* If --batch-silent is enabled then there's no need to print the current source location, and to try risks causing an error message about @@ -5687,15 +5687,15 @@ normal_stop (void) && frame_id_eq (tp->control.step_frame_id, get_frame_id (get_current_frame ())) && step_start_function == find_pc_function (stop_pc)) - source_flag = SRC_LINE; /* finished step, just - print source line */ + source_flag = SRC_LINE; /* Finished step, just + print source line. */ else - source_flag = SRC_AND_LOC; /* print location and - source line */ + source_flag = SRC_AND_LOC; /* Print location and + source line. */ break; case PRINT_SRC_AND_LOC: - source_flag = SRC_AND_LOC; /* print location and - source line */ + source_flag = SRC_AND_LOC; /* Print location and + source line. */ break; case PRINT_SRC_ONLY: source_flag = SRC_LINE; @@ -5712,7 +5712,7 @@ normal_stop (void) flag is: SRC_LINE: Print only source line LOCATION: Print only location - SRC_AND_LOC: Print location and source line */ + SRC_AND_LOC: Print location and source line. */ if (do_frame_printing) print_stack_frame (get_selected_frame (NULL), 0, source_flag); @@ -5895,13 +5895,13 @@ handle_command (char *args, int from_tty) error_no_arg (_("signal to handle")); } - /* Allocate and zero an array of flags for which signals to handle. */ + /* Allocate and zero an array of flags for which signals to handle. */ nsigs = (int) TARGET_SIGNAL_LAST; sigs = (unsigned char *) alloca (nsigs); memset (sigs, 0, nsigs); - /* Break the command line up into args. */ + /* Break the command line up into args. */ argv = gdb_buildargv (args); old_chain = make_cleanup_freeargv (argv); @@ -5909,7 +5909,7 @@ handle_command (char *args, int from_tty) /* Walk through the args, looking for signal oursigs, signal names, and actions. Signal numbers and signal names may be interspersed with actions, with the actions being performed for all signals cumulatively - specified. Signal ranges can be specified as -. */ + specified. Signal ranges can be specified as -. */ while (*argv != NULL) { @@ -5923,7 +5923,7 @@ handle_command (char *args, int from_tty) if (wordlen >= 1 && !strncmp (*argv, "all", wordlen)) { /* Apply action to all signals except those used by the - debugger. Silently skip those. */ + debugger. Silently skip those. */ allsigs = 1; sigfirst = 0; siglast = nsigs - 1; @@ -5979,7 +5979,7 @@ handle_command (char *args, int from_tty) } if (sigfirst > siglast) { - /* Bet he didn't figure we'd think of this case... */ + /* Bet he didn't figure we'd think of this case... */ signum = sigfirst; sigfirst = siglast; siglast = signum; @@ -6000,7 +6000,7 @@ handle_command (char *args, int from_tty) } /* If any signal numbers or symbol names were found, set flags for - which signals to apply actions to. */ + which signals to apply actions to. */ for (signum = sigfirst; signum >= 0 && signum <= siglast; signum++) { @@ -6066,7 +6066,7 @@ xdb_handle_command (char *args, int from_tty) if (args == NULL) error_no_arg (_("xdb command")); - /* Break the command line up into args. */ + /* Break the command line up into args. */ argv = gdb_buildargv (args); old_chain = make_cleanup_freeargv (argv); @@ -6515,7 +6515,7 @@ discard_infcall_control_state (struct infcall_control_state *inf_status) inf_status->thread_control.exception_resume_breakpoint->disposition = disp_del_at_next_stop; - /* See save_infcall_control_state for info on stop_bpstat. */ + /* See save_infcall_control_state for info on stop_bpstat. */ bpstat_clear (&inf_status->thread_control.stop_bpstat); xfree (inf_status); diff --git a/gdb/interps.c b/gdb/interps.c index 222d50e30f6..8b74a23cd56 100644 --- a/gdb/interps.c +++ b/gdb/interps.c @@ -18,7 +18,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 . */ + along with this program. If not, see . */ /* This is just a first cut at separating out the "interpreter" functions of gdb into self-contained modules. There are a couple @@ -44,7 +44,7 @@ struct interp { - /* This is the name in "-i=" and set interpreter. */ + /* This is the name in "-i=" and set interpreter. */ const char *name; /* Interpreters are stored in a linked list, this is the next @@ -57,7 +57,7 @@ struct interp object is a bit confused. */ void *data; - /* Has the init_proc been run? */ + /* Has the init_proc been run? */ int inited; /* This is the ui_out used to collect results for this interpreter. @@ -69,12 +69,12 @@ struct interp int quiet_p; }; -/* Functions local to this file. */ +/* Functions local to this file. */ static void initialize_interps (void); static char **interpreter_completer (struct cmd_list_element *cmd, char *text, char *word); -/* The magic initialization routine for this module. */ +/* The magic initialization routine for this module. */ void _initialize_interpreter (void); @@ -88,7 +88,7 @@ static int interpreter_initialized = 0; /* interp_new - This allocates space for a new interpreter, fills the fields from the inputs, and returns a pointer to the - interpreter. */ + interpreter. */ struct interp * interp_new (const char *name, void *data, struct ui_out *uiout, const struct interp_procs *procs) @@ -126,7 +126,7 @@ interp_add (struct interp *interp) init proc is successful, return 1, if it fails, set the old interpreter back in place and return 0. If we can't restore the old interpreter, then raise an internal error, since we are in - pretty bad shape at this point. + pretty bad shape at this point. The TOP_LEVEL parameter tells if this new interpreter is the top-level one. The top-level is what is requested @@ -169,7 +169,7 @@ interp_set (struct interp *interp, int top_level) top_level_interpreter_ptr = interp; /* We use interpreter_p for the "set interpreter" variable, so we need - to make sure we have a malloc'ed copy for the set command to free. */ + to make sure we have a malloc'ed copy for the set command to free. */ if (interpreter_p != NULL && strcmp (current_interpreter->name, interpreter_p) != 0) { @@ -180,7 +180,7 @@ interp_set (struct interp *interp, int top_level) uiout = interp->interpreter_out; - /* Run the init proc. If it fails, try to restore the old interp. */ + /* Run the init proc. If it fails, try to restore the old interp. */ if (!interp->inited) { @@ -206,7 +206,7 @@ interp_set (struct interp *interp, int top_level) /* Finally, put up the new prompt to show that we are indeed here. Also, display_gdb_prompt for the console does some readline magic - which is needed for the console interpreter, at least... */ + which is needed for the console interpreter, at least... */ if (!first_time) { @@ -242,7 +242,7 @@ interp_lookup (const char *name) return NULL; } -/* Returns the current interpreter. */ +/* Returns the current interpreter. */ struct ui_out * interp_ui_out (struct interp *interp) @@ -253,7 +253,7 @@ interp_ui_out (struct interp *interp) return current_interpreter->interpreter_out; } -/* Returns true if the current interp is the passed in name. */ +/* Returns true if the current interp is the passed in name. */ int current_interp_named_p (const char *interp_name) { @@ -312,7 +312,7 @@ interp_set_quiet (struct interp *interp, int quiet) } /* interp_exec - This executes COMMAND_STR in the current - interpreter. */ + interpreter. */ int interp_exec_p (struct interp *interp) { @@ -359,7 +359,7 @@ static void initialize_interps (void) { interpreter_initialized = 1; - /* Don't know if anything needs to be done here... */ + /* Don't know if anything needs to be done here... */ } static void @@ -391,7 +391,7 @@ interpreter_exec_cmd (char *args, int from_tty) if (interp_to_use == NULL) error (_("Could not find interpreter \"%s\"."), prules[0]); - /* Temporarily set interpreters quiet */ + /* Temporarily set interpreters quiet. */ old_quiet = interp_set_quiet (old_interp, 1); use_quiet = interp_set_quiet (interp_to_use, 1); @@ -416,7 +416,7 @@ interpreter_exec_cmd (char *args, int from_tty) interp_set_quiet (old_interp, old_quiet); } -/* List the possible interpreters which could complete the given text. */ +/* List the possible interpreters which could complete the given text. */ static char ** interpreter_completer (struct cmd_list_element *ignore, char *text, char *word) { @@ -428,7 +428,7 @@ interpreter_completer (struct cmd_list_element *ignore, char *text, char *word) /* We expect only a very limited number of interpreters, so just allocate room for all of them plus one for the last that must be NULL - to correctly end the list. */ + to correctly end the list. */ for (interp = interp_list; interp != NULL; interp = interp->next) ++alloced; matches = (char **) xcalloc (alloced + 1, sizeof (char *)); @@ -445,12 +445,12 @@ interpreter_completer (struct cmd_list_element *ignore, char *text, char *word) strcpy (matches[num_matches], interp->name); else if (word > text) { - /* Return some portion of interp->name */ + /* Return some portion of interp->name. */ strcpy (matches[num_matches], interp->name + (word - text)); } else { - /* Return some of text plus interp->name */ + /* Return some of text plus interp->name. */ strncpy (matches[num_matches], word, text - word); matches[num_matches][text - word] = '\0'; strcat (matches[num_matches], interp->name); diff --git a/gdb/interps.h b/gdb/interps.h index 19a690b0166..97559d0acf1 100644 --- a/gdb/interps.h +++ b/gdb/interps.h @@ -18,7 +18,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 . */ + along with this program. If not, see . */ #ifndef INTERPS_H #define INTERPS_H diff --git a/gdb/iq2000-tdep.c b/gdb/iq2000-tdep.c index 5674f94c728..b89d1ece49c 100644 --- a/gdb/iq2000-tdep.c +++ b/gdb/iq2000-tdep.c @@ -84,7 +84,7 @@ insn_addr_from_ptr (CORE_ADDR ptr) /* target_pointer to CORE_ADDR. */ } /* Function: pointer_to_address - Convert a target pointer to an address in host (CORE_ADDR) format. */ + Convert a target pointer to an address in host (CORE_ADDR) format. */ static CORE_ADDR iq2000_pointer_to_address (struct gdbarch *gdbarch, @@ -233,7 +233,7 @@ iq2000_scan_prologue (struct gdbarch *gdbarch, only later do we compute its actual address. Since the offset can be zero, we must first initialize all the saved regs to minus one (so we can later distinguish - between one that's not saved, and one that's saved at zero). */ + between one that's not saved, and one that's saved at zero). */ for (srcreg = 0; srcreg < E_NUM_REGS; srcreg ++) cache->saved_regs[srcreg] = -1; cache->using_fp = 0; @@ -243,7 +243,7 @@ iq2000_scan_prologue (struct gdbarch *gdbarch, { LONGEST insn = read_memory_unsigned_integer (pc, 4, byte_order); /* Skip any instructions writing to (sp) or decrementing the - SP. */ + SP. */ if ((insn & 0xffe00000) == 0xac200000) { /* sw using SP/%1 as base. */ @@ -260,7 +260,7 @@ iq2000_scan_prologue (struct gdbarch *gdbarch, if ((insn & 0xffff8000) == 0x20218000) { /* addi %1, %1, -N == addi %sp, %sp, -N */ - /* LEGACY -- from assembly-only port */ + /* LEGACY -- from assembly-only port. */ found_decr_sp = 1; cache->framesize = -((signed short) (insn & 0xffff)); continue; @@ -284,7 +284,7 @@ iq2000_scan_prologue (struct gdbarch *gdbarch, if (tgtreg == E_SP_REGNUM || tgtreg == E_FP_REGNUM) { - /* "push" to stack (via SP or FP reg) */ + /* "push" to stack (via SP or FP reg). */ if (cache->saved_regs[srcreg] == -1) /* Don't save twice. */ cache->saved_regs[srcreg] = offset; continue; @@ -404,7 +404,8 @@ static struct value * iq2000_frame_prev_register (struct frame_info *this_frame, void **this_cache, int regnum) { - struct iq2000_frame_cache *cache = iq2000_frame_cache (this_frame, this_cache); + struct iq2000_frame_cache *cache = iq2000_frame_cache (this_frame, + this_cache); if (regnum == E_SP_REGNUM && cache->saved_sp) return frame_unwind_got_constant (this_frame, regnum, cache->saved_sp); @@ -423,7 +424,8 @@ static void iq2000_frame_this_id (struct frame_info *this_frame, void **this_cache, struct frame_id *this_id) { - struct iq2000_frame_cache *cache = iq2000_frame_cache (this_frame, this_cache); + struct iq2000_frame_cache *cache = iq2000_frame_cache (this_frame, + this_cache); /* This marks the outermost frame. */ if (cache->base == 0) @@ -462,7 +464,8 @@ iq2000_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame) static CORE_ADDR iq2000_frame_base_address (struct frame_info *this_frame, void **this_cache) { - struct iq2000_frame_cache *cache = iq2000_frame_cache (this_frame, this_cache); + struct iq2000_frame_cache *cache = iq2000_frame_cache (this_frame, + this_cache); return cache->base; } @@ -609,7 +612,7 @@ iq2000_frame_align (struct gdbarch *ignore, CORE_ADDR sp) } /* Convenience function to check 8-byte types for being a scalar type - or a struct with only one long long or double member. */ + or a struct with only one long long or double member. */ static int iq2000_pass_8bytetype_by_address (struct type *type) { @@ -637,7 +640,7 @@ iq2000_pass_8bytetype_by_address (struct type *type) if (TYPE_CODE (ftype) == TYPE_CODE_FLT || TYPE_CODE (ftype) == TYPE_CODE_INT) return 0; - /* Everything else, pass by address. */ + /* Everything else, pass by address. */ return 1; } @@ -653,10 +656,10 @@ iq2000_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct type *type; int i, argreg, typelen, slacklen; int stackspace = 0; - /* Used to copy struct arguments into the stack. */ + /* Used to copy struct arguments into the stack. */ CORE_ADDR struct_ptr; - /* First determine how much stack space we will need. */ + /* First determine how much stack space we will need. */ for (i = 0, argreg = E_1ST_ARGREG + (struct_return != 0); i < nargs; i++) { type = value_type (args[i]); @@ -675,19 +678,19 @@ iq2000_push_dummy_call (struct gdbarch *gdbarch, struct value *function, { /* long long, double, and possibly - structs with a single field of long long or double. */ + structs with a single field of long long or double. */ if (argreg <= E_LAST_ARGREG - 1) { /* 8-byte arg goes into a register pair - (must start with an even-numbered reg) */ + (must start with an even-numbered reg). */ if (((argreg - E_1ST_ARGREG) % 2) != 0) argreg ++; argreg += 2; } else { - argreg = E_LAST_ARGREG + 1; /* no more argregs. */ - /* 8-byte arg goes on stack, must be 8-byte aligned. */ + argreg = E_LAST_ARGREG + 1; /* no more argregs. */ + /* 8-byte arg goes on stack, must be 8-byte aligned. */ stackspace = ((stackspace + 7) & ~7); stackspace += 8; } @@ -696,7 +699,7 @@ iq2000_push_dummy_call (struct gdbarch *gdbarch, struct value *function, { /* Structs are passed as pointer to a copy of the struct. So we need room on the stack for a copy of the struct - plus for the argument pointer. */ + plus for the argument pointer. */ if (argreg <= E_LAST_ARGREG) argreg++; else @@ -707,7 +710,7 @@ iq2000_push_dummy_call (struct gdbarch *gdbarch, struct value *function, } /* Now copy params, in ascending order, into their assigned location - (either in a register or on the stack). */ + (either in a register or on the stack). */ sp -= (sp % 8); /* align */ struct_ptr = sp; @@ -718,7 +721,7 @@ iq2000_push_dummy_call (struct gdbarch *gdbarch, struct value *function, argreg = E_1ST_ARGREG; if (struct_return) { - /* A function that returns a struct will consume one argreg to do so. + /* A function that returns a struct will consume one argreg to do so. */ regcache_cooked_write_unsigned (regcache, argreg++, struct_addr); } @@ -730,18 +733,18 @@ iq2000_push_dummy_call (struct gdbarch *gdbarch, struct value *function, val = value_contents (args[i]); if (typelen <= 4) { - /* Char, short, int, float, pointer, and structs <= four bytes. */ + /* Char, short, int, float, pointer, and structs <= four bytes. */ slacklen = (4 - (typelen % 4)) % 4; memset (buf, 0, sizeof (buf)); memcpy (buf + slacklen, val, typelen); if (argreg <= E_LAST_ARGREG) { - /* Passed in a register. */ + /* Passed in a register. */ regcache_raw_write (regcache, argreg++, buf); } else { - /* Passed on the stack. */ + /* Passed on the stack. */ write_memory (sp + stackspace, buf, 4); stackspace += 4; } @@ -749,11 +752,11 @@ iq2000_push_dummy_call (struct gdbarch *gdbarch, struct value *function, else if (typelen == 8 && !iq2000_pass_8bytetype_by_address (type)) { /* (long long), (double), or struct consisting of - a single (long long) or (double). */ + a single (long long) or (double). */ if (argreg <= E_LAST_ARGREG - 1) { /* 8-byte arg goes into a register pair - (must start with an even-numbered reg) */ + (must start with an even-numbered reg). */ if (((argreg - E_1ST_ARGREG) % 2) != 0) argreg++; regcache_raw_write (regcache, argreg++, val); @@ -761,8 +764,8 @@ iq2000_push_dummy_call (struct gdbarch *gdbarch, struct value *function, } else { - /* 8-byte arg goes on stack, must be 8-byte aligned. */ - argreg = E_LAST_ARGREG + 1; /* no more argregs. */ + /* 8-byte arg goes on stack, must be 8-byte aligned. */ + argreg = E_LAST_ARGREG + 1; /* no more argregs. */ stackspace = ((stackspace + 7) & ~7); write_memory (sp + stackspace, val, typelen); stackspace += 8; @@ -786,13 +789,13 @@ iq2000_push_dummy_call (struct gdbarch *gdbarch, struct value *function, } } - /* Store return address. */ + /* Store return address. */ regcache_cooked_write_unsigned (regcache, E_LR_REGNUM, bp_addr); /* Update stack pointer. */ regcache_cooked_write_unsigned (regcache, E_SP_REGNUM, sp); - /* And that should do it. Return the new stack pointer. */ + /* And that should do it. Return the new stack pointer. */ return sp; } @@ -854,7 +857,7 @@ iq2000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Function: _initialize_iq2000_tdep Initializer function for the iq2000 module. - Called by gdb at start-up. */ + Called by gdb at start-up. */ /* Provide a prototype to silence -Wmissing-prototypes. */ extern initialize_file_ftype _initialize_iq2000_tdep; diff --git a/gdb/irix5-nat.c b/gdb/irix5-nat.c index f9d36722cb5..f0738d4febd 100644 --- a/gdb/irix5-nat.c +++ b/gdb/irix5-nat.c @@ -36,7 +36,7 @@ #include #include /* For JB_XXX. */ -/* Prototypes for supply_gregset etc. */ +/* Prototypes for supply_gregset etc. */ #include "gregset.h" #include "mips-tdep.h" @@ -147,7 +147,7 @@ supply_fpregset (struct regcache *regcache, const fpregset_t *fpregsetp) char fsrbuf[8]; struct gdbarch *gdbarch = get_regcache_arch (regcache); - /* FIXME, this is wrong for the N32 ABI which has 64 bit FP regs. */ + /* FIXME, this is wrong for the N32 ABI which has 64 bit FP regs. */ for (regi = 0; regi < 32; regi++) regcache_raw_supply (regcache, gdbarch_fp0_regnum (gdbarch) + regi, @@ -164,20 +164,21 @@ supply_fpregset (struct regcache *regcache, const fpregset_t *fpregsetp) regcache_raw_supply (regcache, mips_regnum (gdbarch)->fp_control_status, fsrbuf); - /* FIXME: how can we supply FCRIR? SGI doesn't tell us. */ + /* FIXME: how can we supply FCRIR? SGI doesn't tell us. */ regcache_raw_supply (regcache, mips_regnum (gdbarch)->fp_implementation_revision, zerobuf); } void -fill_fpregset (const struct regcache *regcache, fpregset_t *fpregsetp, int regno) +fill_fpregset (const struct regcache *regcache, + fpregset_t *fpregsetp, int regno) { int regi; char *from, *to; struct gdbarch *gdbarch = get_regcache_arch (regcache); - /* FIXME, this is wrong for the N32 ABI which has 64 bit FP regs. */ + /* FIXME, this is wrong for the N32 ABI which has 64 bit FP regs. */ for (regi = gdbarch_fp0_regnum (gdbarch); regi < gdbarch_fp0_regnum (gdbarch) + 32; regi++) @@ -248,7 +249,7 @@ fetch_core_registers (struct regcache *regcache, } /* Register that we are able to handle irix5 core file formats. - This really is bfd_target_unknown_flavour */ + This really is bfd_target_unknown_flavour. */ static struct core_fns irix5_core_fns = { diff --git a/gdb/jit.c b/gdb/jit.c index cadd7f6dc11..39693b05b80 100644 --- a/gdb/jit.c +++ b/gdb/jit.c @@ -146,7 +146,8 @@ bfd_open_from_target_memory (CORE_ADDR addr, ULONGEST size, char *target) mem_bfd_iovec_stat); } -/* Helper function for reading the global JIT descriptor from remote memory. */ +/* Helper function for reading the global JIT descriptor from remote + memory. */ static void jit_read_descriptor (struct gdbarch *gdbarch, @@ -296,7 +297,8 @@ JITed symbol file is not an object file, ignoring it.\n")); discard_cleanups (old_cleanups); } -/* This function unregisters JITed code and frees the corresponding objfile. */ +/* This function unregisters JITed code and frees the corresponding + objfile. */ static void jit_unregister_code (struct objfile *objfile) @@ -372,8 +374,8 @@ jit_inferior_init (struct gdbarch *gdbarch) "jit_inferior_init, jit_descriptor_addr = %s\n", paddress (gdbarch, jit_descriptor_addr)); - /* Read the descriptor so we can check the version number and load any already - JITed functions. */ + /* Read the descriptor so we can check the version number and load + any already JITed functions. */ jit_read_descriptor (gdbarch, &descriptor); /* Check that the version number agrees with that we support. */ @@ -383,8 +385,8 @@ jit_inferior_init (struct gdbarch *gdbarch) /* Put a breakpoint in the registration symbol. */ create_jit_event_breakpoint (gdbarch, reg_addr); - /* If we've attached to a running program, we need to check the descriptor to - register any functions that were already generated. */ + /* If we've attached to a running program, we need to check the descriptor + to register any functions that were already generated. */ for (cur_entry_addr = descriptor.first_entry; cur_entry_addr != 0; cur_entry_addr = cur_entry.next_entry) @@ -425,9 +427,9 @@ jit_inferior_created_observer (struct target_ops *objfile, int from_tty) jit_inferior_init (target_gdbarch); } -/* This function cleans up any code entries left over when the inferior exits. - We get left over code when the inferior exits without unregistering its code, - for example when it crashes. */ +/* This function cleans up any code entries left over when the + inferior exits. We get left over code when the inferior exits + without unregistering its code, for example when it crashes. */ static void jit_inferior_exit_hook (struct inferior *inf) @@ -456,7 +458,7 @@ jit_event_handler (struct gdbarch *gdbarch) jit_read_descriptor (gdbarch, &descriptor); entry_addr = descriptor.relevant_entry; - /* Do the corresponding action. */ + /* Do the corresponding action. */ switch (descriptor.action_flag) { case JIT_NOACTION: @@ -468,7 +470,8 @@ jit_event_handler (struct gdbarch *gdbarch) case JIT_UNREGISTER: objf = jit_find_objf_with_entry_addr (entry_addr); if (objf == NULL) - printf_unfiltered (_("Unable to find JITed code entry at address: %s\n"), + printf_unfiltered (_("Unable to find JITed code " + "entry at address: %s\n"), paddress (gdbarch, entry_addr)); else jit_unregister_code (objf); @@ -487,10 +490,10 @@ extern void _initialize_jit (void); void _initialize_jit (void) { - add_setshow_zinteger_cmd ("jit", class_maintenance, &jit_debug, _("\ -Set JIT debugging."), _("\ -Show JIT debugging."), _("\ -When non-zero, JIT debugging is enabled."), + add_setshow_zinteger_cmd ("jit", class_maintenance, &jit_debug, + _("Set JIT debugging."), + _("Show JIT debugging."), + _("When non-zero, JIT debugging is enabled."), NULL, show_jit_debug, &setdebuglist, &showdebuglist); diff --git a/gdb/jit.h b/gdb/jit.h index 8187d52e7b5..73a14147ec0 100644 --- a/gdb/jit.h +++ b/gdb/jit.h @@ -20,9 +20,9 @@ #ifndef JIT_H #define JIT_H -/* When the JIT breakpoint fires, the inferior wants us to take one of these - actions. These values are used by the inferior, so the values of these enums - cannot be changed. */ +/* When the JIT breakpoint fires, the inferior wants us to take one of + these actions. These values are used by the inferior, so the + values of these enums cannot be changed. */ typedef enum { @@ -31,11 +31,12 @@ typedef enum JIT_UNREGISTER } jit_actions_t; -/* This struct describes a single symbol file in a linked list of symbol files - describing generated code. As the inferior generates code, it adds these - entries to the list, and when we attach to the inferior, we read them all. - For the first element prev_entry should be NULL, and for the last element - next_entry should be NULL. */ +/* This struct describes a single symbol file in a linked list of + symbol files describing generated code. As the inferior generates + code, it adds these entries to the list, and when we attach to the + inferior, we read them all. For the first element prev_entry + should be NULL, and for the last element next_entry should be + NULL. */ struct jit_code_entry { @@ -46,11 +47,12 @@ struct jit_code_entry }; /* This is the global descriptor that the inferior uses to communicate - information to the debugger. To alert the debugger to take an action, the - inferior sets the action_flag to the appropriate enum value, updates - relevant_entry to point to the relevant code entry, and calls the function at - the well-known symbol with our breakpoint. We then read this descriptor from - another global well-known symbol. */ + information to the debugger. To alert the debugger to take an + action, the inferior sets the action_flag to the appropriate enum + value, updates relevant_entry to point to the relevant code entry, + and calls the function at the well-known symbol with our + breakpoint. We then read this descriptor from another global + well-known symbol. */ struct jit_descriptor { @@ -62,9 +64,10 @@ struct jit_descriptor CORE_ADDR first_entry; }; -/* Looks for the descriptor and registration symbols and breakpoints the - registration function. If it finds both, it registers all the already JITed - code. If it has already found the symbols, then it doesn't try again. */ +/* Looks for the descriptor and registration symbols and breakpoints + the registration function. If it finds both, it registers all the + already JITed code. If it has already found the symbols, then it + doesn't try again. */ extern void jit_inferior_created_hook (void); @@ -72,8 +75,8 @@ extern void jit_inferior_created_hook (void); extern void jit_breakpoint_re_set (void); -/* This function is called by handle_inferior_event when it decides that the JIT - event breakpoint has fired. */ +/* This function is called by handle_inferior_event when it decides + that the JIT event breakpoint has fired. */ extern void jit_event_handler (struct gdbarch *gdbarch); diff --git a/gdb/jv-exp.y b/gdb/jv-exp.y index 1088694518b..80d440801f4 100644 --- a/gdb/jv-exp.y +++ b/gdb/jv-exp.y @@ -57,7 +57,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 java_maxdepth #define yyparse java_parse @@ -337,7 +337,7 @@ QualifiedName: { $$.length = $1.length + $3.length + 1; if ($1.ptr + $1.length + 1 == $3.ptr && $1.ptr[$1.length] == '.') - $$.ptr = $1.ptr; /* Optimization. */ + $$.ptr = $1.ptr; /* Optimization. */ else { $$.ptr = (char *) malloc ($$.length + 1); @@ -495,7 +495,7 @@ PostfixExpression: | Name { push_expression_name ($1); } | VARIABLE - /* Already written by write_dollar_variable. */ + /* Already written by write_dollar_variable. */ | PostIncrementExpression | PostDecrementExpression ; @@ -555,7 +555,7 @@ CastExpression: error (_("Invalid cast expression")); type = expout->elts[base+1].type; /* Remove the 'Expression' and slide the - UnaryExpressionNotPlusMinus down to replace it. */ + UnaryExpressionNotPlusMinus down to replace it. */ for (i = 0; i < last_exp_size; i++) expout->elts[base + i] = expout->elts[base + i + 3]; expout_ptr -= 3; @@ -673,7 +673,7 @@ LeftHandSide: ForcedName { push_expression_name ($1); } | VARIABLE - /* Already written by write_dollar_variable. */ + /* Already written by write_dollar_variable. */ | FieldAccess | ArrayAccess ; @@ -763,7 +763,7 @@ parse_number (char *p, int len, int parsed_float, YYSTYPE *putithere) } c = p[len-1]; - /* A paranoid calculation of (1<<64)-1. */ + /* A paranoid calculation of (1<<64)-1. */ limit = (ULONGEST)0xffffffff; limit = ((limit << 16) << 16) | limit; if (c == 'l' || c == 'L') @@ -896,7 +896,7 @@ yylex (void) case '\'': /* We either have a character constant ('0' or '\177' for example) or we have a quoted symbol reference ('foo(int,int)' in C++ - for example). */ + for example). */ lexptr++; c = *lexptr++; if (c == '\\') @@ -945,7 +945,7 @@ yylex (void) case '.': /* Might be a floating point number. */ if (lexptr[1] < '0' || lexptr[1] > '9') - goto symbol; /* Nope, must be a symbol. */ + goto symbol; /* Nope, must be a symbol. */ /* FALL THRU into number case. */ case '0': @@ -1050,7 +1050,7 @@ yylex (void) do { /* Grow the static temp buffer if necessary, including allocating - the first one on demand. */ + the first one on demand. */ if (tempbufindex + 1 >= tempbufsize) { tempbuf = (char *) realloc (tempbuf, tempbufsize += 64); @@ -1059,7 +1059,7 @@ yylex (void) { case '\0': case '"': - /* Do nothing, loop will terminate. */ + /* Do nothing, loop will terminate. */ break; case '\\': tokptr++; @@ -1216,7 +1216,7 @@ java_type_from_name (struct stoken name) } /* If NAME is a valid variable name in this scope, push it and return 1. - Otherwise, return 0. */ + Otherwise, return 0. */ static int push_variable (struct stoken name) @@ -1262,7 +1262,7 @@ push_variable (struct stoken name) /* Assuming a reference expression has been pushed, emit the STRUCTOP_PTR ops to access the field named NAME. If NAME is a - qualified name (has '.'), generate a field access for each part. */ + qualified name (has '.'), generate a field access for each part. */ static void push_fieldnames (struct stoken name) @@ -1274,7 +1274,7 @@ push_fieldnames (struct stoken name) { if (i == name.length || name.ptr[i] == '.') { - /* token.ptr is start of current field name. */ + /* token.ptr is start of current field name. */ token.length = &name.ptr[i] - token.ptr; write_exp_elt_opcode (STRUCTOP_PTR); write_exp_string (token); @@ -1353,7 +1353,7 @@ push_qualified_expression_name (struct stoken name, int dot_index) } /* Handle Name in an expression (or LHS). - Handle VAR, TYPE, TYPE.FIELD1....FIELDN and VAR.FIELD1....FIELDN. */ + Handle VAR, TYPE, TYPE.FIELD1....FIELDN and VAR.FIELD1....FIELDN. */ static void push_expression_name (struct stoken name) @@ -1366,13 +1366,13 @@ push_expression_name (struct stoken name) { if (name.ptr[i] == '.') { - /* It's a Qualified Expression Name. */ + /* It's a Qualified Expression Name. */ push_qualified_expression_name (name, i); return; } } - /* It's a Simple Expression Name. */ + /* It's a Simple Expression Name. */ if (push_variable (name)) return; diff --git a/gdb/jv-lang.c b/gdb/jv-lang.c index 16e29376263..c854ea9c005 100644 --- a/gdb/jv-lang.c +++ b/gdb/jv-lang.c @@ -61,11 +61,11 @@ static const struct objfile_data *jv_type_objfile_data_key; /* This objfile contains symtabs that have been dynamically created to record dynamically loaded Java classes and dynamically - compiled java methods. */ + compiled java methods. */ static struct objfile *dynamics_objfile = NULL; -/* symtab contains classes read from the inferior. */ +/* symtab contains classes read from the inferior. */ static struct symtab *class_symtab = NULL; @@ -129,7 +129,7 @@ get_java_class_symtab (struct gdbarch *gdbarch) BLOCKVECTOR_NBLOCKS (bv) = 1; BLOCKVECTOR (class_symtab) = bv; - /* Allocate dummy STATIC_BLOCK. */ + /* Allocate dummy STATIC_BLOCK. */ bl = allocate_block (&objfile->objfile_obstack); BLOCK_DICT (bl) = dict_create_linear (&objfile->objfile_obstack, NULL); @@ -190,12 +190,12 @@ java_lookup_class (char *name) sym = lookup_symbol (name, expression_context_block, STRUCT_DOMAIN, NULL); if (sym != NULL) return SYMBOL_TYPE (sym); - /* FIXME - should search inferior's symbol table. */ + /* FIXME - should search inferior's symbol table. */ return NULL; } /* Return a nul-terminated string (allocated on OBSTACK) for - a name given by NAME (which has type Utf8Const*). */ + a name given by NAME (which has type Utf8Const*). */ char * get_java_utf8_name (struct obstack *obstack, struct value *name) @@ -234,13 +234,14 @@ java_class_from_object (struct value *obj_val) static int java_class_is_primitive (struct value *clas) { - struct value *vtable = value_struct_elt (&clas, NULL, "vtable", NULL, "struct"); + struct value *vtable = value_struct_elt (&clas, NULL, "vtable", + NULL, "struct"); CORE_ADDR i = value_as_address (vtable); return (int) (i & 0x7fffffff) == (int) 0x7fffffff; } -/* Read a GCJ Class object, and generated a gdb (TYPE_CODE_STRUCT) type. */ +/* Read a GCJ Class object, and generated a gdb (TYPE_CODE_STRUCT) type. */ struct type * type_from_class (struct gdbarch *gdbarch, struct value *clas) @@ -273,8 +274,8 @@ type_from_class (struct gdbarch *gdbarch, struct value *clas) return java_primitive_type (gdbarch, value_as_long (sig)); } - /* Get Class name. */ - /* if clasloader non-null, prepend loader address. FIXME */ + /* Get Class name. */ + /* If clasloader non-null, prepend loader address. FIXME */ temp = clas; utf8_name = value_struct_elt (&temp, NULL, "name", NULL, "structure"); name = get_java_utf8_name (&objfile->objfile_obstack, utf8_name); @@ -303,9 +304,10 @@ type_from_class (struct gdbarch *gdbarch, struct value *clas) name[namelen] = '\0'; is_array = 1; temp = clas; - /* Set array element type. */ + /* Set array element type. */ temp = value_struct_elt (&temp, NULL, "methods", NULL, "structure"); - deprecated_set_value_type (temp, lookup_pointer_type (value_type (clas))); + deprecated_set_value_type (temp, + lookup_pointer_type (value_type (clas))); TYPE_TARGET_TYPE (type) = type_from_class (gdbarch, temp); } @@ -316,7 +318,7 @@ type_from_class (struct gdbarch *gdbarch, struct value *clas) return java_link_class_type (gdbarch, type, clas); } -/* Fill in class TYPE with data from the CLAS value. */ +/* Fill in class TYPE with data from the CLAS value. */ static struct type * java_link_class_type (struct gdbarch *gdbarch, @@ -358,13 +360,15 @@ java_link_class_type (struct gdbarch *gdbarch, ninterfaces = 0; #else temp = clas; - ninterfaces = value_as_long (value_struct_elt (&temp, NULL, "interface_len", NULL, "structure")); + ninterfaces = value_as_long (value_struct_elt (&temp, NULL, "interface_len", + NULL, "structure")); #endif TYPE_N_BASECLASSES (type) = (tsuper == NULL ? 0 : 1) + ninterfaces; temp = clas; - nfields = value_as_long (value_struct_elt (&temp, NULL, "field_count", NULL, "structure")); + nfields = value_as_long (value_struct_elt (&temp, NULL, "field_count", + NULL, "structure")); nfields += TYPE_N_BASECLASSES (type); - nfields++; /* Add one for dummy "class" field. */ + nfields++; /* Add one for dummy "class" field. */ TYPE_NFIELDS (type) = nfields; TYPE_FIELDS (type) = (struct field *) TYPE_ALLOC (type, sizeof (struct field) * nfields); @@ -398,17 +402,18 @@ java_link_class_type (struct gdbarch *gdbarch, if (i > 2 && name[i - 1] == ']' && tsuper != NULL) { /* FIXME */ - TYPE_LENGTH (type) = TYPE_LENGTH (tsuper) + 4; /* size with "length" */ + TYPE_LENGTH (type) = TYPE_LENGTH (tsuper) + 4; /* size with "length" */ } else { temp = clas; - temp = value_struct_elt (&temp, NULL, "size_in_bytes", NULL, "structure"); + temp = value_struct_elt (&temp, NULL, "size_in_bytes", + NULL, "structure"); TYPE_LENGTH (type) = value_as_long (temp); } fields = NULL; - nfields--; /* First set up dummy "class" field. */ + nfields--; /* First set up dummy "class" field. */ SET_FIELD_PHYSADDR (TYPE_FIELD (type, nfields), value_address (clas)); TYPE_FIELD_NAME (type, nfields) = "class"; TYPE_FIELD_TYPE (type, nfields) = value_type (clas); @@ -426,7 +431,7 @@ java_link_class_type (struct gdbarch *gdbarch, field = value_ind (fields); } else - { /* Re-use field value for next field. */ + { /* Re-use field value for next field. */ CORE_ADDR addr = value_address (field) + TYPE_LENGTH (value_type (field)); @@ -497,11 +502,12 @@ java_link_class_type (struct gdbarch *gdbarch, if (methods == NULL) { temp = clas; - methods = value_struct_elt (&temp, NULL, "methods", NULL, "structure"); + methods = value_struct_elt (&temp, NULL, "methods", + NULL, "structure"); method = value_ind (methods); } else - { /* Re-use method value for next method. */ + { /* Re-use method value for next method. */ CORE_ADDR addr = value_address (method) + TYPE_LENGTH (value_type (method)); @@ -509,7 +515,7 @@ java_link_class_type (struct gdbarch *gdbarch, set_value_lazy (method, 1); } - /* Get method name. */ + /* Get method name. */ temp = method; temp = value_struct_elt (&temp, NULL, "name", NULL, "structure"); mname = get_java_utf8_name (&objfile->objfile_obstack, temp); @@ -525,7 +531,7 @@ java_link_class_type (struct gdbarch *gdbarch, for (k = 0, j = TYPE_NFN_FIELDS (type);;) { if (--j < 0) - { /* No match - new method name. */ + { /* No match - new method name. */ j = TYPE_NFN_FIELDS (type)++; fn_fieldlists[j].name = mname; fn_fieldlists[j].length = 1; @@ -534,15 +540,15 @@ java_link_class_type (struct gdbarch *gdbarch, break; } if (strcmp (mname, fn_fieldlists[j].name) == 0) - { /* Found an existing method with the same name. */ + { /* Found an existing method with the same name. */ int l; if (mname != unqualified_name) obstack_free (&objfile->objfile_obstack, mname); mname = fn_fieldlists[j].name; fn_fieldlists[j].length++; - k = i - k; /* Index of new slot. */ - /* Shift intervening fn_fields (between k and i) down. */ + k = i - k; /* Index of new slot. */ + /* Shift intervening fn_fields (between k and i) down. */ for (l = i; l > k; l--) fn_fields[l] = fn_fields[l - 1]; for (l = TYPE_NFN_FIELDS (type); --l > j;) @@ -632,7 +638,8 @@ is_object_type (struct type *type) name = TYPE_TAG_NAME (ttype); if (name != NULL && strcmp (name, "java.lang.Object") == 0) return 1; - name = TYPE_NFIELDS (ttype) > 0 ? TYPE_FIELD_NAME (ttype, 0) : (char *) 0; + name + = TYPE_NFIELDS (ttype) > 0 ? TYPE_FIELD_NAME (ttype, 0) : (char *) 0; if (name != NULL && strcmp (name, "vtable") == 0) { if (java_object_type == NULL) @@ -673,7 +680,7 @@ java_primitive_type (struct gdbarch *gdbarch, int signature) } /* If name[0 .. namelen-1] is the name of a primitive Java type, - return that type. Otherwise, return NULL. */ + return that type. Otherwise, return NULL. */ struct type * java_primitive_type_from_name (struct gdbarch *gdbarch, @@ -748,7 +755,7 @@ java_primitive_type_name (int signature) } /* Return the length (in bytes) of demangled name of the Java type - signature string SIGNATURE. */ + signature string SIGNATURE. */ static int java_demangled_signature_length (char *signature) @@ -756,18 +763,19 @@ java_demangled_signature_length (char *signature) int array = 0; for (; *signature == '['; signature++) - array += 2; /* Two chars for "[]". */ + array += 2; /* Two chars for "[]". */ switch (signature[0]) { case 'L': - /* Subtract 2 for 'L' and ';'. */ + /* Subtract 2 for 'L' and ';'. */ return strlen (signature) - 2 + array; default: return strlen (java_primitive_type_name (signature[0])) + array; } } -/* Demangle the Java type signature SIGNATURE, leaving the result in RESULT. */ +/* Demangle the Java type signature SIGNATURE, leaving the result in + RESULT. */ static void java_demangled_signature_copy (char *result, char *signature) @@ -784,7 +792,7 @@ java_demangled_signature_copy (char *result, char *signature) switch (signature[0]) { case 'L': - /* Subtract 2 for 'L' and ';', but add 1 for final nul. */ + /* Subtract 2 for 'L' and ';', but add 1 for final nul. */ signature++; ptr = result; for (; *signature != ';' && *signature != '\0'; signature++) @@ -810,7 +818,7 @@ java_demangled_signature_copy (char *result, char *signature) } /* Return the demangled name of the Java type signature string SIGNATURE, - as a freshly allocated copy. */ + as a freshly allocated copy. */ char * java_demangle_type_signature (char *signature) @@ -824,21 +832,21 @@ java_demangle_type_signature (char *signature) } /* Return the type of TYPE followed by DIMS pairs of [ ]. - If DIMS == 0, TYPE is returned. */ + If DIMS == 0, TYPE is returned. */ struct type * java_array_type (struct type *type, int dims) { while (dims-- > 0) { - /* FIXME This is bogus! Java arrays are not gdb arrays! */ + /* FIXME This is bogus! Java arrays are not gdb arrays! */ type = lookup_array_range_type (type, 0, 0); } return type; } -/* Create a Java string in the inferior from a (Utf8) literal. */ +/* Create a Java string in the inferior from a (Utf8) literal. */ static struct value * java_value_string (char *ptr, int len) @@ -848,7 +856,7 @@ java_value_string (char *ptr, int len) /* Print the character C on STREAM as part of the contents of a literal string whose delimiter is QUOTER. Note that that format for printing - characters and strings is language specific. */ + characters and strings is language specific. */ static void java_emit_char (int c, struct type *type, struct ui_file *stream, int quoter) @@ -921,7 +929,7 @@ evaluate_subexp_java (struct type *expect_type, struct expression *exp, goto nosideret; /* If the user attempts to subscript something that is not an array or pointer type (like a plain int variable for example), - then report this as an error. */ + then report this as an error. */ arg1 = coerce_ref (arg1); type = check_typedef (value_type (arg1)); @@ -942,7 +950,7 @@ evaluate_subexp_java (struct type *expect_type, struct expression *exp, struct value *clas = java_class_from_object (arg1); struct value *temp = clas; - /* Get CLASS_ELEMENT_TYPE of the array type. */ + /* Get CLASS_ELEMENT_TYPE of the array type. */ temp = value_struct_elt (&temp, NULL, "methods", NULL, "structure"); deprecated_set_value_type (temp, value_type (clas)); @@ -985,7 +993,7 @@ evaluate_subexp_java (struct type *expect_type, struct expression *exp, case STRUCTOP_PTR: arg1 = evaluate_subexp_standard (expect_type, exp, pos, noside); - /* Convert object field (such as TYPE.class) to reference. */ + /* Convert object field (such as TYPE.class) to reference. */ if (TYPE_CODE (value_type (arg1)) == TYPE_CODE_STRUCT) arg1 = value_addr (arg1); return arg1; diff --git a/gdb/jv-lang.h b/gdb/jv-lang.h index fb33d3c2cc6..9694107eb79 100644 --- a/gdb/jv-lang.h +++ b/gdb/jv-lang.h @@ -23,7 +23,7 @@ struct value; -extern int java_parse (void); /* Defined in jv-exp.y */ +extern int java_parse (void); /* Defined in jv-exp.y */ extern void java_error (char *); /* Defined in jv-exp.y */ @@ -69,8 +69,8 @@ extern struct type *java_lookup_class (char *); extern int is_object_type (struct type *); /* Defined in jv-typeprint.c */ -extern void java_print_type (struct type *, const char *, struct ui_file *, int, - int); +extern void java_print_type (struct type *, const char *, + struct ui_file *, int, int); extern char *java_demangle_type_signature (char *); diff --git a/gdb/jv-typeprint.c b/gdb/jv-typeprint.c index 1fabe51e69a..0a709e9d977 100644 --- a/gdb/jv-typeprint.c +++ b/gdb/jv-typeprint.c @@ -171,7 +171,7 @@ java_type_print_base (struct type *type, struct ui_file *stream, int show, && is_cplus_marker ((TYPE_FIELD_NAME (type, i))[5])) continue; - /* Don't print the dummy field "class". */ + /* Don't print the dummy field "class". */ if (strncmp (TYPE_FIELD_NAME (type, i), "class", 5) == 0) continue; @@ -197,12 +197,12 @@ java_type_print_base (struct type *type, struct ui_file *stream, int show, fprintf_filtered (stream, ";\n"); } - /* If there are both fields and methods, put a space between. */ + /* If there are both fields and methods, put a space between. */ len = TYPE_NFN_FIELDS (type); if (len) fprintf_filtered (stream, "\n"); - /* Print out the methods */ + /* Print out the methods. */ for (i = 0; i < len; i++) { @@ -346,7 +346,7 @@ java_print_type (struct type *type, const char *varstring, } /* For demangled function names, we have the arglist as part of the name, - so don't print an additional pair of ()'s */ + so don't print an additional pair of ()'s. */ demangled_args = varstring != NULL && strchr (varstring, '(') != NULL; c_type_print_varspec_suffix (type, stream, show, 0, demangled_args); diff --git a/gdb/jv-valprint.c b/gdb/jv-valprint.c index 4fe1de28fd0..d345685f970 100644 --- a/gdb/jv-valprint.c +++ b/gdb/jv-valprint.c @@ -53,7 +53,7 @@ java_value_print (struct value *val, struct ui_file *stream, { CORE_ADDR obj_addr; - /* Get the run-time type, and cast the object into that */ + /* Get the run-time type, and cast the object into that. */ obj_addr = unpack_pointer (type, value_contents (val)); @@ -89,9 +89,9 @@ java_value_print (struct value *val, struct ui_file *stream, if (el_type == NULL) { CORE_ADDR element; - CORE_ADDR next_element = -1; /* dummy initial value */ + CORE_ADDR next_element = -1; /* Dummy initial value. */ - /* Skip object header and length. */ + /* Skip object header and length. */ address += get_java_object_header_size (gdbarch) + 4; while (i < length && things_printed < options->print_max) @@ -177,7 +177,8 @@ java_value_print (struct value *val, struct ui_file *stream, for (reps = 1; i + reps < length; reps++) { set_value_lazy (next_v, 1); - set_value_offset (next_v, value_offset (next_v) + TYPE_LENGTH (el_type)); + set_value_offset (next_v, value_offset (next_v) + + TYPE_LENGTH (el_type)); if (memcmp (value_contents (v), value_contents (next_v), TYPE_LENGTH (el_type)) != 0) break; @@ -205,7 +206,7 @@ java_value_print (struct value *val, struct ui_file *stream, return 0; } - /* If it's type String, print it */ + /* If it's type String, print it. */ if (TYPE_CODE (type) == TYPE_CODE_PTR && TYPE_TARGET_TYPE (type) @@ -225,7 +226,7 @@ java_value_print (struct value *val, struct ui_file *stream, unsigned long count; struct value *mark; - mark = value_mark (); /* Remember start of new values */ + mark = value_mark (); /* Remember start of new values. */ data_val = value_struct_elt (&val, NULL, "data", NULL, NULL); data = value_as_address (data_val); @@ -236,7 +237,7 @@ java_value_print (struct value *val, struct ui_file *stream, count_val = value_struct_elt (&val, NULL, "count", NULL, NULL); count = value_as_address (count_val); - value_free_to_mark (mark); /* Release unnecessary values */ + value_free_to_mark (mark); /* Release unnecessary values. */ char_type = builtin_java_type (gdbarch)->builtin_char; val_print_string (char_type, NULL, data + boffset, count, stream, @@ -486,7 +487,7 @@ java_val_print (struct type *type, const gdb_byte *valaddr, 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. */ struct type *target_type; CORE_ADDR addr; @@ -504,10 +505,11 @@ java_val_print (struct type *type, const gdb_byte *valaddr, { /* Print the unmangled name if desired. */ /* Print vtable entry - we only get here if we ARE using - -fvtable_thunks. (Otherwise, look under TYPE_CODE_STRUCT.) */ + -fvtable_thunks. (Otherwise, look under TYPE_CODE_STRUCT.) */ /* Extract an address, assume that it is unsigned. */ print_address_demangle (gdbarch, - extract_unsigned_integer (valaddr, TYPE_LENGTH (type)), + extract_unsigned_integer (valaddr, + TYPE_LENGTH (type)), stream, demangle); break; } diff --git a/gdb/language.c b/gdb/language.c index 374cdec7e4a..2ff77f55c36 100644 --- a/gdb/language.c +++ b/gdb/language.c @@ -24,7 +24,7 @@ /* This file contains functions that return things that are specific to languages. Each function should examine current_language if necessary, - and return the appropriate result. */ + and return the appropriate result. */ /* FIXME: Most of these would be better organized as macros which return data out of a "language-specific" struct pointer that is set @@ -87,7 +87,7 @@ enum type_check type_check = type_check_off; enum case_mode case_mode = case_mode_auto; enum case_sensitivity case_sensitivity = case_sensitive_on; -/* The current language and language_mode (see language.h) */ +/* The current language and language_mode (see language.h). */ const struct language_defn *current_language = &unknown_language_defn; enum language_mode language_mode = language_mode_auto; @@ -112,20 +112,20 @@ static const char *range; static const char *case_sensitive; /* Warning issued when current_language and the language of the current - frame do not match. */ + frame do not match. */ char lang_frame_mismatch_warn[] = "Warning: the current language does not match this frame."; /* This page contains the functions corresponding to GDB commands - and their helpers. */ + and their helpers. */ /* Show command. Display a warning if the language set - does not match the frame. */ + does not match the frame. */ static void show_language_command (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) { - enum language flang; /* The language of the current frame */ + enum language flang; /* The language of the current frame. */ if (language_mode == language_mode_auto) fprintf_filtered (gdb_stdout, @@ -144,7 +144,7 @@ show_language_command (struct ui_file *file, int from_tty, printf_filtered ("%s\n", lang_frame_mismatch_warn); } -/* Set command. Change the current working language. */ +/* Set command. Change the current working language. */ static void set_language_command (char *ignore, int from_tty, struct cmd_list_element *c) { @@ -188,7 +188,7 @@ set_language_command (char *ignore, int from_tty, struct cmd_list_element *c) } /* Show command. Display a warning if the type setting does - not match the current language. */ + not match the current language. */ static void show_type_command (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) @@ -226,7 +226,7 @@ show_type_command (struct ui_file *file, int from_tty, " does not match the language.\n")); } -/* Set command. Change the setting for type checking. */ +/* Set command. Change the setting for type checking. */ static void set_type_command (char *ignore, int from_tty, struct cmd_list_element *c) { @@ -261,7 +261,7 @@ set_type_command (char *ignore, int from_tty, struct cmd_list_element *c) } /* Show command. Display a warning if the range setting does - not match the current language. */ + not match the current language. */ static void show_range_command (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) @@ -299,7 +299,7 @@ show_range_command (struct ui_file *file, int from_tty, "does not match the language.\n")); } -/* Set command. Change the setting for range checking. */ +/* Set command. Change the setting for range checking. */ static void set_range_command (char *ignore, int from_tty, struct cmd_list_element *c) { @@ -335,7 +335,7 @@ set_range_command (char *ignore, int from_tty, struct cmd_list_element *c) } /* Show command. Display a warning if the case sensitivity setting does - not match the current language. */ + not match the current language. */ static void show_case_command (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) @@ -408,7 +408,7 @@ set_case_command (char *ignore, int from_tty, struct cmd_list_element *c) /* Set the status of range and type checking and case sensitivity based on the current modes and the current language. If SHOW is non-zero, then print out the current language, - type and range checking status. */ + type and range checking status. */ static void set_type_range_case (void) { @@ -422,7 +422,8 @@ set_type_range_case (void) case_sensitivity = current_language->la_case_sensitivity; } -/* Set current language to (enum language) LANG. Returns previous language. */ +/* Set current language to (enum language) LANG. Returns previous + language. */ enum language set_language (enum language lang) @@ -470,7 +471,7 @@ language_info (int quietly) } } -/* Return the result of a binary operation. */ +/* Return the result of a binary operation. */ #if 0 /* Currently unused */ @@ -506,7 +507,7 @@ binop_result_type (struct value *v1, struct value *v2) break; case language_m2: /* If we are doing type-checking, l1 should equal l2, so this is - not needed. */ + not needed. */ return l1 > l2 ? VALUE_TYPE (v1) : VALUE_TYPE (v2); break; } @@ -528,11 +529,11 @@ binop_result_type (struct value *v1, struct value *v2) Note that some of them are not currently dependent upon which language is currently being parsed. For example, floats are the same in C and Modula-2 (ie. the only floating point type has TYPE_CODE of - TYPE_CODE_FLT), while booleans are different. */ + TYPE_CODE_FLT), while booleans are different. */ /* Returns non-zero if its argument is a simple type. This is the same for both Modula-2 and for C. In the C case, TYPE_CODE_CHAR will never occur, - and thus will never cause the failure of the test. */ + and thus will never cause the failure of the test. */ int simple_type (struct type *type) { @@ -555,7 +556,7 @@ simple_type (struct type *type) /* Returns non-zero if its argument is of an ordered type. An ordered type is one in which the elements can be tested for the properties of "greater than", "less than", etc, or for which the - operations "increment" or "decrement" make sense. */ + operations "increment" or "decrement" make sense. */ int ordered_type (struct type *type) { @@ -574,14 +575,14 @@ ordered_type (struct type *type) } } -/* Returns non-zero if the two types are the same */ +/* Returns non-zero if the two types are the same. */ int same_type (struct type *arg1, struct type *arg2) { CHECK_TYPEDEF (type); if (structured_type (arg1) ? !structured_type (arg2) : structured_type (arg2)) - /* One is structured and one isn't */ + /* One is structured and one isn't. */ return 0; else if (structured_type (arg1) && structured_type (arg2)) return arg1 == arg2; @@ -593,7 +594,7 @@ same_type (struct type *arg1, struct type *arg2) return arg1 == arg2; } -/* Returns non-zero if the type is integral */ +/* Returns non-zero if the type is integral. */ int integral_type (struct type *type) { @@ -614,7 +615,7 @@ integral_type (struct type *type) } } -/* Returns non-zero if the value is numeric */ +/* Returns non-zero if the value is numeric. */ int numeric_type (struct type *type) { @@ -630,7 +631,7 @@ numeric_type (struct type *type) } } -/* Returns non-zero if the value is a character type */ +/* Returns non-zero if the value is a character type. */ int character_type (struct type *type) { @@ -653,7 +654,7 @@ character_type (struct type *type) } } -/* Returns non-zero if the value is a string type */ +/* Returns non-zero if the value is a string type. */ int string_type (struct type *type) { @@ -668,14 +669,14 @@ string_type (struct type *type) case language_cplus: case language_d: case language_objc: - /* C does not have distinct string type. */ + /* C does not have distinct string type. */ return (0); default: return (0); } } -/* Returns non-zero if the value is a boolean type */ +/* Returns non-zero if the value is a boolean type. */ int boolean_type (struct type *type) { @@ -699,7 +700,7 @@ boolean_type (struct type *type) return 0; } -/* Returns non-zero if the value is a floating-point type */ +/* Returns non-zero if the value is a floating-point type. */ int float_type (struct type *type) { @@ -708,7 +709,7 @@ float_type (struct type *type) } #endif -/* Returns non-zero if the value is a pointer type */ +/* Returns non-zero if the value is a pointer type. */ int pointer_type (struct type *type) { @@ -717,7 +718,7 @@ pointer_type (struct type *type) } #if 0 -/* Returns non-zero if the value is a structured type */ +/* Returns non-zero if the value is a structured type. */ int structured_type (struct type *type) { @@ -747,9 +748,9 @@ structured_type (struct type *type) #endif /* This page contains functions that return info about - (struct value) values used in GDB. */ + (struct value) values used in GDB. */ -/* Returns non-zero if the value VAL represents a true value. */ +/* Returns non-zero if the value VAL represents a true value. */ int value_true (struct value *val) { @@ -764,14 +765,14 @@ value_true (struct value *val) /* This page contains functions for the printing out of error messages that occur during type- and range- - checking. */ + checking. */ /* These are called when a language fails a type- or range-check. The first argument should be a printf()-style format string, and the rest of the arguments should be its arguments. If [type|range]_check is [type|range]_check_on, an error is printed; if [type|range]_check_warn, a warning; otherwise just the - message. */ + message. */ void type_error (const char *string,...) @@ -826,9 +827,9 @@ range_error (const char *string,...) } -/* This page contains miscellaneous functions */ +/* This page contains miscellaneous functions. */ -/* Return the language enum for a given language string. */ +/* Return the language enum for a given language string. */ enum language language_enum (char *str) @@ -842,7 +843,7 @@ language_enum (char *str) return language_unknown; } -/* Return the language struct for a given language enum. */ +/* Return the language struct for a given language enum. */ const struct language_defn * language_def (enum language lang) @@ -859,7 +860,7 @@ language_def (enum language lang) return NULL; } -/* Return the language as a string */ +/* Return the language as a string. */ char * language_str (enum language lang) { @@ -996,10 +997,10 @@ skip_language_trampoline (struct frame_info *frame, CORE_ADDR pc) return 0; } -/* Return demangled language symbol, or NULL. +/* Return demangled language symbol, or NULL. FIXME: Options are only useful for certain languages and ignored by others, so it would be better to remove them here and have a - more flexible demangler for the languages that need it. + more flexible demangler for the languages that need it. FIXME: Sometimes the demangler is invoked when we don't know the language, so we can't use this everywhere. */ char * @@ -1013,7 +1014,7 @@ language_demangle (const struct language_defn *current_language, /* Return class name from physname or NULL. */ char * -language_class_name_from_physname (const struct language_defn *current_language, +language_class_name_from_physname (const struct language_defn *curr_language, const char *physname) { if (current_language != NULL @@ -1203,7 +1204,8 @@ const struct language_defn unknown_language_defn = LANG_MAGIC }; -/* These two structs define fake entries for the "local" and "auto" options. */ +/* These two structs define fake entries for the "local" and "auto" + options. */ const struct language_defn auto_language_defn = { "auto", @@ -1364,7 +1366,7 @@ language_lookup_primitive_type_by_name (const struct language_defn *la, return (NULL); } -/* Initialize the language routines */ +/* Initialize the language routines. */ void _initialize_language (void) @@ -1378,7 +1380,7 @@ _initialize_language (void) language_gdbarch_data = gdbarch_data_register_post_init (language_gdbarch_post_init); - /* GDB commands for language specific stuff */ + /* GDB commands for language specific stuff. */ add_prefix_cmd ("check", no_class, set_check, _("Set the status of the type/range checker."), @@ -1425,6 +1427,6 @@ For Fortran the default is off; for other languages the default is on."), range = xstrdup ("auto"); case_sensitive = xstrdup ("auto"); - /* Have the above take effect */ + /* Have the above take effect. */ set_language (language_auto); } diff --git a/gdb/language.h b/gdb/language.h index 39b59fc4110..1ff575f1527 100644 --- a/gdb/language.h +++ b/gdb/language.h @@ -24,7 +24,7 @@ #if !defined (LANGUAGE_H) #define LANGUAGE_H 1 -/* Forward decls for prototypes */ +/* Forward decls for prototypes. */ struct value; struct objfile; struct frame_info; @@ -32,7 +32,7 @@ struct expression; struct ui_file; struct value_print_options; -#define MAX_FORTRAN_DIMS 7 /* Maximum number of F77 array dims */ +#define MAX_FORTRAN_DIMS 7 /* Maximum number of F77 array dims. */ /* range_mode == range_mode_auto: range_check set automatically to default of language. @@ -56,8 +56,8 @@ extern enum range_check range_check; /* type_mode == - type_mode_auto: type_check set automatically to default of language - type_mode_manual: type_check set manually by user. */ + type_mode_auto: type_check set automatically to default of language. + type_mode_manual: type_check set manually by user. */ extern enum type_mode { @@ -77,7 +77,7 @@ extern enum type_check type_check; /* case_mode == - case_mode_auto: case_sensitivity set upon selection of scope + case_mode_auto: case_sensitivity set upon selection of scope. case_mode_manual: case_sensitivity set only by user. */ extern enum case_mode @@ -87,8 +87,8 @@ extern enum case_mode case_mode; /* array_ordering == - array_row_major: Arrays are in row major order - array_column_major: Arrays are in column major order.*/ + array_row_major: Arrays are in row major order. + array_column_major: Arrays are in column major order. */ extern enum array_ordering { @@ -98,8 +98,8 @@ array_ordering; /* case_sensitivity == - case_sensitive_on: Case sensitivity in name matching is used - case_sensitive_off: Case sensitivity in name matching is not used */ + case_sensitive_on: Case sensitivity in name matching is used. + case_sensitive_off: Case sensitivity in name matching is not used. */ extern enum case_sensitivity { @@ -109,8 +109,8 @@ case_sensitivity; /* macro_expansion == - macro_expansion_no: No macro expansion is available - macro_expansion_c: C-like macro expansion is available */ + macro_expansion_no: No macro expansion is available. + macro_expansion_c: C-like macro expansion is available. */ enum macro_expansion { @@ -127,7 +127,7 @@ struct language_arch_info expressions, regardless of whether the program being debugged actually defines such a type. */ struct type **primitive_type_vector; - /* Type of elements of strings. */ + /* Type of elements of strings. */ struct type *string_char_type; /* Symbol name of type to use as boolean type, if defined. */ @@ -140,41 +140,41 @@ struct language_arch_info struct language_defn { - /* Name of the language */ + /* Name of the language. */ char *la_name; - /* its symtab language-enum (defs.h) */ + /* its symtab language-enum (defs.h). */ enum language la_language; - /* Default range checking */ + /* Default range checking. */ enum range_check la_range_check; - /* Default type checking */ + /* Default type checking. */ enum type_check la_type_check; - /* Default case sensitivity */ + /* Default case sensitivity. */ enum case_sensitivity la_case_sensitivity; - /* Multi-dimensional array ordering */ + /* Multi-dimensional array ordering. */ enum array_ordering la_array_ordering; /* Style of macro expansion, if any, supported by this language. */ enum macro_expansion la_macro_expansion; /* Definitions related to expression printing, prefixifying, and - dumping */ + dumping. */ const struct exp_descriptor *la_exp_desc; - /* Parser function. */ + /* Parser function. */ int (*la_parser) (void); - /* Parser error function */ + /* Parser error function. */ void (*la_error) (char *); @@ -197,7 +197,7 @@ struct language_defn void (*la_emitchar) (int ch, struct type *chtype, struct ui_file * stream, int quoter); - /* Print a type using syntax appropriate for this language. */ + /* Print a type using syntax appropriate for this language. */ void (*la_print_type) (struct type *, const char *, struct ui_file *, int, int); @@ -237,7 +237,7 @@ struct language_defn const struct value *val, const struct value_print_options *options); - /* Print a top-level value using syntax appropriate for this language. */ + /* Print a top-level value using syntax appropriate for this language. */ int (*la_value_print) (struct value *, struct ui_file *, const struct value_print_options *); @@ -272,16 +272,16 @@ struct language_defn /* Return class name of a mangled method name or NULL. */ char *(*la_class_name_from_physname) (const char *physname); - /* Table for printing expressions */ + /* Table for printing expressions. */ const struct op_print *la_op_print_tab; /* Zero if the language has first-class arrays. True if there are no - array values, and array objects decay to pointers, as in C. */ + array values, and array objects decay to pointers, as in C. */ char c_style_arrays; - /* Index to use for extracting the first element of a string. */ + /* Index to use for extracting the first element of a string. */ char string_lower_bound; /* The list of characters forming word boundaries. */ @@ -318,8 +318,8 @@ struct language_defn void (*la_get_string) (struct value *value, gdb_byte **buffer, int *length, struct type **chartype, const char **charset); - /* Add fields above this point, so the magic number is always last. */ - /* Magic number for compat checking */ + /* Add fields above this point, so the magic number is always last. */ + /* Magic number for compat checking. */ long la_magic; @@ -375,14 +375,14 @@ struct type *language_lookup_primitive_type_by_name (const struct language_defn /* These macros define the behaviour of the expression evaluator. */ -/* Should we strictly type check expressions? */ +/* Should we strictly type check expressions? */ #define STRICT_TYPE (type_check != type_check_off) -/* Should we range check values against the domain of their type? */ +/* Should we range check values against the domain of their type? */ #define RANGE_CHECK (range_check != range_check_off) -/* "cast" really means conversion */ -/* FIXME -- should be a setting in language_defn */ +/* "cast" really means conversion. */ +/* FIXME -- should be a setting in language_defn. */ #define CAST_IS_CONVERSION(LANG) ((LANG)->la_language == language_c || \ (LANG)->la_language == language_cplus || \ (LANG)->la_language == language_objc) @@ -395,7 +395,7 @@ extern enum language set_language (enum language); /* This page contains functions that return things that are specific to languages. Each of these functions is based on the current setting of working_lang, which the user sets - with the "set language" command. */ + with the "set language" command. */ #define LA_PRINT_TYPE(type,varstring,stream,show,level) \ (current_language->la_print_type(type,varstring,stream,show,level)) @@ -426,7 +426,7 @@ extern enum language set_language (enum language); or needs to be printed in another representation. For example, in C the literal form of the character with octal value 141 is 'a' and the "other representation" is '\141'. The "other representation" - is program language dependent. */ + is program language dependent. */ #define PRINT_LITERAL_FORM(c) \ ((c) >= 0x20 \ @@ -455,8 +455,8 @@ extern int pointer_type (struct type *); extern int structured_type (struct type *); -/* Checks Binary and Unary operations for semantic type correctness */ -/* FIXME: Does not appear to be used */ +/* Checks Binary and Unary operations for semantic type correctness. */ +/* FIXME: Does not appear to be used. */ #define unop_type_check(v,o) binop_type_check((v),NULL,(o)) extern void binop_type_check (struct value *, struct value *, int); @@ -485,7 +485,7 @@ extern void add_language (const struct language_defn *); extern enum language get_frame_language (void); /* In stack.c */ -/* Check for a language-specific trampoline. */ +/* Check for a language-specific trampoline. */ extern CORE_ADDR skip_language_trampoline (struct frame_info *, CORE_ADDR pc); diff --git a/gdb/linespec.c b/gdb/linespec.c index ae48de785d4..e801381e083 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -42,11 +42,11 @@ #include "target.h" #include "arch-utils.h" -/* We share this one with symtab.c, but it is not exported widely. */ +/* We share this one with symtab.c, but it is not exported widely. */ extern char *operator_chars (char *, char **); -/* Prototypes for local functions */ +/* Prototypes for local functions. */ static void initialize_defaults (struct symtab **default_symtab, int *default_line); @@ -142,7 +142,7 @@ static struct symtabs_and_lines minsym_found (int funfirstline, struct minimal_symbol *msymbol); -/* Helper functions. */ +/* Helper functions. */ /* Issue a helpful hint on using the command completion feature on single quoted demangled C++ symbols as part of the completion @@ -178,7 +178,7 @@ cplusplus_error (const char *name, const char *fmt, ...) } /* Return the number of methods described for TYPE, including the - methods from types it derives from. This can't be done in the symbol + methods from types it derives from. This can't be done in the symbol reader because the type of the baseclass might still be stubbed when the definition of the derived class is parsed. */ @@ -321,11 +321,11 @@ add_matching_methods (int method_counter, struct type *t, else { /* This error message gets printed, but the method - still seems to be found + still seems to be found. fputs_filtered("(Cannot find method ", gdb_stdout); fprintf_symbol_filtered (gdb_stdout, phys_name, - language_cplus, - DMGL_PARAMS | DMGL_ANSI); + language_cplus, + DMGL_PARAMS | DMGL_ANSI); fputs_filtered(" - possibly inlined.)\n", gdb_stdout); */ } @@ -457,7 +457,7 @@ find_toplevel_char (char *s, char c) } /* Determines if the gives string corresponds to an Objective-C method - representation, such as -[Foo bar:] or +[Foo bar]. Objective-C symbols + representation, such as -[Foo bar:] or +[Foo bar]. Objective-C symbols are allowed to have spaces and parentheses in them. */ static int @@ -664,7 +664,7 @@ find_method_overload_end (char *p) return p; } -/* The parser of linespec itself. */ +/* The parser of linespec itself. */ /* Parse a string that specifies a line number. Pass the address of a char * variable; that variable will be @@ -695,9 +695,9 @@ find_method_overload_end (char *p) DEFAULT_LINE specifies the line number to use for relative line numbers (that start with signs). Defaults to current_source_line. If CANONICAL is non-NULL, store an array of strings containing the canonical - line specs there if necessary. Currently overloaded member functions and + line specs there if necessary. Currently overloaded member functions and line numbers or static functions without a filename yield a canonical - line spec. The array and the line spec strings are allocated on the heap, + line spec. The array and the line spec strings are allocated on the heap, it is the callers responsibility to free them. Note that it is possible to return zero for the symtab @@ -760,8 +760,8 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab, /* Locate the end of the first half of the linespec. After the call, for instance, if the argptr string is "foo.c:123" p will point at "123". If there is only one part, like "foo", p - will point to "". If this is a C++ name, like "A::B::foo", p will - point to "::B::foo". Argptr is not changed by this call. */ + will point to "". If this is a C++ name, like "A::B::foo", p will + point to "::B::foo". Argptr is not changed by this call. */ first_half = p = locate_first_half (argptr, &is_quote_enclosed); @@ -787,10 +787,10 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab, { /* Is it a C++ or Java compound data structure? The check on p[1] == ':' is capturing the case of "::", - since p[0]==':' was checked above. + since p[0]==':' was checked above. Note that the call to decode_compound does everything for us, including the lookup on the symbol table, so we - can return now. */ + can return now. */ if (p[0] == '.' || p[1] == ':') { @@ -863,7 +863,7 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab, } else if (is_objc_method) { - /* allow word separators in method names for Obj-C */ + /* allow word separators in method names for Obj-C. */ p = skip_quoted_chars (*argptr, NULL, ""); } else @@ -871,7 +871,7 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab, p = skip_quoted (*argptr); } - /* Keep any template parameters */ + /* Keep any template parameters. */ if (*p == '<') p = find_template_name_end (p); @@ -879,7 +879,7 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab, if (*p == '(') p = find_method_overload_end (p); - /* Make sure we keep important kewords like "const" */ + /* Make sure we keep important kewords like "const". */ if (strncmp (p, " const", 6) == 0) p += 6; @@ -960,7 +960,7 @@ initialize_defaults (struct symtab **default_symtab, int *default_line) { /* Use whatever we have for the default source line. We don't use get_current_or_default_symtab_and_line as it can recurse and call - us back! */ + us back! */ struct symtab_and_line cursal = get_current_source_symtab_and_line (); @@ -1021,7 +1021,7 @@ locate_first_half (char **argptr, int *is_quote_enclosed) has_comma = (ii != 0); /* Temporarily zap out second half to not confuse the code below. - This is undone below. Do not change ii!! */ + This is undone below. Do not change ii!! */ if (has_comma) { *ii = '\0'; @@ -1058,7 +1058,7 @@ locate_first_half (char **argptr, int *is_quote_enclosed) p = temp_end; } /* Check for a colon and a plus or minus and a [ (which - indicates an Objective-C method) */ + indicates an Objective-C method). */ if (is_objc_method_format (p)) { break; @@ -1147,7 +1147,8 @@ decode_objc (char **argptr, int funfirstline, struct symtab *file_symtab, if (i1 > 0) { - sym_arr = (struct symbol **) alloca ((i1 + 1) * sizeof (struct symbol *)); + sym_arr = (struct symbol **) + alloca ((i1 + 1) * sizeof (struct symbol *)); sym_arr[i1] = NULL; copy = find_imps (file_symtab, block, *argptr, sym_arr, &i1, &i2); @@ -1211,7 +1212,7 @@ decode_objc (char **argptr, int funfirstline, struct symtab *file_symtab, if (i1 > 1) { - /* More than one match. The user must choose one or more. */ + /* More than one match. The user must choose one or more. */ return decode_line_2 (sym_arr, i2, funfirstline, canonical); } @@ -1240,7 +1241,7 @@ decode_compound (char **argptr, int funfirstline, char ***canonical, /* First check for "global" namespace specification, of the form "::foo". If found, skip over the colons and jump to normal symbol processing. I.e. the whole line specification starts with - "::" (note the condition that *argptr == p). */ + "::" (note the condition that *argptr == p). */ if (p[0] == ':' && ((*argptr == p) || (p[-1] == ' ') || (p[-1] == '\t'))) saved_arg2 += 2; @@ -1261,16 +1262,16 @@ decode_compound (char **argptr, int funfirstline, char ***canonical, p2 = p; /* Save for restart. */ - /* This is very messy. Following the example above we have now the + /* This is very messy. Following the example above we have now the following pointers: p -> "::inA::fun" argptr -> "AAA::inA::fun saved_arg -> "AAA::inA::fun saved_arg2 -> "AAA::inA::fun - p2 -> "::inA::fun". */ + p2 -> "::inA::fun". */ /* In the loop below, with these strings, we'll make 2 passes, each - is marked in comments.*/ + is marked in comments. */ while (1) { @@ -1280,7 +1281,7 @@ decode_compound (char **argptr, int funfirstline, char ***canonical, /* PASS1: at this point p2->"::inA::fun", so p->":inA::fun", i.e. if there is a double-colon, p will now point to the - second colon. */ + second colon. */ /* PASS2: p2->"::fun", p->":fun" */ /* Move pointer ahead to next double-colon. */ @@ -1300,12 +1301,12 @@ decode_compound (char **argptr, int funfirstline, char ***canonical, /* Note that, since, at the start of this loop, p would be pointing to the second colon in a double-colon, we only satisfy the condition below if there is another - double-colon to the right (after). I.e. there is another - component that can be a class or a namespace. I.e, if at + double-colon to the right (after). I.e. there is another + component that can be a class or a namespace. I.e, if at the beginning of this loop (PASS1), we had p->":inA::fun", we'll trigger this when p has been advanced to point to "::fun". */ - /* PASS2: we will not trigger this. */ + /* PASS2: we will not trigger this. */ else if ((p[0] == ':') && (p[1] == ':')) break; /* Found double-colon. */ else @@ -1318,10 +1319,10 @@ decode_compound (char **argptr, int funfirstline, char ***canonical, break; /* Out of the while (1). This would happen for instance if we have looked up unsuccessfully all the components of the - string, and p->""(PASS2) */ + string, and p->""(PASS2). */ /* We get here if p points to ' ', '\t', '\'', "::" or ""(i.e - string ended). */ + string ended). */ /* Save restart for next time around. */ p2 = p; /* Restore argptr as it was on entry to this function. */ @@ -1333,10 +1334,10 @@ decode_compound (char **argptr, int funfirstline, char ***canonical, } /* while (1) */ - /* Start of lookup in the symbol tables. */ + /* Start of lookup in the symbol tables. */ /* Lookup in the symbol table the substring between argptr and - p. Note, this call changes the value of argptr. */ + p. Note, this call changes the value of argptr. */ /* Before the call, argptr->"AAA::inA::fun", p->"", p2->"::fun". After the call: argptr->"fun", p, p2 unchanged. */ @@ -1380,7 +1381,7 @@ decode_compound (char **argptr, int funfirstline, char ***canonical, p += cp_validate_operator (p - 8) - 8; } - /* Keep any template parameters */ + /* Keep any template parameters. */ if (*p == '<') p = find_template_name_end (p); @@ -1389,7 +1390,7 @@ decode_compound (char **argptr, int funfirstline, char ***canonical, if (a != NULL) p = find_method_overload_end (a); - /* Make sure we keep important kewords like "const" */ + /* Make sure we keep important kewords like "const". */ if (strncmp (p, " const", 6) == 0) p += 6; @@ -1419,7 +1420,7 @@ decode_compound (char **argptr, int funfirstline, char ***canonical, } /* Allocate our own copy of the substring between argptr and - p. */ + p. */ copy = (char *) alloca (p - *argptr + 1); memcpy (copy, *argptr, p - *argptr); copy[p - *argptr] = '\0'; @@ -1429,7 +1430,7 @@ decode_compound (char **argptr, int funfirstline, char ***canonical, copy[p - *argptr - 1]) != NULL) copy[p - *argptr - 1] = '\0'; - /* At this point copy->"fun", p->"" */ + /* At this point copy->"fun", p->"". */ /* No line number may be specified. */ while (*p == ' ' || *p == '\t') @@ -1437,11 +1438,11 @@ decode_compound (char **argptr, int funfirstline, char ***canonical, *argptr = p; /* At this point arptr->"". */ - /* Look for copy as a method of sym_class. */ + /* Look for copy as a method of sym_class. */ /* At this point copy->"fun", sym_class is "AAA:inA", saved_arg->"AAA::inA::fun". This concludes the scanning of the string for possible components matches. If we find it - here, we return. If not, and we are at the and of the string, + here, we return. If not, and we are at the and of the string, we'll lookup the whole string in the symbol tables. */ values = find_method (funfirstline, canonical, saved_arg, @@ -1465,7 +1466,7 @@ decode_compound (char **argptr, int funfirstline, char ***canonical, } } return values; - } /* End if symbol found */ + } /* End if symbol found. */ /* We couldn't find a class, so we're in case 2 above. We check the @@ -1479,7 +1480,7 @@ decode_compound (char **argptr, int funfirstline, char ***canonical, /* Set argptr to skip over the name. */ *argptr = (*p == '\'') ? p + 1 : p; - /* Look up entire name */ + /* Look up entire name. */ sym = lookup_symbol (copy, 0, VAR_DOMAIN, 0); if (sym) return symbol_found (funfirstline, canonical, copy, sym, NULL); @@ -1525,7 +1526,7 @@ lookup_prefix_sym (char **argptr, char *p) *argptr = p; /* At this point p1->"::inA::fun", p->"inA::fun" copy->"AAA", - argptr->"inA::fun" */ + argptr->"inA::fun". */ sym = lookup_symbol (copy, 0, STRUCT_DOMAIN, 0); if (sym == NULL) @@ -1942,7 +1943,7 @@ symbol_found (int funfirstline, char ***canonical, char *copy, if (SYMBOL_CLASS (sym) == LOC_BLOCK) { - /* Arg is the name of a function */ + /* Arg is the name of a function. */ values.sals = (struct symtab_and_line *) xmalloc (sizeof (struct symtab_and_line)); values.sals[0] = find_function_start_sal (sym, funfirstline); diff --git a/gdb/linux-fork.c b/gdb/linux-fork.c index 6a80f574b6a..b5816269026 100644 --- a/gdb/linux-fork.c +++ b/gdb/linux-fork.c @@ -49,7 +49,7 @@ struct fork_info struct fork_info *next; ptid_t ptid; ptid_t parent_ptid; - int num; /* Convenient handle (GDB fork id) */ + int num; /* Convenient handle (GDB fork id). */ struct regcache *savedregs; /* Convenient for info fork, saves having to actually switch contexts. */ int clobber_regs; /* True if we should restore saved regs. */ @@ -419,7 +419,7 @@ inferior_call_waitpid_cleanup (void *fp) if (oldfp) { - /* Switch back to inferior_ptid. */ + /* Switch back to inferior_ptid. */ remove_breakpoints (); fork_load_infrun_state (oldfp); insert_breakpoints (); diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index ec0433f5a6e..c769010f99e 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -38,12 +38,12 @@ #include "inf-ptrace.h" #include "auxv.h" #include /* for MAXPATHLEN */ -#include /* for elf_gregset etc. */ +#include /* for elf_gregset etc. */ #include "elf-bfd.h" /* for elfcore_write_* */ #include "gregset.h" /* for gregset */ #include "gdbcore.h" /* for get_exec_file */ #include /* for isdigit */ -#include "gdbthread.h" /* for struct thread_info etc. */ +#include "gdbthread.h" /* for struct thread_info etc. */ #include "gdb_stat.h" /* for struct stat */ #include /* for O_RDONLY */ #include "inf-loop.h" @@ -68,7 +68,7 @@ # endif #endif /* HAVE_PERSONALITY */ -/* This comment documents high-level logic of this file. +/* This comment documents high-level logic of this file. Waiting for events in sync mode =============================== @@ -76,12 +76,12 @@ Waiting for events in sync mode When waiting for an event in a specific thread, we just use waitpid, passing the specific pid, and not passing WNOHANG. -When waiting for an event in all threads, waitpid is not quite good. Prior to +When waiting for an event in all threads, waitpid is not quite good. Prior to version 2.4, Linux can either wait for event in main thread, or in secondary -threads. (2.4 has the __WALL flag). So, if we use blocking waitpid, we might +threads. (2.4 has the __WALL flag). So, if we use blocking waitpid, we might miss an event. The solution is to use non-blocking waitpid, together with sigsuspend. First, we use non-blocking waitpid to get an event in the main -process, if any. Second, we use non-blocking waitpid with the __WCLONED +process, if any. Second, we use non-blocking waitpid with the __WCLONED flag to check for events in cloned processes. If nothing is found, we use sigsuspend to wait for SIGCHLD. When SIGCHLD arrives, it means something happened to a child process -- and SIGCHLD will be delivered both for events @@ -90,7 +90,7 @@ an event, we get back to calling nonblocking waitpid with and without __WCLONED. Note that SIGCHLD should be blocked between waitpid and sigsuspend calls, -so that we don't miss a signal. If SIGCHLD arrives in between, when it's +so that we don't miss a signal. If SIGCHLD arrives in between, when it's blocked, the signal becomes pending and sigsuspend immediately notices it and returns. @@ -167,7 +167,7 @@ blocked. */ #define PTRACE_SETOPTIONS 0x4200 #define PTRACE_GETEVENTMSG 0x4201 -/* options set using PTRACE_SETOPTIONS */ +/* Options set using PTRACE_SETOPTIONS. */ #define PTRACE_O_TRACESYSGOOD 0x00000001 #define PTRACE_O_TRACEFORK 0x00000002 #define PTRACE_O_TRACEVFORK 0x00000004 @@ -297,7 +297,7 @@ static int linux_supports_tracesysgood_flag = -1; static int linux_supports_tracevforkdone_flag = -1; -/* Async mode support */ +/* Async mode support. */ /* Zero if the async mode, although enabled, is masked, which means linux_nat_wait should behave as if async mode was off. */ @@ -698,7 +698,7 @@ holding the child stopped. Try \"set detach-on-fork\" or \ { struct lwp_info *child_lp = NULL; - /* We're already attached to the parent, by default. */ + /* We're already attached to the parent, by default. */ /* Detach new forked process? */ if (detach_fork) @@ -2726,7 +2726,7 @@ stop_wait_callback (struct lwp_info *lp, void *data) save_sigtrap (lp); - /* Now resume this LWP and get the SIGSTOP event. */ + /* Now resume this LWP and get the SIGSTOP event. */ errno = 0; ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, 0); if (debug_linux_nat) @@ -2741,12 +2741,12 @@ stop_wait_callback (struct lwp_info *lp, void *data) target_pid_to_str (lp->ptid)); } /* Hold this event/waitstatus while we check to see if - there are any more (we still want to get that SIGSTOP). */ + there are any more (we still want to get that SIGSTOP). */ stop_wait_callback (lp, NULL); /* Hold the SIGTRAP for handling by linux_nat_wait. If there's another event, throw it back into the - queue. */ + queue. */ if (lp->status) { if (debug_linux_nat) @@ -2757,14 +2757,14 @@ stop_wait_callback (struct lwp_info *lp, void *data) kill_lwp (GET_LWP (lp->ptid), WSTOPSIG (lp->status)); } - /* Save the sigtrap event. */ + /* Save the sigtrap event. */ lp->status = status; return 0; } else { /* The thread was stopped with a signal other than - SIGSTOP, and didn't accidentally trip a breakpoint. */ + SIGSTOP, and didn't accidentally trip a breakpoint. */ if (debug_linux_nat) { @@ -2773,7 +2773,7 @@ stop_wait_callback (struct lwp_info *lp, void *data) status_to_str ((int) status), target_pid_to_str (lp->ptid)); } - /* Now resume this LWP and get the SIGSTOP event. */ + /* Now resume this LWP and get the SIGSTOP event. */ errno = 0; ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, 0); if (debug_linux_nat) @@ -2783,7 +2783,7 @@ stop_wait_callback (struct lwp_info *lp, void *data) errno ? safe_strerror (errno) : "OK"); /* Hold this event/waitstatus while we check to see if - there are any more (we still want to get that SIGSTOP). */ + there are any more (we still want to get that SIGSTOP). */ stop_wait_callback (lp, NULL); /* If the lp->status field is still empty, use it to @@ -2887,7 +2887,7 @@ select_event_lwp_callback (struct lwp_info *lp, void *data) gdb_assert (selector != NULL); - /* Select only resumed LWPs that have a SIGTRAP event pending. */ + /* Select only resumed LWPs that have a SIGTRAP event pending. */ if (lp->resumed && linux_nat_lp_status_is_event (lp)) if ((*selector)-- == 0) return 1; @@ -3065,7 +3065,7 @@ linux_nat_filter_event (int lwpid, int status, int options) } /* Make sure we don't report an event for the exit of an LWP not in - our list, i.e. not part of the current process. This can happen + our list, i.e. not part of the current process. This can happen if we detach from a program we original forked and then it exits. */ if (!WIFSTOPPED (status) && !lp) @@ -4569,7 +4569,7 @@ linux_nat_info_proc_cmd (char *args, int from_tty) } else { - /* [...] (future options here) */ + /* [...] (future options here). */ } argv++; } @@ -4769,9 +4769,9 @@ linux_nat_info_proc_cmd (char *args, int from_tty) printf_filtered (_("Start of stack: 0x%lx\n"), ltmp); #if 0 /* Don't know how architecture-dependent the rest is... Anyway the signal bitmap info is available from "status". */ - if (fscanf (procfile, "%lu ", <mp) > 0) /* FIXME arch? */ + if (fscanf (procfile, "%lu ", <mp) > 0) /* FIXME arch? */ printf_filtered (_("Kernel stack pointer: 0x%lx\n"), ltmp); - if (fscanf (procfile, "%lu ", <mp) > 0) /* FIXME arch? */ + if (fscanf (procfile, "%lu ", <mp) > 0) /* FIXME arch? */ printf_filtered (_("Kernel instr pointer: 0x%lx\n"), ltmp); if (fscanf (procfile, "%ld ", <mp) > 0) printf_filtered (_("Pending signals bitmap: 0x%lx\n"), ltmp); @@ -4781,7 +4781,7 @@ linux_nat_info_proc_cmd (char *args, int from_tty) printf_filtered (_("Ignored signals bitmap: 0x%lx\n"), ltmp); if (fscanf (procfile, "%ld ", <mp) > 0) printf_filtered (_("Catched signals bitmap: 0x%lx\n"), ltmp); - if (fscanf (procfile, "%lu ", <mp) > 0) /* FIXME arch? */ + if (fscanf (procfile, "%lu ", <mp) > 0) /* FIXME arch? */ printf_filtered (_("wchan (system call): 0x%lx\n"), ltmp); #endif do_cleanups (cleanup); diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c index 81c3bc5eff2..9f360b9fe61 100644 --- a/gdb/linux-thread-db.c +++ b/gdb/linux-thread-db.c @@ -864,8 +864,7 @@ thread_db_load_search (void) } /* Attempt to load and initialize libthread_db. - Return 1 on success. - */ + Return 1 on success. */ static int thread_db_load (void) @@ -1707,7 +1706,7 @@ _initialize_thread_db (void) executable -- there could be mutiple versions of glibc, compiled with LinuxThreads or NPTL, and until there is a running inferior, we can't tell which libthread_db is - the correct one to load. */ + the correct one to load. */ libthread_db_search_path = xstrdup (LIBTHREAD_DB_SEARCH_PATH); diff --git a/gdb/lm32-tdep.c b/gdb/lm32-tdep.c index b805716d539..327ac327d8a 100644 --- a/gdb/lm32-tdep.c +++ b/gdb/lm32-tdep.c @@ -48,7 +48,7 @@ struct gdbarch_tdep { - /* gdbarch target dependent data here. Currently unused for LM32. */ + /* gdbarch target dependent data here. Currently unused for LM32. */ }; struct lm32_frame_cache @@ -144,7 +144,7 @@ lm32_analyze_prologue (struct gdbarch *gdbarch, if ((LM32_OPCODE (instruction) == OP_SW) && (LM32_REG0 (instruction) == SIM_LM32_SP_REGNUM)) { - /* Any stack displaced store is likely part of the prologue. + /* Any stack displaced store is likely part of the prologue. Record that the register is being saved, and the offset into the stack. */ info->saved_regs[LM32_REG1 (instruction)].addr = @@ -153,7 +153,7 @@ lm32_analyze_prologue (struct gdbarch *gdbarch, else if ((LM32_OPCODE (instruction) == OP_ADDI) && (LM32_REG1 (instruction) == SIM_LM32_SP_REGNUM)) { - /* An add to the SP is likely to be part of the prologue. + /* An add to the SP is likely to be part of the prologue. Adjust stack size by whatever the instruction adds to the sp. */ info->size -= LM32_IMM16 (instruction); } @@ -172,7 +172,8 @@ lm32_analyze_prologue (struct gdbarch *gdbarch, } else { - /* Any other instruction is likely not to be part of the prologue. */ + /* Any other instruction is likely not to be part of the + prologue. */ break; } } @@ -336,8 +337,8 @@ lm32_extract_return_value (struct type *type, struct regcache *regcache, } else { - /* Aggregate types greater than a single register are returned in memory. - FIXME: Unless they are only 2 regs?. */ + /* Aggregate types greater than a single register are returned + in memory. FIXME: Unless they are only 2 regs?. */ regcache_cooked_read_unsigned (regcache, SIM_LM32_R1_REGNUM, &l); return_buffer = l; read_memory (return_buffer, valbuf, TYPE_LENGTH (type)); @@ -463,7 +464,8 @@ lm32_frame_cache (struct frame_info *this_frame, void **this_prologue_cache) converted into a request for the RA register. */ info->saved_regs[SIM_LM32_PC_REGNUM] = info->saved_regs[SIM_LM32_RA_REGNUM]; - /* The previous frame's SP needed to be computed. Save the computed value. */ + /* The previous frame's SP needed to be computed. Save the computed + value. */ trad_frame_set_value (info->saved_regs, SIM_LM32_SP_REGNUM, prev_sp); return info; -- 2.30.2