aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog63
-rw-r--r--gdb/s390-tdep.c21
-rw-r--r--gdb/score-tdep.c145
-rw-r--r--gdb/score-tdep.h15
-rw-r--r--gdb/ser-base.c51
-rw-r--r--gdb/ser-go32.c72
-rw-r--r--gdb/ser-mingw.c2
-rw-r--r--gdb/ser-pipe.c16
-rw-r--r--gdb/ser-tcp.c31
-rw-r--r--gdb/ser-unix.c34
-rw-r--r--gdb/serial.c28
-rw-r--r--gdb/serial.h22
-rw-r--r--gdb/sh-tdep.c179
-rw-r--r--gdb/sh-tdep.h4
-rw-r--r--gdb/sh64-tdep.c214
-rw-r--r--gdb/shnbsd-nat.c2
-rw-r--r--gdb/sol-thread.c8
-rw-r--r--gdb/solib-darwin.c4
-rw-r--r--gdb/solib-frv.c12
-rw-r--r--gdb/solib-irix.c12
-rw-r--r--gdb/solib-osf.c18
-rw-r--r--gdb/solib-pa64.c30
-rw-r--r--gdb/solib-som.c53
-rw-r--r--gdb/solib-spu.c2
-rw-r--r--gdb/solib-sunos.c44
-rw-r--r--gdb/solib-svr4.c27
-rw-r--r--gdb/solib.c14
-rw-r--r--gdb/solib.h6
-rw-r--r--gdb/solist.h12
-rw-r--r--gdb/somread.c28
-rw-r--r--gdb/source.c105
-rw-r--r--gdb/source.h12
-rw-r--r--gdb/sparc-linux-nat.c3
-rw-r--r--gdb/sparc-linux-tdep.c8
-rw-r--r--gdb/sparc-sol2-nat.c5
-rw-r--r--gdb/sparc-sol2-tdep.c2
-rw-r--r--gdb/sparc-tdep.c4
-rw-r--r--gdb/sparc-tdep.h2
-rw-r--r--gdb/sparc64-linux-tdep.c6
-rw-r--r--gdb/sparc64-tdep.c2
-rw-r--r--gdb/spu-tdep.c28
-rw-r--r--gdb/stabsread.c193
-rw-r--r--gdb/stabsread.h12
-rw-r--r--gdb/stack.c16
-rw-r--r--gdb/symfile.c163
-rw-r--r--gdb/symfile.h6
-rw-r--r--gdb/symmisc.c10
-rw-r--r--gdb/symtab.c177
-rw-r--r--gdb/symtab.h116
-rw-r--r--gdb/target-descriptions.c2
-rw-r--r--gdb/target-descriptions.h2
-rw-r--r--gdb/target-memory.c2
-rw-r--r--gdb/target.c56
-rw-r--r--gdb/target.h46
-rw-r--r--gdb/terminal.h4
-rw-r--r--gdb/thread.c31
-rw-r--r--gdb/top.c14
-rw-r--r--gdb/tracepoint.c140
-rw-r--r--gdb/tracepoint.h4
-rw-r--r--gdb/trad-frame.h4
-rw-r--r--gdb/typeprint.c6
61 files changed, 1232 insertions, 1118 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 277c94f..9d670a9 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,66 @@
+2011-01-11 Michael Snyder <msnyder@vmware.com>
+
+ * s390-tdep.c: Comment cleanup, mostly periods and spaces.
+ * score-tdep.c: Ditto.
+ * score-tdep.h: Ditto.
+ * ser-base.c: Ditto.
+ * ser-go32.c: Ditto.
+ * serial.c: Ditto.
+ * serial.h: Ditto.
+ * ser-mingw.c: Ditto.
+ * ser-pipe.c: Ditto.
+ * ser-tcp.c: Ditto.
+ * ser-unix.c: Ditto.
+ * sh64-tdep.c: Ditto.
+ * shnbsd-nat.c: Ditto.
+ * sh-tdep.c: Ditto.
+ * sh-tdep.h: Ditto.
+ * solib.c: Ditto.
+ * solib-darwin.c: Ditto.
+ * solib-frv.c: Ditto.
+ * solib.h: Ditto.
+ * solib-irix.c: Ditto.
+ * solib-osf.c: Ditto.
+ * solib-pa64.c: Ditto.
+ * solib-som.c: Ditto.
+ * solib-spu.c: Ditto.
+ * solib-sunos.c: Ditto.
+ * solib-svr4.c: Ditto.
+ * solist.h: Ditto.
+ * sol-thread.c: Ditto.
+ * somread.c: Ditto.
+ * source.c: Ditto.
+ * source.h: Ditto.
+ * sparc64-linux-tdep.c: Ditto.
+ * sparc64-tdep.c: Ditto.
+ * sparc-linux-nat.c: Ditto.
+ * sparc-linux-tdep.c: Ditto.
+ * sparc-sol2-nat.c: Ditto.
+ * sparc-sol2-tdep.c: Ditto.
+ * sparc-tdep.c: Ditto.
+ * sparc-tdep.h: Ditto.
+ * spu-tdep.c: Ditto.
+ * stabsread.c: Ditto.
+ * stabsread.h: Ditto.
+ * stack.c: Ditto.
+ * symfile.c: Ditto.
+ * symfile.h: Ditto.
+ * symmisc.c: Ditto.
+ * symtab.c: Ditto.
+ * symtab.h: Ditto.
+ * target.c: Ditto.
+ * target-descriptions.c: Ditto.
+ * target-descriptions.h: Ditto.
+ * target.h: Ditto.
+ * target-memory.c: Ditto.
+ * terminal.h: Ditto.
+ * thread.c: Ditto.
+ * top.c: Ditto.
+ * tracepoint.c: Ditto.
+ * tracepoint.h: Ditto.
+ * trad-frame.h: Ditto.
+ * typeprint.c: Ditto.
+
2011-01-11 Thiago Jung Bauermann <bauerman@br.ibm.com>
* breakpoint.c (resources_needed_watchpoint): Fix indentation.
diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c
index a5c1852..85e4c13 100644
--- a/gdb/s390-tdep.c
+++ b/gdb/s390-tdep.c
@@ -959,7 +959,8 @@ s390_load (struct s390_prologue_data *data,
register was saved, record its offset in the reg_offset table in
PROLOGUE_UNTYPED. */
static void
-s390_check_for_saved (void *data_untyped, pv_t addr, CORE_ADDR size, pv_t value)
+s390_check_for_saved (void *data_untyped, pv_t addr,
+ CORE_ADDR size, pv_t value)
{
struct s390_prologue_data *data = data_untyped;
int i, offset;
@@ -1118,7 +1119,8 @@ s390_analyze_prologue (struct gdbarch *gdbarch,
s390_store (data, d2, x2, b2, data->fpr_size, data->fpr[r1]);
/* STM r1, r3, d2(b2) --- store multiple. */
- /* STMY r1, r3, d2(b2) --- store multiple (long-displacement version). */
+ /* STMY r1, r3, d2(b2) --- store multiple (long-displacement
+ version). */
/* STMG r1, r3, d2(b2) --- store multiple (64-bit version). */
else if (is_rs (insn32, op_stm, &r1, &r3, &d2, &b2)
|| is_rsy (insn32, op1_stmy, op2_stmy, &r1, &r3, &d2, &b2)
@@ -1532,7 +1534,7 @@ s390_prologue_frame_unwind_cache (struct frame_info *this_frame,
/* If we've detected a function with stack frame, we'll still have to
treat it as frameless if we're currently within the function epilog
- code at a point where the frame pointer has already been restored.
+ code at a point where the frame pointer has already been restored.
This can only happen in an innermost frame. */
/* FIXME: cagney/2004-05-01: This sanity check shouldn't be needed,
instead the code should simpliy rely on its analysis. */
@@ -1865,7 +1867,7 @@ s390_sigtramp_frame_unwind_cache (struct frame_info *this_frame,
/* New-style RT frame:
retcode + alignment (8 bytes)
siginfo (128 bytes)
- ucontext (contains sigregs at offset 5 words) */
+ ucontext (contains sigregs at offset 5 words). */
if (next_ra == next_cfa)
{
sigreg_ptr = next_cfa + 8 + 128 + align_up (5*word_size, 8);
@@ -1876,7 +1878,7 @@ s390_sigtramp_frame_unwind_cache (struct frame_info *this_frame,
/* Old-style RT frame and all non-RT frames:
old signal mask (8 bytes)
- pointer to sigregs */
+ pointer to sigregs. */
else
{
sigreg_ptr = read_memory_unsigned_integer (next_cfa + 8,
@@ -2454,7 +2456,8 @@ s390_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
{
/* Integer arguments are always extended to word size. */
regcache_cooked_write_signed (regcache, S390_R0_REGNUM + gr,
- extend_simple_arg (gdbarch, arg));
+ extend_simple_arg (gdbarch,
+ arg));
gr++;
}
else
@@ -2634,7 +2637,8 @@ s390_return_value (struct gdbarch *gdbarch, struct type *func_type,
/* Breakpoints. */
static const gdb_byte *
-s390_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
+s390_breakpoint_from_pc (struct gdbarch *gdbarch,
+ CORE_ADDR *pcptr, int *lenptr)
{
static const gdb_byte breakpoint[] = { 0x0, 0x1 };
@@ -2670,7 +2674,8 @@ s390_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags)
}
static int
-s390_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name,
+s390_address_class_name_to_type_flags (struct gdbarch *gdbarch,
+ const char *name,
int *type_flags_ptr)
{
if (strcmp (name, "mode32") == 0)
diff --git a/gdb/score-tdep.c b/gdb/score-tdep.c
index 16ff1ce..ffe562f 100644
--- a/gdb/score-tdep.c
+++ b/gdb/score-tdep.c
@@ -43,9 +43,9 @@
((unsigned)((_i) << (31 - (_ms))) >> (31 - (_ms) + (_ls)))
typedef struct{
- unsigned long long v;
- unsigned long long raw;
- unsigned int len;
+ unsigned long long v;
+ unsigned long long raw;
+ unsigned int len;
}inst_t;
struct score_frame_cache
@@ -61,7 +61,8 @@ static struct type *
score_register_type (struct gdbarch *gdbarch, int regnum)
{
gdb_assert (regnum >= 0
- && regnum < ((target_mach == bfd_mach_score7) ? SCORE7_NUM_REGS : SCORE3_NUM_REGS));
+ && regnum < ((target_mach == bfd_mach_score7)
+ ? SCORE7_NUM_REGS : SCORE3_NUM_REGS));
return builtin_type (gdbarch)->builtin_uint32;
}
@@ -121,7 +122,8 @@ static int
score_register_sim_regno (struct gdbarch *gdbarch, int regnum)
{
gdb_assert (regnum >= 0
- && regnum < ((target_mach == bfd_mach_score7) ? SCORE7_NUM_REGS : SCORE3_NUM_REGS));
+ && regnum < ((target_mach == bfd_mach_score7)
+ ? SCORE7_NUM_REGS : SCORE3_NUM_REGS));
return regnum;
}
#endif
@@ -421,7 +423,8 @@ score_xfer_register (struct regcache *regcache, int regnum, int length,
{
int reg_offset = 0;
gdb_assert (regnum >= 0
- && regnum < ((target_mach == bfd_mach_score7) ? SCORE7_NUM_REGS : SCORE3_NUM_REGS));
+ && regnum < ((target_mach == bfd_mach_score7)
+ ? SCORE7_NUM_REGS : SCORE3_NUM_REGS));
switch (endian)
{
@@ -465,6 +468,7 @@ score_return_value (struct gdbarch *gdbarch, struct type *func_type,
offset += SCORE_REGSIZE, regnum++)
{
int xfer = SCORE_REGSIZE;
+
if (offset + xfer > TYPE_LENGTH (type))
xfer = TYPE_LENGTH (type) - offset;
score_xfer_register (regcache, regnum, xfer,
@@ -478,9 +482,9 @@ score_return_value (struct gdbarch *gdbarch, struct type *func_type,
static struct frame_id
score_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
{
- return frame_id_build (
- get_frame_register_unsigned (this_frame, SCORE_SP_REGNUM),
- get_frame_pc (this_frame));
+ return frame_id_build (get_frame_register_unsigned (this_frame,
+ SCORE_SP_REGNUM),
+ get_frame_pc (this_frame));
}
static int
@@ -687,7 +691,8 @@ score3_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
while (iscan-- > 0)
{
inst_t *inst
- = score3_adjust_pc_and_fetch_inst (&cpc, NULL, gdbarch_byte_order (gdbarch));
+ = score3_adjust_pc_and_fetch_inst (&cpc, NULL,
+ gdbarch_byte_order (gdbarch));
if (!inst)
break;
@@ -764,7 +769,8 @@ score3_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR cur_pc)
{
CORE_ADDR pc = cur_pc;
inst_t *inst
- = score3_adjust_pc_and_fetch_inst (&pc, NULL, gdbarch_byte_order (gdbarch));
+ = score3_adjust_pc_and_fetch_inst (&pc, NULL,
+ gdbarch_byte_order (gdbarch));
if (inst->len == 2
&& (G_FLD (inst->v, 14, 10) == 0x10)
@@ -901,7 +907,7 @@ score7_analyze_prologue (CORE_ADDR startaddr, CORE_ADDR pc,
inst = score7_fetch_inst (gdbarch, cur_pc, NULL);
}
- /* FIXME: make a full-power prologue analyzer */
+ /* FIXME: make a full-power prologue analyzer. */
if (inst->len == 2)
{
inst_len = SCORE16_INSTLEN;
@@ -1071,7 +1077,8 @@ score3_analyze_prologue (CORE_ADDR startaddr, CORE_ADDR pc,
CORE_ADDR sp;
CORE_ADDR fp;
CORE_ADDR cur_pc = startaddr;
- enum bfd_endian byte_order = gdbarch_byte_order (get_frame_arch (this_frame));
+ enum bfd_endian byte_order
+ = gdbarch_byte_order (get_frame_arch (this_frame));
int sp_offset = 0;
int ra_offset = 0;
@@ -1091,7 +1098,7 @@ score3_analyze_prologue (CORE_ADDR startaddr, CORE_ADDR pc,
inst = score3_adjust_pc_and_fetch_inst (&cur_pc, &inst_len, byte_order);
- /* FIXME: make a full-power prologue analyzer */
+ /* FIXME: make a full-power prologue analyzer. */
if (inst->len == 2)
{
if (G_FLD (inst->v, 14, 12) == 0x0
@@ -1177,7 +1184,8 @@ score3_analyze_prologue (CORE_ADDR startaddr, CORE_ADDR pc,
inst_t *inst2;
cur_pc += inst->len;
- inst2 = score3_adjust_pc_and_fetch_inst (&cur_pc, NULL, byte_order);
+ inst2 = score3_adjust_pc_and_fetch_inst (&cur_pc, NULL,
+ byte_order);
if (inst2->len == 2
&& G_FLD (inst2->v, 14, 10) == 0x10
@@ -1262,7 +1270,8 @@ score3_analyze_prologue (CORE_ADDR startaddr, CORE_ADDR pc,
inst_t *inst2;
cur_pc += inst->len;
- inst2 = score3_adjust_pc_and_fetch_inst (&cur_pc, NULL, byte_order);
+ inst2 = score3_adjust_pc_and_fetch_inst (&cur_pc, NULL,
+ byte_order);
if (inst2->len == 2
&& G_FLD (inst2->v, 14, 10) == 0x10
@@ -1392,74 +1401,76 @@ score_prologue_frame_base_sniffer (struct frame_info *this_frame)
/* Core file support (dirty hack)
- The core file MUST be generated by GNU/Linux on S+core */
+ The core file MUST be generated by GNU/Linux on S+core. */
static void
score7_linux_supply_gregset(const struct regset *regset,
struct regcache *regcache,
int regnum, const void *gregs_buf, size_t len)
{
- int regno;
- elf_gregset_t *gregs;
+ int regno;
+ elf_gregset_t *gregs;
- gdb_assert (regset != NULL);
- gdb_assert ((regcache != NULL) && (gregs_buf != NULL));
+ gdb_assert (regset != NULL);
+ gdb_assert ((regcache != NULL) && (gregs_buf != NULL));
- gregs = (elf_gregset_t *) gregs_buf;
+ gregs = (elf_gregset_t *) gregs_buf;
- for (regno = 0; regno < 32; regno++)
- if (regnum == -1 || regnum == regno)
- regcache_raw_supply (regcache, regno, gregs->regs + regno);
+ for (regno = 0; regno < 32; regno++)
+ if (regnum == -1 || regnum == regno)
+ regcache_raw_supply (regcache, regno, gregs->regs + regno);
- {
- struct sreg {
- int regnum;
- void *buf;
- } sregs [] = {
- { 55, &(gregs->cel) }, /* CEL */
- { 54, &(gregs->ceh) }, /* CEH */
- { 53, &(gregs->sr0) }, /* sr0, i.e. cnt or COUNTER */
- { 52, &(gregs->sr1) }, /* sr1, i.e. lcr or LDCR */
- { 51, &(gregs->sr1) }, /* sr2, i.e. scr or STCR */
-
- /* Exception occured at this address, exactly the PC we want */
- { 49, &(gregs->cp0_epc) }, /* PC */
-
- { 38, &(gregs->cp0_ema) }, /* EMA */
- { 37, &(gregs->cp0_epc) }, /* EPC */
- { 34, &(gregs->cp0_ecr) }, /* ECR */
- { 33, &(gregs->cp0_condition) }, /* COND */
- { 32, &(gregs->cp0_psr) }, /* PSR */
- };
-
- for (regno = 0; regno < sizeof(sregs)/sizeof(sregs[0]); regno++)
- if (regnum == -1 || regnum == sregs[regno].regnum)
- regcache_raw_supply (regcache, sregs[regno].regnum, sregs[regno].buf);
- }
+ {
+ struct sreg {
+ int regnum;
+ void *buf;
+ } sregs [] = {
+ { 55, &(gregs->cel) }, /* CEL */
+ { 54, &(gregs->ceh) }, /* CEH */
+ { 53, &(gregs->sr0) }, /* sr0, i.e. cnt or COUNTER */
+ { 52, &(gregs->sr1) }, /* sr1, i.e. lcr or LDCR */
+ { 51, &(gregs->sr1) }, /* sr2, i.e. scr or STCR */
+
+ /* Exception occured at this address, exactly the PC we want */
+ { 49, &(gregs->cp0_epc) }, /* PC */
+
+ { 38, &(gregs->cp0_ema) }, /* EMA */
+ { 37, &(gregs->cp0_epc) }, /* EPC */
+ { 34, &(gregs->cp0_ecr) }, /* ECR */
+ { 33, &(gregs->cp0_condition) }, /* COND */
+ { 32, &(gregs->cp0_psr) }, /* PSR */
+ };
+
+ for (regno = 0; regno < sizeof(sregs)/sizeof(sregs[0]); regno++)
+ if (regnum == -1 || regnum == sregs[regno].regnum)
+ regcache_raw_supply (regcache,
+ sregs[regno].regnum, sregs[regno].buf);
+ }
}
/* Return the appropriate register set from the core section identified
- by SECT_NAME and SECT_SIZE. */
+ by SECT_NAME and SECT_SIZE. */
static const struct regset *
score7_linux_regset_from_core_section(struct gdbarch *gdbarch,
const char *sect_name, size_t sect_size)
{
- struct gdbarch_tdep *tdep;
+ struct gdbarch_tdep *tdep;
- gdb_assert (gdbarch != NULL);
- gdb_assert (sect_name != NULL);
+ gdb_assert (gdbarch != NULL);
+ gdb_assert (sect_name != NULL);
- tdep = gdbarch_tdep (gdbarch);
+ tdep = gdbarch_tdep (gdbarch);
- if (strcmp(sect_name, ".reg") == 0 && sect_size == sizeof(elf_gregset_t))
+ if (strcmp(sect_name, ".reg") == 0 && sect_size == sizeof(elf_gregset_t))
{
- if (tdep->gregset == NULL)
- tdep->gregset = regset_alloc (gdbarch, score7_linux_supply_gregset, NULL);
- return tdep->gregset;
+ if (tdep->gregset == NULL)
+ tdep->gregset = regset_alloc (gdbarch,
+ score7_linux_supply_gregset, NULL);
+ return tdep->gregset;
}
- return NULL;
+ return NULL;
}
static struct gdbarch *
@@ -1487,7 +1498,8 @@ score_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
#endif
set_gdbarch_pc_regnum (gdbarch, SCORE_PC_REGNUM);
set_gdbarch_sp_regnum (gdbarch, SCORE_SP_REGNUM);
- set_gdbarch_adjust_breakpoint_address (gdbarch, score_adjust_breakpoint_address);
+ set_gdbarch_adjust_breakpoint_address (gdbarch,
+ score_adjust_breakpoint_address);
set_gdbarch_register_type (gdbarch, score_register_type);
set_gdbarch_frame_align (gdbarch, score_frame_align);
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
@@ -1500,17 +1512,20 @@ score_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
case bfd_mach_score7:
set_gdbarch_breakpoint_from_pc (gdbarch, score7_breakpoint_from_pc);
set_gdbarch_skip_prologue (gdbarch, score7_skip_prologue);
- set_gdbarch_in_function_epilogue_p (gdbarch, score7_in_function_epilogue_p);
+ set_gdbarch_in_function_epilogue_p (gdbarch,
+ score7_in_function_epilogue_p);
set_gdbarch_register_name (gdbarch, score7_register_name);
set_gdbarch_num_regs (gdbarch, SCORE7_NUM_REGS);
- /* Core file support. */
- set_gdbarch_regset_from_core_section (gdbarch, score7_linux_regset_from_core_section);
+ /* Core file support. */
+ set_gdbarch_regset_from_core_section (gdbarch,
+ score7_linux_regset_from_core_section);
break;
case bfd_mach_score3:
set_gdbarch_breakpoint_from_pc (gdbarch, score3_breakpoint_from_pc);
set_gdbarch_skip_prologue (gdbarch, score3_skip_prologue);
- set_gdbarch_in_function_epilogue_p (gdbarch, score3_in_function_epilogue_p);
+ set_gdbarch_in_function_epilogue_p (gdbarch,
+ score3_in_function_epilogue_p);
set_gdbarch_register_name (gdbarch, score3_register_name);
set_gdbarch_num_regs (gdbarch, SCORE3_NUM_REGS);
break;
diff --git a/gdb/score-tdep.h b/gdb/score-tdep.h
index 9bb27fa..11c9e6a 100644
--- a/gdb/score-tdep.h
+++ b/gdb/score-tdep.h
@@ -47,28 +47,29 @@ enum gdb_regnum
#define SCORE_INSTLEN 4
#define SCORE16_INSTLEN 2
-/* Forward declarations. */
+/* Forward declarations. */
struct regset;
/* Target-dependent structure in gdbarch */
struct gdbarch_tdep
{
- /* Cached core file helpers. */
+ /* Cached core file helpers. */
struct regset *gregset;
};
/* Linux Core file support (dirty hack)
- S+core Linux register set definition, copy from S+core Linux */
+ S+core Linux register set definition, copy from S+core Linux. */
struct pt_regs {
- /* Pad bytes for argument save space on the stack. */
- unsigned long pad0[6]; /* may be 4,MIPS accept 6var,SCore accepts 4 Var--yuchen */
+ /* Pad bytes for argument save space on the stack. */
+ unsigned long pad0[6]; /* may be 4, MIPS accept 6var, SCore
+ accepts 4 Var--yuchen */
- /* Saved main processor registers. */
+ /* Saved main processor registers. */
unsigned long orig_r4;
unsigned long regs[32];
- /* Other saved registers. */
+ /* Other saved registers. */
unsigned long cel;
unsigned long ceh;
diff --git a/gdb/ser-base.c b/gdb/ser-base.c
index 31ba5b5..8f014d0 100644
--- a/gdb/ser-base.c
+++ b/gdb/ser-base.c
@@ -42,27 +42,27 @@ static handler_func fd_event;
is constantly scheduling timer events.
ASYNC only stops pestering its client when it is de-async'ed or it
- is told to go away. */
+ is told to go away. */
/* Value of scb->async_state: */
enum {
/* >= 0 (TIMER_SCHEDULED) */
- /* The ID of the currently scheduled timer event. This state is
+ /* The ID of the currently scheduled timer event. This state is
rarely encountered. Timer events are one-off so as soon as the
- event is delivered the state is shanged to NOTHING_SCHEDULED. */
+ event is delivered the state is shanged to NOTHING_SCHEDULED. */
FD_SCHEDULED = -1,
/* The fd_event() handler is scheduled. It is called when ever the
- file descriptor becomes ready. */
+ file descriptor becomes ready. */
NOTHING_SCHEDULED = -2
/* Either no task is scheduled (just going into ASYNC mode) or a
timer event has just gone off and the current state has been
- forced into nothing scheduled. */
+ forced into nothing scheduled. */
};
/* Identify and schedule the next ASYNC task based on scb->async_state
and scb->buf* (the input FIFO). A state machine is used to avoid
the need to make redundant calls into the event-loop - the next
- scheduled task is only changed when needed. */
+ scheduled task is only changed when needed. */
static void
reschedule (struct serial *scb)
@@ -128,7 +128,7 @@ reschedule (struct serial *scb)
is no pending error). As soon as data arrives, it is read into the
input FIFO and the client notified. The client should then drain
the FIFO using readchar(). If the FIFO isn't immediatly emptied,
- push_event() is used to nag the client until it is. */
+ push_event() is used to nag the client until it is. */
static void
fd_event (int error, void *context)
@@ -142,7 +142,7 @@ fd_event (int error, void *context)
{
/* Prime the input FIFO. The readchar() function is used to
pull characters out of the buffer. See also
- generic_readchar(). */
+ generic_readchar(). */
int nr;
nr = scb->ops->read_prim (scb, BUFSIZ);
if (nr == 0)
@@ -166,7 +166,7 @@ fd_event (int error, void *context)
/* PUSH_EVENT: The input FIFO is non-empty (or there is a pending
error). Nag the client until all the data has been read. In the
case of errors, the client will need to close or de-async the
- device before naging stops. */
+ device before naging stops. */
static void
push_event (void *context)
@@ -180,7 +180,7 @@ push_event (void *context)
}
/* Wait for input on scb, with timeout seconds. Returns 0 on success,
- otherwise SERIAL_TIMEOUT or SERIAL_ERROR. */
+ otherwise SERIAL_TIMEOUT or SERIAL_ERROR. */
static int
ser_base_wait_for (struct serial *scb, int timeout)
@@ -193,7 +193,7 @@ ser_base_wait_for (struct serial *scb, int timeout)
/* NOTE: Some OS's can scramble the READFDS when the select()
call fails (ex the kernel with Red Hat 5.2). Initialize all
- arguments before each call. */
+ arguments before each call. */
tv.tv_sec = timeout;
tv.tv_usec = 0;
@@ -215,7 +215,8 @@ ser_base_wait_for (struct serial *scb, int timeout)
else if (errno == EINTR)
continue;
else
- return SERIAL_ERROR; /* Got an error from select or poll */
+ return SERIAL_ERROR; /* Got an error from select or
+ poll. */
}
return 0;
@@ -225,7 +226,7 @@ ser_base_wait_for (struct serial *scb, int timeout)
/* Read a character with user-specified timeout. TIMEOUT is number of seconds
to wait, or -1 to wait forever. Use timeout of 0 to effect a poll. Returns
char if successful. Returns -2 if timeout expired, EOF if line dropped
- dead, or -3 for any other error (see errno in that case). */
+ dead, or -3 for any other error (see errno in that case). */
static int
do_ser_base_readchar (struct serial *scb, int timeout)
@@ -261,12 +262,12 @@ do_ser_base_readchar (struct serial *scb, int timeout)
timeout -= delta;
/* If we got a character or an error back from wait_for, then we can
- break from the loop before the timeout is completed. */
+ break from the loop before the timeout is completed. */
if (status != SERIAL_TIMEOUT)
break;
/* If we have exhausted the original timeout, then generate
- a SERIAL_TIMEOUT, and pass it out of the loop. */
+ a SERIAL_TIMEOUT, and pass it out of the loop. */
else if (timeout == 0)
{
status = SERIAL_TIMEOUT;
@@ -294,7 +295,7 @@ do_ser_base_readchar (struct serial *scb, int timeout)
return *scb->bufp++;
}
-/* Perform operations common to both old and new readchar. */
+/* Perform operations common to both old and new readchar. */
/* Return the next character from the input FIFO. If the FIFO is
empty, call the SERIAL specific routine to try and read in more
@@ -306,7 +307,7 @@ do_ser_base_readchar (struct serial *scb, int timeout)
specific readchar() function. Note: reschedule() is called after
every read. This is because there is no guarentee that the lower
level fd_event() poll_event() code (which also calls reschedule())
- will be called. */
+ will be called. */
int
generic_readchar (struct serial *scb, int timeout,
@@ -321,7 +322,7 @@ generic_readchar (struct serial *scb, int timeout,
}
else if (scb->bufcnt < 0)
{
- /* Some errors/eof are are sticky. */
+ /* Some errors/eof are are sticky. */
ch = scb->bufcnt;
}
else
@@ -333,7 +334,7 @@ generic_readchar (struct serial *scb, int timeout,
{
case SERIAL_EOF:
case SERIAL_ERROR:
- /* Make the error/eof stick. */
+ /* Make the error/eof stick. */
scb->bufcnt = ch;
break;
case SERIAL_TIMEOUT:
@@ -452,13 +453,13 @@ ser_base_drain_output (struct serial *scb)
void
ser_base_raw (struct serial *scb)
{
- return; /* Always in raw mode */
+ return; /* Always in raw mode. */
}
serial_ttystate
ser_base_get_tty_state (struct serial *scb)
{
- /* allocate a dummy */
+ /* Allocate a dummy. */
return (serial_ttystate) XMALLOC (int);
}
@@ -488,13 +489,13 @@ ser_base_print_tty_state (struct serial *scb,
int
ser_base_setbaudrate (struct serial *scb, int rate)
{
- return 0; /* Never fails! */
+ return 0; /* Never fails! */
}
int
ser_base_setstopbits (struct serial *scb, int num)
{
- return 0; /* Never fails! */
+ return 0; /* Never fails! */
}
/* Put the SERIAL device into/out-of ASYNC mode. */
@@ -505,7 +506,7 @@ ser_base_async (struct serial *scb,
{
if (async_p)
{
- /* Force a re-schedule. */
+ /* Force a re-schedule. */
scb->async_state = NOTHING_SCHEDULED;
if (serial_debug_p (scb))
fprintf_unfiltered (gdb_stdlog, "[fd%d->asynchronous]\n",
@@ -517,7 +518,7 @@ ser_base_async (struct serial *scb,
if (serial_debug_p (scb))
fprintf_unfiltered (gdb_stdlog, "[fd%d->synchronous]\n",
scb->fd);
- /* De-schedule whatever tasks are currently scheduled. */
+ /* De-schedule whatever tasks are currently scheduled. */
switch (scb->async_state)
{
case FD_SCHEDULED:
diff --git a/gdb/ser-go32.c b/gdb/ser-go32.c
index 38ea622..44fea13 100644
--- a/gdb/ser-go32.c
+++ b/gdb/ser-go32.c
@@ -152,12 +152,12 @@ static int intrcnt;
static int cnts[NCNT];
static char *cntnames[NCNT] =
{
- /* h/w interrupt counts. */
+ /* h/w interrupt counts. */
"mlsc", "nopend", "txrdy", "?3",
"rxrdy", "?5", "rls", "?7",
"?8", "?9", "?a", "?b",
"rxtout", "?d", "?e", "?f",
- /* s/w counts. */
+ /* s/w counts. */
"rxcnt", "txcnt", "stray", "swoflo"
};
@@ -166,15 +166,15 @@ static char *cntnames[NCNT] =
#define COUNT(x)
#endif
-/* Main interrupt controller port addresses. */
+/* Main interrupt controller port addresses. */
#define ICU_BASE 0x20
#define ICU_OCW2 (ICU_BASE + 0)
#define ICU_MASK (ICU_BASE + 1)
-/* Original interrupt controller mask register. */
+/* Original interrupt controller mask register. */
unsigned char icu_oldmask;
-/* Maximum of 8 interrupts (we don't handle the slave icu yet). */
+/* Maximum of 8 interrupts (we don't handle the slave icu yet). */
#define NINTR 8
static struct intrupt
@@ -341,11 +341,11 @@ dos_comisr (int irq)
break;
case IIR_NOPEND:
- /* no more pending interrupts, all done */
+ /* No more pending interrupts, all done. */
return;
default:
- /* unexpected interrupt, ignore */
+ /* Unexpected interrupt, ignore. */
break;
}
COUNT (iir);
@@ -385,7 +385,7 @@ dos_hookirq (unsigned int irq)
vec = 0x08 + irq;
isr = isrs[irq];
- /* setup real mode handler */
+ /* Setup real mode handler. */
_go32_dpmi_get_real_mode_interrupt_vector (vec, &intr->old_rmhandler);
intr->new_rmhandler.pm_selector = _go32_my_cs ();
@@ -401,7 +401,7 @@ dos_hookirq (unsigned int irq)
return 0;
}
- /* setup protected mode handler */
+ /* Setup protected mode handler. */
_go32_dpmi_get_protected_mode_interrupt_vector (vec, &intr->old_pmhandler);
intr->new_pmhandler.pm_selector = _go32_my_cs ();
@@ -414,7 +414,7 @@ dos_hookirq (unsigned int irq)
return 0;
}
- /* setup interrupt controller mask */
+ /* Setup interrupt controller mask. */
disable ();
outportb (ICU_MASK, inportb (ICU_MASK) & ~(1 << irq));
enable ();
@@ -433,17 +433,17 @@ dos_unhookirq (struct intrupt *intr)
irq = intr - intrupts;
vec = 0x08 + irq;
- /* restore old interrupt mask bit */
+ /* Restore old interrupt mask bit. */
mask = 1 << irq;
disable ();
outportb (ICU_MASK, inportb (ICU_MASK) | (mask & icu_oldmask));
enable ();
- /* remove real mode handler */
+ /* Remove real mode handler. */
_go32_dpmi_set_real_mode_interrupt_vector (vec, &intr->old_rmhandler);
_go32_dpmi_free_real_mode_callback (&intr->new_rmhandler);
- /* remove protected mode handler */
+ /* Remove protected mode handler. */
_go32_dpmi_set_protected_mode_interrupt_vector (vec, &intr->old_pmhandler);
_go32_dpmi_free_iret_wrapper (&intr->new_pmhandler);
intr->inuse = 0;
@@ -482,12 +482,12 @@ dos_open (struct serial *scb, const char *name)
port = &ports[fd];
if (port->refcnt++ > 0)
{
- /* Device already opened another user. Just point at it. */
+ /* Device already opened another user. Just point at it. */
scb->fd = fd;
return 0;
}
- /* force access to ID reg */
+ /* Force access to ID reg. */
outb (port, com_cfcr, 0);
outb (port, com_iir, 0);
for (i = 0; i < 17; i++)
@@ -500,23 +500,23 @@ dos_open (struct serial *scb, const char *name)
return -1;
ok:
- /* disable all interrupts in chip */
+ /* Disable all interrupts in chip. */
outb (port, com_ier, 0);
- /* tentatively enable 16550 fifo, and see if it responds */
+ /* Tentatively enable 16550 fifo, and see if it responds. */
outb (port, com_fifo,
FIFO_ENABLE | FIFO_RCV_RST | FIFO_XMT_RST | FIFO_TRIGGER);
sleep (1);
port->fifo = ((inb (port, com_iir) & IIR_FIFO_MASK) == IIR_FIFO_MASK);
- /* clear pending status reports. */
+ /* clear pending status reports. */
(void) inb (port, com_lsr);
(void) inb (port, com_msr);
- /* enable external interrupt gate (to avoid floating IRQ) */
+ /* Enable external interrupt gate (to avoid floating IRQ). */
outb (port, com_mcr, MCR_IENABLE);
- /* hook up interrupt handler and initialise icu */
+ /* Hook up interrupt handler and initialise icu. */
port->intrupt = dos_hookirq (port->irq);
if (!port->intrupt)
{
@@ -532,22 +532,22 @@ ok:
port->intrupt->port = port;
scb->fd = fd;
- /* clear rx buffer, tx busy flag and overflow count */
+ /* Clear rx buffer, tx busy flag and overflow count. */
port->first = port->count = 0;
port->txbusy = 0;
port->oflo = 0;
- /* set default baud rate and mode: 9600,8,n,1 */
+ /* Set default baud rate and mode: 9600,8,n,1 */
i = dos_baudconv (port->baudrate = 9600);
outb (port, com_cfcr, CFCR_DLAB);
outb (port, com_dlbl, i & 0xff);
outb (port, com_dlbh, i >> 8);
outb (port, com_cfcr, CFCR_8BITS);
- /* enable all interrupts */
+ /* Enable all interrupts. */
outb (port, com_ier, IER_ETXRDY | IER_ERXRDY | IER_ERLS | IER_EMSC);
- /* enable DTR & RTS */
+ /* Enable DTR & RTS. */
outb (port, com_mcr, MCR_DTR | MCR_RTS | MCR_IENABLE);
enable ();
@@ -573,7 +573,7 @@ dos_close (struct serial *scb)
if (!(intrupt = port->intrupt))
return;
- /* disable interrupts, fifo, flow control */
+ /* Disable interrupts, fifo, flow control. */
disable ();
port->intrupt = 0;
intrupt->port = 0;
@@ -581,11 +581,11 @@ dos_close (struct serial *scb)
outb (port, com_ier, 0);
enable ();
- /* unhook handler, and disable interrupt gate */
+ /* Unhook handler, and disable interrupt gate. */
dos_unhookirq (intrupt);
outb (port, com_mcr, 0);
- /* Check for overflow errors */
+ /* Check for overflow errors. */
if (port->oflo)
{
fprintf_unfiltered (gdb_stderr,
@@ -607,7 +607,7 @@ dos_noop (struct serial *scb)
static void
dos_raw (struct serial *scb)
{
- /* Always in raw mode */
+ /* Always in raw mode. */
}
static int
@@ -690,7 +690,7 @@ static void
dos_print_tty_state (struct serial *scb, serial_ttystate ttystate,
struct ui_file *stream)
{
- /* Nothing to print */
+ /* Nothing to print. */
return;
}
@@ -702,7 +702,7 @@ dos_baudconv (int rate)
if (rate <= 0)
return -1;
-#define divrnd(n, q) (((n) * 2 / (q) + 1) / 2) /* divide and round off */
+#define divrnd(n, q) (((n) * 2 / (q) + 1) / 2) /* Divide and round off. */
x = divrnd (COMTICK, rate);
if (x <= 0)
return -1;
@@ -786,7 +786,7 @@ dos_write (struct serial *scb, const char *str, int len)
while (len > 0)
{
- /* send the data, fifosize bytes at a time */
+ /* Send the data, fifosize bytes at a time. */
cnt = fifosize > len ? len : fifosize;
port->txbusy = 1;
/* Francisco Pastor <fpastor.etra-id@etra.es> says OUTSB messes
@@ -802,7 +802,7 @@ dos_write (struct serial *scb, const char *str, int len)
#ifdef DOS_STATS
cnts[CNT_TX] += cnt;
#endif
- /* wait for transmission to complete (max 1 sec) */
+ /* Wait for transmission to complete (max 1 sec). */
then = rawclock () + RAWHZ;
while (port->txbusy)
{
@@ -856,8 +856,8 @@ static struct serial_ops dos_ops =
dos_noflush_set_tty_state,
dos_setbaudrate,
dos_setstopbits,
- dos_noop, /* wait for output to drain */
- (void (*)(struct serial *, int))NULL /* change into async mode */
+ dos_noop, /* Wait for output to drain. */
+ (void (*)(struct serial *, int))NULL /* Change into async mode. */
};
int
@@ -903,10 +903,10 @@ _initialize_ser_dos (void)
{
serial_add_interface (&dos_ops);
- /* Save original interrupt mask register. */
+ /* Save original interrupt mask register. */
icu_oldmask = inportb (ICU_MASK);
- /* Mark fixed motherboard irqs as inuse. */
+ /* Mark fixed motherboard irqs as inuse. */
intrupts[0].inuse = /* timer tick */
intrupts[1].inuse = /* keyboard */
intrupts[2].inuse = 1; /* slave icu */
diff --git a/gdb/ser-mingw.c b/gdb/ser-mingw.c
index b1bfc32..6d8edcc 100644
--- a/gdb/ser-mingw.c
+++ b/gdb/ser-mingw.c
@@ -380,7 +380,7 @@ struct ser_console_state
the started state. */
HANDLE start_select;
/* Signaled by the main program to tell the select thread to enter
- the stopped state. */
+ the stopped state. */
HANDLE stop_select;
/* Signaled by the main program to tell the select thread to
exit. */
diff --git a/gdb/ser-pipe.c b/gdb/ser-pipe.c
index f73ba83..fd6650a 100644
--- a/gdb/ser-pipe.c
+++ b/gdb/ser-pipe.c
@@ -45,7 +45,7 @@ struct pipe_state
int pid;
};
-/* Open up a raw pipe */
+/* Open up a raw pipe. */
static int
pipe_open (struct serial *scb, const char *name)
@@ -80,7 +80,7 @@ pipe_open (struct serial *scb, const char *name)
on certain platforms. */
pid = vfork ();
- /* Error. */
+ /* Error. */
if (pid == -1)
{
close (pdes[0]);
@@ -97,7 +97,7 @@ pipe_open (struct serial *scb, const char *name)
err_pdes[0] = err_pdes[1] = -1;
}
- /* Child. */
+ /* Child. */
if (pid == 0)
{
/* We don't want ^c to kill the connection. */
@@ -109,7 +109,7 @@ pipe_open (struct serial *scb, const char *name)
signal (SIGINT, SIG_IGN);
#endif
- /* re-wire pdes[1] to stdin/stdout */
+ /* Re-wire pdes[1] to stdin/stdout. */
close (pdes[0]);
if (pdes[1] != STDOUT_FILENO)
{
@@ -125,18 +125,18 @@ pipe_open (struct serial *scb, const char *name)
close (err_pdes[1]);
}
#if 0
- /* close any stray FD's - FIXME - how? */
+ /* close any stray FD's - FIXME - how? */
/* POSIX.2 B.3.2.2 "popen() shall ensure that any streams
from previous popen() calls that remain open in the
- parent process are closed in the new child process. */
+ parent process are closed in the new child process. */
for (old = pidlist; old; old = old->next)
- close (fileno (old->fp)); /* don't allow a flush */
+ close (fileno (old->fp)); /* Don't allow a flush. */
#endif
execl ("/bin/sh", "sh", "-c", name, (char *) 0);
_exit (127);
}
- /* Parent. */
+ /* Parent. */
close (pdes[1]);
if (err_pdes[1] != -1)
close (err_pdes[1]);
diff --git a/gdb/ser-tcp.c b/gdb/ser-tcp.c
index 140f131..cbf3149 100644
--- a/gdb/ser-tcp.c
+++ b/gdb/ser-tcp.c
@@ -29,10 +29,10 @@
#include <sys/types.h>
#ifdef HAVE_SYS_FILIO_H
-#include <sys/filio.h> /* For FIONBIO. */
+#include <sys/filio.h> /* For FIONBIO. */
#endif
#ifdef HAVE_SYS_IOCTL_H
-#include <sys/ioctl.h> /* For FIONBIO. */
+#include <sys/ioctl.h> /* For FIONBIO. */
#endif
#include <sys/time.h>
@@ -73,7 +73,7 @@ static int tcp_auto_retry = 1;
static int tcp_retry_limit = 15;
-/* how many times per second to poll deprecated_ui_loop_hook */
+/* How many times per second to poll deprecated_ui_loop_hook. */
#define POLL_INTERVAL 5
@@ -149,7 +149,7 @@ wait_for_connect (struct serial *scb, int *polls)
return n;
}
-/* Open a tcp socket */
+/* Open a tcp socket. */
int
net_open (struct serial *scb, const char *name)
@@ -178,14 +178,15 @@ net_open (struct serial *scb, const char *name)
port_str = strchr (name, ':');
if (!port_str)
- error (_("net_open: No colon in host name!")); /* Shouldn't ever happen */
+ error (_("net_open: No colon in host name!")); /* Shouldn't ever
+ happen. */
tmp = min (port_str - name, (int) sizeof hostname - 1);
- strncpy (hostname, name, tmp); /* Don't want colon */
- hostname[tmp] = '\000'; /* Tie off host name */
+ strncpy (hostname, name, tmp); /* Don't want colon. */
+ hostname[tmp] = '\000'; /* Tie off host name. */
port = atoi (port_str + 1);
- /* default hostname is localhost */
+ /* Default hostname is localhost. */
if (!hostname[0])
strcpy (hostname, "localhost");
@@ -212,12 +213,12 @@ net_open (struct serial *scb, const char *name)
if (scb->fd == -1)
return -1;
- /* set socket nonblocking */
+ /* Set socket nonblocking. */
ioarg = 1;
ioctl (scb->fd, FIONBIO, &ioarg);
/* Use Non-blocking connect. connect() will return 0 if connected
- already. */
+ already. */
n = connect (scb->fd, (struct sockaddr *) &sockaddr, sizeof (sockaddr));
if (n < 0)
@@ -257,7 +258,7 @@ net_open (struct serial *scb, const char *name)
return -1;
}
- /* looks like we need to wait for the connect */
+ /* Looks like we need to wait for the connect. */
do
{
n = wait_for_connect (scb, &polls);
@@ -270,7 +271,7 @@ net_open (struct serial *scb, const char *name)
}
}
- /* Got something. Is it an error? */
+ /* Got something. Is it an error? */
{
int res, err;
socklen_t len;
@@ -302,13 +303,13 @@ net_open (struct serial *scb, const char *name)
}
}
- /* turn off nonblocking */
+ /* Turn off nonblocking. */
ioarg = 0;
ioctl (scb->fd, FIONBIO, &ioarg);
if (use_udp == 0)
{
- /* Disable Nagle algorithm. Needed in some cases. */
+ /* Disable Nagle algorithm. Needed in some cases. */
tmp = 1;
setsockopt (scb->fd, IPPROTO_TCP, TCP_NODELAY,
(char *)&tmp, sizeof (tmp));
@@ -348,7 +349,7 @@ net_write_prim (struct serial *scb, const void *buf, size_t count)
int
ser_tcp_send_break (struct serial *scb)
{
- /* Send telnet IAC and BREAK characters. */
+ /* Send telnet IAC and BREAK characters. */
return (serial_write (scb, "\377\363", 2));
}
diff --git a/gdb/ser-unix.c b/gdb/ser-unix.c
index 0ac6c2d..c213b3d 100644
--- a/gdb/ser-unix.c
+++ b/gdb/ser-unix.c
@@ -103,7 +103,7 @@ static int hardwire_setstopbits (struct serial *, int);
void _initialize_ser_hardwire (void);
-/* Open up a real live device for serial I/O */
+/* Open up a real live device for serial I/O. */
static int
hardwire_open (struct serial *scb, const char *name)
@@ -287,7 +287,8 @@ hardwire_print_tty_state (struct serial *scb,
#endif
}
-/* Wait for the output to drain away, as opposed to flushing (discarding) it */
+/* Wait for the output to drain away, as opposed to flushing
+ (discarding) it. */
static int
hardwire_drain_output (struct serial *scb)
@@ -303,7 +304,7 @@ hardwire_drain_output (struct serial *scb)
#ifdef HAVE_SGTTY
/* Get the current state and then restore it using TIOCSETP,
which should cause the output to drain and pending input
- to be discarded. */
+ to be discarded. */
{
struct hardwire_ttystate state;
@@ -440,17 +441,16 @@ hardwire_raw (struct serial *scb)
otherwise SERIAL_TIMEOUT or SERIAL_ERROR.
For termio{s}, we actually just setup VTIME if necessary, and let the
- timeout occur in the read() in hardwire_read().
- */
+ timeout occur in the read() in hardwire_read(). */
/* FIXME: cagney/1999-09-16: Don't replace this with the equivalent
ser_base*() until the old TERMIOS/SGTTY/... timer code has been
- flushed. . */
+ flushed. . */
/* NOTE: cagney/1999-09-30: Much of the code below is dead. The only
possible values of the TIMEOUT parameter are ONE and ZERO.
Consequently all the code that tries to handle the possability of
- an overflowed timer is unnecessary. */
+ an overflowed timer is unnecessary. */
static int
wait_for (struct serial *scb, int timeout)
@@ -464,7 +464,7 @@ wait_for (struct serial *scb, int timeout)
/* NOTE: Some OS's can scramble the READFDS when the select()
call fails (ex the kernel with Red Hat 5.2). Initialize all
- arguments before each call. */
+ arguments before each call. */
tv.tv_sec = timeout;
tv.tv_usec = 0;
@@ -483,7 +483,7 @@ wait_for (struct serial *scb, int timeout)
else if (errno == EINTR)
continue;
else
- return SERIAL_ERROR; /* Got an error from select or poll */
+ return SERIAL_ERROR; /* Got an error from select or poll. */
return 0;
}
@@ -568,13 +568,13 @@ wait_for (struct serial *scb, int timeout)
/* FIXME: cagney/1999-09-16: Don't replace this with the equivalent
ser_base*() until the old TERMIOS/SGTTY/... timer code has been
- flushed. */
+ flushed. */
/* NOTE: cagney/1999-09-16: This function is not identical to
ser_base_readchar() as part of replacing it with ser_base*()
merging will be required - this code handles the case where read()
times out due to no data while ser_base_readchar() doesn't expect
- that. */
+ that. */
static int
do_hardwire_readchar (struct serial *scb, int timeout)
@@ -768,12 +768,12 @@ rate_to_code (int rate)
for (i = 0; baudtab[i].rate != -1; i++)
{
- /* test for perfect macth. */
+ /* test for perfect macth. */
if (rate == baudtab[i].rate)
return baudtab[i].code;
else
{
- /* check if it is in between valid values. */
+ /* check if it is in between valid values. */
if (rate < baudtab[i].rate)
{
if (i)
@@ -792,7 +792,7 @@ rate_to_code (int rate)
}
}
- /* The requested speed was too large. */
+ /* The requested speed was too large. */
warning (_("Invalid baud rate %d. Maximum value is %d."),
rate, baudtab[i - 1].rate);
return -1;
@@ -807,7 +807,7 @@ hardwire_setbaudrate (struct serial *scb, int rate)
if (baud_code < 0)
{
/* The baud rate was not valid.
- A warning has already been issued. */
+ A warning has already been issued. */
errno = EINVAL;
return -1;
}
@@ -902,8 +902,8 @@ _initialize_ser_hardwire (void)
ops->open = hardwire_open;
ops->close = hardwire_close;
/* FIXME: Don't replace this with the equivalent ser_base*() until
- the old TERMIOS/SGTTY/... timer code has been flushed. cagney
- 1999-09-16. */
+ the old TERMIOS/SGTTY/... timer code has been flushed. cagney
+ 1999-09-16. */
ops->readchar = hardwire_readchar;
ops->write = ser_base_write;
ops->flush_output = hardwire_flush_output;
diff --git a/gdb/serial.c b/gdb/serial.c
index 10b37f1..8809abd 100644
--- a/gdb/serial.c
+++ b/gdb/serial.c
@@ -27,24 +27,24 @@
extern void _initialize_serial (void);
-/* Is serial being debugged? */
+/* Is serial being debugged? */
static int global_serial_debug_p;
-/* Linked list of serial I/O handlers */
+/* Linked list of serial I/O handlers. */
static struct serial_ops *serial_ops_list = NULL;
-/* This is the last serial stream opened. Used by connect command. */
+/* This is the last serial stream opened. Used by connect command. */
static struct serial *last_serial_opened = NULL;
-/* Pointer to list of scb's. */
+/* Pointer to list of scb's. */
static struct serial *scb_base;
/* Non-NULL gives filename which contains a recording of the remote session,
- suitable for playback by gdbserver. */
+ suitable for playback by gdbserver. */
static char *serial_logfile = NULL;
static struct ui_file *serial_logfp = NULL;
@@ -62,7 +62,7 @@ static const char *serial_logbase = logbase_ascii;
static int serial_current_type = 0;
-/* Log char CH of type CHTYPE, with TIMEOUT */
+/* Log char CH of type CHTYPE, with TIMEOUT. */
/* Define bogus char to represent a BREAK. Should be careful to choose a value
that can't be confused with a normal char, or an error code. */
@@ -143,7 +143,7 @@ serial_log_command (const char *cmd)
fputs_unfiltered (cmd, serial_logfp);
/* Make sure that the log file is as up-to-date as possible,
- in case we are getting ready to dump core or something. */
+ in case we are getting ready to dump core or something. */
gdb_flush (serial_logfp);
}
@@ -167,7 +167,7 @@ serial_add_interface (struct serial_ops *optable)
serial_ops_list = optable;
}
-/* Open up a device or a network socket, depending upon the syntax of NAME. */
+/* Open up a device or a network socket, depending upon the syntax of NAME. */
struct serial *
serial_open (const char *name)
@@ -327,7 +327,7 @@ do_serial_close (struct serial *scb, int really_close)
fputs_unfiltered ("\nEnd of log\n", serial_logfp);
serial_current_type = 0;
- /* XXX - What if serial_logfp == gdb_stdout or gdb_stderr? */
+ /* XXX - What if serial_logfp == gdb_stdout or gdb_stderr? */
ui_file_delete (serial_logfp);
serial_logfp = NULL;
}
@@ -342,7 +342,7 @@ do_serial_close (struct serial *scb, int really_close)
if (scb->refcnt > 0)
return;
- /* ensure that the FD has been taken out of async mode */
+ /* ensure that the FD has been taken out of async mode. */
if (scb->async_handler != NULL)
serial_async (scb, NULL, NULL);
@@ -385,7 +385,7 @@ serial_readchar (struct serial *scb, int timeout)
int ch;
/* FIXME: cagney/1999-10-11: Don't enable this check until the ASYNC
- code is finished. */
+ code is finished. */
if (0 && serial_is_async_p (scb) && timeout < 0)
internal_error (__FILE__, __LINE__,
_("serial_readchar: blocking read in async mode"));
@@ -396,7 +396,7 @@ serial_readchar (struct serial *scb, int timeout)
serial_logchar (serial_logfp, 'r', ch, timeout);
/* Make sure that the log file is as up-to-date as possible,
- in case we are getting ready to dump core or something. */
+ in case we are getting ready to dump core or something. */
gdb_flush (serial_logfp);
}
if (serial_debug_p (scb))
@@ -421,7 +421,7 @@ serial_write (struct serial *scb, const char *str, int len)
serial_logchar (serial_logfp, 'w', str[count] & 0xff, 0);
/* Make sure that the log file is as up-to-date as possible,
- in case we are getting ready to dump core or something. */
+ in case we are getting ready to dump core or something. */
gdb_flush (serial_logfp);
}
if (serial_debug_p (scb))
@@ -557,7 +557,7 @@ int
deprecated_serial_fd (struct serial *scb)
{
/* FIXME: should this output a warning that deprecated code is being
- called? */
+ called? */
if (scb->fd < 0)
{
internal_error (__FILE__, __LINE__,
diff --git a/gdb/serial.h b/gdb/serial.h
index 196f8cf..58207c7 100644
--- a/gdb/serial.h
+++ b/gdb/serial.h
@@ -37,9 +37,9 @@ typedef void *serial_ttystate;
struct serial;
/* Try to open NAME. Returns a new `struct serial *' on success, NULL
- on failure. Note that some open calls can block and, if possible,
+ on failure. Note that some open calls can block and, if possible,
should be written to be non-blocking, with calls to ui_look_hook
- so they can be cancelled. An async interface for open could be
+ so they can be cancelled. An async interface for open could be
added to GDB if necessary. */
extern struct serial *serial_open (const char *name);
@@ -75,7 +75,7 @@ extern void serial_un_fdopen (struct serial *scb);
/* Read one char from the serial device with TIMEOUT seconds to wait
or -1 to wait forever. Use timeout of 0 to effect a poll.
- Infinite waits are not permitted. Returns unsigned char if ok, else
+ Infinite waits are not permitted. Returns unsigned char if ok, else
one of the following codes. Note that all error return-codes are
guaranteed to be < 0. */
@@ -137,7 +137,7 @@ extern serial_ttystate serial_get_tty_state (struct serial *scb);
extern int serial_set_tty_state (struct serial *scb, serial_ttystate ttystate);
/* printf_filtered a user-comprehensible description of ttystate on
- the specified STREAM. FIXME: At present this sends output to the
+ the specified STREAM. FIXME: At present this sends output to the
default stream - GDB_STDOUT. */
extern void serial_print_tty_state (struct serial *scb,
@@ -170,11 +170,11 @@ extern int serial_setstopbits (struct serial *scb, int num);
/* Asynchronous serial interface: */
-/* Can the serial device support asynchronous mode? */
+/* Can the serial device support asynchronous mode? */
extern int serial_can_async_p (struct serial *scb);
-/* Has the serial device been put in asynchronous mode? */
+/* Has the serial device been put in asynchronous mode? */
extern int serial_is_async_p (struct serial *scb);
@@ -188,7 +188,7 @@ extern void serial_async (struct serial *scb,
/* Provide direct access to the underlying FD (if any) used to
implement the serial device. This interface is clearly
- deprecated. Will call internal_error() if the operation isn't
+ deprecated. Will call internal_error() if the operation isn't
applicable to the current serial device. */
extern int deprecated_serial_fd (struct serial *scb);
@@ -203,7 +203,7 @@ extern void serial_debug (struct serial *scb, int debug_p);
extern int serial_debug_p (struct serial *scb);
-/* Details of an instance of a serial object */
+/* Details of an instance of a serial object. */
struct serial
{
@@ -257,7 +257,7 @@ struct serial_ops
serial_ttystate);
int (*setbaudrate) (struct serial *, int rate);
int (*setstopbits) (struct serial *, int num);
- /* Wait for output to drain */
+ /* Wait for output to drain. */
int (*drain_output) (struct serial *);
/* Change the serial device into/out of asynchronous mode, call
the specified function when ever there is something
@@ -284,11 +284,11 @@ struct serial_ops
#endif /* USE_WIN32API */
};
-/* Add a new serial interface to the interface list */
+/* Add a new serial interface to the interface list. */
extern void serial_add_interface (struct serial_ops * optable);
-/* File in which to record the remote debugging session */
+/* File in which to record the remote debugging session. */
extern void serial_log_command (const char *);
diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
index 2964d52..1b9fd90 100644
--- a/gdb/sh-tdep.c
+++ b/gdb/sh-tdep.c
@@ -19,10 +19,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-/*
- Contributed by Steve Chamberlain
- sac@cygnus.com
- */
+/* Contributed by Steve Chamberlain
+ sac@cygnus.com. */
#include "defs.h"
#include "frame.h"
@@ -54,7 +52,7 @@
/* sh flags */
#include "elf/sh.h"
#include "dwarf2.h"
-/* registers numbers shared with the simulator */
+/* registers numbers shared with the simulator. */
#include "gdb/sim-sh.h"
/* List of "set sh ..." and "show sh ..." commands. */
@@ -82,7 +80,7 @@ struct sh_frame_cache
LONGEST 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. */
@@ -203,7 +201,7 @@ sh_sh2a_register_name (struct gdbarch *gdbarch, int reg_nr)
/* 41, 42 */
"", "",
/* 43 - 62. Banked registers. The bank number used is determined by
- the bank register (63). */
+ the bank register (63). */
"r0b", "r1b", "r2b", "r3b", "r4b", "r5b", "r6b", "r7b",
"r8b", "r9b", "r10b", "r11b", "r12b", "r13b", "r14b",
"machb", "ivnb", "prb", "gbrb", "maclb",
@@ -243,7 +241,7 @@ sh_sh2a_nofpu_register_name (struct gdbarch *gdbarch, int reg_nr)
/* 41, 42 */
"", "",
/* 43 - 62. Banked registers. The bank number used is determined by
- the bank register (63). */
+ the bank register (63). */
"r0b", "r1b", "r2b", "r3b", "r4b", "r5b", "r6b", "r7b",
"r8b", "r9b", "r10b", "r11b", "r12b", "r13b", "r14b",
"machb", "ivnb", "prb", "gbrb", "maclb",
@@ -332,7 +330,7 @@ sh_sh4_register_name (struct gdbarch *gdbarch, int reg_nr)
/* bank 1 51 - 58 */
"r0b1", "r1b1", "r2b1", "r3b1", "r4b1", "r5b1", "r6b1", "r7b1",
"", "", "", "", "", "", "", "",
- /* pseudo bank register. */
+ /* pseudo bank register. */
"",
/* double precision (pseudo) 59 - 66 */
"dr0", "dr2", "dr4", "dr6", "dr8", "dr10", "dr12", "dr14",
@@ -369,7 +367,7 @@ sh_sh4_nofpu_register_name (struct gdbarch *gdbarch, int reg_nr)
/* bank 1 51 - 58 */
"r0b1", "r1b1", "r2b1", "r3b1", "r4b1", "r5b1", "r6b1", "r7b1",
"", "", "", "", "", "", "", "",
- /* pseudo bank register. */
+ /* pseudo bank register. */
"",
/* double precision (pseudo) 59 - 66 -- not for nofpu target */
"", "", "", "", "", "", "", "",
@@ -409,7 +407,7 @@ sh_sh4al_dsp_register_name (struct gdbarch *gdbarch, int reg_nr)
static const unsigned char *
sh_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
{
- /* 0xc3c3 is trapa #c3, and it works in big and little endian modes */
+ /* 0xc3c3 is trapa #c3, and it works in big and little endian modes. */
static unsigned char breakpoint[] = { 0xc3, 0xc3 };
/* For remote stub targets, trapa #20 is used. */
@@ -441,8 +439,7 @@ sh_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
sub <room_for_loca_vars>,r15
mov r15,r14
- Actually it can be more complicated than this but that's it, basically.
- */
+ Actually it can be more complicated than this but that's it, basically. */
#define GET_SOURCE_REG(x) (((x) >> 4) & 0xf)
#define GET_TARGET_REG(x) (((x) >> 8) & 0xf)
@@ -481,7 +478,7 @@ sh_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
FMOV DRm,@-Rn Rn-8-->Rn, DRm-->(Rn) 1111nnnnmmm01011
FMOV XDm,@-Rn Rn-8-->Rn, XDm-->(Rn) 1111nnnnmmm11011 */
/* CV, 2003-08-28: Only suitable with Rn == SP, therefore name changed to
- make this entirely clear. */
+ make this entirely clear. */
/* #define IS_FMOV(x) (((x) & 0xf00f) == 0xf00b) */
#define IS_FPUSH(x) (((x) & 0xff0f) == 0xff0b)
@@ -512,7 +509,7 @@ sh_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
#define FPSCR_SZ (1 << 20)
-/* The following instructions are used for epilogue testing. */
+/* The following instructions are used for epilogue testing. */
#define IS_RESTORE_FP(x) ((x) == 0x6ef6)
#define IS_RTS(x) ((x) == 0x000b)
#define IS_LDS(x) ((x) == 0x4f26)
@@ -541,7 +538,7 @@ sh_analyze_prologue (struct gdbarch *gdbarch,
for (opc = pc + (2 * 28); pc < opc; pc += 2)
{
inst = read_memory_unsigned_integer (pc, 2, byte_order);
- /* See where the registers will be saved to */
+ /* See where the registers will be saved to. */
if (IS_PUSH (inst))
{
cache->saved_regs[GET_SOURCE_REG (inst)] = cache->sp_offset;
@@ -612,7 +609,7 @@ sh_analyze_prologue (struct gdbarch *gdbarch,
{
sav_reg = reg;
sav_offset = GET_SOURCE_REG (inst) << 16;
- /* MOVI20 is a 32 bit instruction! */
+ /* MOVI20 is a 32 bit instruction! */
pc += 2;
sav_offset
|= read_memory_unsigned_integer (pc, 2, byte_order);
@@ -650,7 +647,7 @@ sh_analyze_prologue (struct gdbarch *gdbarch,
registers or argument register moves to @(X,fp) which are
moving the register arguments onto the stack area allocated
by a former add somenumber to SP call. Don't allow moving
- to an fp indirect address above fp + cache->sp_offset. */
+ to an fp indirect address above fp + cache->sp_offset. */
pc += 2;
for (opc = pc + 12; pc < opc; pc += 2)
{
@@ -683,15 +680,16 @@ sh_analyze_prologue (struct gdbarch *gdbarch,
appear to be called after the function it is calling via the
jsr, which will be very confusing. Most likely the next
instruction is going to be IS_MOV_SP_FP in the delay slot. If
- so, note that before returning the current pc. */
+ so, note that before returning the current pc. */
inst = read_memory_integer (pc + 2, 2, byte_order);
if (IS_MOV_SP_FP (inst))
cache->uses_fp = 1;
break;
}
-#if 0 /* This used to just stop when it found an instruction that
- was not considered part of the prologue. Now, we just
- keep going looking for likely instructions. */
+#if 0 /* This used to just stop when it found an instruction
+ that was not considered part of the prologue. Now,
+ we just keep going looking for likely
+ instructions. */
else
break;
#endif
@@ -700,10 +698,10 @@ sh_analyze_prologue (struct gdbarch *gdbarch,
return pc;
}
-/* Skip any prologue before the guts of a function */
+/* Skip any prologue before the guts of a function. */
-/* Skip the prologue using the debug information. If this fails we'll
- fall back on the 'guess' method below. */
+/* Skip the prologue using the debug information. If this fails we'll
+ fall back on the 'guess' method below. */
static CORE_ADDR
after_prologue (CORE_ADDR pc)
{
@@ -742,7 +740,7 @@ sh_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc)
pc = after_prologue (start_pc);
/* If after_prologue returned a useful address, then use it. Else
- fall back on the instruction skipping code. */
+ fall back on the instruction skipping code. */
if (pc)
return max (pc, start_pc);
@@ -767,16 +765,16 @@ sh_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc)
When an aggregate type is returned in R0 and R1, R0 contains the
first four bytes of the aggregate, and R1 contains the
- remainder. If the size of the aggregate type is not a multiple of 4
+ remainder. If the size of the aggregate type is not a multiple of 4
bytes, the aggregate is tail-padded up to a multiple of 4
- bytes. The value of the padding is undefined. For little-endian
+ bytes. The value of the padding is undefined. For little-endian
targets the padding will appear at the most significant end of the
last element, for big-endian targets the padding appears at the
least significant end of the last element.
- All other aggregate types are returned by address. The caller
+ All other aggregate types are returned by address. The caller
function passes the address of an area large enough to hold the
- aggregate value in R2. The called function stores the result in
+ aggregate value in R2. The called function stores the result in
this location.
To reiterate, structs smaller than 8 bytes could also be returned
@@ -799,9 +797,7 @@ sh_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc)
because a struct containing two chars has alignment 1, that matches
type char, but size 2, that matches type short. There's no integer
type that has alignment 1 and size 2, so the struct is returned in
- memory.
-
-*/
+ memory. */
static int
sh_use_struct_convention (int renesas_abi, struct type *type)
@@ -874,7 +870,7 @@ sh_frame_align (struct gdbarch *ignore, CORE_ADDR sp)
Arguments that are larger than 4 bytes may be split between two or
more registers. If there are not enough registers free, an argument
may be passed partly in a register (or registers), and partly on the
- stack. This includes doubles, long longs, and larger aggregates.
+ stack. This includes doubles, long longs, and larger aggregates.
As far as I know, there is no upper limit to the size of aggregates
that will be passed in this way; in other words, the convention of
passing a pointer to a large aggregate instead of a copy is not used.
@@ -904,9 +900,9 @@ sh_frame_align (struct gdbarch *ignore, CORE_ADDR sp)
is greater than one byte). In this case, a pointer to the return
value location is passed into the callee in register R2, which does
not displace any of the other arguments passed in via registers R4
- to R7. */
+ to R7. */
-/* Helper function to justify value in register according to endianess. */
+/* Helper function to justify value in register according to endianess. */
static char *
sh_justify_value_in_reg (struct gdbarch *gdbarch, struct value *val, int len)
{
@@ -915,7 +911,7 @@ sh_justify_value_in_reg (struct gdbarch *gdbarch, struct value *val, int len)
memset (valbuf, 0, sizeof (valbuf));
if (len < 4)
{
- /* value gets right-justified in the register or stack word */
+ /* value gets right-justified in the register or stack word. */
if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
memcpy (valbuf + (4 - len), (char *) value_contents (val), len);
else
@@ -925,7 +921,7 @@ sh_justify_value_in_reg (struct gdbarch *gdbarch, struct value *val, int len)
return (char *) value_contents (val);
}
-/* Helper function to eval number of bytes to allocate on stack. */
+/* Helper function to eval number of bytes to allocate on stack. */
static CORE_ADDR
sh_stack_allocsize (int nargs, struct value **args)
{
@@ -937,12 +933,12 @@ sh_stack_allocsize (int nargs, struct value **args)
/* Helper functions for getting the float arguments right. Registers usage
depends on the ABI and the endianess. The comments should enlighten how
- it's intended to work. */
+ it's intended to work. */
-/* This array stores which of the float arg registers are already in use. */
+/* This array stores which of the float arg registers are already in use. */
static int flt_argreg_array[FLOAT_ARGLAST_REGNUM - FLOAT_ARG0_REGNUM + 1];
-/* This function just resets the above array to "no reg used so far". */
+/* This function just resets the above array to "no reg used so far". */
static void
sh_init_flt_argreg (void)
{
@@ -957,25 +953,25 @@ sh_init_flt_argreg (void)
Note that register number 0 in flt_argreg_array corresponds with the
real float register fr4. In contrast to FLOAT_ARG0_REGNUM (value is
29) the parity of the register number is preserved, which is important
- for the double register passing test (see the "argreg & 1" test below). */
+ for the double register passing test (see the "argreg & 1" test below). */
static int
sh_next_flt_argreg (struct gdbarch *gdbarch, int len, struct type *func_type)
{
int argreg;
- /* First search for the next free register. */
+ /* First search for the next free register. */
for (argreg = 0; argreg <= FLOAT_ARGLAST_REGNUM - FLOAT_ARG0_REGNUM;
++argreg)
if (!flt_argreg_array[argreg])
break;
- /* No register left? */
+ /* No register left? */
if (argreg > FLOAT_ARGLAST_REGNUM - FLOAT_ARG0_REGNUM)
return FLOAT_ARGLAST_REGNUM + 1;
if (len == 8)
{
- /* Doubles are always starting in a even register number. */
+ /* Doubles are always starting in a even register number. */
if (argreg & 1)
{
/* In gcc ABI, the skipped register is lost for further argument
@@ -985,17 +981,17 @@ sh_next_flt_argreg (struct gdbarch *gdbarch, int len, struct type *func_type)
++argreg;
- /* No register left? */
+ /* No register left? */
if (argreg > FLOAT_ARGLAST_REGNUM - FLOAT_ARG0_REGNUM)
return FLOAT_ARGLAST_REGNUM + 1;
}
- /* Also mark the next register as used. */
+ /* Also mark the next register as used. */
flt_argreg_array[argreg + 1] = 1;
}
else if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_LITTLE
&& !sh_is_renesas_calling_convention (func_type))
{
- /* In little endian, gcc passes floats like this: f5, f4, f7, f6, ... */
+ /* In little endian, gcc passes floats like this: f5, f4, f7, f6, ... */
if (!flt_argreg_array[argreg + 1])
++argreg;
}
@@ -1082,13 +1078,13 @@ sh_push_dummy_call_fpu (struct gdbarch *gdbarch,
&& TYPE_VARARGS (func_type))
last_reg_arg = TYPE_NFIELDS (func_type) - 2;
- /* first force sp to a 4-byte alignment */
+ /* First force sp to a 4-byte alignment. */
sp = sh_frame_align (gdbarch, sp);
- /* make room on stack for args */
+ /* Make room on stack for args. */
sp -= sh_stack_allocsize (nargs, args);
- /* Initialize float argument mechanism. */
+ /* Initialize float argument mechanism. */
sh_init_flt_argreg ();
/* Now load as many as possible of the first arguments into
@@ -1101,10 +1097,10 @@ sh_push_dummy_call_fpu (struct gdbarch *gdbarch,
val = sh_justify_value_in_reg (gdbarch, args[argnum], len);
/* Some decisions have to be made how various types are handled.
- This also differs in different ABIs. */
+ This also differs in different ABIs. */
pass_on_stack = 0;
- /* Find out the next register to use for a floating point value. */
+ /* Find out the next register to use for a floating point value. */
treat_as_flt = sh_treat_as_flt_p (type);
if (treat_as_flt)
flt_argreg = sh_next_flt_argreg (gdbarch, len, func_type);
@@ -1128,7 +1124,7 @@ sh_push_dummy_call_fpu (struct gdbarch *gdbarch,
|| pass_on_stack))
|| argnum > last_reg_arg)
{
- /* The data goes entirely on the stack, 4-byte aligned. */
+ /* The data goes entirely on the stack, 4-byte aligned. */
reg_size = (len + 3) & ~3;
write_memory (sp + stack_offset, val, reg_size);
stack_offset += reg_size;
@@ -1144,7 +1140,7 @@ sh_push_dummy_call_fpu (struct gdbarch *gdbarch,
code first writes the first 32 bits in the next but one
register, increments the val and len values accordingly
and then proceeds as normal by writing the second 32 bits
- into the next register. */
+ into the next register. */
if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_LITTLE
&& TYPE_LENGTH (type) == 2 * reg_size)
{
@@ -1152,7 +1148,8 @@ sh_push_dummy_call_fpu (struct gdbarch *gdbarch,
regval);
val += reg_size;
len -= reg_size;
- regval = extract_unsigned_integer (val, reg_size, byte_order);
+ regval = extract_unsigned_integer (val, reg_size,
+ byte_order);
}
regcache_cooked_write_unsigned (regcache, flt_argreg++, regval);
}
@@ -1163,7 +1160,8 @@ sh_push_dummy_call_fpu (struct gdbarch *gdbarch,
regval = extract_unsigned_integer (val, reg_size, byte_order);
regcache_cooked_write_unsigned (regcache, argreg++, regval);
}
- /* Store the value one register at a time or in one step on stack. */
+ /* Store the value one register at a time or in one step on
+ stack. */
len -= reg_size;
val += reg_size;
}
@@ -1182,7 +1180,7 @@ sh_push_dummy_call_fpu (struct gdbarch *gdbarch,
STRUCT_RETURN_REGNUM, struct_addr);
}
- /* Store return address. */
+ /* Store return address. */
regcache_cooked_write_unsigned (regcache, PR_REGNUM, bp_addr);
/* Update stack pointer. */
@@ -1220,10 +1218,10 @@ sh_push_dummy_call_nofpu (struct gdbarch *gdbarch,
&& TYPE_VARARGS (func_type))
last_reg_arg = TYPE_NFIELDS (func_type) - 2;
- /* first force sp to a 4-byte alignment */
+ /* First force sp to a 4-byte alignment. */
sp = sh_frame_align (gdbarch, sp);
- /* make room on stack for args */
+ /* Make room on stack for args. */
sp -= sh_stack_allocsize (nargs, args);
/* Now load as many as possible of the first arguments into
@@ -1236,7 +1234,7 @@ sh_push_dummy_call_nofpu (struct gdbarch *gdbarch,
val = sh_justify_value_in_reg (gdbarch, args[argnum], len);
/* Some decisions have to be made how various types are handled.
- This also differs in different ABIs. */
+ This also differs in different ABIs. */
pass_on_stack = 0;
/* Renesas ABI pushes doubles and long longs entirely on stack.
Same goes for aggregate types. */
@@ -1252,14 +1250,14 @@ sh_push_dummy_call_nofpu (struct gdbarch *gdbarch,
|| argnum > last_reg_arg)
{
/* The remainder of the data goes entirely on the stack,
- 4-byte aligned. */
+ 4-byte aligned. */
reg_size = (len + 3) & ~3;
write_memory (sp + stack_offset, val, reg_size);
stack_offset += reg_size;
}
else if (argreg <= ARGLAST_REGNUM)
{
- /* there's room in a register */
+ /* There's room in a register. */
reg_size = register_size (gdbarch, argreg);
regval = extract_unsigned_integer (val, reg_size, byte_order);
regcache_cooked_write_unsigned (regcache, argreg++, regval);
@@ -1285,7 +1283,7 @@ sh_push_dummy_call_nofpu (struct gdbarch *gdbarch,
STRUCT_RETURN_REGNUM, struct_addr);
}
- /* Store return address. */
+ /* Store return address. */
regcache_cooked_write_unsigned (regcache, PR_REGNUM, bp_addr);
/* Update stack pointer. */
@@ -1337,7 +1335,8 @@ sh_extract_return_value_fpu (struct type *type, struct regcache *regcache,
int i, regnum = gdbarch_fp0_regnum (gdbarch);
for (i = 0; i < len; i += 4)
if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_LITTLE)
- regcache_raw_read (regcache, regnum++, (char *) valbuf + len - 4 - i);
+ regcache_raw_read (regcache, regnum++,
+ (char *) valbuf + len - 4 - i);
else
regcache_raw_read (regcache, regnum++, (char *) valbuf + i);
}
@@ -1349,8 +1348,8 @@ sh_extract_return_value_fpu (struct type *type, struct regcache *regcache,
of type TYPE, given in virtual format.
If the architecture is sh4 or sh3e, store a function's return value
in the R0 general register or in the FP0 floating point register,
- depending on the type of the return value. In all the other cases
- the result is stored in r0, left-justified. */
+ depending on the type of the return value. In all the other cases
+ the result is stored in r0, left-justified. */
static void
sh_store_return_value_nofpu (struct type *type, struct regcache *regcache,
const void *valbuf)
@@ -1423,7 +1422,7 @@ sh_return_value_fpu (struct gdbarch *gdbarch, struct type *func_type,
return RETURN_VALUE_REGISTER_CONVENTION;
}
-/* Print the registers in a form similar to the E7000 */
+/* Print the registers in a form similar to the E7000. */
static void
sh_generic_show_regs (struct frame_info *frame)
@@ -2224,7 +2223,7 @@ sh_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
}
/* On the sh4, the DRi pseudo registers are problematic if the target
- is little endian. When the user writes one of those registers, for
+ is little endian. When the user writes one of those registers, for
instance with 'ser var $dr0=1', we want the double to be stored
like this:
fr0 = 0x00 0x00 0x00 0x00 0x00 0xf0 0x3f
@@ -2247,7 +2246,7 @@ sh_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
fr1 = 0x00 0x00 0x00 0x00 0x00 0x00 0x00
The other pseudo registers (the FVs) also don't pose a problem
- because they are stored as 4 individual FP elements. */
+ because they are stored as 4 individual FP elements. */
static void
sh_register_convert_to_virtual (int regnum, struct type *type,
@@ -2279,7 +2278,7 @@ sh_register_convert_to_raw (struct type *type, int regnum,
error (_("sh_register_convert_to_raw called with non DR register number"));
}
-/* For vectors of 4 floating point registers. */
+/* For vectors of 4 floating point registers. */
static int
fv_reg_base_num (struct gdbarch *gdbarch, int fv_regnum)
{
@@ -2290,7 +2289,7 @@ fv_reg_base_num (struct gdbarch *gdbarch, int fv_regnum)
return fp_regnum;
}
-/* For double precision floating point registers, i.e 2 fp regs.*/
+/* For double precision floating point registers, i.e 2 fp regs. */
static int
dr_reg_base_num (struct gdbarch *gdbarch, int dr_regnum)
{
@@ -2315,14 +2314,14 @@ sh_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
{
base_regnum = dr_reg_base_num (gdbarch, reg_nr);
- /* Build the value in the provided buffer. */
+ /* Build the value in the provided buffer. */
/* Read the real regs for which this one is an alias. */
for (portion = 0; portion < 2; portion++)
regcache_raw_read (regcache, base_regnum + portion,
(temp_buffer
+ register_size (gdbarch,
base_regnum) * portion));
- /* We must pay attention to the endiannes. */
+ /* We must pay attention to the endiannes. */
sh_register_convert_to_virtual (reg_nr,
register_type (gdbarch, reg_nr),
temp_buffer, buffer);
@@ -2351,7 +2350,7 @@ sh_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
{
/* When the bank register is written to, the whole register bank
is switched and all values in the bank registers must be read
- from the target/sim again. We're just invalidating the regcache
+ from the target/sim again. We're just invalidating the regcache
so that a re-read happens next time it's necessary. */
int bregnum;
@@ -2363,7 +2362,7 @@ sh_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
{
base_regnum = dr_reg_base_num (gdbarch, reg_nr);
- /* We must pay attention to the endiannes. */
+ /* We must pay attention to the endiannes. */
sh_register_convert_to_raw (register_type (gdbarch, reg_nr),
reg_nr, buffer, temp_buffer);
@@ -2531,7 +2530,7 @@ sh_frame_cache (struct frame_info *this_frame, void **this_cache)
which holds the base address for the current stack frame.
However, for functions that don't need it, the frame pointer is
optional. For these "frameless" functions the frame pointer is
- actually the frame pointer of the calling frame. */
+ actually the frame pointer of the calling frame. */
cache->base = get_frame_register_unsigned (this_frame, FP_REGNUM);
if (cache->base == 0)
return cache;
@@ -2656,7 +2655,7 @@ static const struct frame_base sh_frame_base = {
/* The epilogue is defined here as the area at the end of a function,
either on the `ret' instruction itself or after an instruction which
- destroys the function's stack frame. */
+ destroys the function's stack frame. */
static int
sh_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc)
{
@@ -2669,14 +2668,14 @@ sh_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc)
/* The sh epilogue is max. 14 bytes long. Give another 14 bytes
for a nop and some fixed data (e.g. big offsets) which are
unfortunately also treated as part of the function (which
- means, they are below func_end. */
+ means, they are below func_end. */
CORE_ADDR addr = func_end - 28;
if (addr < func_addr + 4)
addr = func_addr + 4;
if (pc < addr)
return 0;
- /* First search forward until hitting an rts. */
+ /* First search forward until hitting an rts. */
while (addr < func_end
&& !IS_RTS (read_memory_unsigned_integer (addr, 2, byte_order)))
addr += 2;
@@ -2685,7 +2684,7 @@ sh_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc)
/* At this point we should find a mov.l @r15+,r14 instruction,
either before or after the rts. If not, then the function has
- probably no "normal" epilogue and we bail out here. */
+ probably no "normal" epilogue and we bail out here. */
inst = read_memory_unsigned_integer (addr - 2, 2, byte_order);
if (IS_RESTORE_FP (read_memory_unsigned_integer (addr - 2, 2,
byte_order)))
@@ -2696,21 +2695,21 @@ sh_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc)
inst = read_memory_unsigned_integer (addr - 2, 2, byte_order);
- /* Step over possible lds.l @r15+,macl. */
+ /* Step over possible lds.l @r15+,macl. */
if (IS_MACL_LDS (inst))
{
addr -= 2;
inst = read_memory_unsigned_integer (addr - 2, 2, byte_order);
}
- /* Step over possible lds.l @r15+,pr. */
+ /* Step over possible lds.l @r15+,pr. */
if (IS_LDS (inst))
{
addr -= 2;
inst = read_memory_unsigned_integer (addr - 2, 2, byte_order);
}
- /* Step over possible mov r14,r15. */
+ /* Step over possible mov r14,r15. */
if (IS_MOV_FP_SP (inst))
{
addr -= 2;
@@ -2718,7 +2717,7 @@ sh_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc)
}
/* Now check for FP adjustments, using add #imm,r14 or add rX, r14
- instructions. */
+ instructions. */
while (addr > func_addr + 4
&& (IS_ADD_REG_TO_FP (inst) || IS_ADD_IMM_FP (inst)))
{
@@ -2880,7 +2879,7 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
case bfd_mach_sh5:
sh_show_regs = sh64_show_regs;
- /* SH5 is handled entirely in sh64-tdep.c */
+ /* SH5 is handled entirely in sh64-tdep.c. */
return sh64_gdbarch_init (info, arches);
}
@@ -2890,7 +2889,7 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
return arches->gdbarch;
/* None found, create a new architecture from the information
- provided. */
+ provided. */
tdep = XZALLOC (struct gdbarch_tdep);
gdbarch = gdbarch_alloc (&info, tdep);
@@ -2949,7 +2948,7 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
break;
case bfd_mach_sh2e:
- /* doubles on sh2e and sh3e are actually 4 byte. */
+ /* doubles on sh2e and sh3e are actually 4 byte. */
set_gdbarch_double_bit (gdbarch, 4 * TARGET_CHAR_BIT);
set_gdbarch_register_name (gdbarch, sh_sh2e_register_name);
@@ -2994,7 +2993,7 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
case bfd_mach_sh3e:
case bfd_mach_sh2a_or_sh3e:
- /* doubles on sh2e and sh3e are actually 4 byte. */
+ /* doubles on sh2e and sh3e are actually 4 byte. */
set_gdbarch_double_bit (gdbarch, 4 * TARGET_CHAR_BIT);
set_gdbarch_register_name (gdbarch, sh_sh3e_register_name);
@@ -3062,7 +3061,7 @@ set_sh_command (char *args, int from_tty)
help_list (setshcmdlist, "set sh ", all_commands, gdb_stdout);
}
-extern initialize_file_ftype _initialize_sh_tdep; /* -Wmissing-prototypes */
+extern initialize_file_ftype _initialize_sh_tdep; /* -Wmissing-prototypes */
void
_initialize_sh_tdep (void)
diff --git a/gdb/sh-tdep.h b/gdb/sh-tdep.h
index d7a240b..70131dc 100644
--- a/gdb/sh-tdep.h
+++ b/gdb/sh-tdep.h
@@ -20,9 +20,9 @@
#ifndef SH_TDEP_H
#define SH_TDEP_H
-/* Contributed by Steve Chamberlain sac@cygnus.com */
+/* Contributed by Steve Chamberlain sac@cygnus.com. */
-/* Registers for all SH variants. Used also by sh3-rom.c. */
+/* Registers for all SH variants. Used also by sh3-rom.c. */
enum
{
R0_REGNUM = 0,
diff --git a/gdb/sh64-tdep.c b/gdb/sh64-tdep.c
index 6b15234..06a7762 100644
--- a/gdb/sh64-tdep.c
+++ b/gdb/sh64-tdep.c
@@ -19,10 +19,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-/*
- Contributed by Steve Chamberlain
- sac@cygnus.com
- */
+/* Contributed by Steve Chamberlain
+ sac@cygnus.com. */
#include "defs.h"
#include "frame.h"
@@ -47,7 +45,7 @@
/* sh flags */
#include "elf/sh.h"
-/* registers numbers shared with the simulator */
+/* Register numbers shared with the simulator. */
#include "gdb/sim-sh.h"
#include "language.h"
@@ -71,7 +69,7 @@ struct sh64_frame_cache
LONGEST 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;
int media_mode;
@@ -97,7 +95,7 @@ enum
DR_LAST_REGNUM = 172,
/* FPP stands for Floating Point Pair, to avoid confusion with
GDB's gdbarch_fp0_regnum, which is the number of the first Floating
- point register. Unfortunately on the sh5, the floating point
+ point register. Unfortunately on the sh5, the floating point
registers are called FR, and the floating point pairs are called FP. */
FPP0_REGNUM = 173,
FPP_LAST_REGNUM = 204,
@@ -148,13 +146,13 @@ sh64_register_name (struct gdbarch *gdbarch, int reg_nr)
/* status reg., saved status reg., saved pc reg. (64-bit) 65-67 */
"sr", "ssr", "spc",
- /* target registers (64-bit) 68-75*/
+ /* target registers (64-bit) 68-75 */
"tr0", "tr1", "tr2", "tr3", "tr4", "tr5", "tr6", "tr7",
/* floating point state control register (32-bit) 76 */
"fpscr",
- /* single precision floating point registers (32-bit) 77-140*/
+ /* single precision floating point registers (32-bit) 77-140 */
"fr0", "fr1", "fr2", "fr3", "fr4", "fr5", "fr6", "fr7",
"fr8", "fr9", "fr10", "fr11", "fr12", "fr13", "fr14", "fr15",
"fr16", "fr17", "fr18", "fr19", "fr20", "fr21", "fr22", "fr23",
@@ -170,27 +168,30 @@ sh64_register_name (struct gdbarch *gdbarch, int reg_nr)
"dr32", "dr34", "dr36", "dr38", "dr40", "dr42", "dr44", "dr46",
"dr48", "dr50", "dr52", "dr54", "dr56", "dr58", "dr60", "dr62",
- /* floating point pairs (pseudo) 173-204*/
+ /* floating point pairs (pseudo) 173-204 */
"fp0", "fp2", "fp4", "fp6", "fp8", "fp10", "fp12", "fp14",
"fp16", "fp18", "fp20", "fp22", "fp24", "fp26", "fp28", "fp30",
"fp32", "fp34", "fp36", "fp38", "fp40", "fp42", "fp44", "fp46",
"fp48", "fp50", "fp52", "fp54", "fp56", "fp58", "fp60", "fp62",
- /* floating point vectors (4 floating point regs) (pseudo) 205-220*/
+ /* floating point vectors (4 floating point regs) (pseudo) 205-220 */
"fv0", "fv4", "fv8", "fv12", "fv16", "fv20", "fv24", "fv28",
"fv32", "fv36", "fv40", "fv44", "fv48", "fv52", "fv56", "fv60",
- /* SH COMPACT MODE (ISA 16) (all pseudo) 221-272*/
+ /* SH COMPACT MODE (ISA 16) (all pseudo) 221-272 */
"r0_c", "r1_c", "r2_c", "r3_c", "r4_c", "r5_c", "r6_c", "r7_c",
"r8_c", "r9_c", "r10_c", "r11_c", "r12_c", "r13_c", "r14_c", "r15_c",
"pc_c",
"gbr_c", "mach_c", "macl_c", "pr_c", "t_c",
"fpscr_c", "fpul_c",
- "fr0_c", "fr1_c", "fr2_c", "fr3_c", "fr4_c", "fr5_c", "fr6_c", "fr7_c",
- "fr8_c", "fr9_c", "fr10_c", "fr11_c", "fr12_c", "fr13_c", "fr14_c", "fr15_c",
- "dr0_c", "dr2_c", "dr4_c", "dr6_c", "dr8_c", "dr10_c", "dr12_c", "dr14_c",
+ "fr0_c", "fr1_c", "fr2_c", "fr3_c",
+ "fr4_c", "fr5_c", "fr6_c", "fr7_c",
+ "fr8_c", "fr9_c", "fr10_c", "fr11_c",
+ "fr12_c", "fr13_c", "fr14_c", "fr15_c",
+ "dr0_c", "dr2_c", "dr4_c", "dr6_c",
+ "dr8_c", "dr10_c", "dr12_c", "dr14_c",
"fv0_c", "fv4_c", "fv8_c", "fv12_c",
- /* FIXME!!!! XF0 XF15, XD0 XD14 ?????*/
+ /* FIXME!!!! XF0 XF15, XD0 XD14 ????? */
};
if (reg_nr < 0)
@@ -255,7 +256,8 @@ pc_is_isa32 (bfd_vma memaddr)
}
static const unsigned char *
-sh64_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
+sh64_breakpoint_from_pc (struct gdbarch *gdbarch,
+ CORE_ADDR *pcptr, int *lenptr)
{
/* The BRK instruction for shmedia is
01101111 11110101 11111111 11110000
@@ -265,13 +267,15 @@ sh64_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
/* The BRK instruction for shcompact is
00000000 00111011
which translates in big endian mode to 0x0, 0x3b
- and in little endian mode to 0x3b, 0x0*/
+ and in little endian mode to 0x3b, 0x0 */
if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
{
if (pc_is_isa32 (*pcptr))
{
- static unsigned char big_breakpoint_media[] = {0x6f, 0xf5, 0xff, 0xf0};
+ static unsigned char big_breakpoint_media[] = {
+ 0x6f, 0xf5, 0xff, 0xf0
+ };
*pcptr = UNMAKE_ISA32_ADDR (*pcptr);
*lenptr = sizeof (big_breakpoint_media);
return big_breakpoint_media;
@@ -287,7 +291,9 @@ sh64_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
{
if (pc_is_isa32 (*pcptr))
{
- static unsigned char little_breakpoint_media[] = {0xf0, 0xff, 0xf5, 0x6f};
+ static unsigned char little_breakpoint_media[] = {
+ 0xf0, 0xff, 0xf5, 0x6f
+ };
*pcptr = UNMAKE_ISA32_ADDR (*pcptr);
*lenptr = sizeof (little_breakpoint_media);
return little_breakpoint_media;
@@ -381,7 +387,8 @@ sh64_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
R15 + R63 --> R14 */
#define IS_ADD_SP_FP_MEDIA(x) ((x) == 0x00f9fce0)
-#define IS_MOV_SP_FP_MEDIA(x) (IS_ADDL_SP_FP_MEDIA(x) || IS_ADD_SP_FP_MEDIA(x))
+#define IS_MOV_SP_FP_MEDIA(x) \
+ (IS_ADDL_SP_FP_MEDIA(x) || IS_ADD_SP_FP_MEDIA(x))
/* MOV #imm, R0 1110 0000 ssss ssss
#imm-->R0 */
@@ -400,9 +407,11 @@ sh64_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
/* ADD Rm,R63,Rn Rm+R63-->Rn 0000 00mm mmmm 1001 1111 11nn nnnn 0000
where Rm is one of r2-r9 which are the argument registers. */
-/* FIXME: Recognize the float and double register moves too! */
+/* FIXME: Recognize the float and double register moves too! */
#define IS_MEDIA_IND_ARG_MOV(x) \
-((((x) & 0xfc0ffc0f) == 0x0009fc00) && (((x) & 0x03f00000) >= 0x00200000 && ((x) & 0x03f00000) <= 0x00900000))
+ ((((x) & 0xfc0ffc0f) == 0x0009fc00) \
+ && (((x) & 0x03f00000) >= 0x00200000 \
+ && ((x) & 0x03f00000) <= 0x00900000))
/* ST.Q Rn,0,Rm Rm-->Rn+0 1010 11nn nnnn 0000 0000 00mm mmmm 0000
or ST.L Rn,0,Rm Rm-->Rn+0 1010 10nn nnnn 0000 0000 00mm mmmm 0000
@@ -411,11 +420,11 @@ sh64_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
(((((x) & 0xfc0ffc0f) == 0xac000000) || (((x) & 0xfc0ffc0f) == 0xa8000000)) \
&& (((x) & 0x000003f0) >= 0x00000020 && ((x) & 0x000003f0) <= 0x00000090))
-/* ST.B R14,0,Rn Rn-->(R14+0) 1010 0000 1110 0000 0000 00nn nnnn 0000*/
-/* ST.W R14,0,Rn Rn-->(R14+0) 1010 0100 1110 0000 0000 00nn nnnn 0000*/
-/* ST.L R14,0,Rn Rn-->(R14+0) 1010 1000 1110 0000 0000 00nn nnnn 0000*/
-/* FST.S R14,0,FRn Rn-->(R14+0) 1011 0100 1110 0000 0000 00nn nnnn 0000*/
-/* FST.D R14,0,DRn Rn-->(R14+0) 1011 1100 1110 0000 0000 00nn nnnn 0000*/
+/* ST.B R14,0,Rn Rn-->(R14+0) 1010 0000 1110 0000 0000 00nn nnnn 0000 */
+/* ST.W R14,0,Rn Rn-->(R14+0) 1010 0100 1110 0000 0000 00nn nnnn 0000 */
+/* ST.L R14,0,Rn Rn-->(R14+0) 1010 1000 1110 0000 0000 00nn nnnn 0000 */
+/* FST.S R14,0,FRn Rn-->(R14+0) 1011 0100 1110 0000 0000 00nn nnnn 0000 */
+/* FST.D R14,0,DRn Rn-->(R14+0) 1011 1100 1110 0000 0000 00nn nnnn 0000 */
#define IS_MEDIA_MOV_TO_R14(x) \
((((x) & 0xfffffc0f) == 0xa0e00000) \
|| (((x) & 0xfffffc0f) == 0xa4e00000) \
@@ -426,12 +435,14 @@ sh64_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
/* MOV Rm, Rn Rm-->Rn 0110 nnnn mmmm 0011
where Rm is r2-r9 */
#define IS_COMPACT_IND_ARG_MOV(x) \
-((((x) & 0xf00f) == 0x6003) && (((x) & 0x00f0) >= 0x0020) && (((x) & 0x00f0) <= 0x0090))
+ ((((x) & 0xf00f) == 0x6003) && (((x) & 0x00f0) >= 0x0020) \
+ && (((x) & 0x00f0) <= 0x0090))
/* compact direct arg move!
MOV.L Rn, @r14 0010 1110 mmmm 0010 */
#define IS_COMPACT_ARG_MOV(x) \
-(((((x) & 0xff0f) == 0x2e02) && (((x) & 0x00f0) >= 0x0020) && ((x) & 0x00f0) <= 0x0090))
+ (((((x) & 0xff0f) == 0x2e02) && (((x) & 0x00f0) >= 0x0020) \
+ && ((x) & 0x00f0) <= 0x0090))
/* MOV.B Rm, @R14 0010 1110 mmmm 0000
MOV.W Rm, @R14 0010 1110 mmmm 0001 */
@@ -450,7 +461,7 @@ sh64_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
r15+imm-->r15 */
#define IS_ADD_SP(x) (((x) & 0xff00) == 0x7f00)
-/* Skip any prologue before the guts of a function */
+/* Skip any prologue before the guts of a function. */
/* Skip the prologue using the debug information. If this fails we'll
fall back on the 'guess' method below. */
@@ -500,7 +511,7 @@ look_for_args_moves (struct gdbarch *gdbarch,
if (IS_MEDIA_IND_ARG_MOV (w))
{
/* This must be followed by a store to r14, so the argument
- is where the debug info says it is. This can happen after
+ is where the debug info says it is. This can happen after
the SP has been saved, unfortunately. */
int next_insn = read_memory_integer (UNMAKE_ISA32_ADDR (here),
@@ -525,7 +536,7 @@ look_for_args_moves (struct gdbarch *gdbarch,
if (IS_COMPACT_IND_ARG_MOV (w))
{
/* This must be followed by a store to r14, so the argument
- is where the debug info says it is. This can happen after
+ is where the debug info says it is. This can happen after
the SP has been saved, unfortunately. */
int next_insn = 0xffff & read_memory_integer (here, insn_size,
@@ -542,9 +553,9 @@ look_for_args_moves (struct gdbarch *gdbarch,
else if (IS_MOVL_R0 (w))
{
/* There is a function that gcc calls to get the arguments
- passed correctly to the function. Only after this
+ passed correctly to the function. Only after this
function call the arguments will be found at the place
- where they are supposed to be. This happens in case the
+ where they are supposed to be. This happens in case the
argument has to be stored into a 64-bit register (for
instance doubles, long longs). SHcompact doesn't have
access to the full 64-bits, so we store the register in
@@ -556,11 +567,11 @@ look_for_args_moves (struct gdbarch *gdbarch,
value in a stack slot and stores the address of the
stack slot in the register. GCC thinks the argument is
just passed by transparent reference, but this is only
- true after the argument decoder is called. Such a call
+ true after the argument decoder is called. Such a call
needs to be considered part of the prologue. */
/* This must be followed by a JSR @r0 instruction and by
- a NOP instruction. After these, the prologue is over! */
+ a NOP instruction. After these, the prologue is over! */
int next_insn = 0xffff & read_memory_integer (here, insn_size,
byte_order);
@@ -611,7 +622,8 @@ sh64_skip_prologue_hard_way (struct gdbarch *gdbarch, CORE_ADDR start_pc)
here += insn_size;
if (IS_STQ_R18_R14 (w) || IS_STQ_R18_R15 (w) || IS_STQ_R14_R15 (w)
|| IS_STL_R14_R15 (w) || IS_STL_R18_R15 (w)
- || IS_ADDIL_SP_MEDIA (w) || IS_ADDI_SP_MEDIA (w) || IS_PTABSL_R18 (w))
+ || IS_ADDIL_SP_MEDIA (w) || IS_ADDI_SP_MEDIA (w)
+ || IS_PTABSL_R18 (w))
{
start_pc = here;
}
@@ -698,7 +710,7 @@ sh64_fv_reg_base_num (struct gdbarch *gdbarch, int fv_regnum)
return fp_regnum;
}
-/* For double precision floating point registers, i.e 2 fp regs.*/
+/* For double precision floating point registers, i.e 2 fp regs. */
static int
sh64_dr_reg_base_num (struct gdbarch *gdbarch, int dr_regnum)
{
@@ -708,7 +720,7 @@ sh64_dr_reg_base_num (struct gdbarch *gdbarch, int dr_regnum)
return fp_regnum;
}
-/* For pairs of floating point registers */
+/* For pairs of floating point registers. */
static int
sh64_fpp_reg_base_num (struct gdbarch *gdbarch, int fpp_regnum)
{
@@ -888,8 +900,9 @@ sh64_analyze_prologue (struct gdbarch *gdbarch,
insn_size, byte_order);
if (IS_MOV_TO_R15 (next_insn))
{
- cache->saved_regs[PR_REGNUM] =
- cache->sp_offset - ((((next_insn & 0xf) ^ 0x8) - 0x8) << 2);
+ cache->saved_regs[PR_REGNUM]
+ = cache->sp_offset - ((((next_insn & 0xf) ^ 0x8)
+ - 0x8) << 2);
pc += insn_size;
}
}
@@ -901,7 +914,7 @@ sh64_analyze_prologue (struct gdbarch *gdbarch,
else if (IS_MOV_R0 (insn))
{
/* Put in R0 the offset from SP at which to store some
- registers. We are interested in this value, because it
+ registers. We are interested in this value, because it
will tell us where the given registers are stored within
the frame. */
r0_val = ((insn & 0xff) ^ 0x80) - 0x80;
@@ -915,14 +928,14 @@ sh64_analyze_prologue (struct gdbarch *gdbarch,
else if (IS_STS_R0 (insn))
{
- /* Store PR at r0_val-4 from SP. Decrement r0 by 4*/
+ /* Store PR at r0_val-4 from SP. Decrement r0 by 4. */
cache->saved_regs[PR_REGNUM] = cache->sp_offset - (r0_val - 4);
r0_val -= 4;
}
else if (IS_MOV_R14_R0 (insn))
{
- /* Store R14 at r0_val-4 from SP. Decrement r0 by 4 */
+ /* Store R14 at r0_val-4 from SP. Decrement r0 by 4. */
cache->saved_regs[MEDIA_FP_REGNUM] = cache->sp_offset
- (r0_val - 4);
r0_val -= 4;
@@ -941,20 +954,24 @@ sh64_analyze_prologue (struct gdbarch *gdbarch,
sign_extend ((((insn & 0xffc00) ^ 0x80000) - 0x80000) >> 10, 9);
else if (IS_STQ_R18_R15 (insn))
- cache->saved_regs[PR_REGNUM] =
- cache->sp_offset - (sign_extend ((insn & 0xffc00) >> 10, 9) << 3);
+ cache->saved_regs[PR_REGNUM]
+ = cache->sp_offset - (sign_extend ((insn & 0xffc00) >> 10,
+ 9) << 3);
else if (IS_STL_R18_R15 (insn))
- cache->saved_regs[PR_REGNUM] =
- cache->sp_offset - (sign_extend ((insn & 0xffc00) >> 10, 9) << 2);
+ cache->saved_regs[PR_REGNUM]
+ = cache->sp_offset - (sign_extend ((insn & 0xffc00) >> 10,
+ 9) << 2);
else if (IS_STQ_R14_R15 (insn))
- cache->saved_regs[MEDIA_FP_REGNUM] =
- cache->sp_offset - (sign_extend ((insn & 0xffc00) >> 10, 9) << 3);
+ cache->saved_regs[MEDIA_FP_REGNUM]
+ = cache->sp_offset - (sign_extend ((insn & 0xffc00) >> 10,
+ 9) << 3);
else if (IS_STL_R14_R15 (insn))
- cache->saved_regs[MEDIA_FP_REGNUM] =
- cache->sp_offset - (sign_extend ((insn & 0xffc00) >> 10, 9) << 2);
+ cache->saved_regs[MEDIA_FP_REGNUM]
+ = cache->sp_offset - (sign_extend ((insn & 0xffc00) >> 10,
+ 9) << 2);
else if (IS_MOV_SP_FP_MEDIA (insn))
break;
@@ -987,7 +1004,7 @@ sh64_frame_align (struct gdbarch *ignore, CORE_ADDR sp)
Arguments that are larger than 4 bytes may be split between two or
more registers. If there are not enough registers free, an argument
may be passed partly in a register (or registers), and partly on the
- stack. This includes doubles, long longs, and larger aggregates.
+ stack. This includes doubles, long longs, and larger aggregates.
As far as I know, there is no upper limit to the size of aggregates
that will be passed in this way; in other words, the convention of
passing a pointer to a large aggregate instead of a copy is not used.
@@ -1012,7 +1029,7 @@ sh64_frame_align (struct gdbarch *ignore, CORE_ADDR sp)
is greater than one byte). In this case, a pointer to the return
value location is passed into the callee in register R2, which does
not displace any of the other arguments passed in via registers R4
- to R7. */
+ to R7. */
/* R2-R9 for integer types and integer equivalent (char, pointers) and
non-scalar (struct, union) elements (even if the elements are
@@ -1022,13 +1039,13 @@ sh64_frame_align (struct gdbarch *ignore, CORE_ADDR sp)
If a float is argument number 3 (for instance) and arguments number
1,2, and 4 are integer, the mapping will be:
- arg1 -->R2, arg2 --> R3, arg3 -->FR0, arg4 --> R5. I.e. R4 is not used.
+ arg1 -->R2, arg2 --> R3, arg3 -->FR0, arg4 --> R5. I.e. R4 is not used.
If a float is argument number 10 (for instance) and arguments number
1 through 10 are integer, the mapping will be:
arg1->R2, arg2->R3, arg3->R4, arg4->R5, arg5->R6, arg6->R7, arg7->R8,
- arg8->R9, arg9->(0,SP)stack(8-byte aligned), arg10->FR0, arg11->stack(16,SP).
- I.e. there is hole in the stack.
+ arg8->R9, arg9->(0,SP)stack(8-byte aligned), arg10->FR0,
+ arg11->stack(16,SP). I.e. there is hole in the stack.
Different rules apply for variable arguments functions, and for functions
for which the prototype is not known. */
@@ -1061,20 +1078,20 @@ sh64_push_dummy_call (struct gdbarch *gdbarch,
memset (fp_args, 0, sizeof (fp_args));
- /* first force sp to a 8-byte alignment */
+ /* First force sp to a 8-byte alignment. */
sp = sh64_frame_align (gdbarch, sp);
/* The "struct return pointer" pseudo-argument has its own dedicated
- register */
+ register. */
if (struct_return)
regcache_cooked_write_unsigned (regcache,
STRUCT_RETURN_REGNUM, struct_addr);
- /* Now make sure there's space on the stack */
+ /* Now make sure there's space on the stack. */
for (argnum = 0, stack_alloc = 0; argnum < nargs; argnum++)
stack_alloc += ((TYPE_LENGTH (value_type (args[argnum])) + 7) & ~7);
- sp -= stack_alloc; /* make room on stack for args */
+ sp -= stack_alloc; /* Make room on stack for args. */
/* Now load as many as possible of the first arguments into
registers, and push the rest onto the stack. There are 64 bytes
@@ -1096,7 +1113,7 @@ sh64_push_dummy_call (struct gdbarch *gdbarch,
if (len < argreg_size)
{
- /* value gets right-justified in the register or stack word */
+ /* value gets right-justified in the register or stack word. */
if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
memcpy (valbuf + argreg_size - len,
(char *) value_contents (args[argnum]), len);
@@ -1112,7 +1129,7 @@ sh64_push_dummy_call (struct gdbarch *gdbarch,
{
if (int_argreg > ARGLAST_REGNUM)
{
- /* must go on the stack */
+ /* Must go on the stack. */
write_memory (sp + stack_offset, (const bfd_byte *) val,
argreg_size);
stack_offset += 8;/*argreg_size;*/
@@ -1122,14 +1139,15 @@ sh64_push_dummy_call (struct gdbarch *gdbarch,
AND in the registers! */
if (int_argreg <= ARGLAST_REGNUM)
{
- /* there's room in a register */
+ /* There's room in a register. */
regval = extract_unsigned_integer (val, argreg_size,
byte_order);
- regcache_cooked_write_unsigned (regcache, int_argreg, regval);
+ regcache_cooked_write_unsigned (regcache,
+ int_argreg, regval);
}
/* Store the value 8 bytes at a time. This means that
things larger than 8 bytes may go partly in registers
- and partly on the stack. FIXME: argreg is incremented
+ and partly on the stack. FIXME: argreg is incremented
before we use its size. */
len -= argreg_size;
val += argreg_size;
@@ -1141,13 +1159,13 @@ sh64_push_dummy_call (struct gdbarch *gdbarch,
val = (char *) value_contents (args[argnum]);
if (len == 4)
{
- /* Where is it going to be stored? */
+ /* Where is it going to be stored? */
while (fp_args[float_arg_index])
float_arg_index ++;
/* Now float_argreg points to the register where it
should be stored. Are we still within the allowed
- register set? */
+ register set? */
if (float_arg_index <= FLOAT_ARGLAST_REGNUM)
{
/* Goes in FR0...FR11 */
@@ -1167,12 +1185,12 @@ sh64_push_dummy_call (struct gdbarch *gdbarch,
}
else if (len == 8)
{
- /* Where is it going to be stored? */
+ /* Where is it going to be stored? */
while (fp_args[double_arg_index])
double_arg_index += 2;
/* Now double_argreg points to the register
where it should be stored.
- Are we still within the allowed register set? */
+ Are we still within the allowed register set? */
if (double_arg_index < FLOAT_ARGLAST_REGNUM)
{
/* Goes in DR0...DR10 */
@@ -1193,7 +1211,7 @@ sh64_push_dummy_call (struct gdbarch *gdbarch,
}
}
}
- /* Store return address. */
+ /* Store return address. */
regcache_cooked_write_unsigned (regcache, PR_REGNUM, bp_addr);
/* Update stack pointer. */
@@ -1219,13 +1237,13 @@ sh64_extract_return_value (struct type *type, struct regcache *regcache,
{
if (len == 4)
{
- /* Return value stored in gdbarch_fp0_regnum */
+ /* Return value stored in gdbarch_fp0_regnum. */
regcache_raw_read (regcache,
gdbarch_fp0_regnum (gdbarch), valbuf);
}
else if (len == 8)
{
- /* return value stored in DR0_REGNUM */
+ /* return value stored in DR0_REGNUM. */
DOUBLEST val;
gdb_byte buf[8];
@@ -1246,7 +1264,7 @@ sh64_extract_return_value (struct type *type, struct regcache *regcache,
{
int offset;
char buf[8];
- /* Result is in register 2. If smaller than 8 bytes, it is padded
+ /* Result is in register 2. If smaller than 8 bytes, it is padded
at the most significant end. */
regcache_raw_read (regcache, DEFAULT_RETURN_REGNUM, buf);
@@ -1266,7 +1284,7 @@ sh64_extract_return_value (struct type *type, struct regcache *regcache,
of type TYPE, given in virtual format.
If the architecture is sh4 or sh3e, store a function's return value
in the R0 general register or in the FP0 floating point register,
- depending on the type of the return value. In all the other cases
+ depending on the type of the return value. In all the other cases
the result is stored in r0, left-justified. */
static void
@@ -1659,7 +1677,7 @@ sh64_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
+ register_size (gdbarch, base_regnum) * portion));
}
- /* sh compact pseudo registers. 1-to-1 with a shmedia register */
+ /* sh compact pseudo registers. 1-to-1 with a shmedia register. */
else if (reg_nr >= R0_C_REGNUM
&& reg_nr <= T_C_REGNUM)
{
@@ -1669,7 +1687,8 @@ sh64_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
regcache_raw_read (regcache, base_regnum, temp_buffer);
if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
offset = 4;
- memcpy (buffer, temp_buffer + offset, 4); /* get LOWER 32 bits only????*/
+ memcpy (buffer,
+ temp_buffer + offset, 4); /* get LOWER 32 bits only???? */
}
else if (reg_nr >= FP0_C_REGNUM
@@ -1742,7 +1761,7 @@ sh64_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
21-31 reserved
*/
/* *INDENT-ON* */
- /* Get FPSCR into a local buffer */
+ /* Get FPSCR into a local buffer. */
regcache_raw_read (regcache, fpscr_base_regnum, temp_buffer);
/* Get value as an int. */
fpscr_value = extract_unsigned_integer (temp_buffer, 4, byte_order);
@@ -1754,7 +1773,7 @@ sh64_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
fpscr_c_part1_value = fpscr_value & 0x3fffd;
fpscr_c_part2_value = (sr_value & 0x7000) << 6;
fpscr_c_value = fpscr_c_part1_value | fpscr_c_part2_value;
- /* Store that in out buffer!!! */
+ /* Store that in out buffer!!! */
store_unsigned_integer (buffer, 4, byte_order, fpscr_c_value);
/* FIXME There is surely an endianness gotcha here. */
}
@@ -1821,7 +1840,7 @@ sh64_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
base_regnum) * portion));
}
- /* sh compact general pseudo registers. 1-to-1 with a shmedia
+ /* sh compact general pseudo registers. 1-to-1 with a shmedia
register but only 4 bytes of it. */
else if (reg_nr >= R0_C_REGNUM
&& reg_nr <= T_C_REGNUM)
@@ -1836,13 +1855,13 @@ sh64_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
buffer, so that overwriting the last four bytes with the new
value of the pseudo will leave the upper 4 bytes unchanged. */
regcache_raw_read (regcache, base_regnum, temp_buffer);
- /* Write as an 8 byte quantity */
+ /* Write as an 8 byte quantity. */
memcpy (temp_buffer + offset, buffer, 4);
regcache_raw_write (regcache, base_regnum, temp_buffer);
}
- /* sh floating point compact pseudo registers. 1-to-1 with a shmedia
- registers. Both are 4 bytes. */
+ /* sh floating point compact pseudo registers. 1-to-1 with a shmedia
+ registers. Both are 4 bytes. */
else if (reg_nr >= FP0_C_REGNUM
&& reg_nr <= FP_LAST_C_REGNUM)
{
@@ -1990,25 +2009,24 @@ sh64_do_cr_c_register_info (struct ui_file *file, struct frame_info *frame,
static void
sh64_do_fp_register (struct gdbarch *gdbarch, struct ui_file *file,
struct frame_info *frame, int regnum)
-{ /* do values for FP (float) regs */
+{ /* Do values for FP (float) regs. */
unsigned char *raw_buffer;
- double flt; /* double extracted from raw hex data */
+ double flt; /* Double extracted from raw hex data. */
int inv;
int j;
/* Allocate space for the float. */
- raw_buffer = (unsigned char *) alloca
- (register_size (gdbarch,
- gdbarch_fp0_regnum
- (gdbarch)));
+ raw_buffer = (unsigned char *)
+ alloca (register_size (gdbarch, gdbarch_fp0_regnum (gdbarch)));
/* Get the data in raw format. */
if (!frame_register_read (frame, regnum, raw_buffer))
error (_("can't read register %d (%s)"),
regnum, gdbarch_register_name (gdbarch, regnum));
- /* Get the register as a number */
- flt = unpack_double (builtin_type (gdbarch)->builtin_float, raw_buffer, &inv);
+ /* Get the register as a number. */
+ flt = unpack_double (builtin_type (gdbarch)->builtin_float,
+ raw_buffer, &inv);
/* Print the name and some spaces. */
fputs_filtered (gdbarch_register_name (gdbarch, regnum), file);
@@ -2160,7 +2178,7 @@ sh64_media_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file,
struct frame_info *frame, int regnum,
int fpregs)
{
- if (regnum != -1) /* do one specified register */
+ if (regnum != -1) /* Do one specified register. */
{
if (*(gdbarch_register_name (gdbarch, regnum)) == '\0')
error (_("Not a valid register for the current processor type"));
@@ -2168,7 +2186,7 @@ sh64_media_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file,
sh64_print_register (gdbarch, file, frame, regnum);
}
else
- /* do all (or most) registers */
+ /* Do all (or most) registers. */
{
regnum = 0;
while (regnum < gdbarch_num_regs (gdbarch))
@@ -2187,7 +2205,7 @@ sh64_media_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file,
{
if (fpregs)
{
- /* true for "INFO ALL-REGISTERS" command */
+ /* true for "INFO ALL-REGISTERS" command. */
sh64_do_fp_register (gdbarch, file, frame, regnum);
regnum ++;
}
@@ -2218,7 +2236,7 @@ sh64_compact_print_registers_info (struct gdbarch *gdbarch,
struct frame_info *frame, int regnum,
int fpregs)
{
- if (regnum != -1) /* do one specified register */
+ if (regnum != -1) /* Do one specified register. */
{
if (*(gdbarch_register_name (gdbarch, regnum)) == '\0')
error (_("Not a valid register for the current processor type"));
@@ -2229,7 +2247,7 @@ sh64_compact_print_registers_info (struct gdbarch *gdbarch,
sh64_print_register (gdbarch, file, frame, regnum);
}
else
- /* do all compact registers */
+ /* Do all compact registers. */
{
regnum = R0_C_REGNUM;
while (regnum < gdbarch_num_regs (gdbarch)
@@ -2300,7 +2318,7 @@ sh64_frame_cache (struct frame_info *this_frame, void **this_cache)
which holds the base address for the current stack frame.
However, for functions that don't need it, the frame pointer is
optional. For these "frameless" functions the frame pointer is
- actually the frame pointer of the calling frame. */
+ actually the frame pointer of the calling frame. */
cache->base = get_frame_register_unsigned (this_frame, MEDIA_FP_REGNUM);
if (cache->base == 0)
return cache;
diff --git a/gdb/shnbsd-nat.c b/gdb/shnbsd-nat.c
index 001c139..f66571a 100644
--- a/gdb/shnbsd-nat.c
+++ b/gdb/shnbsd-nat.c
@@ -32,7 +32,7 @@
#include "regcache.h"
-/* Determine if PT_GETREGS fetches this register. */
+/* Determine if PT_GETREGS fetches this register. */
#define GETREGS_SUPPLIES(gdbarch, regno) \
(((regno) >= R0_REGNUM && (regno) <= (R0_REGNUM + 15)) \
|| (regno) == gdbarch_pc_regnum (gdbarch) || (regno) == PR_REGNUM \
diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c
index 1a8ae18..8087d40 100644
--- a/gdb/sol-thread.c
+++ b/gdb/sol-thread.c
@@ -72,7 +72,7 @@ struct target_ops sol_thread_ops;
extern char *procfs_pid_to_str (struct target_ops *ops, ptid_t ptid);
-/* Prototypes for supply_gregset etc. */
+/* Prototypes for supply_gregset etc. */
#include "gregset.h"
/* This struct is defined by us, but mainly used for the proc_service
@@ -764,7 +764,7 @@ sol_thread_alive (struct target_ops *ops, ptid_t ptid)
Which one you have depends on the Solaris version and what patches
you've applied. On the theory that there are only two major
variants, we have configure check the prototype of ps_pdwrite (),
- and use that info to make appropriate typedefs here. */
+ and use that info to make appropriate typedefs here. */
#ifdef PROC_SERVICE_IS_OLD
typedef const struct ps_prochandle *gdb_ps_prochandle_t;
@@ -1058,7 +1058,7 @@ ps_lgetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
return PS_OK;
}
-/* Set floating-point regs for LWP */
+/* Set floating-point regs for LWP. */
ps_err_e
ps_lsetfpregs (gdb_ps_prochandle_t ph, lwpid_t lwpid,
@@ -1269,7 +1269,7 @@ info_cb (const td_thrhandle_t *th, void *s)
/* Wrap up line, if necessary. */
if (ti.ti_state != TD_THR_SLEEP && ti.ti_startfunc == 0)
- printf_filtered ("\n"); /* don't you hate counting newlines? */
+ printf_filtered ("\n"); /* don't you hate counting newlines? */
}
else
warning (_("info sol-thread: failed to get info for thread."));
diff --git a/gdb/solib-darwin.c b/gdb/solib-darwin.c
index 1ba3d22..24301d9 100644
--- a/gdb/solib-darwin.c
+++ b/gdb/solib-darwin.c
@@ -204,7 +204,7 @@ open_symbol_file_object (void *from_ttyp)
return 0;
}
-/* Build a list of currently loaded shared objects. See solib-svr4.c */
+/* Build a list of currently loaded shared objects. See solib-svr4.c. */
static struct so_list *
darwin_current_sos (void)
@@ -293,7 +293,7 @@ darwin_special_symbol_handling (void)
{
}
-/* Shared library startup support. See documentation in solib-svr4.c */
+/* Shared library startup support. See documentation in solib-svr4.c. */
static void
darwin_solib_create_inferior_hook (int from_tty)
diff --git a/gdb/solib-frv.c b/gdb/solib-frv.c
index b67c812..16455be 100644
--- a/gdb/solib-frv.c
+++ b/gdb/solib-frv.c
@@ -202,7 +202,7 @@ struct ext_link_map
ext_ptr l_next, l_prev; /* struct link_map *l_next, *l_prev; */
};
-/* Link map info to include in an allocated so_list entry */
+/* Link map info to include in an allocated so_list entry. */
struct lm_info
{
@@ -225,7 +225,7 @@ struct lm_info
caching of the dynamic relocations could be dispensed with. */
asymbol **dyn_syms;
arelent **dyn_relocs;
- int dyn_reloc_count; /* number of dynamic relocs. */
+ int dyn_reloc_count; /* Number of dynamic relocs. */
};
@@ -284,7 +284,7 @@ bfd_lookup_symbol (bfd *abfd, char *symname)
sym = *symbol_table++;
if (strcmp (sym->name, symname) == 0)
{
- /* Bfd symbols are section relative. */
+ /* Bfd symbols are section relative. */
symaddr = sym->value + sym->section->vma;
break;
}
@@ -310,7 +310,7 @@ bfd_lookup_symbol (bfd *abfd, char *symname)
sym = *symbol_table++;
if (strcmp (sym->name, symname) == 0)
{
- /* Bfd symbols are section relative. */
+ /* Bfd symbols are section relative. */
symaddr = sym->value + sym->section->vma;
break;
}
@@ -340,7 +340,7 @@ bfd_lookup_symbol (bfd *abfd, char *symname)
If FROM_TTYP dereferences to a non-zero integer, allow messages to
be printed. This parameter is a pointer rather than an int because
open_symbol_file_object() is called via catch_errors() and
- catch_errors() requires a pointer argument. */
+ catch_errors() requires a pointer argument. */
static int
open_symbol_file_object (void *from_ttyp)
@@ -905,7 +905,7 @@ enable_break (void)
static void
frv_special_symbol_handling (void)
{
- /* Nothing needed (yet) for FRV. */
+ /* Nothing needed (yet) for FRV. */
}
static void
diff --git a/gdb/solib-irix.c b/gdb/solib-irix.c
index bd577a0..17956be 100644
--- a/gdb/solib-irix.c
+++ b/gdb/solib-irix.c
@@ -158,7 +158,7 @@ fetch_lm_info (CORE_ADDR addr)
if (extract_unsigned_integer (buf.magic.b, sizeof (buf.magic), byte_order)
!= 0xffffffff)
{
- /* Use buf.ol32... */
+ /* Use buf.ol32... */
char obj_buf[432];
CORE_ADDR obj_addr = extract_mips_address (&buf.ol32.data,
sizeof (buf.ol32.data),
@@ -242,7 +242,7 @@ fetch_lm_info (CORE_ADDR addr)
static void *base_breakpoint;
-static CORE_ADDR debug_base; /* Base of dynamic linker structures */
+static CORE_ADDR debug_base; /* Base of dynamic linker structures. */
/*
@@ -328,7 +328,7 @@ disable_break (void)
int status = 1;
/* Note that breakpoint address and original contents are in our address
- space, so we just need to write the original contents back. */
+ space, so we just need to write the original contents back. */
if (deprecated_remove_raw_breakpoint (target_gdbarch, base_breakpoint) != 0)
{
@@ -463,7 +463,7 @@ irix_solib_create_inferior_hook (int from_tty)
/* Now run the target. It will eventually hit the breakpoint, at
which point all of the libraries will have been mapped in and we
can go groveling around in the dynamic linker structures to find
- out what we need to know about them. */
+ out what we need to know about them. */
tp = inferior_thread ();
@@ -482,7 +482,7 @@ irix_solib_create_inferior_hook (int from_tty)
/* We are now either at the "mapping complete" breakpoint (or somewhere
else, a condition we aren't prepared to deal with anyway), so adjust
the PC as necessary after a breakpoint, disable the breakpoint, and
- add any shared libraries that were mapped in. */
+ add any shared libraries that were mapped in. */
if (!disable_break ())
{
@@ -623,7 +623,7 @@ irix_current_sos (void)
If FROM_TTYP dereferences to a non-zero integer, allow messages to
be printed. This parameter is a pointer rather than an int because
open_symbol_file_object() is called via catch_errors() and
- catch_errors() requires a pointer argument. */
+ catch_errors() requires a pointer argument. */
static int
irix_open_symbol_file_object (void *from_ttyp)
diff --git a/gdb/solib-osf.c b/gdb/solib-osf.c
index 02bf7b1..33e851c 100644
--- a/gdb/solib-osf.c
+++ b/gdb/solib-osf.c
@@ -28,7 +28,7 @@
1) Peek around in the runtime loader structures.
These are not documented, and they are not defined in the system
- header files. The definitions below were obtained by experimentation,
+ header files. The definitions below were obtained by experimentation,
but they seem stable enough.
2) Use the libxproc.a library, which contains the equivalent ldr_*
@@ -73,8 +73,8 @@ typedef struct
CORE_ADDR previous;
CORE_ADDR unknown1;
CORE_ADDR module_name;
- CORE_ADDR modinfo_addr; /* used by next_link_map_member() to detect
- the end of the shared module list */
+ CORE_ADDR modinfo_addr; /* Used by next_link_map_member() to detect
+ the end of the shared module list. */
long module_id;
CORE_ADDR unknown2;
CORE_ADDR unknown3;
@@ -287,7 +287,7 @@ osf_clear_solib (void)
instructions.
For a statically bound executable, the inferior's first instruction is the
- one at "_start", or a similar text label. No further processing is needed
+ one at "_start", or a similar text label. No further processing is needed
in that case.
For a dynamically bound executable, this first instruction is somewhere
@@ -352,7 +352,7 @@ osf_solib_create_inferior_hook (int from_tty)
/* solib_add will call reinit_frame_cache.
But we are stopped in the runtime loader and we do not have symbols
- for the runtime loader. So heuristic_proc_start will be called
+ for the runtime loader. So heuristic_proc_start will be called
and will put out an annoying warning.
Delaying the resetting of stop_soon until after symbol loading
suppresses the warning. */
@@ -611,12 +611,12 @@ osf_open_symbol_file_object (void *from_ttyp)
static int
osf_in_dynsym_resolve_code (CORE_ADDR pc)
{
- /* This function currently always return False. This is a temporary
+ /* This function currently always return False. This is a temporary
solution which only consequence is to introduce a minor incovenience
for the user: When stepping inside a subprogram located in a shared
library, gdb might stop inside the dynamic loader code instead of
- inside the subprogram itself. See the explanations in infrun.c about
- the in_solib_dynsym_resolve_code() function for more details. */
+ inside the subprogram itself. See the explanations in infrun.c about
+ the in_solib_dynsym_resolve_code() function for more details. */
return 0;
}
@@ -635,6 +635,6 @@ _initialize_osf_solib (void)
osf_so_ops.in_dynsym_resolve_code = osf_in_dynsym_resolve_code;
osf_so_ops.bfd_open = solib_bfd_open;
- /* FIXME: Don't do this here. *_gdbarch_init() should set so_ops. */
+ /* FIXME: Don't do this here. *_gdbarch_init() should set so_ops. */
current_target_so_ops = &osf_so_ops;
}
diff --git a/gdb/solib-pa64.c b/gdb/solib-pa64.c
index c26fc62..f7d7b6f 100644
--- a/gdb/solib-pa64.c
+++ b/gdb/solib-pa64.c
@@ -16,9 +16,9 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
- HP in their infinite stupidity choose not to use standard ELF dynamic
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* HP in their infinite stupidity choose not to use standard ELF dynamic
linker interfaces. They also choose not to make their ELF dymamic
linker interfaces compatible with the SOM dynamic linker. The
net result is we can not use either of the existing somsolib.c or
@@ -60,7 +60,7 @@ struct lm_info {
CORE_ADDR desc_addr;
};
-/* When adding fields, be sure to clear them in _initialize_pa64_solib. */
+/* When adding fields, be sure to clear them in _initialize_pa64_solib. */
typedef struct
{
CORE_ADDR dld_flags_addr;
@@ -166,7 +166,7 @@ read_dld_descriptor (void)
if (!dld_cache.load_map)
return 0;
- /* Read in the dld load module descriptor */
+ /* Read in the dld load module descriptor. */
if (dlgetmodinfo (-1,
&dld_cache.dld_desc,
sizeof (dld_cache.dld_desc),
@@ -206,7 +206,7 @@ read_dynamic_info (asection *dyninfo_sect, dld_cache_t *dld_cache_p)
return 0;
/* Scan the .dynamic section and record the items of interest.
- In particular, DT_HP_DLD_FLAGS */
+ In particular, DT_HP_DLD_FLAGS. */
for (bufend = buf + dyninfo_sect_size, entry_addr = dyninfo_addr;
buf < bufend;
buf += sizeof (Elf64_Dyn), entry_addr += sizeof (Elf64_Dyn))
@@ -224,7 +224,7 @@ read_dynamic_info (asection *dyninfo_sect, dld_cache_t *dld_cache_p)
break;
else if (dyn_tag == DT_HP_DLD_FLAGS)
{
- /* Set dld_flags_addr and dld_flags in *dld_cache_p */
+ /* Set dld_flags_addr and dld_flags in *dld_cache_p. */
dld_cache_p->dld_flags_addr = entry_addr + offsetof(Elf64_Dyn, d_un);
if (target_read_memory (dld_cache_p->dld_flags_addr,
(char*) &dld_cache_p->dld_flags,
@@ -251,11 +251,11 @@ read_dynamic_info (asection *dyninfo_sect, dld_cache_t *dld_cache_p)
}
else
{
- /* tag is not of interest */
+ /* Tag is not of interest. */
}
}
- /* Record other information and set is_valid to 1. */
+ /* Record other information and set is_valid to 1. */
dld_cache_p->dyninfo_sect = dyninfo_sect;
/* Verify that we read in required info. These fields are re-set to zero
@@ -269,8 +269,7 @@ read_dynamic_info (asection *dyninfo_sect, dld_cache_t *dld_cache_p)
return 1;
}
-/*
- bfd_lookup_symbol -- lookup the value for a specific symbol
+/* bfd_lookup_symbol -- lookup the value for a specific symbol
An expensive way to lookup the value of a single symbol for
bfd's that are only temporary anyway. This is used by the
@@ -278,8 +277,7 @@ read_dynamic_info (asection *dyninfo_sect, dld_cache_t *dld_cache_p)
interface structures in the shared library.
Note that 0 is specifically allowed as an error return (no
- such symbol).
- */
+ such symbol). */
static CORE_ADDR
bfd_lookup_symbol (bfd *abfd, char *symname)
@@ -305,7 +303,7 @@ bfd_lookup_symbol (bfd *abfd, char *symname)
sym = *symbol_table++;
if (strcmp (sym->name, symname) == 0)
{
- /* Bfd symbols are section relative. */
+ /* Bfd symbols are section relative. */
symaddr = sym->value + sym->section->vma;
break;
}
@@ -417,7 +415,7 @@ manpage for methods to privately map shared library text."));
/* We find the dynamic linker's base address by examining the
current pc (which point at the entry point for the dynamic
- linker) and subtracting the offset of the entry point.
+ linker) and subtracting the offset of the entry point.
Also note the breakpoint is the second instruction in the
routine. */
@@ -629,7 +627,7 @@ pa64_solib_get_solib_by_pc (CORE_ADDR addr)
return retval;
}
-/* pa64 libraries do not seem to set the section offsets in a standard (i.e.
+/* pa64 libraries do not seem to set the section offsets in a standard (i.e.
SVr4) way; the text section offset stored in the file doesn't correspond
to the place where the library is actually loaded into memory. Instead,
we rely on the dll descriptor to tell us where things were loaded. */
diff --git a/gdb/solib-som.c b/gdb/solib-som.c
index d1522ff..6dc5d14 100644
--- a/gdb/solib-som.c
+++ b/gdb/solib-som.c
@@ -40,8 +40,8 @@
/* These ought to be defined in some public interface, but aren't. They
define the meaning of the various bits in the distinguished __dld_flags
variable that is declared in every debuggable a.out on HP-UX, and that
- is shared between the debugger and the dynamic linker.
- */
+ is shared between the debugger and the dynamic linker. */
+
#define DLD_FLAGS_MAPPRIVATE 0x1
#define DLD_FLAGS_HOOKVALID 0x2
#define DLD_FLAGS_LISTVALID 0x4
@@ -88,8 +88,8 @@ struct lm_info
};
/* These addresses should be filled in by som_solib_create_inferior_hook.
- They are also used elsewhere in this module.
- */
+ They are also used elsewhere in this module. */
+
typedef struct
{
CORE_ADDR address;
@@ -97,7 +97,7 @@ typedef struct
}
addr_and_unwind_t;
-/* When adding fields, be sure to clear them in _initialize_som_solib. */
+/* When adding fields, be sure to clear them in _initialize_som_solib. */
static struct
{
int is_valid;
@@ -239,8 +239,8 @@ GDB will be unable to track shl_load/shl_unload calls"));
Note that the above is the pre-HP-UX 9.0 behaviour. At 9.0 and above,
the dld provides an export stub named "__d_trap" as well as the
function named "__d_trap" itself, but doesn't provide "_DLD_HOOK".
- We'll look first for the old flavor and then the new.
- */
+ We'll look first for the old flavor and then the new. */
+
msymbol = lookup_minimal_symbol ("_DLD_HOOK", NULL, symfile_objfile);
if (msymbol == NULL)
msymbol = lookup_minimal_symbol ("__d_trap", NULL, symfile_objfile);
@@ -338,7 +338,7 @@ manpage for methods to privately map shared library text."));
if (status != 0)
error (_("Unable to write __dld_flags."));
- /* Now find the address of _start and set a breakpoint there.
+ /* Now find the address of _start and set a breakpoint there.
We still need this code for two reasons:
* Not all sites have /opt/langtools/lib/end.o, so it's not always
@@ -375,8 +375,8 @@ som_solib_desire_dynamic_linker_symbols (void)
we've no work to do.
(If you add clauses to this test, be sure to likewise update the
- test within the loop.)
- */
+ test within the loop.) */
+
if (dld_cache.is_valid)
return;
@@ -415,8 +415,8 @@ som_solib_desire_dynamic_linker_symbols (void)
cover the body of "shl_unload", the second being 4 bytes past
the end of the first. This is a large hack to handle that
case, but since I don't seem to have any legitimate way to
- look for this thing via the symbol table...
- */
+ look for this thing via the symbol table... */
+
if (dld_cache.unload.unwind != NULL)
{
u = find_unwind_entry (dld_cache.unload.unwind->region_end + 4);
@@ -443,7 +443,7 @@ som_solib_desire_dynamic_linker_symbols (void)
}
}
- /* Did we find everything we were looking for? If so, stop. */
+ /* Did we find everything we were looking for? If so, stop. */
if ((dld_cache.load.address != 0)
&& (dld_cache.load_stub.address != 0)
&& (dld_cache.unload.address != 0)
@@ -458,8 +458,7 @@ som_solib_desire_dynamic_linker_symbols (void)
dld_cache.hook_stub.unwind = find_unwind_entry (dld_cache.hook_stub.address);
/* We're prepared not to find some of these symbols, which is why
- this function is a "desire" operation, and not a "require".
- */
+ this function is a "desire" operation, and not a "require". */
}
static int
@@ -475,17 +474,17 @@ som_in_dynsym_resolve_code (CORE_ADDR pc)
weren't mapped to a (writeable) private region. However, in
that case the debugger probably isn't able to set the fundamental
breakpoint in the dld callback anyways, so this hack should be
- safe.
- */
+ safe. */
+
if ((pc & (CORE_ADDR) 0xc0000000) == (CORE_ADDR) 0xc0000000)
return 1;
/* Cache the address of some symbols that are part of the dynamic
- linker, if not already known.
- */
+ linker, if not already known. */
+
som_solib_desire_dynamic_linker_symbols ();
- /* Are we in the dld callback? Or its export stub? */
+ /* Are we in the dld callback? Or its export stub? */
u_pc = find_unwind_entry (pc);
if (u_pc == NULL)
return 0;
@@ -493,7 +492,7 @@ som_in_dynsym_resolve_code (CORE_ADDR pc)
if ((u_pc == dld_cache.hook.unwind) || (u_pc == dld_cache.hook_stub.unwind))
return 1;
- /* Or the interface of the dld (i.e., "shl_load" or friends)? */
+ /* Or the interface of the dld (i.e., "shl_load" or friends)? */
if ((u_pc == dld_cache.load.unwind)
|| (u_pc == dld_cache.unload.unwind)
|| (u_pc == dld_cache.unload2.unwind)
@@ -501,7 +500,7 @@ som_in_dynsym_resolve_code (CORE_ADDR pc)
|| (u_pc == dld_cache.unload_stub.unwind))
return 1;
- /* Apparently this address isn't part of the dld's text. */
+ /* Apparently this address isn't part of the dld's text. */
return 0;
}
@@ -567,7 +566,7 @@ link_map_start (void)
return extract_unsigned_integer (buf, 4, byte_order);
}
-/* Does this so's name match the main binary? */
+/* Does this so's name match the main binary? */
static int
match_main (const char *name)
{
@@ -707,7 +706,7 @@ som_open_symbol_file_object (void *from_ttyp)
/* First link map member should be the executable. */
if ((lm = link_map_start ()) == 0)
- return 0; /* failed somehow... */
+ return 0; /* failed somehow... */
/* Read address of name from target memory to GDB. */
read_memory (lm + offsetof (struct dld_list, name), buf, 4);
@@ -773,8 +772,8 @@ som_solib_get_got_by_pc (CORE_ADDR addr)
/* Return the address of the handle of the shared library in which
ADDR belongs. If ADDR isn't in any known shared library, return
zero. */
-/* this function is used in initialize_hp_cxx_exception_support in
- hppa-hpux-tdep.c */
+/* This function is used in initialize_hp_cxx_exception_support in
+ hppa-hpux-tdep.c. */
static CORE_ADDR
som_solib_get_solib_by_pc (CORE_ADDR addr)
@@ -827,7 +826,7 @@ som_solib_select (struct gdbarch *gdbarch)
}
/* The rest of these functions are not part of the solib interface; they
- are used by somread.c or hppa-hpux-tdep.c */
+ are used by somread.c or hppa-hpux-tdep.c. */
int
som_solib_section_offsets (struct objfile *objfile,
diff --git a/gdb/solib-spu.c b/gdb/solib-spu.c
index 32ff3f5..1594fbb 100644
--- a/gdb/solib-spu.c
+++ b/gdb/solib-spu.c
@@ -227,7 +227,7 @@ spu_current_sos (void)
link_ptr = &new->next;
}
- /* Append OpenCL sos. */
+ /* Append OpenCL sos. */
append_ocl_sos (link_ptr);
return head;
diff --git a/gdb/solib-sunos.c b/gdb/solib-sunos.c
index 65dcf22..dc7d31a 100644
--- a/gdb/solib-sunos.c
+++ b/gdb/solib-sunos.c
@@ -85,7 +85,7 @@
#endif
-/* Link map info to include in an allocated so_list entry */
+/* Link map info to include in an allocated so_list entry. */
struct lm_info
{
@@ -96,7 +96,7 @@ struct lm_info
};
-/* Symbols which are used to locate the base of the link map structures. */
+/* Symbols which are used to locate the base of the link map structures. */
static char *debug_base_symbols[] =
{
@@ -173,7 +173,7 @@ LM_NAME (struct so_list *so)
lm_name_size, byte_order);
}
-static CORE_ADDR debug_base; /* Base of dynamic linker structures */
+static CORE_ADDR debug_base; /* Base of dynamic linker structures. */
/* Local function prototypes */
@@ -195,7 +195,7 @@ allocate_rt_common_objfile (void)
obstack_init (&objfile->objfile_obstack);
objfile->name = xstrdup ("rt_common");
- /* Add this file onto the tail of the linked list of other such files. */
+ /* Add this file onto the tail of the linked list of other such files. */
objfile->next = NULL;
if (object_files == NULL)
@@ -249,14 +249,14 @@ solib_add_common_symbols (CORE_ADDR rtc_symp)
{
/* FIXME: The length of the symbol name is not available, but in the
current implementation the common symbol is allocated immediately
- behind the name of the symbol. */
+ behind the name of the symbol. */
len = inferior_rtc_nlist.n_value - inferior_rtc_nlist.n_un.n_strx;
name = xmalloc (len);
read_memory (SOLIB_EXTRACT_ADDRESS (inferior_rtc_nlist.n_un.n_name),
name, len);
- /* Allocate the runtime common objfile if necessary. */
+ /* Allocate the runtime common objfile if necessary. */
if (rt_common_objfile == NULL)
allocate_rt_common_objfile ();
@@ -320,7 +320,7 @@ locate_base (void)
/* For SunOS, we want to limit the search for the debug base symbol to the
executable being debugged, since there is a duplicate named symbol in the
- shared library. We don't want the shared library versions. */
+ shared library. We don't want the shared library versions. */
for (symbolp = debug_base_symbols; *symbolp != NULL; symbolp++)
{
@@ -360,7 +360,7 @@ first_link_map_member (void)
if (dynamic_copy.ld_version >= 2)
{
/* It is a version that we can deal with, so read in the secondary
- structure and find the address of the link map list from it. */
+ structure and find the address of the link map list from it. */
read_memory (SOLIB_EXTRACT_ADDRESS (dynamic_copy.ld_un.ld_2),
(char *) &ld_2_copy, sizeof (struct link_dynamic_2));
lm = SOLIB_EXTRACT_ADDRESS (ld_2_copy.ld_loaded);
@@ -515,18 +515,18 @@ sunos_in_dynsym_resolve_code (CORE_ADDR pc)
static int
disable_break (void)
{
- CORE_ADDR breakpoint_addr; /* Address where end bkpt is set */
+ CORE_ADDR breakpoint_addr; /* Address where end bkpt is set. */
int in_debugger = 0;
/* Read the debugger structure from the inferior to retrieve the
address of the breakpoint and the original contents of the
breakpoint address. Remove the breakpoint by writing the original
- contents back. */
+ contents back. */
read_memory (debug_addr, (char *) &debug_copy, sizeof (debug_copy));
- /* Set `in_debugger' to zero now. */
+ /* Set `in_debugger' to zero now. */
write_memory (flag_addr, (char *) &in_debugger, sizeof (in_debugger));
@@ -536,7 +536,7 @@ disable_break (void)
/* For the SVR4 version, we always know the breakpoint address. For the
SunOS version we don't know it until the above code is executed.
- Grumble if we are stopped anywhere besides the breakpoint address. */
+ Grumble if we are stopped anywhere besides the breakpoint address. */
if (stop_pc != breakpoint_addr)
{
@@ -598,7 +598,7 @@ enable_break (void)
int j;
int in_debugger;
- /* Get link_dynamic structure */
+ /* Get link_dynamic structure. */
j = target_read_memory (debug_base, (char *) &dynamic_copy,
sizeof (dynamic_copy));
@@ -608,11 +608,11 @@ enable_break (void)
return (0);
}
- /* Calc address of debugger interface structure */
+ /* Calc address of debugger interface structure. */
debug_addr = SOLIB_EXTRACT_ADDRESS (dynamic_copy.ldd);
- /* Calc address of `in_debugger' member of debugger interface structure */
+ /* Calc address of `in_debugger' member of debugger interface structure. */
flag_addr = debug_addr + (CORE_ADDR) ((char *) &debug_copy.ldd_in_debugger -
(char *) &debug_copy);
@@ -656,7 +656,7 @@ sunos_special_symbol_handling (void)
if (debug_addr == 0)
{
- /* Get link_dynamic structure */
+ /* Get link_dynamic structure. */
j = target_read_memory (debug_base, (char *) &dynamic_copy,
sizeof (dynamic_copy));
@@ -666,7 +666,7 @@ sunos_special_symbol_handling (void)
return;
}
- /* Calc address of debugger interface structure */
+ /* Calc address of debugger interface structure. */
/* FIXME, this needs work for cross-debugging of core files
(byteorder, size, alignment, etc). */
@@ -674,14 +674,14 @@ sunos_special_symbol_handling (void)
}
/* Read the debugger structure from the inferior, just to make sure
- we have a current copy. */
+ we have a current copy. */
j = target_read_memory (debug_addr, (char *) &debug_copy,
sizeof (debug_copy));
if (j)
return; /* unreadable */
- /* Get common symbol definitions for the loaded object. */
+ /* Get common symbol definitions for the loaded object. */
if (debug_copy.ldd_cp)
{
@@ -749,7 +749,7 @@ sunos_solib_create_inferior_hook (int from_tty)
if ((debug_base = locate_base ()) == 0)
{
- /* Can't find the symbol or the executable is statically linked. */
+ /* Can't find the symbol or the executable is statically linked. */
return;
}
@@ -766,7 +766,7 @@ sunos_solib_create_inferior_hook (int from_tty)
Now run the target. It will eventually hit the breakpoint, at
which point all of the libraries will have been mapped in and we
can go groveling around in the dynamic linker structures to find
- out what we need to know about them. */
+ out what we need to know about them. */
inf = current_inferior ();
tp = inferior_thread ();
@@ -844,6 +844,6 @@ _initialize_sunos_solib (void)
sunos_so_ops.in_dynsym_resolve_code = sunos_in_dynsym_resolve_code;
sunos_so_ops.bfd_open = solib_bfd_open;
- /* FIXME: Don't do this here. *_gdbarch_init() should set so_ops. */
+ /* FIXME: Don't do this here. *_gdbarch_init() should set so_ops. */
current_target_so_ops = &sunos_so_ops;
}
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index d45cd92..432da99 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -52,7 +52,7 @@ static struct link_map_offsets *svr4_fetch_link_map_offsets (void);
static int svr4_have_link_map_offsets (void);
static void svr4_relocate_main_executable (void);
-/* Link map info to include in an allocated so_list entry */
+/* Link map info to include in an allocated so_list entry. */
struct lm_info
{
@@ -140,7 +140,7 @@ svr4_same (struct so_list *gdb, struct so_list *inferior)
return (svr4_same_1 (gdb->so_original_name, inferior->so_original_name));
}
-/* link map access functions */
+/* link map access functions. */
static CORE_ADDR
LM_ADDR_FROM_LINK_MAP (struct so_list *so)
@@ -306,7 +306,7 @@ IGNORE_FIRST_LINK_MAP_ENTRY (struct so_list *so)
struct svr4_info
{
- CORE_ADDR debug_base; /* Base of dynamic linker structures */
+ CORE_ADDR debug_base; /* Base of dynamic linker structures. */
/* Validity flag for debug_loader_offset. */
int debug_loader_offset_p;
@@ -594,7 +594,7 @@ find_program_interpreter (void)
}
-/* Scan for DYNTAG in .dynamic section of ABFD. If DYNTAG is found 1 is
+/* Scan for DYNTAG in .dynamic section of ABFD. If DYNTAG is found 1 is
returned and the corresponding PTR is set. */
static int
@@ -992,7 +992,7 @@ svr4_keep_data_in_core (CORE_ADDR vaddr, unsigned long size)
If FROM_TTYP dereferences to a non-zero integer, allow messages to
be printed. This parameter is a pointer rather than an int because
open_symbol_file_object() is called via catch_errors() and
- catch_errors() requires a pointer argument. */
+ catch_errors() requires a pointer argument. */
static int
open_symbol_file_object (void *from_ttyp)
@@ -1015,12 +1015,12 @@ open_symbol_file_object (void *from_ttyp)
/* Always locate the debug struct, in case it has moved. */
info->debug_base = 0;
if (locate_base (info) == 0)
- return 0; /* failed somehow... */
+ return 0; /* failed somehow... */
/* First link map member should be the executable. */
lm = solib_svr4_r_map (info);
if (lm == 0)
- return 0; /* failed somehow... */
+ return 0; /* failed somehow... */
/* Read address of name from target memory to GDB. */
read_memory (lm + lmo->l_name_offset, l_name_buf, l_name_size);
@@ -1160,7 +1160,7 @@ svr4_current_sos (void)
inferior executable, so we must ignore it. For some versions of
SVR4, it has no name. For others (Solaris 2.3 for example), it
does have a name, so we can no longer use a missing name to
- decide when to ignore it. */
+ decide when to ignore it. */
else if (IGNORE_FIRST_LINK_MAP_ENTRY (new) && ldsomap == 0)
{
info->main_lm_addr = new->lm_info->lm_addr;
@@ -1686,7 +1686,7 @@ read_program_headers_from_bfd (bfd *abfd, int *phdrs_size)
exec_bfd. Otherwise return 0.
We relocate all of the sections by the same amount. This
- behavior is mandated by recent editions of the System V ABI.
+ behavior is mandated by recent editions of the System V ABI.
According to the System V Application Binary Interface,
Edition 4.1, page 5-5:
@@ -2045,7 +2045,7 @@ svr4_exec_displacement (CORE_ADDR *displacementp)
}
/* Relocate the main executable. This function should be called upon
- stopping the inferior process at the entry point to the program.
+ stopping the inferior process at the entry point to the program.
The entry point from BFD is compared to the AT_ENTRY of AUXV and if they are
different, the main executable is relocated by the proper amount. */
@@ -2078,8 +2078,7 @@ svr4_relocate_main_executable (void)
the `qOffsets' packet.
- The section offsets were not reset earlier, and the best we can
- hope is that the old offsets are still applicable to the new run.
- */
+ hope is that the old offsets are still applicable to the new run. */
if (! svr4_exec_displacement (&displacement))
return;
@@ -2191,7 +2190,7 @@ svr4_solib_create_inferior_hook (int from_tty)
Now run the target. It will eventually hit the breakpoint, at
which point all of the libraries will have been mapped in and we
can go groveling around in the dynamic linker structures to find
- out what we need to know about them. */
+ out what we need to know about them. */
inf = current_inferior ();
tp = inferior_thread ();
@@ -2395,7 +2394,7 @@ svr4_lp64_fetch_link_map_offsets (void)
struct target_so_ops svr4_so_ops;
-/* Lookup global symbol for ELF DSOs linked with -Bsymbolic. Those DSOs have a
+/* Lookup global symbol for ELF DSOs linked with -Bsymbolic. Those DSOs have a
different rule for symbol lookup. The lookup begins here in the DSO, not in
the main executable. */
diff --git a/gdb/solib.c b/gdb/solib.c
index 21b554e..909a23b 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -345,12 +345,12 @@ solib_find (char *in_pathname, int *fd)
target_lbasename (fskind, in_pathname),
O_RDONLY | O_BINARY, &temp_pathname);
- /* If not found, try to use target supplied solib search method */
+ /* If not found, try to use target supplied solib search method. */
if (found_file < 0 && ops->find_and_open_solib)
found_file = ops->find_and_open_solib (in_pathname, O_RDONLY | O_BINARY,
&temp_pathname);
- /* If not found, next search the inferior's $PATH environment variable. */
+ /* If not found, next search the inferior's $PATH environment variable. */
if (found_file < 0 && gdb_sysroot_is_empty)
found_file = openp (get_in_environ (current_inferior ()->environment,
"PATH"),
@@ -358,7 +358,7 @@ solib_find (char *in_pathname, int *fd)
&temp_pathname);
/* If not found, next search the inferior's $LD_LIBRARY_PATH
- environment variable. */
+ environment variable. */
if (found_file < 0 && gdb_sysroot_is_empty)
found_file = openp (get_in_environ (current_inferior ()->environment,
"LD_LIBRARY_PATH"),
@@ -500,7 +500,7 @@ solib_map_sections (struct so_list *so)
so->abfd = gdb_bfd_ref (abfd);
/* copy full path name into so_name, so that later symbol_file_add
- can find it */
+ can find it. */
if (strlen (bfd_get_filename (abfd)) >= SO_NAME_MAX_PATH_SIZE)
error (_("Shared library file name is too long."));
strcpy (so->so_name, bfd_get_filename (abfd));
@@ -515,7 +515,7 @@ solib_map_sections (struct so_list *so)
{
/* Relocate the section binding addresses as recorded in the shared
object's file by the base address to which the object was actually
- mapped. */
+ mapped. */
ops->relocate_section_addresses (so, p);
/* If the target didn't provide information about the address
@@ -580,7 +580,7 @@ free_so_symbols (struct so_list *so)
DESCRIPTION
Free the storage associated with the `struct so_list' object SO.
- If we have opened a BFD for SO, close it.
+ If we have opened a BFD for SO, close it.
The caller is responsible for removing SO from whatever list it is
a member of. If we have placed SO's sections in some target's
@@ -1377,7 +1377,7 @@ reload_shared_libraries (char *ignored, int from_tty,
ops = solib_ops (target_gdbarch);
- /* Creating inferior hooks here has two purposes. First, if we reload
+ /* Creating inferior hooks here has two purposes. First, if we reload
shared libraries then the address of solib breakpoint we've computed
previously might be no longer valid. For example, if we forgot to set
solib-absolute-prefix and are setting it right now, then the previous
diff --git a/gdb/solib.h b/gdb/solib.h
index bce21e5..c473d85 100644
--- a/gdb/solib.h
+++ b/gdb/solib.h
@@ -28,11 +28,11 @@ struct target_so_ops;
struct program_space;
/* Called when we free all symtabs, to free the shared library information
- as well. */
+ as well. */
extern void clear_solib (void);
-/* Called to add symbols from a shared library to gdb's symbol table. */
+/* Called to add symbols from a shared library to gdb's symbol table. */
extern void solib_add (char *, int, struct target_ops *, int);
extern int solib_read_symbols (struct so_list *, int);
@@ -65,7 +65,7 @@ extern int solib_keep_data_in_core (CORE_ADDR vaddr, unsigned long size);
extern int in_solib_dynsym_resolve_code (CORE_ADDR);
-/* Discard symbols that were auto-loaded from shared libraries. */
+/* Discard symbols that were auto-loaded from shared libraries. */
extern void no_shared_libraries (char *ignored, int from_tty);
diff --git a/gdb/solist.h b/gdb/solist.h
index ab7b087..c4607d0 100644
--- a/gdb/solist.h
+++ b/gdb/solist.h
@@ -39,7 +39,7 @@ struct so_list
/* A pointer to target specific link map information. Often this
will be a copy of struct link_map from the user process, but
it need not be; it can be any collection of data needed to
- traverse the dynamic linker's data structures. */
+ traverse the dynamic linker's data structures. */
struct lm_info *lm_info;
/* Shared object file name, exactly as it appears in the
@@ -49,7 +49,7 @@ struct so_list
map we've already loaded. */
char so_original_name[SO_NAME_MAX_PATH_SIZE];
- /* shared object file name, expanded to something GDB can open */
+ /* Shared object file name, expanded to something GDB can open. */
char so_name[SO_NAME_MAX_PATH_SIZE];
/* Program space this shared library belongs to. */
@@ -62,7 +62,7 @@ struct so_list
current_sos must initialize these fields to 0. */
bfd *abfd;
- char symbols_loaded; /* flag: symbols read in yet? */
+ char symbols_loaded; /* flag: symbols read in yet? */
/* objfile with symbols for a loaded library. Target memory is read from
ABFD. OBJFILE may be NULL either before symbols have been loaded, if
@@ -107,13 +107,13 @@ struct target_so_ops
int (*open_symbol_file_object) (void *from_ttyp);
/* Determine if PC lies in the dynamic symbol resolution code of
- the run time loader */
+ the run time loader. */
int (*in_dynsym_resolve_code) (CORE_ADDR pc);
/* Find and open shared library binary file. */
bfd *(*bfd_open) (char *pathname);
- /* Extra hook for finding and opening a solib.
+ /* Extra hook for finding and opening a solib.
Convenience function for remote debuggers finding host libs. */
int (*find_and_open_solib) (char *soname,
unsigned o_flags, char **temp_pathname);
@@ -154,7 +154,7 @@ extern bfd *solib_bfd_fopen (char *pathname, int fd);
/* Find solib binary file and open it. */
extern bfd *solib_bfd_open (char *in_pathname);
-/* FIXME: gdbarch needs to control this variable */
+/* FIXME: gdbarch needs to control this variable. */
extern struct target_so_ops *current_target_so_ops;
/* Handler for library-specific global symbol lookup in solib.c. */
diff --git a/gdb/somread.c b/gdb/somread.c
index 18e839c..fbbe356 100644
--- a/gdb/somread.c
+++ b/gdb/somread.c
@@ -197,7 +197,7 @@ som_symtab_read (bfd *abfd, struct objfile *objfile,
the nasty habit of placing section symbols from the literal
subspaces in the middle of the program's text. Filter
those out as best we can. Check for first and last character
- being '$'.
+ being '$'.
And finally, the newer HP compilers emit crud like $PIC_foo$N
in some circumstance (PIC code I guess). It's also claimed
@@ -321,18 +321,18 @@ som_symfile_read (struct objfile *objfile, int symfile_flags)
init_minimal_symbol_collection ();
back_to = make_cleanup_discard_minimal_symbols ();
- /* Process the normal SOM symbol table first.
+ /* Process the normal SOM symbol table first.
This reads in the DNTT and string table, but doesn't
- actually scan the DNTT. It does scan the linker symbol
- table and thus build up a "minimal symbol table". */
+ actually scan the DNTT. It does scan the linker symbol
+ table and thus build up a "minimal symbol table". */
som_symtab_read (abfd, objfile, objfile->section_offsets);
/* Install any minimal symbols that have been collected as the current
- minimal symbols for this objfile.
+ minimal symbols for this objfile.
Further symbol-reading is done incrementally, file-by-file,
- in a step known as "psymtab-to-symtab" expansion. hp-symtab-read.c
- contains the code to do the actual DNTT scanning and symtab building. */
+ in a step known as "psymtab-to-symtab" expansion. hp-symtab-read.c
+ contains the code to do the actual DNTT scanning and symtab building. */
install_minimal_symbols (objfile);
do_cleanups (back_to);
@@ -356,9 +356,9 @@ som_new_init (struct objfile *ignore)
}
/* Perform any local cleanups required when we are done with a particular
- objfile. I.E, we are in the process of discarding all symbol information
+ objfile. I.e, we are in the process of discarding all symbol information
for an objfile, freeing up all memory held for it, and unlinking the
- objfile struct from the global list of known objfiles. */
+ objfile struct from the global list of known objfiles. */
static void
som_symfile_finish (struct objfile *objfile)
@@ -396,11 +396,11 @@ som_symfile_offsets (struct objfile *objfile, struct section_addr_info *addrs)
SIZEOF_N_SECTION_OFFSETS (objfile->num_sections));
/* FIXME: ezannoni 2000-04-20 The section names in SOM are not
- .text, .data, etc, but $TEXT$, $DATA$,... We should initialize
- SET_OFF_* from bfd. (See default_symfile_offsets()). But I don't
+ .text, .data, etc, but $TEXT$, $DATA$,... We should initialize
+ SET_OFF_* from bfd. (See default_symfile_offsets()). But I don't
know the correspondence between SOM sections and GDB's idea of
- section names. So for now we default to what is was before these
- changes.*/
+ section names. So for now we default to what is was before these
+ changes. */
objfile->sect_index_text = 0;
objfile->sect_index_data = 1;
objfile->sect_index_bss = 2;
@@ -412,7 +412,7 @@ som_symfile_offsets (struct objfile *objfile, struct section_addr_info *addrs)
{
/* Note: Here is OK to compare with ".text" because this is the
name that gdb itself gives to that section, not the SOM
- name. */
+ name. */
for (i = 0; i < addrs->num_sections && addrs->other[i].name; i++)
if (strcmp (addrs->other[i].name, ".text") == 0)
break;
diff --git a/gdb/source.c b/gdb/source.c
index 8449878..a14a802 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -52,11 +52,11 @@
#define OPEN_MODE (O_RDONLY | O_BINARY)
#define FDOPEN_MODE FOPEN_RB
-/* Prototypes for exported functions. */
+/* Prototypes for exported functions. */
void _initialize_source (void);
-/* Prototypes for local functions. */
+/* Prototypes for local functions. */
static int get_filename_and_charpos (struct symtab *, char **);
@@ -121,14 +121,14 @@ static int last_line_listed;
static int first_line_listed;
/* Saves the name of the last source file visited and a possible error code.
- Used to prevent repeating annoying "No such file or directories" msgs */
+ Used to prevent repeating annoying "No such file or directories" msgs. */
static struct symtab *last_source_visited = NULL;
static int last_source_error = 0;
/* Return the first line listed by print_source_lines.
Used by command interpreters to request listing from
- a previous point. */
+ a previous point. */
int
get_first_line_listed (void)
@@ -139,7 +139,7 @@ get_first_line_listed (void)
/* Return the default number of lines to print with commands like the
cli "list". The caller of print_source_lines must use this to
calculate the end line and use it in the call to print_source_lines
- as it does not automatically use this value. */
+ as it does not automatically use this value. */
int
get_lines_to_list (void)
@@ -148,7 +148,7 @@ get_lines_to_list (void)
}
/* Return the current source file for listing and next line to list.
- NOTE: The returned sal pc and end fields are not valid. */
+ NOTE: The returned sal pc and end fields are not valid. */
struct symtab_and_line
get_current_source_symtab_and_line (void)
@@ -170,7 +170,7 @@ get_current_source_symtab_and_line (void)
We must be cautious about where it is called, as it can recurse as the
process of determining a new default may call the caller!
Use get_current_source_symtab_and_line only to get whatever
- we have without erroring out or trying to get a default. */
+ we have without erroring out or trying to get a default. */
void
set_default_source_symtab_and_line (void)
@@ -178,7 +178,7 @@ set_default_source_symtab_and_line (void)
if (!have_full_symbols () && !have_partial_symbols ())
error (_("No symbol table is loaded. Use the \"file\" command."));
- /* Pull in a current source symtab if necessary */
+ /* Pull in a current source symtab if necessary. */
if (current_source_symtab == 0)
select_source_symtab (0);
}
@@ -186,7 +186,7 @@ set_default_source_symtab_and_line (void)
/* Return the current default file for listing and next line to list
(the returned sal pc and end fields are not valid.)
and set the current default to whatever is in SAL.
- NOTE: The returned sal pc and end fields are not valid. */
+ NOTE: The returned sal pc and end fields are not valid. */
struct symtab_and_line
set_current_source_symtab_and_line (const struct symtab_and_line *sal)
@@ -206,7 +206,7 @@ set_current_source_symtab_and_line (const struct symtab_and_line *sal)
return cursal;
}
-/* Reset any information stored about a default file and line to print. */
+/* Reset any information stored about a default file and line to print. */
void
clear_current_source_symtab_and_line (void)
@@ -386,7 +386,7 @@ void
directory_command (char *dirname, int from_tty)
{
dont_repeat ();
- /* FIXME, this goes to "delete dir"... */
+ /* FIXME, this goes to "delete dir"... */
if (dirname == 0)
{
if (!from_tty || query (_("Reinitialize source path to empty? ")))
@@ -425,7 +425,7 @@ mod_path (char *dirname, char **which_path)
if dirname should be parsed for separators that indicate multiple
directories. This allows for interfaces that pre-parse the dirname
and allow specification of traditional separator characters such
- as space or tab. */
+ as space or tab. */
void
add_path (char *dirname, char **which_path, int parse_separators)
@@ -442,7 +442,7 @@ add_path (char *dirname, char **which_path, int parse_separators)
if (parse_separators)
{
/* This will properly parse the space and tab separators
- and any quotes that may exist. DIRNAME_SEPARATOR will
+ and any quotes that may exist. DIRNAME_SEPARATOR will
be dealt with later. */
argv = gdb_buildargv (dirname);
make_cleanup_freeargv (argv);
@@ -495,7 +495,7 @@ add_path (char *dirname, char **which_path, int parse_separators)
&& !(p == name + 3 && name[1] == ':') /* "d:/" */
#endif
&& IS_DIR_SEPARATOR (p[-1]))
- /* Sigh. "foo/" => "foo" */
+ /* Sigh. "foo/" => "foo" */
--p;
*p = '\0';
@@ -580,11 +580,11 @@ add_path (char *dirname, char **which_path, int parse_separators)
if (!strncmp (p, name, len)
&& (p[len] == '\0' || p[len] == DIRNAME_SEPARATOR))
{
- /* Found it in the search path, remove old copy */
+ /* Found it in the search path, remove old copy. */
if (p > *which_path)
- p--; /* Back over leading separator */
+ p--; /* Back over leading separator. */
if (prefix > p - *which_path)
- goto skip_dup; /* Same dir twice in one cmd */
+ goto skip_dup; /* Same dir twice in one cmd. */
strcpy (p, &p[len + 1]); /* Copy from next \0 or : */
}
p = strchr (p, DIRNAME_SEPARATOR);
@@ -657,7 +657,7 @@ source_info (char *ignore, int from_tty)
}
-/* Return True if the file NAME exists and is a regular file */
+/* Return True if the file NAME exists and is a regular file. */
static int
is_regular_file (const char *name)
{
@@ -667,8 +667,8 @@ is_regular_file (const char *name)
/* Stat should never fail except when the file does not exist.
If stat fails, analyze the source of error and return True
unless the file does not exist, to avoid returning false results
- on obscure systems where stat does not work as expected.
- */
+ on obscure systems where stat does not work as expected. */
+
if (status != 0)
return (errno != ENOENT);
@@ -701,7 +701,7 @@ is_regular_file (const char *name)
Otherwise, return -1, with errno set for the last name we tried to open. */
/* >>>> This should only allow files of certain types,
- >>>> eg executable, non-directory */
+ >>>> eg executable, non-directory. */
int
openp (const char *path, int opts, const char *string,
int mode, char **filename_opened)
@@ -763,7 +763,7 @@ openp (const char *path, int opts, const char *string,
if (HAS_DRIVE_SPEC (string))
string = STRIP_DRIVE_SPEC (string);
- /* /foo => foo, to avoid multiple slashes that Emacs doesn't like. */
+ /* /foo => foo, to avoid multiple slashes that Emacs doesn't like. */
while (IS_DIR_SEPARATOR(string[0]))
string++;
@@ -788,7 +788,7 @@ openp (const char *path, int opts, const char *string,
/* Name is $cwd -- insert current directory name instead. */
int newlen;
- /* First, realloc the filename buffer if too short. */
+ /* First, realloc the filename buffer if too short. */
len = strlen (current_directory);
newlen = len + strlen (string) + 2;
if (newlen > alloclen)
@@ -815,7 +815,7 @@ openp (const char *path, int opts, const char *string,
continue;
}
- /* Remove trailing slashes */
+ /* Remove trailing slashes. */
while (len > 0 && IS_DIR_SEPARATOR (filename[len - 1]))
filename[--len] = 0;
@@ -833,9 +833,9 @@ openp (const char *path, int opts, const char *string,
done:
if (filename_opened)
{
- /* If a file was opened, canonicalize its filename. Use xfullpath
+ /* If a file was opened, canonicalize its filename. Use xfullpath
rather than gdb_realpath to avoid resolving the basename part
- of filenames when the associated file is a symbolic link. This
+ of filenames when the associated file is a symbolic link. This
fixes a potential inconsistency between the filenames known to
GDB and the filenames it prints in the annotations. */
if (fd < 0)
@@ -844,7 +844,7 @@ done:
*filename_opened = xfullpath (filename);
else
{
- /* Beware the // my son, the Emacs barfs, the botch that catch... */
+ /* Beware the // my son, the Emacs barfs, the botch that catch... */
char *f = concat (current_directory,
IS_DIR_SEPARATOR (current_directory[strlen (current_directory) - 1])
@@ -940,7 +940,7 @@ get_substitute_path_rule (const char *path)
/* If the user specified a source path substitution rule that applies
to PATH, then apply it and return the new path. This new path must
- be deallocated afterwards.
+ be deallocated afterwards.
Return NULL if no substitution rule was specified by the user,
or if no rule applied to the given PATH. */
@@ -968,8 +968,8 @@ rewrite_source_path (const char *path)
}
/* This function is capable of finding the absolute path to a
- source file, and opening it, provided you give it a FILENAME. Both the
- DIRNAME and FULLNAME are only added suggestions on where to find the file.
+ source file, and opening it, provided you give it a FILENAME. Both the
+ DIRNAME and FULLNAME are only added suggestions on where to find the file.
FILENAME should be the filename to open.
DIRNAME is the compilation directory of a particular source file.
@@ -979,12 +979,12 @@ rewrite_source_path (const char *path)
is applied we free the old value and set a new one.
On Success
- A valid file descriptor is returned. ( the return value is positive )
+ A valid file descriptor is returned (the return value is positive).
FULLNAME is set to the absolute path to the file just opened.
The caller is responsible for freeing FULLNAME.
On Failure
- An invalid file descriptor is returned. ( the return value is negative )
+ An invalid file descriptor is returned (the return value is negative).
FULLNAME is set to NULL. */
int
@@ -996,7 +996,7 @@ find_and_open_source (const char *filename,
const char *p;
int result;
- /* Quick way out if we already know its full name */
+ /* Quick way out if we already know its full name. */
if (*fullname)
{
@@ -1014,7 +1014,7 @@ find_and_open_source (const char *filename,
result = open (*fullname, OPEN_MODE);
if (result >= 0)
return result;
- /* Didn't work -- free old one, try again. */
+ /* Didn't work -- free old one, try again. */
xfree (*fullname);
*fullname = NULL;
}
@@ -1032,10 +1032,11 @@ find_and_open_source (const char *filename,
dirname = rewritten_dirname;
}
- /* Replace a path entry of $cdir with the compilation directory name */
+ /* Replace a path entry of $cdir with the compilation directory
+ name. */
#define cdir_len 5
/* We cast strstr's result in case an ANSIhole has made it const,
- which produces a "required warning" when assigned to a nonconst. */
+ which produces a "required warning" when assigned to a nonconst. */
p = (char *) strstr (source_path, "$cdir");
if (p && (p == path || p[-1] == DIRNAME_SEPARATOR)
&& (p[cdir_len] == DIRNAME_SEPARATOR || p[cdir_len] == '\0'))
@@ -1068,7 +1069,7 @@ find_and_open_source (const char *filename,
result = openp (path, OPF_SEARCH_IN_PATH, filename, OPEN_MODE, fullname);
if (result < 0)
{
- /* Didn't work. Try using just the basename. */
+ /* Didn't work. Try using just the basename. */
p = lbasename (filename);
if (p != filename)
result = openp (path, OPF_SEARCH_IN_PATH, p, OPEN_MODE, fullname);
@@ -1080,7 +1081,7 @@ find_and_open_source (const char *filename,
/* Open a source file given a symtab S. Returns a file descriptor or
negative number for error.
- This function is a convience function to find_and_open_source. */
+ This function is a convience function to find_and_open_source. */
int
open_source_file (struct symtab *s)
@@ -1107,7 +1108,7 @@ symtab_to_fullname (struct symtab *s)
return NULL;
/* Don't check s->fullname here, the file could have been
- deleted/moved/..., look for it again */
+ deleted/moved/..., look for it again. */
r = find_and_open_source (s->filename, s->dirname, &s->fullname);
if (r >= 0)
@@ -1152,7 +1153,7 @@ find_source_lines (struct symtab *s, int desc)
{
char c;
- /* Have to read it byte by byte to find out where the chars live */
+ /* Have to read it byte by byte to find out where the chars live. */
line_charpos[0] = lseek (desc, 0, SEEK_CUR);
nlines = 1;
@@ -1245,7 +1246,7 @@ source_charpos_line (struct symtab *s, int chr)
if (s == 0 || s->line_charpos == 0)
return 0;
lnp = s->line_charpos;
- /* Files are usually short, so sequential search is Ok */
+ /* Files are usually short, so sequential search is Ok. */
while (line < s->nlines && *lnp <= chr)
{
line++;
@@ -1320,7 +1321,7 @@ identify_source_line (struct symtab *s, int line, int mid_statement,
/* Print source lines from the file of symtab S,
- starting with line number LINE and stopping before line number STOPLINE. */
+ starting with line number LINE and stopping before line number STOPLINE. */
static void print_source_lines_base (struct symtab *s, int line, int stopline,
int noerror);
@@ -1334,16 +1335,16 @@ print_source_lines_base (struct symtab *s, int line, int stopline, int noerror)
int nlines = stopline - line;
struct cleanup *cleanup;
- /* Regardless of whether we can open the file, set current_source_symtab. */
+ /* Regardless of whether we can open the file, set current_source_symtab. */
current_source_symtab = s;
current_source_line = line;
first_line_listed = line;
/* If printing of source lines is disabled, just print file and line
- number */
+ number. */
if (ui_out_test_flags (uiout, ui_source_list))
{
- /* Only prints "No such file or directory" once */
+ /* Only prints "No such file or directory" once. */
if ((s != last_source_visited) || (!last_source_error))
{
last_source_visited = s;
@@ -1447,7 +1448,7 @@ print_source_lines_base (struct symtab *s, int line, int stopline, int noerror)
/* Show source lines from the file of symtab S, starting with line
number LINE and stopping before line number STOPLINE. If this is
not the command line version, then the source is shown in the source
- window otherwise it is simply printed */
+ window otherwise it is simply printed. */
void
print_source_lines (struct symtab *s, int line, int stopline, int noerror)
@@ -1484,7 +1485,7 @@ line_info (char *arg, int from_tty)
}
/* C++ More than one line may have been specified, as when the user
- specifies an overloaded function name. Print info on them all. */
+ specifies an overloaded function name. Print info on them all. */
for (i = 0; i < sals.nelts; i++)
{
sal = sals.sals[i];
@@ -1629,11 +1630,11 @@ forward_search_command (char *regex, int from_tty)
p[-1] = '\n';
}
- /* we now have a source line in buf, null terminate and match */
+ /* We now have a source line in buf, null terminate and match. */
*p = 0;
if (re_exec (buf) > 0)
{
- /* Match! */
+ /* Match! */
do_cleanups (cleanups);
print_source_lines (current_source_symtab, line, line + 1, 0);
set_internalvar_integer (lookup_internalvar ("_"), line);
@@ -1686,8 +1687,8 @@ reverse_search_command (char *regex, int from_tty)
cleanups = make_cleanup_fclose (stream);
while (line > 1)
{
-/* FIXME!!! We walk right off the end of buf if we get a long line!!! */
- char buf[4096]; /* Should be reasonable??? */
+/* FIXME!!! We walk right off the end of buf if we get a long line!!! */
+ char buf[4096]; /* Should be reasonable??? */
char *p = buf;
c = getc (stream);
@@ -1711,7 +1712,7 @@ reverse_search_command (char *regex, int from_tty)
*p = 0;
if (re_exec (buf) > 0)
{
- /* Match! */
+ /* Match! */
do_cleanups (cleanups);
print_source_lines (current_source_symtab, line, line + 1, 0);
set_internalvar_integer (lookup_internalvar ("_"), line);
diff --git a/gdb/source.h b/gdb/source.h
index 93f5f90..501d0b3 100644
--- a/gdb/source.h
+++ b/gdb/source.h
@@ -36,17 +36,17 @@ extern void find_source_lines (struct symtab *s, int desc);
/* Return the first line listed by print_source_lines.
Used by command interpreters to request listing from
- a previous point. */
+ a previous point. */
extern int get_first_line_listed (void);
/* Return the default number of lines to print with commands like the
cli "list". The caller of print_source_lines must use this to
calculate the end line and use it in the call to print_source_lines
- as it does not automatically use this value. */
+ as it does not automatically use this value. */
extern int get_lines_to_list (void);
/* Return the current source file for listing and next line to list.
- NOTE: The returned sal pc and end fields are not valid. */
+ NOTE: The returned sal pc and end fields are not valid. */
extern struct symtab_and_line get_current_source_symtab_and_line (void);
/* If the current source file for listing is not set, try and get a default.
@@ -55,16 +55,16 @@ extern struct symtab_and_line get_current_source_symtab_and_line (void);
We must be cautious about where it is called, as it can recurse as the
process of determining a new default may call the caller!
Use get_current_source_symtab_and_line only to get whatever
- we have without erroring out or trying to get a default. */
+ we have without erroring out or trying to get a default. */
extern void set_default_source_symtab_and_line (void);
/* Return the current default file for listing and next line to list
(the returned sal pc and end fields are not valid.)
and set the current default to whatever is in SAL.
- NOTE: The returned sal pc and end fields are not valid. */
+ NOTE: The returned sal pc and end fields are not valid. */
extern struct symtab_and_line set_current_source_symtab_and_line (const struct symtab_and_line *);
-/* Reset any information stored about a default file and line to print. */
+/* Reset any information stored about a default file and line to print. */
extern void clear_current_source_symtab_and_line (void);
/* Add a source path substitution rule. */
diff --git a/gdb/sparc-linux-nat.c b/gdb/sparc-linux-nat.c
index 046c623..5801e65 100644
--- a/gdb/sparc-linux-nat.c
+++ b/gdb/sparc-linux-nat.c
@@ -48,7 +48,8 @@ fill_gregset (const struct regcache *regcache, prgregset_t *gregs, int regnum)
}
void
-fill_fpregset (const struct regcache *regcache, prfpregset_t *fpregs, int regnum)
+fill_fpregset (const struct regcache *regcache,
+ prfpregset_t *fpregs, int regnum)
{
sparc32_collect_fpregset (regcache, regnum, fpregs);
}
diff --git a/gdb/sparc-linux-tdep.c b/gdb/sparc-linux-tdep.c
index 38a0a17..b21b7a8 100644
--- a/gdb/sparc-linux-tdep.c
+++ b/gdb/sparc-linux-tdep.c
@@ -141,7 +141,7 @@ sparc32_linux_step_trap (struct frame_info *frame, unsigned long insn)
{
ULONGEST sc_num = get_frame_register_unsigned (frame, SPARC_G1_REGNUM);
- /* __NR_rt_sigreturn is 101 and __NR_sigreturn is 216 */
+ /* __NR_rt_sigreturn is 101 and __NR_sigreturn is 216. */
if (sc_num == 101 || sc_num == 216)
{
struct gdbarch *gdbarch = get_frame_arch (frame);
@@ -193,7 +193,8 @@ sparc32_linux_supply_core_gregset (const struct regset *regset,
struct regcache *regcache,
int regnum, const void *gregs, size_t len)
{
- sparc32_supply_gregset (&sparc32_linux_core_gregset, regcache, regnum, gregs);
+ sparc32_supply_gregset (&sparc32_linux_core_gregset,
+ regcache, regnum, gregs);
}
static void
@@ -201,7 +202,8 @@ sparc32_linux_collect_core_gregset (const struct regset *regset,
const struct regcache *regcache,
int regnum, void *gregs, size_t len)
{
- sparc32_collect_gregset (&sparc32_linux_core_gregset, regcache, regnum, gregs);
+ sparc32_collect_gregset (&sparc32_linux_core_gregset,
+ regcache, regnum, gregs);
}
static void
diff --git a/gdb/sparc-sol2-nat.c b/gdb/sparc-sol2-nat.c
index 3df03ca..7ff9495 100644
--- a/gdb/sparc-sol2-nat.c
+++ b/gdb/sparc-sol2-nat.c
@@ -93,7 +93,8 @@ fill_gregset (const struct regcache *regcache, prgregset_t *gregs, int regnum)
}
void
-fill_fpregset (const struct regcache *regcache, prfpregset_t *fpregs, int regnum)
+fill_fpregset (const struct regcache *regcache,
+ prfpregset_t *fpregs, int regnum)
{
sparc_collect_fpregset (regcache, regnum, fpregs);
}
@@ -107,7 +108,7 @@ _initialize_sparc_sol2_nat (void)
struct target_ops *t;
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
add_target (t);
diff --git a/gdb/sparc-sol2-tdep.c b/gdb/sparc-sol2-tdep.c
index bb5dd9d..ee9d9b5 100644
--- a/gdb/sparc-sol2-tdep.c
+++ b/gdb/sparc-sol2-tdep.c
@@ -57,7 +57,7 @@ const struct sparc_gregset sparc32_sol2_gregset =
`ucontext_t', which has a member `uc_mcontext' that contains the
saved registers. Incidentally, the kernel passes the `ucontext_t'
pointer as the third argument of the signal trampoline too, and
- `sigacthandler' simply passes it on. However, if you link your
+ `sigacthandler' simply passes it on. However, if you link your
program with "-L/usr/ucblib -R/usr/ucblib -lucb", the function
`ucbsigvechandler' will be used, which invokes the using the BSD
convention, where the third argument is a pointer to an instance of
diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
index 33145e3..b71a40f 100644
--- a/gdb/sparc-tdep.c
+++ b/gdb/sparc-tdep.c
@@ -145,7 +145,7 @@ sparc_is_unimp_insn (CORE_ADDR pc)
More information on StackGuard can be found on in:
- Mike Frantzen and Mike Shuey. "StackGhost: Hardware Facilitated
+ Mike Frantzen and Mike Shuey. "StackGhost: Hardware Facilitated
Stack Protection." 2001. Published in USENIX Security Symposium
'01. */
@@ -347,7 +347,7 @@ sparc_fsr_type (struct gdbarch *gdbarch)
}
/* Return the GDB type object for the "standard" data type of data in
- register REGNUM. */
+ register REGNUM. */
static struct type *
sparc32_register_type (struct gdbarch *gdbarch, int regnum)
diff --git a/gdb/sparc-tdep.h b/gdb/sparc-tdep.h
index 475c669..0eb7afa 100644
--- a/gdb/sparc-tdep.h
+++ b/gdb/sparc-tdep.h
@@ -146,7 +146,7 @@ struct sparc_frame_cache
/* Do we have a frame? */
int frameless_p;
- /* Do we have a Structure, Union or Quad-Precision return value?. */
+ /* Do we have a Structure, Union or Quad-Precision return value? */
int struct_return_p;
/* Table of saved registers. */
diff --git a/gdb/sparc64-linux-tdep.c b/gdb/sparc64-linux-tdep.c
index ecd5b22..87e7285 100644
--- a/gdb/sparc64-linux-tdep.c
+++ b/gdb/sparc64-linux-tdep.c
@@ -157,7 +157,8 @@ sparc64_linux_supply_core_gregset (const struct regset *regset,
struct regcache *regcache,
int regnum, const void *gregs, size_t len)
{
- sparc64_supply_gregset (&sparc64_linux_core_gregset, regcache, regnum, gregs);
+ sparc64_supply_gregset (&sparc64_linux_core_gregset,
+ regcache, regnum, gregs);
}
static void
@@ -165,7 +166,8 @@ sparc64_linux_collect_core_gregset (const struct regset *regset,
const struct regcache *regcache,
int regnum, void *gregs, size_t len)
{
- sparc64_collect_gregset (&sparc64_linux_core_gregset, regcache, regnum, gregs);
+ sparc64_collect_gregset (&sparc64_linux_core_gregset,
+ regcache, regnum, gregs);
}
static void
diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c
index 9d2d01b..24d132d 100644
--- a/gdb/sparc64-tdep.c
+++ b/gdb/sparc64-tdep.c
@@ -272,7 +272,7 @@ sparc64_register_name (struct gdbarch *gdbarch, int regnum)
}
/* Return the GDB type object for the "standard" data type of data in
- register REGNUM. */
+ register REGNUM. */
static struct type *
sparc64_register_type (struct gdbarch *gdbarch, int regnum)
diff --git a/gdb/spu-tdep.c b/gdb/spu-tdep.c
index f70b2b8..d424659 100644
--- a/gdb/spu-tdep.c
+++ b/gdb/spu-tdep.c
@@ -814,7 +814,7 @@ spu_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc,
}
else
{
- /* ??? We don't really know ... */
+ /* ??? We don't really know ... */
*reg = SPU_SP_REGNUM;
*offset = 0;
}
@@ -1007,7 +1007,8 @@ spu_frame_unwind_cache (struct frame_info *this_frame,
{
/* Assume the link register is saved into its slot. */
if (backchain + 16 <= lslr)
- info->saved_regs[SPU_LR_REGNUM].addr = SPUADDR (id, backchain + 16);
+ info->saved_regs[SPU_LR_REGNUM].addr = SPUADDR (id,
+ backchain + 16);
/* Frame bases. */
info->frame_base = SPUADDR (id, backchain);
@@ -1487,7 +1488,8 @@ spu_return_value (struct gdbarch *gdbarch, struct type *func_type,
/* Breakpoints. */
static const gdb_byte *
-spu_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR * pcptr, int *lenptr)
+spu_breakpoint_from_pc (struct gdbarch *gdbarch,
+ CORE_ADDR * pcptr, int *lenptr)
{
static const gdb_byte breakpoint[] = { 0x00, 0x00, 0x3f, 0xff };
@@ -1628,8 +1630,9 @@ spu_dis_asm_print_address (bfd_vma addr, struct disassemble_info *info)
static int
gdb_print_insn_spu (bfd_vma memaddr, struct disassemble_info *info)
{
- /* The opcodes disassembler does 18-bit address arithmetic. Make sure the
- SPU ID encoded in the high bits is added back when we call print_address. */
+ /* The opcodes disassembler does 18-bit address arithmetic. Make
+ sure the SPU ID encoded in the high bits is added back when we
+ call print_address. */
struct disassemble_info spu_info = *info;
struct spu_dis_asm_data data;
data.gdbarch = info->application_data;
@@ -1663,11 +1666,12 @@ gdb_print_insn_spu (bfd_vma memaddr, struct disassemble_info *info)
_ovly_table should never change.
- Both tables are aligned to a 16-byte boundary, the symbols _ovly_table
- and _ovly_buf_table are of type STT_OBJECT and their size set to the size
- of the respective array. buf in _ovly_table is an index into _ovly_buf_table.
+ Both tables are aligned to a 16-byte boundary, the symbols
+ _ovly_table and _ovly_buf_table are of type STT_OBJECT and their
+ size set to the size of the respective array. buf in _ovly_table is
+ an index into _ovly_buf_table.
- mapped is an index into _ovly_table. Both the mapped and buf indices start
+ mapped is an index into _ovly_table. Both the mapped and buf indices start
from one to reference the first entry in their respective tables. */
/* Using the per-objfile private data mechanism, we store for each
@@ -1710,7 +1714,8 @@ spu_get_overlay_table (struct objfile *objfile)
if (!ovly_table_msym)
return NULL;
- ovly_buf_table_msym = lookup_minimal_symbol ("_ovly_buf_table", NULL, objfile);
+ ovly_buf_table_msym = lookup_minimal_symbol ("_ovly_buf_table",
+ NULL, objfile);
if (!ovly_buf_table_msym)
return NULL;
@@ -2532,7 +2537,8 @@ info_spu_proxydma_command (char *args, int from_tty)
static void
info_spu_command (char *args, int from_tty)
{
- printf_unfiltered (_("\"info spu\" must be followed by the name of an SPU facility.\n"));
+ printf_unfiltered (_("\"info spu\" must be followed by "
+ "the name of an SPU facility.\n"));
help_list (infospucmdlist, "info spu ", -1, gdb_stdout);
}
diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index 71b9233..b57d92a 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -23,7 +23,7 @@
the "stabs" format. This format is used with many systems that use
the a.out object file format, as well as some systems that use
COFF or ELF where the stabs data is placed in a special section.
- Avoid placing any object file format specific code in this file. */
+ Avoid placing any object file format specific code in this file. */
#include "defs.h"
#include "gdb_string.h"
@@ -61,7 +61,7 @@ extern void _initialize_stabsread (void);
C++ class pass lists of data member fields and lists of member function
fields in an instance of a field_info structure, as defined below.
This is part of some reorganization of low level C++ support and is
- expected to eventually go away... (FIXME) */
+ expected to eventually go away... (FIXME) */
struct field_info
{
@@ -190,7 +190,7 @@ static struct symbol *current_symbol = NULL;
/* Make a list of nameless types that are undefined.
This happens when another type is referenced by its number
- before this type is actually defined. For instance "t(0,1)=k(0,2)"
+ before this type is actually defined. For instance "t(0,1)=k(0,2)"
and type (0,2) is defined only later. */
struct nat
@@ -314,7 +314,7 @@ dbx_lookup_type (int typenums[2], struct objfile *objfile)
and return the type object.
This can create an empty (zeroed) type object.
TYPENUMS may be (-1, -1) to return a new type object that is not
- put into the type vector, and so may not be referred to by number. */
+ put into the type vector, and so may not be referred to by number. */
static struct type *
dbx_alloc_type (int typenums[2], struct objfile *objfile)
@@ -340,7 +340,7 @@ dbx_alloc_type (int typenums[2], struct objfile *objfile)
}
/* for all the stabs in a given stab vector, build appropriate types
- and fix their symbols in given symbol vector. */
+ and fix their symbols in given symbol vector. */
static void
patch_block_stabs (struct pending *symbols, struct pending_stabs *stabs,
@@ -354,7 +354,7 @@ patch_block_stabs (struct pending *symbols, struct pending_stabs *stabs,
if (stabs)
{
/* for all the stab entries, find their corresponding symbols and
- patch their types! */
+ patch their types! */
for (ii = 0; ii < stabs->count; ++ii)
{
@@ -463,7 +463,7 @@ read_type_number (char **pp, int *typenums)
#define VISIBILITY_IGNORE '9' /* Optimized out or zero length */
/* Structure for storing pointers to reference definitions for fast lookup
- during "process_later". */
+ during "process_later". */
struct ref_map
{
@@ -478,15 +478,15 @@ struct ref_map
static struct ref_map *ref_map;
-/* Ptr to free cell in chunk's linked list. */
+/* Ptr to free cell in chunk's linked list. */
static int ref_count = 0;
-/* Number of chunks malloced. */
+/* Number of chunks malloced. */
static int ref_chunk = 0;
/* This file maintains a cache of stabs aliases found in the symbol
- table. If the symbol table changes, this cache must be cleared
- or we are left holding onto data in invalid obstacks. */
+ table. If the symbol table changes, this cache must be cleared
+ or we are left holding onto data in invalid obstacks. */
void
stabsread_clear_cache (void)
{
@@ -496,8 +496,8 @@ stabsread_clear_cache (void)
/* Create array of pointers mapping refids to symbols and stab strings.
Add pointers to reference definition symbols and/or their values as we
- find them, using their reference numbers as our index.
- These will be used later when we resolve references. */
+ find them, using their reference numbers as our index.
+ These will be used later when we resolve references. */
void
ref_add (int refnum, struct symbol *sym, char *stabs, CORE_ADDR value)
{
@@ -545,7 +545,7 @@ process_reference (char **string)
/* Advance beyond the initial '#'. */
p = *string + 1;
- /* Read number as reference id. */
+ /* Read number as reference id. */
while (*p && isdigit (*p))
{
refnum = refnum * 10 + *p - '0';
@@ -566,16 +566,16 @@ symbol_reference_defined (char **string)
refnum = process_reference (&p);
- /* Defining symbols end in '=' */
+ /* Defining symbols end in '='. */
if (*p == '=')
{
- /* Symbol is being defined here. */
+ /* Symbol is being defined here. */
*string = p + 1;
return refnum;
}
else
{
- /* Must be a reference. Either the symbol has already been defined,
+ /* Must be a reference. Either the symbol has already been defined,
or this is a forward reference to it. */
*string = p;
return -1;
@@ -595,7 +595,7 @@ stab_reg_to_regnum (struct symbol *sym, struct gdbarch *gdbarch)
+ gdbarch_num_pseudo_regs (gdbarch),
SYMBOL_PRINT_NAME (sym));
- regno = gdbarch_sp_regnum (gdbarch); /* Known safe, though useless */
+ regno = gdbarch_sp_regnum (gdbarch); /* Known safe, though useless. */
}
return regno;
@@ -619,8 +619,8 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
/* We would like to eliminate nameless symbols, but keep their types.
E.g. stab entry ":t10=*2" should produce a type 10, which is a pointer
- to type 2, but, should not create a symbol to address that type. Since
- the symbol will be nameless, there is no way any user can refer to it. */
+ to type 2, but, should not create a symbol to address that type. Since
+ the symbol will be nameless, there is no way any user can refer to it. */
int nameless;
@@ -628,7 +628,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
if (string[0] == 0)
return 0;
- /* Ignore old-style symbols from cc -go */
+ /* Ignore old-style symbols from cc -go. */
if (p == 0)
return 0;
@@ -694,12 +694,12 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
/* SunPRO (3.0 at least) static variable encoding. */
if (gdbarch_static_transform_name_p (gdbarch))
goto normal;
- /* ... fall through ... */
+ /* ... fall through ... */
default:
complaint (&symfile_complaints, _("Unknown C++ symbol name `%s'"),
string);
- goto normal; /* Do *something* with it */
+ goto normal; /* Do *something* with it. */
}
}
else
@@ -936,7 +936,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
primarily for promotion when calling the function from GDB. */
TYPE_PROTOTYPED (SYMBOL_TYPE (sym)) = 1;
- /* fall into process_prototype_types */
+ /* fall into process_prototype_types. */
process_prototype_types:
/* Sun acc puts declared types of arguments here. */
@@ -955,7 +955,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
nsemi++;
}
- /* Allocate parameter information fields and fill them in. */
+ /* Allocate parameter information fields and fill them in. */
TYPE_FIELDS (ftype) = (struct field *)
TYPE_ALLOC (ftype, nsemi * sizeof (struct field));
while (*p++ == ';')
@@ -970,7 +970,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
/* The Sun compilers mark integer arguments, which should
be promoted to the width of the calling conventions, with
- a type which references itself. This type is turned into
+ a type which references itself. This type is turned into
a TYPE_CODE_VOID type by read_type, and we have to turn
it back into builtin_int here.
FIXME: Do we need a new builtin_promoted_int_arg ? */
@@ -1153,7 +1153,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
break;
case 'S':
- /* Static symbol at top level of file */
+ /* Static symbol at top level of file. */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
SYMBOL_CLASS (sym) = LOC_STATIC;
SYMBOL_VALUE_ADDRESS (sym) = valu;
@@ -1182,7 +1182,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
case 't':
/* In Ada, there is no distinction between typedef and non-typedef;
any type declaration implicitly has the equivalent of a typedef,
- and thus 't' is in fact equivalent to 'Tt'.
+ and thus 't' is in fact equivalent to 'Tt'.
Therefore, for Ada units, we check the character immediately
before the 't', and if we do not find a 'T', then make sure to
@@ -1200,7 +1200,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
SYMBOL_TYPE (sym) = read_type (&p, objfile);
/* For a nameless type, we don't want a create a symbol, thus we
- did not use `sym'. Return without further processing. */
+ did not use `sym'. Return without further processing. */
if (nameless)
return NULL;
@@ -1228,7 +1228,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
{
/* gcc-2.6 or later (when using -fvtable-thunks)
emits a unique named type for a vtable entry.
- Some gdb code depends on that specific name. */
+ Some gdb code depends on that specific name. */
extern const char vtbl_ptr_name[];
if ((TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_PTR
@@ -1253,15 +1253,16 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
Fortunately, this check seems not to be necessary
for anything except pointers or functions. */
- /* ezannoni: 2000-10-26. This seems to apply for
- versions of gcc older than 2.8. This was the original
+ /* ezannoni: 2000-10-26. This seems to apply for
+ versions of gcc older than 2.8. This was the original
problem: with the following code gdb would tell that
- the type for name1 is caddr_t, and func is char()
+ the type for name1 is caddr_t, and func is char().
+
typedef char *caddr_t;
char *name2;
struct x
{
- char *name1;
+ char *name1;
} xx;
char *func()
{
@@ -1269,7 +1270,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
main () {}
*/
- /* Pascal accepts names for pointer types. */
+ /* Pascal accepts names for pointer types. */
if (current_subfile->language == language_pascal)
{
TYPE_NAME (SYMBOL_TYPE (sym)) = SYMBOL_LINKAGE_NAME (sym);
@@ -1312,7 +1313,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
SYMBOL_TYPE (sym) = read_type (&p, objfile);
/* For a nameless type, we don't want a create a symbol, thus we
- did not use `sym'. Return without further processing. */
+ did not use `sym'. Return without further processing. */
if (nameless)
return NULL;
@@ -1328,7 +1329,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
if (synonym)
{
- /* Clone the sym and then modify it. */
+ /* Clone the sym and then modify it. */
struct symbol *typedef_sym = (struct symbol *)
obstack_alloc (&objfile->objfile_obstack, sizeof (struct symbol));
@@ -1346,7 +1347,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
break;
case 'V':
- /* Static symbol of local scope */
+ /* Static symbol of local scope. */
SYMBOL_TYPE (sym) = read_type (&p, objfile);
SYMBOL_CLASS (sym) = LOC_STATIC;
SYMBOL_VALUE_ADDRESS (sym) = valu;
@@ -1508,10 +1509,10 @@ read_type (char **pp, struct objfile *objfile)
there is no size attribute. */
int type_size = -1;
- /* Used to distinguish string and bitstring from char-array and set. */
+ /* Used to distinguish string and bitstring from char-array and set. */
int is_string = 0;
- /* Used to distinguish vector from array. */
+ /* Used to distinguish vector from array. */
int is_vector = 0;
/* Read type number if present. The type number may be omitted.
@@ -1700,10 +1701,10 @@ again:
(*pp)--;
/* We deal with something like t(1,2)=(3,4)=... which
- the Lucid compiler and recent gcc versions (post 2.7.3) use. */
+ the Lucid compiler and recent gcc versions (post 2.7.3) use. */
/* Allocate and enter the typedef type first.
- This handles recursive types. */
+ This handles recursive types. */
type = dbx_alloc_type (typenums, objfile);
TYPE_CODE (type) = TYPE_CODE_TYPEDEF;
{
@@ -1900,12 +1901,12 @@ again:
break;
case 'S': /* String attribute */
- /* FIXME: check to see if following type is array? */
+ /* FIXME: check to see if following type is array? */
is_string = 1;
break;
case 'V': /* Vector attribute */
- /* FIXME: check to see if following type is array? */
+ /* FIXME: check to see if following type is array? */
is_vector = 1;
break;
@@ -2028,8 +2029,8 @@ again:
break;
default:
- --*pp; /* Go back to the symbol in error */
- /* Particularly important if it was \0! */
+ --*pp; /* Go back to the symbol in error. */
+ /* Particularly important if it was \0! */
return error_type (pp, objfile);
}
@@ -2047,7 +2048,7 @@ again:
}
/* RS/6000 xlc/dbx combination uses a set of builtin types, starting from -1.
- Return the proper type node for a given builtin type number. */
+ Return the proper type node for a given builtin type number. */
static const struct objfile_data *rs6000_builtin_type_data;
@@ -2289,13 +2290,13 @@ read_member_functions (struct field_info *fip, char **pp, struct type *type,
char *p;
/* Process each list until we find something that is not a member function
- or find the end of the functions. */
+ or find the end of the functions. */
while (**pp != ';')
{
/* We should be positioned at the start of the function name.
Scan forward to find the first ':' and if it is not the
- first of a "::" delimiter, then this is not a member function. */
+ first of a "::" delimiter, then this is not a member function. */
p = *pp;
while (*p != ':')
{
@@ -2360,7 +2361,7 @@ read_member_functions (struct field_info *fip, char **pp, struct type *type,
/* Check for and handle cretinous dbx symbol name continuation! */
if (look_ahead_type == NULL)
{
- /* Normal case. */
+ /* Normal case. */
STABS_CONTINUE (pp, objfile);
new_sublist->fn_field.type = read_type (pp, objfile);
@@ -2384,7 +2385,7 @@ read_member_functions (struct field_info *fip, char **pp, struct type *type,
p++;
}
- /* If this is just a stub, then we don't have the real name here. */
+ /* If this is just a stub, then we don't have the real name here. */
if (TYPE_STUB (new_sublist->fn_field.type))
{
@@ -2409,28 +2410,28 @@ read_member_functions (struct field_info *fip, char **pp, struct type *type,
STABS_CONTINUE (pp, objfile);
switch (**pp)
{
- case 'A': /* Normal functions. */
+ case 'A': /* Normal functions. */
new_sublist->fn_field.is_const = 0;
new_sublist->fn_field.is_volatile = 0;
(*pp)++;
break;
- case 'B': /* `const' member functions. */
+ case 'B': /* `const' member functions. */
new_sublist->fn_field.is_const = 1;
new_sublist->fn_field.is_volatile = 0;
(*pp)++;
break;
- case 'C': /* `volatile' member function. */
+ case 'C': /* `volatile' member function. */
new_sublist->fn_field.is_const = 0;
new_sublist->fn_field.is_volatile = 1;
(*pp)++;
break;
- case 'D': /* `const volatile' member function. */
+ case 'D': /* `const volatile' member function. */
new_sublist->fn_field.is_const = 1;
new_sublist->fn_field.is_volatile = 1;
(*pp)++;
break;
case '*': /* File compiled with g++ version 1 --
- no info */
+ no info. */
case '?':
case '.':
break;
@@ -2472,7 +2473,7 @@ read_member_functions (struct field_info *fip, char **pp, struct type *type,
look_ahead_type = read_type (pp, objfile);
if (**pp == ':')
{
- /* g++ version 1 overloaded methods. */
+ /* g++ version 1 overloaded methods. */
}
else
{
@@ -2768,7 +2769,7 @@ read_cpp_abbrev (struct field_info *fip, char **pp, struct type *type,
/* At this point, *pp points to something like "22:23=*22...",
where the type number before the ':' is the "context" and
everything after is a regular type definition. Lookup the
- type, find it's name, and construct the field name. */
+ type, find it's name, and construct the field name. */
context = read_type (pp, objfile);
@@ -2807,7 +2808,7 @@ read_cpp_abbrev (struct field_info *fip, char **pp, struct type *type,
}
/* At this point, *pp points to the ':'. Skip it and read the
- field type. */
+ field type. */
p = ++(*pp);
if (p[-1] != ':')
@@ -2854,7 +2855,7 @@ read_one_struct_field (struct field_info *fip, char **pp, char *p,
obsavestring (*pp, p - *pp, &objfile->objfile_obstack);
*pp = p + 1;
- /* This means we have a visibility for a field coming. */
+ /* This means we have a visibility for a field coming. */
if (**pp == '/')
{
(*pp)++;
@@ -2871,7 +2872,7 @@ read_one_struct_field (struct field_info *fip, char **pp, char *p,
{
p = ++(*pp);
#if 0
- /* Possible future hook for nested types. */
+ /* Possible future hook for nested types. */
if (**pp == '!')
{
fip->list->field.bitpos = (long) -2; /* nested type */
@@ -2999,9 +3000,9 @@ read_struct_fields (struct field_info *fip, char **pp, struct type *type,
/* Read each data member type until we find the terminating ';' at the end of
the data member list, or break for some other reason such as finding the
- start of the member function list. */
+ start of the member function list. */
/* Stab string for structure/union does not end with two ';' in
- SUN C compiler 5.3 i.e. F6U2, hence check for end of string. */
+ SUN C compiler 5.3 i.e. F6U2, hence check for end of string. */
while (**pp != ';' && **pp != '\0')
{
@@ -3031,7 +3032,7 @@ read_struct_fields (struct field_info *fip, char **pp, struct type *type,
/* Look for the ':' that separates the field name from the field
values. Data members are delimited by a single ':', while member
functions are delimited by a pair of ':'s. When we hit the member
- functions (if any), terminate scan loop and return. */
+ functions (if any), terminate scan loop and return. */
while (*p != ':' && *p != '\0')
{
@@ -3051,7 +3052,7 @@ read_struct_fields (struct field_info *fip, char **pp, struct type *type,
{
/* (the deleted) chill the list of fields: the last entry (at
the head) is a partially constructed entry which we now
- scrub. */
+ scrub. */
fip->list = fip->list->next;
}
return 1;
@@ -3097,7 +3098,7 @@ read_baseclasses (struct field_info *fip, char **pp, struct type *type,
}
else
{
- /* Skip the '!' baseclass information marker. */
+ /* Skip the '!' baseclass information marker. */
(*pp)++;
}
@@ -3134,13 +3135,14 @@ read_baseclasses (struct field_info *fip, char **pp, struct type *type,
memset (new, 0, sizeof (struct nextfield));
new->next = fip->list;
fip->list = new;
- FIELD_BITSIZE (new->field) = 0; /* this should be an unpacked field! */
+ FIELD_BITSIZE (new->field) = 0; /* This should be an unpacked
+ field! */
STABS_CONTINUE (pp, objfile);
switch (**pp)
{
case '0':
- /* Nothing to do. */
+ /* Nothing to do. */
break;
case '1':
SET_TYPE_FIELD_VIRTUAL (type, i);
@@ -3187,12 +3189,12 @@ read_baseclasses (struct field_info *fip, char **pp, struct type *type,
/* The last piece of baseclass information is the type of the
base class. Read it, and remember it's type name as this
- field's name. */
+ field's name. */
new->field.type = read_type (pp, objfile);
new->field.name = type_name_no_tag (new->field.type);
- /* skip trailing ';' and bump count of number of fields seen */
+ /* Skip trailing ';' and bump count of number of fields seen. */
if (**pp == ';')
(*pp)++;
else
@@ -3217,7 +3219,7 @@ read_tilde_fields (struct field_info *fip, char **pp, struct type *type,
STABS_CONTINUE (pp, objfile);
- /* If we are positioned at a ';', then skip it. */
+ /* If we are positioned at a ';', then skip it. */
if (**pp == ';')
{
(*pp)++;
@@ -3230,7 +3232,7 @@ read_tilde_fields (struct field_info *fip, char **pp, struct type *type,
if (**pp == '=' || **pp == '+' || **pp == '-')
{
/* Obsolete flags that used to indicate the presence
- of constructors and/or destructors. */
+ of constructors and/or destructors. */
(*pp)++;
}
@@ -3259,7 +3261,7 @@ read_tilde_fields (struct field_info *fip, char **pp, struct type *type,
}
TYPE_VPTR_BASETYPE (type) = t;
- if (type == t) /* Our own class provides vtbl ptr */
+ if (type == t) /* Our own class provides vtbl ptr. */
{
for (i = TYPE_NFIELDS (t) - 1;
i >= TYPE_N_BASECLASSES (t);
@@ -3302,7 +3304,7 @@ attach_fn_fields_to_type (struct field_info *fip, struct type *type)
fip->fnlist != NULL;
fip->fnlist = fip->fnlist->next)
{
- --n; /* Circumvent Sun3 compiler bug */
+ --n; /* Circumvent Sun3 compiler bug. */
TYPE_FN_FIELDLISTS (type)[n] = fip->fnlist->fn_fieldlist;
}
return 1;
@@ -3323,7 +3325,7 @@ attach_fields_to_type (struct field_info *fip, struct type *type,
/* Count up the number of fields that we have, as well as taking note of
whether or not there are any non-public fields, which requires us to
allocate and build the private_field_bits and protected_field_bits
- bitfields. */
+ bitfields. */
for (scan = fip->list; scan != NULL; scan = scan->next)
{
@@ -3336,7 +3338,7 @@ attach_fields_to_type (struct field_info *fip, struct type *type,
/* Now we know how many fields there are, and whether or not there are any
non-public fields. Record the field count, allocate space for the
- array of fields, and create blank visibility bitfields if necessary. */
+ array of fields, and create blank visibility bitfields if necessary. */
TYPE_NFIELDS (type) = nfields;
TYPE_FIELDS (type) = (struct field *)
@@ -3360,9 +3362,10 @@ attach_fields_to_type (struct field_info *fip, struct type *type,
B_CLRALL (TYPE_FIELD_IGNORE_BITS (type), nfields);
}
- /* Copy the saved-up fields into the field vector. Start from the head
- of the list, adding to the tail of the field array, so that they end
- up in the same order in the array in which they were added to the list. */
+ /* Copy the saved-up fields into the field vector. Start from the
+ head of the list, adding to the tail of the field array, so that
+ they end up in the same order in the array in which they were
+ added to the list. */
while (nfields-- > 0)
{
@@ -3788,12 +3791,12 @@ read_sun_builtin_type (char **pp, int typenums[2], struct objfile *objfile)
if (nbits != 0)
return error_type (pp, objfile);
- /* The second number is always 0, so ignore it too. */
+ /* The second number is always 0, so ignore it too. */
read_huge_number (pp, ';', &nbits, 0);
if (nbits != 0)
return error_type (pp, objfile);
- /* The third number is the number of bits for this type. */
+ /* The third number is the number of bits for this type. */
type_bits = read_huge_number (pp, 0, &nbits, 0);
if (nbits != 0)
return error_type (pp, objfile);
@@ -3831,7 +3834,7 @@ read_sun_floating_type (char **pp, int typenums[2], struct objfile *objfile)
if (nbits != 0)
return error_type (pp, objfile);
- /* The second number is the number of bytes occupied by this type */
+ /* The second number is the number of bytes occupied by this type. */
nbytes = read_huge_number (pp, ';', &nbits, 0);
if (nbits != 0)
return error_type (pp, objfile);
@@ -3952,14 +3955,14 @@ read_huge_number (char **pp, int end, int *bits, int twos_complement_bits)
{
/* unsigned representation */
n *= radix;
- n += c - '0'; /* FIXME this overflows anyway */
+ n += c - '0'; /* FIXME this overflows anyway. */
}
}
else
overflow = 1;
/* This depends on large values being output in octal, which is
- what GCC does. */
+ what GCC does. */
if (radix == 8)
{
if (nbits == 0)
@@ -4079,7 +4082,7 @@ read_range_type (char **pp, int typenums[2], int type_size,
int nbits = 0;
/* If a type size attribute has been specified, the bounds of
- the range should fit in this size. If the lower bounds needs
+ the range should fit in this size. If the lower bounds needs
more bits than the upper bound, then the type is signed. */
if (n2bits <= type_size && n3bits <= type_size)
{
@@ -4131,7 +4134,7 @@ read_range_type (char **pp, int typenums[2], int type_size,
Also note that for complexes, g77 sets n2 to the size of one of
the member floats, not the whole complex beast. My guess is that
- this was to work well with pre-COMPLEX versions of gdb. */
+ this was to work well with pre-COMPLEX versions of gdb. */
if (n3 == 0 && n2 > 0)
{
@@ -4251,7 +4254,7 @@ read_args (char **pp, int end, struct objfile *objfile, int *nargsp,
int *varargsp)
{
/* FIXME! Remove this arbitrary limit! */
- struct type *types[1024]; /* allow for fns of 1023 parameters */
+ struct type *types[1024]; /* Allow for fns of 1023 parameters. */
int n = 0, i;
struct field *rval;
@@ -4264,7 +4267,7 @@ read_args (char **pp, int end, struct objfile *objfile, int *nargsp,
STABS_CONTINUE (pp, objfile);
types[n++] = read_type (pp, objfile);
}
- (*pp)++; /* get past `end' (the ':' character) */
+ (*pp)++; /* get past `end' (the ':' character). */
if (n == 0)
{
@@ -4350,7 +4353,7 @@ common_block_end (struct objfile *objfile)
sym = (struct symbol *)
obstack_alloc (&objfile->objfile_obstack, sizeof (struct symbol));
memset (sym, 0, sizeof (struct symbol));
- /* Note: common_block_name already saved on objfile_obstack */
+ /* Note: common_block_name already saved on objfile_obstack. */
SYMBOL_SET_LINKAGE_NAME (sym, common_block_name);
SYMBOL_CLASS (sym) = LOC_BLOCK;
@@ -4542,7 +4545,7 @@ cleanup_undefined_types_1 (void)
{
struct pending *ppt;
int i;
- /* Name of the type, without "struct" or "union" */
+ /* Name of the type, without "struct" or "union". */
char *typename = TYPE_TAG_NAME (*type);
if (typename == NULL)
@@ -4647,7 +4650,7 @@ scan_file_globals (struct objfile *objfile)
prev = NULL;
/* Get the hash index and check all the symbols
- under that hash index. */
+ under that hash index. */
hash = hashname (SYMBOL_LINKAGE_NAME (msymbol));
@@ -4657,7 +4660,7 @@ scan_file_globals (struct objfile *objfile)
SYMBOL_LINKAGE_NAME (sym)) == 0)
{
/* Splice this symbol out of the hash chain and
- assign the value we have to it. */
+ assign the value we have to it. */
if (prev)
{
SYMBOL_VALUE_CHAIN (prev) = SYMBOL_VALUE_CHAIN (sym);
@@ -4754,7 +4757,7 @@ stabsread_new_init (void)
}
/* Initialize anything that needs initializing at the same time as
- start_symtab() is called. */
+ start_symtab() is called. */
void
start_stabs (void)
@@ -4769,7 +4772,7 @@ start_stabs (void)
common_block_name = NULL;
}
-/* Call after end_symtab() */
+/* Call after end_symtab(). */
void
end_stabs (void)
@@ -4821,7 +4824,7 @@ find_name_end (char *name)
}
}
-/* Initializer for this module */
+/* Initializer for this module. */
void
_initialize_stabsread (void)
diff --git a/gdb/stabsread.h b/gdb/stabsread.h
index 05ad64d..92523a9 100644
--- a/gdb/stabsread.h
+++ b/gdb/stabsread.h
@@ -57,11 +57,11 @@ struct pending_stabs
EXTERN struct pending_stabs *global_stabs;
/* The type code that process_one_symbol saw on its previous invocation.
- Used to detect pairs of N_SO symbols. */
+ Used to detect pairs of N_SO symbols. */
EXTERN int previous_stab_code;
-/* Support for Sun changes to dbx symbol format */
+/* Support for Sun changes to dbx symbol format. */
/* For each identified header file, we have a table of types defined
in that header file.
@@ -90,7 +90,7 @@ struct header_file
/* Numeric code distinguishing instances of one header file that
produced different results when included. It comes from the
- N_BINCL or N_EXCL. */
+ N_BINCL or N_EXCL. */
int instance;
@@ -104,13 +104,13 @@ struct header_file
};
-/* The table of header_files of this OBJFILE. */
+/* The table of header_files of this OBJFILE. */
#define HEADER_FILES(OBJFILE) (DBX_SYMFILE_INFO (OBJFILE)->header_files)
-/* The actual length of HEADER_FILES. */
+/* The actual length of HEADER_FILES. */
#define N_HEADER_FILES(OBJFILE) (DBX_SYMFILE_INFO (OBJFILE)->n_header_files)
-/* The allocated lengh of HEADER_FILES. */
+/* The allocated lengh of HEADER_FILES. */
#define N_ALLOCATED_HEADER_FILES(OBJFILE) \
(DBX_SYMFILE_INFO (OBJFILE)->n_allocated_header_files)
diff --git a/gdb/stack.c b/gdb/stack.c
index 4fc634f..6e59cd0 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -64,7 +64,7 @@ static const char *print_frame_arguments_choices[] =
{"all", "scalars", "none", NULL};
static const char *print_frame_arguments = "scalars";
-/* Prototypes for local functions. */
+/* Prototypes for local functions. */
static void print_frame_local_vars (struct frame_info *, int,
struct ui_file *);
@@ -629,12 +629,12 @@ print_frame_info (struct frame_info *frame, int print_level,
get_user_print_options (&opts);
/* We used to do this earlier, but that is clearly
- wrong. This function is used by many different
+ wrong. This function is used by many different
parts of gdb, including normal_stop in infrun.c,
which uses this to print out the current PC
when we stepi/nexti into the middle of a source
- line. Only the command line really wants this
- behavior. Other UIs probably would like the
+ line. Only the command line really wants this
+ behavior. Other UIs probably would like the
ability to decide for themselves if it is desired. */
if (opts.addressprint && mid_statement)
{
@@ -808,7 +808,7 @@ print_frame (struct frame_info *frame, int print_level,
args.stream = gdb_stdout;
args_list_chain = make_cleanup_ui_out_list_begin_end (uiout, "args");
catch_errors (print_args_stub, &args, "", RETURN_MASK_ERROR);
- /* FIXME: ARGS must be a list. If one argument is a string it
+ /* FIXME: ARGS must be a list. If one argument is a string it
will have " that will not be properly escaped. */
/* Invoke ui_out_tuple_end. */
do_cleanups (args_list_chain);
@@ -934,7 +934,7 @@ parse_frame_specification_1 (const char *frame_exp, const char *message,
fid = find_relative_frame (get_current_frame (), &level);
if (level == 0)
- /* find_relative_frame was successful */
+ /* find_relative_frame was successful. */
return fid;
}
@@ -1582,7 +1582,7 @@ struct print_variable_and_value_data
int values_printed;
};
-/* The callback for the locals and args iterators */
+/* The callback for the locals and args iterators. */
static void
do_print_variable_and_value (const char *print_name,
@@ -2075,7 +2075,7 @@ return_command (char *retval_exp, int from_tty)
}
/* Sets the scope to input function name, provided that the function
- is within the current stack frame */
+ is within the current stack frame. */
struct function_bounds
{
diff --git a/gdb/symfile.c b/gdb/symfile.c
index f2d15b0..9ebe050 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -79,14 +79,14 @@ void (*deprecated_post_add_symbol_hook) (void);
static void clear_symtab_users_cleanup (void *ignore);
-/* Global variables owned by this file */
-int readnow_symbol_files; /* Read full symbols immediately */
+/* Global variables owned by this file. */
+int readnow_symbol_files; /* Read full symbols immediately. */
-/* External variables and functions referenced. */
+/* External variables and functions referenced. */
extern void report_transfer_performance (unsigned long, time_t, time_t);
-/* Functions this file defines */
+/* Functions this file defines. */
static void load_command (char *, int);
@@ -141,7 +141,7 @@ void _initialize_symfile (void);
/* List of all available sym_fns. On gdb startup, each object file reader
calls add_symtab_fns() to register information on each format it is
- prepared to read. */
+ prepared to read. */
typedef const struct sym_fns *sym_fns_ptr;
DEF_VEC_P (sym_fns_ptr);
@@ -190,7 +190,7 @@ int auto_solib_limit;
/* Make a null terminated copy of the string at PTR with SIZE characters in
the obstack pointed to by OBSTACKP . Returns the address of the copy.
- Note that the string at PTR does not have to be null terminated, I.E. it
+ Note that the string at PTR does not have to be null terminated, I.e. it
may be part of a larger string and we are only saving a substring. */
char *
@@ -199,7 +199,7 @@ obsavestring (const char *ptr, int size, struct obstack *obstackp)
char *p = (char *) obstack_alloc (obstackp, size + 1);
/* Open-coded memcpy--saves function call time. These strings are usually
short. FIXME: Is this really still true with a compiler that can
- inline memcpy? */
+ inline memcpy? */
{
const char *p1 = ptr;
char *p2 = p;
@@ -301,7 +301,7 @@ alloc_section_addr_info (size_t num_sections)
}
/* Build (allocate and populate) a section_addr_info struct from
- an existing section table. */
+ an existing section table. */
extern struct section_addr_info *
build_section_addr_info_from_section_table (const struct target_section *start,
@@ -372,7 +372,7 @@ build_section_addr_info_from_objfile (const struct objfile *objfile)
return sap;
}
-/* Free all memory allocated by build_section_addr_info_from_section_table. */
+/* Free all memory allocated by build_section_addr_info_from_section_table. */
extern void
free_section_addr_info (struct section_addr_info *sap)
@@ -531,7 +531,7 @@ relative_addr_info_to_section_offsets (struct section_offsets *section_offsets,
memset (section_offsets, 0, SIZEOF_N_SECTION_OFFSETS (num_sections));
- /* Now calculate offsets for section that were specified by the caller. */
+ /* Now calculate offsets for section that were specified by the caller. */
for (i = 0; i < addrs->num_sections && addrs->other[i].name; i++)
{
struct other_sections *osp;
@@ -540,9 +540,9 @@ relative_addr_info_to_section_offsets (struct section_offsets *section_offsets,
if (osp->addr == 0)
continue;
- /* Record all sections in offsets */
+ /* Record all sections in offsets. */
/* The section_offsets in the objfile are here filled in using
- the BFD index. */
+ the BFD index. */
section_offsets->offsets[osp->sectindex] = osp->addr;
}
}
@@ -650,7 +650,8 @@ addr_info_make_relative (struct section_addr_info *addrs, bfd *abfd)
abfd_addrs_sorted = addrs_section_sort (abfd_addrs);
make_cleanup (xfree, abfd_addrs_sorted);
- /* Now create ADDRS_TO_ABFD_ADDRS from ADDRS_SORTED and ABFD_ADDRS_SORTED. */
+ /* Now create ADDRS_TO_ABFD_ADDRS from ADDRS_SORTED and
+ ABFD_ADDRS_SORTED. */
addrs_to_abfd_addrs = xzalloc (sizeof (*addrs_to_abfd_addrs)
* addrs->num_sections);
@@ -699,7 +700,7 @@ addr_info_make_relative (struct section_addr_info *addrs, bfd *abfd)
if (sect)
{
- /* This is the index used by BFD. */
+ /* This is the index used by BFD. */
addrs->other[i].sectindex = sect->sectindex;
if (addrs->other[i].addr != 0)
@@ -837,7 +838,7 @@ default_symfile_offsets (struct objfile *objfile,
}
/* Remember the bfd indexes for the .text, .data, .bss and
- .rodata sections. */
+ .rodata sections. */
init_objfile_sect_indices (objfile);
}
@@ -953,7 +954,7 @@ syms_from_objfile (struct objfile *objfile,
objfile->sf = find_sym_fns (objfile->obfd);
if (objfile->sf == NULL)
- return; /* No symbols. */
+ return; /* No symbols. */
/* Make sure that partially constructed symbol tables will be cleaned up
if an error occurs during symbol reading. */
@@ -961,7 +962,7 @@ syms_from_objfile (struct objfile *objfile,
/* If ADDRS and OFFSETS are both NULL, put together a dummy address
list. We now establish the convention that an addr of zero means
- no load address was specified. */
+ no load address was specified. */
if (! addrs && ! offsets)
{
local_addr
@@ -1005,7 +1006,7 @@ syms_from_objfile (struct objfile *objfile,
/* Initialize symbol reading routines for this objfile, allow complaints to
appear for this new file, and record how verbose to be, then do the
- initial symbol reading for this file. */
+ initial symbol reading for this file. */
(*objfile->sf->sym_init) (objfile);
clear_complaints (&symfile_complaints, 1, add_flags & SYMFILE_VERBOSE);
@@ -1042,7 +1043,7 @@ void
new_symfile_objfile (struct objfile *objfile, int add_flags)
{
/* If this is the main symbol file we have to clean up all users of the
- old main symbol file. Otherwise it is sufficient to fixup all the
+ old main symbol file. Otherwise it is sufficient to fixup all the
breakpoints that may have been redefined by this symbol file. */
if (add_flags & SYMFILE_MAINLINE)
{
@@ -1074,7 +1075,7 @@ new_symfile_objfile (struct objfile *objfile, int add_flags)
ADDRS is ignored when SYMFILE_MAINLINE bit is set in ADD_FLAGS.
Upon success, returns a pointer to the objfile that was added.
- Upon failure, jumps back to command level (never returns). */
+ Upon failure, jumps back to command level (never returns). */
static struct objfile *
symbol_file_add_with_addrs_or_offsets (bfd *abfd,
@@ -1108,7 +1109,7 @@ symbol_file_add_with_addrs_or_offsets (bfd *abfd,
/* We either created a new mapped symbol table, mapped an existing
symbol table file which has not had initial symbol reading
- performed, or need to read an unmapped symbol table. */
+ performed, or need to read an unmapped symbol table. */
if (from_tty || info_verbose)
{
if (deprecated_pre_add_symbol_hook)
@@ -1126,7 +1127,7 @@ symbol_file_add_with_addrs_or_offsets (bfd *abfd,
/* We now have at least a partial symbol table. Check to see if the
user requested that all symbols be read on initial access via either
the gdb startup command line or on a per symbol file basis. Expand
- all partial symbol tables for this objfile if so. */
+ all partial symbol tables for this objfile if so. */
if ((flags & OBJF_READNOW))
{
@@ -1167,7 +1168,7 @@ symbol_file_add_with_addrs_or_offsets (bfd *abfd,
if (objfile->sf == NULL)
{
observer_notify_new_objfile (objfile);
- return objfile; /* No symbols. */
+ return objfile; /* No symbols. */
}
new_symfile_objfile (objfile, add_flags);
@@ -1300,7 +1301,7 @@ get_debug_link_info (struct objfile *objfile, unsigned long *crc32_out)
bfd_get_section_contents (objfile->obfd, sect, contents,
(file_ptr)0, (bfd_size_type)debuglink_size);
- /* Crc value is stored after the filename, aligned up to 4 bytes. */
+ /* Crc value is stored after the filename, aligned up to 4 bytes. */
crc_offset = strlen (contents) + 1;
crc_offset = (crc_offset + 3) & ~3;
@@ -1324,7 +1325,7 @@ separate_debug_file_exists (const char *name, unsigned long crc,
PARENT_OBJFILE itself this function would not be called. .gnu_debuglink
section can contain just the basename of PARENT_OBJFILE without any
".debug" suffix as "/usr/lib/debug/path/to/file" is a separate tree where
- the separate debug infos with the same basename can exist. */
+ the separate debug infos with the same basename can exist. */
if (strcmp (name, parent_objfile->name) == 0)
return 0;
@@ -1414,7 +1415,7 @@ find_separate_debug_file_by_debuglink (struct objfile *objfile)
/* If I is -1 then no directory is present there and DIR will be "". */
dir[i+1] = '\0';
- /* Set I to max (strlen (canon_name), strlen (dir)). */
+ /* Set I to max (strlen (canon_name), strlen (dir)). */
canon_name = lrealpath (dir);
i = strlen (dir);
if (canon_name && strlen (canon_name) > i)
@@ -1659,7 +1660,7 @@ symfile_bfd_open (char *name)
}
/* Free 1st new malloc'd copy, but keep the 2nd malloc'd copy in
- bfd. It'll be freed in free_objfile(). */
+ bfd. It'll be freed in free_objfile(). */
xfree (name);
name = absolute_name;
@@ -1707,7 +1708,7 @@ get_section_index (struct objfile *objfile, char *section_name)
/* Link SF into the global symtab_fns list. Called on startup by the
_initialize routine in each object file format reader, to register
information about each format the the reader is prepared to
- handle. */
+ handle. */
void
add_symtab_fns (const struct sym_fns *sf)
@@ -2010,7 +2011,7 @@ generic_load (char *args, int from_tty)
error (_("Too many parameters."));
}
- /* Open the file for loading. */
+ /* Open the file for loading. */
loadfile_bfd = bfd_openr (filename, gnutarget);
if (loadfile_bfd == NULL)
{
@@ -2075,11 +2076,11 @@ generic_load (char *args, int from_tty)
do_cleanups (old_cleanups);
}
-/* Report how fast the transfer went. */
+/* Report how fast the transfer went. */
/* DEPRECATED: cagney/1999-10-18: report_transfer_performance is being
replaced by print_transfer_performance (with a very different
- function signature). */
+ function signature). */
void
report_transfer_performance (unsigned long data_count, time_t start_time,
@@ -2151,7 +2152,7 @@ print_transfer_performance (struct ui_file *stream,
monitor for Microware's OS-9 / OS-9000, see remote-os9k.c). In the
rombug case, the user doesn't need to supply a text address,
instead a call to target_link() (in target.c) would supply the
- value to use. We are now discontinuing this type of ad hoc syntax. */
+ value to use. We are now discontinuing this type of ad hoc syntax. */
static void
add_symbol_file_command (char *args, int from_tty)
@@ -2193,10 +2194,10 @@ add_symbol_file_command (char *args, int from_tty)
for (arg = argv[0], argcnt = 0; arg != NULL; arg = argv[++argcnt])
{
- /* Process the argument. */
+ /* Process the argument. */
if (argcnt == 0)
{
- /* The first argument is the file name. */
+ /* The first argument is the file name. */
filename = tilde_expand (arg);
make_cleanup (xfree, filename);
}
@@ -2204,7 +2205,7 @@ add_symbol_file_command (char *args, int from_tty)
if (argcnt == 1)
{
/* The second argument is always the text address at which
- to load the program. */
+ to load the program. */
sect_opts[section_index].name = ".text";
sect_opts[section_index].value = arg;
if (++section_index >= num_sect_opts)
@@ -2219,7 +2220,7 @@ add_symbol_file_command (char *args, int from_tty)
else
{
/* It's an option (starting with '-') or it's an argument
- to an option */
+ to an option. */
if (*arg == '-')
{
@@ -2266,11 +2267,11 @@ add_symbol_file_command (char *args, int from_tty)
if (section_index < 1)
error (_("The address where %s has been loaded is missing"), filename);
- /* Print the prompt for the query below. And save the arguments into
+ /* Print the prompt for the query below. And save the arguments into
a sect_addr_info structure to be passed around to other
functions. We have to split this up into separate print
statements because hex_string returns a local static
- string. */
+ string. */
printf_unfiltered (_("add symbol table from file \"%s\" at\n"), filename);
section_addrs = alloc_section_addr_info (section_index);
@@ -2284,7 +2285,7 @@ add_symbol_file_command (char *args, int from_tty)
addr = parse_and_eval_address (val);
/* Here we store the section offsets in the order they were
- entered on the command line. */
+ entered on the command line. */
section_addrs->other[sec_num].name = sec;
section_addrs->other[sec_num].addr = addr;
printf_unfiltered ("\t%s_addr = %s\n", sec,
@@ -2325,7 +2326,7 @@ reread_symbols (void)
the load time should be saved in the partial symbol tables, since
different tables may come from different source files. FIXME.
This routine should then walk down each partial symbol table
- and see if the symbol table that it originates from has been changed */
+ and see if the symbol table that it originates from has been changed. */
for (objfile = object_files; objfile; objfile = objfile->next)
{
@@ -2347,7 +2348,7 @@ reread_symbols (void)
res = stat (objfile->name, &new_statbuf);
if (res != 0)
{
- /* FIXME, should use print_sys_errmsg but it's not filtered. */
+ /* FIXME, should use print_sys_errmsg but it's not filtered. */
printf_unfiltered (_("`%s' has disappeared; keeping its symbols.\n"),
objfile->name);
continue;
@@ -2442,7 +2443,7 @@ reread_symbols (void)
memset (&objfile->static_psymbols, 0,
sizeof (objfile->static_psymbols));
- /* Free the obstacks for non-reusable objfiles */
+ /* Free the obstacks for non-reusable objfiles. */
psymbol_bcache_free (objfile->psymbol_cache);
objfile->psymbol_cache = psymbol_bcache_init ();
bcache_xfree (objfile->macro_cache);
@@ -2592,7 +2593,7 @@ set_ext_lang_command (char *args, int from_tty, struct cmd_list_element *e)
char *cp = ext_args;
enum language lang;
- /* First arg is filename extension, starting with '.' */
+ /* First arg is filename extension, starting with '.' */
if (*cp != '.')
error (_("'%s': Filename extension must begin with '.'"), ext_args);
@@ -2605,7 +2606,7 @@ set_ext_lang_command (char *args, int from_tty, struct cmd_list_element *e)
"filename extension and language"),
ext_args);
- /* Null-terminate first arg */
+ /* Null-terminate first arg. */
*cp++ = '\0';
/* Find beginning of second arg, which should be a source language. */
@@ -2627,12 +2628,12 @@ set_ext_lang_command (char *args, int from_tty, struct cmd_list_element *e)
if (i >= fl_table_next)
{
- /* new file extension */
+ /* New file extension. */
add_filename_language (ext_args, lang);
}
else
{
- /* redefining a previously known filename extension */
+ /* Redefining a previously known filename extension. */
/* if (from_tty) */
/* query ("Really make files of type %s '%s'?", */
@@ -2660,7 +2661,7 @@ info_ext_lang_command (char *args, int from_tty)
static void
init_filename_language_table (void)
{
- if (fl_table_size == 0) /* protect against repetition */
+ if (fl_table_size == 0) /* Protect against repetition. */
{
fl_table_size = 20;
fl_table_next = 0;
@@ -2749,7 +2750,7 @@ allocate_symtab (const char *filename, struct objfile *objfile)
symtab->language = deduce_language_from_filename (filename);
symtab->debugformat = "unknown";
- /* Hook it to the objfile it comes from */
+ /* Hook it to the objfile it comes from. */
symtab->objfile = objfile;
symtab->next = objfile->symtabs;
@@ -2842,13 +2843,12 @@ clear_symtab_users_cleanup (void *ignore)
overlay_unmapped_address(...): map an address from section's VMA to LMA
symbol_overlayed_address(...): Return a "current" address for symbol:
either in VMA or LMA depending on whether
- the symbol's section is currently mapped
- */
+ the symbol's section is currently mapped. */
/* Overlay debugging state: */
enum overlay_debugging_state overlay_debugging = ovly_off;
-int overlay_cache_invalid = 0; /* True if need to refresh mapped state */
+int overlay_cache_invalid = 0; /* True if need to refresh mapped state. */
/* Function: section_is_overlay (SECTION)
Returns true if SECTION has VMA not equal to LMA, ie.
@@ -2909,7 +2909,7 @@ section_is_mapped (struct obj_section *osect)
return 0; /* overlay debugging off */
case ovly_auto: /* overlay debugging automatic */
/* Unles there is a gdbarch_overlay_update function,
- there's really nothing useful to do here (can't really go auto) */
+ there's really nothing useful to do here (can't really go auto). */
gdbarch = get_objfile_arch (osect->objfile);
if (gdbarch_overlay_update_p (gdbarch))
{
@@ -3028,13 +3028,14 @@ symbol_overlayed_address (CORE_ADDR address, struct obj_section *section)
{
if (overlay_debugging)
{
- /* If the symbol has no section, just return its regular address. */
+ /* If the symbol has no section, just return its regular address. */
if (section == 0)
return address;
- /* If the symbol's section is not an overlay, just return its address */
+ /* If the symbol's section is not an overlay, just return its
+ address. */
if (!section_is_overlay (section))
return address;
- /* If the symbol's section is mapped, just return its address */
+ /* If the symbol's section is mapped, just return its address. */
if (section_is_mapped (section))
return address;
/*
@@ -3094,7 +3095,7 @@ find_pc_mapped_section (CORE_ADDR pc)
}
/* Function: list_overlays_command
- Print a list of mapped sections and their PC ranges */
+ Print a list of mapped sections and their PC ranges. */
void
list_overlays_command (char *args, int from_tty)
@@ -3150,15 +3151,15 @@ map_overlay_command (char *args, int from_tty)
if (args == 0 || *args == 0)
error (_("Argument required: name of an overlay section"));
- /* First, find a section matching the user supplied argument */
+ /* First, find a section matching the user supplied argument. */
ALL_OBJSECTIONS (objfile, sec)
if (!strcmp (bfd_section_name (objfile->obfd, sec->the_bfd_section), args))
{
- /* Now, check to see if the section is an overlay. */
+ /* Now, check to see if the section is an overlay. */
if (!section_is_overlay (sec))
continue; /* not an overlay section */
- /* Mark the overlay as "mapped" */
+ /* Mark the overlay as "mapped". */
sec->ovly_mapped = 1;
/* Next, make a pass and unmap any sections that are
@@ -3170,7 +3171,7 @@ map_overlay_command (char *args, int from_tty)
printf_unfiltered (_("Note: section %s unmapped by overlap\n"),
bfd_section_name (objfile->obfd,
sec2->the_bfd_section));
- sec2->ovly_mapped = 0; /* sec2 overlaps sec: unmap sec2 */
+ sec2->ovly_mapped = 0; /* sec2 overlaps sec: unmap sec2. */
}
return;
}
@@ -3195,7 +3196,7 @@ unmap_overlay_command (char *args, int from_tty)
if (args == 0 || *args == 0)
error (_("Argument required: name of an overlay section"));
- /* First, find a section matching the user supplied argument */
+ /* First, find a section matching the user supplied argument. */
ALL_OBJSECTIONS (objfile, sec)
if (!strcmp (bfd_section_name (objfile->obfd, sec->the_bfd_section), args))
{
@@ -3209,7 +3210,7 @@ unmap_overlay_command (char *args, int from_tty)
/* Function: overlay_auto_command
A utility command to turn on overlay debugging.
- Possibly this should be done via a set/show command. */
+ Possibly this should be done via a set/show command. */
static void
overlay_auto_command (char *args, int from_tty)
@@ -3222,7 +3223,7 @@ overlay_auto_command (char *args, int from_tty)
/* Function: overlay_manual_command
A utility command to turn on overlay debugging.
- Possibly this should be done via a set/show command. */
+ Possibly this should be done via a set/show command. */
static void
overlay_manual_command (char *args, int from_tty)
@@ -3235,7 +3236,7 @@ overlay_manual_command (char *args, int from_tty)
/* Function: overlay_off_command
A utility command to turn on overlay debugging.
- Possibly this should be done via a set/show command. */
+ Possibly this should be done via a set/show command. */
static void
overlay_off_command (char *args, int from_tty)
@@ -3258,9 +3259,9 @@ overlay_load_command (char *args, int from_tty)
}
/* Function: overlay_command
- A place-holder for a mis-typed command */
+ A place-holder for a mis-typed command. */
-/* Command list chain containing all defined "overlay" subcommands. */
+/* Command list chain containing all defined "overlay" subcommands. */
struct cmd_list_element *overlaylist;
static void
@@ -3303,8 +3304,7 @@ overlay_command (char *args, int from_tty)
attempt to detect when the cached copy is invalidated. The main
entry point is "simple_overlay_update(SECT), which looks up SECT in
the cached table and re-reads only the entry for that section from
- the target (whenever possible).
- */
+ the target (whenever possible). */
/* Cached, dynamically allocated copies of the target data structures: */
static unsigned (*cache_ovly_table)[4] = 0;
@@ -3315,7 +3315,7 @@ enum ovly_index
VMA, SIZE, LMA, MAPPED
};
-/* Throw away the cached copy of _ovly_table */
+/* Throw away the cached copy of _ovly_table. */
static void
simple_free_overlay_table (void)
{
@@ -3327,12 +3327,12 @@ simple_free_overlay_table (void)
}
/* Read an array of ints of size SIZE from the target into a local buffer.
- Convert to host order. int LEN is number of ints */
+ Convert to host order. int LEN is number of ints. */
static void
read_target_long_array (CORE_ADDR memaddr, unsigned int *myaddr,
int len, int size, enum bfd_endian byte_order)
{
- /* FIXME (alloca): Not safe if array is very large. */
+ /* FIXME (alloca): Not safe if array is very large. */
gdb_byte *buf = alloca (len * size);
int i;
@@ -3342,7 +3342,7 @@ read_target_long_array (CORE_ADDR memaddr, unsigned int *myaddr,
}
/* Find and grab a copy of the target _ovly_table
- (and _novlys, which is needed for the table's size) */
+ (and _novlys, which is needed for the table's size). */
static int
simple_read_overlay_table (void)
{
@@ -3420,7 +3420,7 @@ simple_overlay_update_1 (struct obj_section *osect)
osect->ovly_mapped = cache_ovly_table[i][MAPPED];
return 1;
}
- else /* Warning! Warning! Target's ovly table has changed! */
+ else /* Warning! Warning! Target's ovly table has changed! */
return 0;
}
return 0;
@@ -3439,17 +3439,18 @@ simple_overlay_update (struct obj_section *osect)
{
struct objfile *objfile;
- /* Were we given an osect to look up? NULL means do all of them. */
+ /* Were we given an osect to look up? NULL means do all of them. */
if (osect)
- /* Have we got a cached copy of the target's overlay table? */
+ /* Have we got a cached copy of the target's overlay table? */
if (cache_ovly_table != NULL)
- /* Does its cached location match what's currently in the symtab? */
+ /* Does its cached location match what's currently in the symtab? */
if (cache_ovly_table_base ==
SYMBOL_VALUE_ADDRESS (lookup_minimal_symbol ("_ovly_table",
NULL, NULL)))
- /* Then go ahead and try to look up this single section in the cache */
+ /* Then go ahead and try to look up this single section in the
+ cache. */
if (simple_overlay_update_1 (osect))
- /* Found it! We're done. */
+ /* Found it! We're done. */
return;
/* Cached table no good: need to read the entire table anew.
@@ -3459,7 +3460,7 @@ simple_overlay_update (struct obj_section *osect)
if (! simple_read_overlay_table ())
return;
- /* Now may as well update all sections, even if only one was requested. */
+ /* Now may as well update all sections, even if only one was requested. */
ALL_OBJSECTIONS (objfile, osect)
if (section_is_overlay (osect))
{
@@ -3472,9 +3473,9 @@ simple_overlay_update (struct obj_section *osect)
if (cache_ovly_table[i][VMA] == bfd_section_vma (obfd, bsect)
&& cache_ovly_table[i][LMA] == bfd_section_lma (obfd, bsect)
/* && cache_ovly_table[i][SIZE] == size */ )
- { /* obj_section matches i'th entry in ovly_table */
+ { /* obj_section matches i'th entry in ovly_table. */
osect->ovly_mapped = cache_ovly_table[i][MAPPED];
- break; /* finished with inner for loop: break out */
+ break; /* finished with inner for loop: break out. */
}
}
}
diff --git a/gdb/symfile.h b/gdb/symfile.h
index 4e24c79..1e8c7ab 100644
--- a/gdb/symfile.h
+++ b/gdb/symfile.h
@@ -80,7 +80,7 @@ struct section_addr_info
/* The number of sections for which address information is
available. */
size_t num_sections;
- /* Sections whose names are file format dependent. */
+ /* Sections whose names are file format dependent. */
struct other_sections
{
CORE_ADDR addr;
@@ -223,7 +223,7 @@ struct quick_symbol_functions
/* Find global or static symbols in all tables that are in NAMESPACE
and for which MATCH (symbol name, NAME) == 0, passing each to
CALLBACK, reading in partial symbol symbol tables as needed. Look
- through global symbols if GLOBAL and otherwise static symbols.
+ through global symbols if GLOBAL and otherwise static symbols.
Passes NAME, NAMESPACE, and DATA to CALLBACK with each symbol
found. After each block is processed, passes NULL to CALLBACK.
MATCH must be weaker than strcmp_iw in the sense that
@@ -233,7 +233,7 @@ struct quick_symbol_functions
strcmp(x,y) == 0 --> ORDERED_COMPARE(x,y) == 0
and
strcmp(x,y) <= 0 --> ORDERED_COMPARE(x,y) <= 0
- (allowing strcmp(x,y) < 0 while ORDERED_COMPARE(x, y) == 0).
+ (allowing strcmp(x,y) < 0 while ORDERED_COMPARE(x, y) == 0).
CALLBACK returns 0 to indicate that the scan should continue, or
non-zero to indicate that the scan should be terminated. */
diff --git a/gdb/symmisc.c b/gdb/symmisc.c
index 7f2d38a..4be8106 100644
--- a/gdb/symmisc.c
+++ b/gdb/symmisc.c
@@ -109,7 +109,7 @@ free_symtab (struct symtab *s)
if (s->free_func != NULL)
s->free_func (s);
- /* Free source-related stuff */
+ /* Free source-related stuff. */
if (s->line_charpos != NULL)
xfree (s->line_charpos);
if (s->fullname != NULL)
@@ -352,7 +352,7 @@ dump_symtab_1 (struct objfile *objfile, struct symtab *symtab,
}
}
/* Now print the block info, but only for primary symtabs since we will
- print lots of duplicate info otherwise. */
+ print lots of duplicate info otherwise. */
if (symtab->primary)
{
fprintf_filtered (outfile, "\nBlockvector:\n\n");
@@ -458,7 +458,7 @@ maintenance_print_symbols (char *args, int from_tty)
if (argv[0] != NULL)
{
filename = argv[0];
- /* If a second arg is supplied, it is a source file name to match on */
+ /* If a second arg is supplied, it is a source file name to match on. */
if (argv[1] != NULL)
{
symname = argv[1];
@@ -678,7 +678,7 @@ maintenance_print_msymbols (char *args, int from_tty)
if (argv[0] != NULL)
{
filename = argv[0];
- /* If a second arg is supplied, it is a source file name to match on */
+ /* If a second arg is supplied, it is a source file name to match on. */
if (argv[1] != NULL)
{
symname = xfullpath (argv[1]);
@@ -800,7 +800,7 @@ block_depth (struct block *block)
}
-/* Do early runtime initializations. */
+/* Do early runtime initializations. */
void
_initialize_symmisc (void)
{
diff --git a/gdb/symtab.c b/gdb/symtab.c
index bdf34d6..68666da 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -147,7 +147,7 @@ multiple_symbols_select_mode (void)
/* Block in which the most recently searched-for symbol was found.
Might be better to make this a parameter to lookup_symbol and
- value_of_this. */
+ value_of_this. */
const struct block *block_found;
@@ -176,7 +176,7 @@ lookup_symtab (const char *name)
got_symtab:
- /* First, search for an exact match */
+ /* First, search for an exact match. */
ALL_SYMTABS (objfile, s)
{
@@ -215,7 +215,7 @@ got_symtab:
}
}
- /* Now, search for a matching tail (only if name doesn't have any dirs) */
+ /* Now, search for a matching tail (only if name doesn't have any dirs). */
if (lbasename (name) == name)
ALL_SYMTABS (objfile, s)
@@ -251,14 +251,14 @@ got_symtab:
been created. So, we need to run through the symtabs again in
order to find the file.
XXX - This is a crock, and should be fixed inside of the the
- symbol parsing routines. */
+ symbol parsing routines. */
goto got_symtab;
}
/* Mangle a GDB method stub type. This actually reassembles the pieces of the
full method name, which consist of the class name (from T), the unadorned
method name from METHOD_ID, and the signature for the specific overload,
- specified by SIGNATURE_ID. Note that this function is g++ specific. */
+ specified by SIGNATURE_ID. Note that this function is g++ specific. */
char *
gdb_mangle_name (struct type *type, int method_id, int signature_id)
@@ -332,7 +332,7 @@ gdb_mangle_name (struct type *type, int method_id, int signature_id)
strcat (mangled_name, buf);
/* If the class doesn't have a name, i.e. newname NULL, then we just
mangle it using 0 for the length of the class. Thus it gets mangled
- as something starting with `::' rather than `classname::'. */
+ as something starting with `::' rather than `classname::'. */
if (newname != NULL)
strcat (mangled_name, newname);
@@ -358,7 +358,7 @@ symbol_init_cplus_specific (struct general_symbol_info *gsymbol,
/* Set the demangled name of GSYMBOL to NAME. NAME must be already
correctly allocated. For C++ symbols a cplus_specific struct is
- allocated so OBJFILE must not be NULL. If this is a non C++ symbol
+ allocated so OBJFILE must not be NULL. If this is a non C++ symbol
OBJFILE can be NULL. */
void
symbol_set_demangled_name (struct general_symbol_info *gsymbol,
@@ -393,7 +393,7 @@ symbol_get_demangled_name (const struct general_symbol_info *gsymbol)
/* Initialize the language dependent portion of a symbol
- depending upon the language for the symbol. */
+ depending upon the language for the symbol. */
void
symbol_set_language (struct general_symbol_info *gsymbol,
enum language language)
@@ -719,7 +719,7 @@ symbol_natural_name (const struct general_symbol_info *gsymbol)
}
/* Return the demangled name for a symbol based on the language for
- that symbol. If no demangled name exists, return NULL. */
+ that symbol. If no demangled name exists, return NULL. */
char *
symbol_demangled_name (const struct general_symbol_info *gsymbol)
{
@@ -748,7 +748,7 @@ symbol_demangled_name (const struct general_symbol_info *gsymbol)
/* Return the search name of a symbol---generally the demangled or
linkage name of the symbol, depending on how it will be searched for.
If there is no distinct demangled name, then returns the same value
- (same pointer) as SYMBOL_LINKAGE_NAME. */
+ (same pointer) as SYMBOL_LINKAGE_NAME. */
char *
symbol_search_name (const struct general_symbol_info *gsymbol)
{
@@ -995,7 +995,7 @@ fixup_symbol_section (struct symbol *sym, struct objfile *objfile)
NAME is a field of the current implied argument `this'. If so set
*IS_A_FIELD_OF_THIS to 1, otherwise set it to zero.
BLOCK_FOUND is set to the block in which NAME is found (in the case of
- a field of `this', value_of_this sets BLOCK_FOUND to the proper value.) */
+ a field of `this', value_of_this sets BLOCK_FOUND to the proper value.) */
/* This function has a bunch of loops in it and it would seem to be
attractive to put in some QUIT's (though I'm not really sure
@@ -1020,7 +1020,7 @@ lookup_symbol_in_language (const char *name, const struct block *block,
modified_name = name;
/* If we are using C++, D, or Java, demangle the name before doing a
- lookup, so we can always binary search. */
+ lookup, so we can always binary search. */
if (lang == language_cplus)
{
demangled_name = cplus_demangle (name, DMGL_ANSI | DMGL_PARAMS);
@@ -1180,7 +1180,7 @@ lookup_symbol_aux (const char *name, const struct block *block,
/* Search all static file-level symbols for NAME from DOMAIN. Do the symtabs
first, then check the psymtabs. If a psymtab indicates the existence of the
desired name as a file-level static, then do psymtab-to-symtab conversion on
- the fly and return the found symbol. */
+ the fly and return the found symbol. */
struct symbol *
lookup_static_symbol_aux (const char *name, const domain_enum domain)
@@ -1391,7 +1391,7 @@ lookup_symbol_aux_quick (struct objfile *objfile, int kind,
{
/* This shouldn't be necessary, but as a last resort try
looking in the statics even though the psymtab claimed
- the symbol was global, or vice-versa. It's possible
+ the symbol was global, or vice-versa. It's possible
that the psymtab gets it wrong in some cases. */
/* FIXME: carlton/2002-09-30: Should we really do that?
@@ -1567,13 +1567,13 @@ basic_lookup_transparent_type_quick (struct objfile *objfile, int kind,
/* This shouldn't be necessary, but as a last resort
* try looking in the 'other kind' even though the psymtab
- * claimed the symbol was one thing. It's possible that
+ * claimed the symbol was one thing. It's possible that
* the psymtab gets it wrong in some cases.
*/
block = BLOCKVECTOR_BLOCK (bv, other_kind);
sym = lookup_block_symbol (block, name, STRUCT_DOMAIN);
if (!sym)
- /* FIXME; error is wrong in one case */
+ /* FIXME; error is wrong in one case. */
error (_("\
Internal: global symbol `%s' found in %s psymtab but not in symtab.\n\
%s may be an inlined function, or may be a template function\n\
@@ -1603,7 +1603,7 @@ basic_lookup_transparent_type (const char *name)
struct type *t;
/* Now search all the global symbols. Do the symtab's first, then
- check the psymtab's. If a psymtab indicates the existence
+ check the psymtab's. If a psymtab indicates the existence
of the desired name as a global, then do psymtab-to-symtab
conversion on the fly and return the found symbol. */
@@ -1637,10 +1637,9 @@ basic_lookup_transparent_type (const char *name)
/* Now search the static file-level symbols.
Not strictly correct, but more useful than an error.
Do the symtab's first, then
- check the psymtab's. If a psymtab indicates the existence
+ check the psymtab's. If a psymtab indicates the existence
of the desired name as a file-level static, then do psymtab-to-symtab
- conversion on the fly and return the found symbol.
- */
+ conversion on the fly and return the found symbol. */
ALL_OBJFILES (objfile)
{
@@ -1671,9 +1670,9 @@ basic_lookup_transparent_type (const char *name)
}
-/* Find the name of the file containing main(). */
+/* Find the name of the file containing main(). */
/* FIXME: What about languages without main() or specially linked
- executables that have no main() ? */
+ executables that have no main() ? */
const char *
find_main_filename (void)
@@ -1703,8 +1702,7 @@ find_main_filename (void)
binary search terminates, we drop through and do a straight linear
search on the symbols. Each symbol which is marked as being a ObjC/C++
symbol (language_cplus or language_objc set) has both the encoded and
- non-encoded names tested for a match.
-*/
+ non-encoded names tested for a match. */
struct symbol *
lookup_block_symbol (const struct block *block, const char *name,
@@ -1749,12 +1747,12 @@ lookup_block_symbol (const struct block *block, const char *name,
}
}
}
- return (sym_found); /* Will be NULL if not found. */
+ return (sym_found); /* Will be NULL if not found. */
}
}
/* Find the symtab associated with PC and SECTION. Look through the
- psymtabs and read in another symtab if necessary. */
+ psymtabs and read in another symtab if necessary. */
struct symtab *
find_pc_sect_symtab (CORE_ADDR pc, struct obj_section *section)
@@ -1791,7 +1789,7 @@ find_pc_sect_symtab (CORE_ADDR pc, struct obj_section *section)
0x1000-0x4000, but for address 0x2345 we want to return symtab b.
This happens for native ecoff format, where code from included files
- gets its own symtab. The symtab for the included file should have
+ gets its own symtab. The symtab for the included file should have
been read in already via the dependency mechanism.
It might be swifter to create several symtabs with the same name
like xcoff does (I'm not sure).
@@ -1814,7 +1812,7 @@ find_pc_sect_symtab (CORE_ADDR pc, struct obj_section *section)
and we simply return its corresponding symtab. */
/* In order to better support objfiles that contain both
stabs and coff debugging info, we continue on if a psymtab
- can't be found. */
+ can't be found. */
if ((objfile->flags & OBJF_REORDERED) && objfile->sf)
{
struct symtab *result;
@@ -1839,7 +1837,8 @@ find_pc_sect_symtab (CORE_ADDR pc, struct obj_section *section)
break;
}
if (sym == NULL)
- continue; /* no symbol in this symtab matches section */
+ continue; /* No symbol in this symtab matches
+ section. */
}
distance = BLOCK_END (b) - BLOCK_START (b);
best_s = s;
@@ -1866,8 +1865,8 @@ find_pc_sect_symtab (CORE_ADDR pc, struct obj_section *section)
return NULL;
}
-/* Find the symtab associated with PC. Look through the psymtabs and
- read in another symtab if necessary. Backward compatibility, no section */
+/* Find the symtab associated with PC. Look through the psymtabs and read
+ in another symtab if necessary. Backward compatibility, no section. */
struct symtab *
find_pc_symtab (CORE_ADDR pc)
@@ -1946,10 +1945,10 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent)
/* elz: added this because this function returned the wrong
information if the pc belongs to a stub (import/export)
- to call a shlib function. This stub would be anywhere between
+ to call a shlib function. This stub would be anywhere between
two functions in the target, and the line info was erroneously
- taken to be the one of the line before the pc.
- */
+ taken to be the one of the line before the pc. */
+
/* RT: Further explanation:
* We have stubs (trampolines) inserted between procedures.
@@ -1958,7 +1957,7 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent)
* exists in the main image.
*
* In the minimal symbol table, we have a bunch of symbols
- * sorted by start address. The stubs are marked as "trampoline",
+ * sorted by start address. The stubs are marked as "trampoline",
* the others appear as text. E.g.:
*
* Minimal symbol table for main image
@@ -1978,13 +1977,13 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent)
*
* Assumptions being made about the minimal symbol table:
* 1. lookup_minimal_symbol_by_pc() will return a trampoline only
- * if we're really in the trampoline. If we're beyond it (say
+ * if we're really in the trampoline.s If we're beyond it (say
* we're in "foo" in the above example), it'll have a closer
* symbol (the "foo" text symbol for example) and will not
* return the trampoline.
* 2. lookup_minimal_symbol_text() will find a real text symbol
* corresponding to the trampoline, and whose address will
- * be different than the trampoline address. I put in a sanity
+ * be different than the trampoline address. I put in a sanity
* check for the address being the same, to avoid an
* infinite recursion.
*/
@@ -2003,16 +2002,18 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent)
* In the above situation, the shared lib is not loaded yet,
* so of course we can't find the real func/line info,
* but the "break" still works, and the warning is annoying.
- * So I commented out the warning. RT */
+ * So I commented out the warning. RT */
/* warning ("In stub for %s; unable to find real function/line info",
- SYMBOL_LINKAGE_NAME (msymbol)) */ ;
+ SYMBOL_LINKAGE_NAME (msymbol)); */
+ ;
/* fall through */
else if (SYMBOL_VALUE_ADDRESS (mfunsym)
== SYMBOL_VALUE_ADDRESS (msymbol))
/* Avoid infinite recursion */
- /* See above comment about why warning is commented out */
+ /* See above comment about why warning is commented out. */
/* warning ("In stub for %s; unable to find real function/line info",
- SYMBOL_LINKAGE_NAME (msymbol)) */ ;
+ SYMBOL_LINKAGE_NAME (msymbol)); */
+ ;
/* fall through */
else
return find_pc_line (SYMBOL_VALUE_ADDRESS (mfunsym), 0);
@@ -2022,7 +2023,7 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent)
s = find_pc_sect_symtab (pc, section);
if (!s)
{
- /* if no symbol information, return previous pc */
+ /* If no symbol information, return previous pc. */
if (notcurrent)
pc++;
val.pc = pc;
@@ -2052,7 +2053,7 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent)
}
prev = NULL;
- item = l->item; /* Get first line info */
+ item = l->item; /* Get first line info. */
/* Is this file's first line closer than the first lines of other files?
If so, record this file, and its first line, as best alternate. */
@@ -2112,7 +2113,7 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent)
{
/* If our best fit is in a range of PC's for which no line
number info is available (line number is zero) then we didn't
- find any valid line information. */
+ find any valid line information. */
val.pc = pc;
}
else
@@ -2131,7 +2132,7 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent)
return val;
}
-/* Backward compatibility (no section) */
+/* Backward compatibility (no section). */
struct symtab_and_line
find_pc_line (CORE_ADDR pc, int notcurrent)
@@ -2612,7 +2613,7 @@ operator_chars (char *p, char **end)
while (*p == ' ' || *p == '\t')
p++;
- /* Recognize 'operator TYPENAME'. */
+ /* Recognize 'operator TYPENAME'. */
if (isalpha (*p) || *p == '_' || *p == '$')
{
@@ -2651,7 +2652,7 @@ operator_chars (char *p, char **end)
}
else
{
- /* Gratuitous qoute: skip it and move on. */
+ /* Gratuitous qoute: skip it and move on. */
p++;
continue;
}
@@ -2675,7 +2676,7 @@ operator_chars (char *p, char **end)
case '|':
if (p[0] == '-' && p[1] == '>')
{
- /* Struct pointer member operator 'operator->'. */
+ /* Struct pointer member operator 'operator->'. */
if (p[2] == '*')
{
*end = p + 3; /* 'operator->*' */
@@ -2865,7 +2866,7 @@ file_matches (const char *file, char *files[], int nfiles)
return 0;
}
-/* Free any memory associated with a search. */
+/* Free any memory associated with a search. */
void
free_search_symbols (struct symbol_search *symbols)
{
@@ -2977,8 +2978,8 @@ search_symbols_name_matches (const char *symname, void *user_data)
free_search_symbols should be called when *MATCHES is no longer needed.
The results are sorted locally; each symtab's global and static blocks are
- separately alphabetized.
- */
+ separately alphabetized. */
+
void
search_symbols (char *regexp, domain_enum kind, int nfiles, char *files[],
struct symbol_search **matches)
@@ -3027,7 +3028,7 @@ search_symbols (char *regexp, domain_enum kind, int nfiles, char *files[],
/* Make sure spacing is right for C++ operators.
This is just a courtesy to make the matching less sensitive
to how many spaces the user leaves between 'operator'
- and <TYPENAME> or <OPERATOR>. */
+ and <TYPENAME> or <OPERATOR>. */
char *opend;
char *opname = operator_chars (regexp, &opend);
@@ -3038,17 +3039,17 @@ search_symbols (char *regexp, domain_enum kind, int nfiles, char *files[],
if (isalpha (*opname) || *opname == '_' || *opname == '$')
{
- /* There should 1 space between 'operator' and 'TYPENAME'. */
+ /* There should 1 space between 'operator' and 'TYPENAME'. */
if (opname[-1] != ' ' || opname[-2] == ' ')
fix = 1;
}
else
{
- /* There should 0 spaces between 'operator' and 'OPERATOR'. */
+ /* There should 0 spaces between 'operator' and 'OPERATOR'. */
if (opname[-1] == ' ')
fix = 0;
}
- /* If wrong number of spaces, fix it. */
+ /* If wrong number of spaces, fix it. */
if (fix >= 0)
{
char *tmp = (char *) alloca (8 + fix + strlen (opname) + 1);
@@ -3064,7 +3065,7 @@ search_symbols (char *regexp, domain_enum kind, int nfiles, char *files[],
/* Search through the partial symtabs *first* for all symbols
matching the regexp. That way we don't have to reproduce all of
- the machinery below. */
+ the machinery below. */
datum.nfiles = nfiles;
datum.files = files;
@@ -3089,8 +3090,7 @@ search_symbols (char *regexp, domain_enum kind, int nfiles, char *files[],
for the function, for variables we have to call lookup_symbol
to determine if the variable has debug info.
If the lookup fails, set found_misc so that we will rescan to print
- any matching symbols without debug info.
- */
+ any matching symbols without debug info. */
if (nfiles == 0 && (kind == VARIABLES_DOMAIN || kind == FUNCTIONS_DOMAIN))
{
@@ -3210,11 +3210,11 @@ search_symbols (char *regexp, domain_enum kind, int nfiles, char *files[],
if (regexp == NULL
|| re_exec (SYMBOL_NATURAL_NAME (msymbol)) != 0)
{
- /* Functions: Look up by address. */
+ /* Functions: Look up by address. */
if (kind != FUNCTIONS_DOMAIN ||
(0 == find_pc_symtab (SYMBOL_VALUE_ADDRESS (msymbol))))
{
- /* Variables/Absolutes: Look up by name */
+ /* Variables/Absolutes: Look up by name. */
if (lookup_symbol (SYMBOL_LINKAGE_NAME (msymbol),
(struct block *) NULL, VAR_DOMAIN, 0)
== NULL)
@@ -3249,8 +3249,8 @@ search_symbols (char *regexp, domain_enum kind, int nfiles, char *files[],
/* Helper function for symtab_symbol_info, this function uses
the data returned from search_symbols() to print information
- regarding the match to gdb_stdout.
- */
+ regarding the match to gdb_stdout. */
+
static void
print_symbol_info (domain_enum kind, struct symtab *s, struct symbol *sym,
int block, char *last)
@@ -3265,11 +3265,11 @@ print_symbol_info (domain_enum kind, struct symtab *s, struct symbol *sym,
if (kind != TYPES_DOMAIN && block == STATIC_BLOCK)
printf_filtered ("static ");
- /* Typedef that is not a C++ class */
+ /* Typedef that is not a C++ class. */
if (kind == TYPES_DOMAIN
&& SYMBOL_DOMAIN (sym) != STRUCT_DOMAIN)
typedef_print (SYMBOL_TYPE (sym), sym, gdb_stdout);
- /* variable, func, or typedef-that-is-c++-class */
+ /* variable, func, or typedef-that-is-c++-class. */
else if (kind < TYPES_DOMAIN ||
(kind == TYPES_DOMAIN &&
SYMBOL_DOMAIN (sym) == STRUCT_DOMAIN))
@@ -3284,8 +3284,8 @@ print_symbol_info (domain_enum kind, struct symtab *s, struct symbol *sym,
}
/* This help function for symtab_symbol_info() prints information
- for non-debugging symbols to gdb_stdout.
- */
+ for non-debugging symbols to gdb_stdout. */
+
static void
print_msymbol_info (struct minimal_symbol *msymbol)
{
@@ -3304,10 +3304,10 @@ print_msymbol_info (struct minimal_symbol *msymbol)
}
/* This is the guts of the commands "info functions", "info types", and
- "info variables". It calls search_symbols to find all matches and then
+ "info variables". It calls search_symbols to find all matches and then
print_[m]symbol_info to print out some useful information about the
- matches.
- */
+ matches. */
+
static void
symtab_symbol_info (char *regexp, domain_enum kind, int from_tty)
{
@@ -3319,7 +3319,7 @@ symtab_symbol_info (char *regexp, domain_enum kind, int from_tty)
char *last_filename = NULL;
int first = 1;
- /* must make sure that if we're interrupted, symbols gets freed */
+ /* Must make sure that if we're interrupted, symbols gets freed. */
search_symbols (regexp, kind, 0, (char **) NULL, &symbols);
old_chain = make_cleanup_free_search_symbols (symbols);
@@ -3374,7 +3374,7 @@ types_info (char *regexp, int from_tty)
symtab_symbol_info (regexp, TYPES_DOMAIN, from_tty);
}
-/* Breakpoint all functions matching regular expression. */
+/* Breakpoint all functions matching regular expression. */
void
rbreak_command_wrapper (char *regexp, int from_tty)
@@ -3488,7 +3488,7 @@ static char **return_val;
/* Test to see if the symbol specified by SYMNAME (which is already
demangled for C++ symbols) matches SYM_TEXT in the first SYM_TEXT_LEN
- characters. If so, add it to the current completion list. */
+ characters. If so, add it to the current completion list. */
static void
completion_list_add_name (char *symname, char *sym_text, int sym_text_len,
@@ -3496,7 +3496,7 @@ completion_list_add_name (char *symname, char *sym_text, int sym_text_len,
{
int newsize;
- /* clip symbols that cannot match */
+ /* Clip symbols that cannot match. */
if (strncmp (symname, sym_text, sym_text_len) != 0)
{
@@ -3504,7 +3504,7 @@ completion_list_add_name (char *symname, char *sym_text, int sym_text_len,
}
/* We have a match for a completion, so add SYMNAME to the current list
- of matches. Note that the name is moved to freshly malloc'd space. */
+ of matches. Note that the name is moved to freshly malloc'd space. */
{
char *new;
@@ -3599,7 +3599,7 @@ completion_list_objc_symbol (struct minimal_symbol *msymbol, char *sym_text,
}
/* Break the non-quoted text based on the characters which are in
- symbols. FIXME: This should probably be language-specific. */
+ symbols. FIXME: This should probably be language-specific. */
static char *
language_search_unquoted_string (char *text, char *p)
@@ -3612,12 +3612,12 @@ language_search_unquoted_string (char *text, char *p)
{
if ((current_language->la_language == language_objc))
{
- if (p[-1] == ':') /* might be part of a method name */
+ if (p[-1] == ':') /* Might be part of a method name. */
continue;
else if (p[-1] == '[' && (p[-2] == '-' || p[-2] == '+'))
- p -= 2; /* beginning of a method name */
+ p -= 2; /* Beginning of a method name. */
else if (p[-1] == ' ' || p[-1] == '(' || p[-1] == ')')
- { /* might be part of a method name */
+ { /* Might be part of a method name. */
char *t = p;
/* Seeing a ' ' or a '(' is not conclusive evidence
@@ -3634,8 +3634,8 @@ language_search_unquoted_string (char *text, char *p)
break;
if (t[-1] == '[' && (t[-2] == '-' || t[-2] == '+'))
- p = t - 2; /* method name detected */
- /* else we leave with p unchanged */
+ p = t - 2; /* Method name detected. */
+ /* Else we leave with p unchanged. */
}
}
break;
@@ -3803,7 +3803,7 @@ default_make_symbol_completion_list_break_on (char *text, char *word,
/* Search upwards from currently selected frame (so that we can
complete on local vars). Also catch fields of types defined in
this places which match our text string. Only complete on types
- visible from current context. */
+ visible from current context. */
b = get_selected_block (0);
surrounding_static_block = block_static_block (b);
@@ -4204,8 +4204,7 @@ make_source_files_completion_list (char *text, char *word)
Returns 1 if PC *might* be in prologue, 0 if definately *not* in prologue.
If non-zero, func_start is where we think the prologue starts, possibly
- by previous examination of symbol table information.
- */
+ by previous examination of symbol table information. */
int
in_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR func_start)
@@ -4329,7 +4328,7 @@ skip_prologue_using_sal (struct gdbarch *gdbarch, CORE_ADDR func_addr)
/* If there is only one sal that covers the entire function,
then it is probably a single line function, like
- "foo(){}". */
+ "foo(){}". */
if (prologue_sal.end >= end_pc)
return 0;
@@ -4369,7 +4368,7 @@ skip_prologue_using_sal (struct gdbarch *gdbarch, CORE_ADDR func_addr)
corresponding line number is less the first one that we
found for the function. This is more conservative then
refine_prologue_limit which scans a large number of SALs
- looking for any in the prologue */
+ looking for any in the prologue. */
prologue_sal = sal;
}
}
@@ -4392,8 +4391,8 @@ decode_line_spec (char *string, int funfirstline)
if (string == 0)
error (_("Empty line specification."));
- /* We use whatever is set as the current source line. We do not try
- and get a default or it will recursively call us! */
+ /* We use whatever is set as the current source line. We do not try
+ and get a default or it will recursively call us! */
cursal = get_current_source_symtab_and_line ();
sals = decode_line_1 (&string, funfirstline,
@@ -4440,12 +4439,12 @@ find_main_name (void)
name. This would allow us to remove this hard-coded call to
an Ada function. It is not clear that this is a better approach
at this point, because all methods need to be written in a way
- such that false positives never be returned. For instance, it is
+ such that false positives never be returned. For instance, it is
important that a method does not return a wrong name for the main
procedure if the main procedure is actually written in a different
language. It is easy to guaranty this with Ada, since we use a
special symbol generated only when the main in Ada to find the name
- of the main procedure. It is difficult however to see how this can
+ of the main procedure. It is difficult however to see how this can
be guarantied for languages such as C, for instance. This suggests
that order of call for these methods becomes important, which means
a more complicated approach. */
diff --git a/gdb/symtab.h b/gdb/symtab.h
index 6864b96..e4ec4bf 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -44,7 +44,7 @@ struct program_space;
These structures are laid out to encourage good packing.
They use ENUM_BITFIELD and short int fields, and they order the
structure members so that fields less than a word are next
- to each other so they can be packed together. */
+ to each other so they can be packed together. */
/* Rearranged: used ENUM_BITFIELD and rearranged field order in
all the space critical structures (plus struct minimal_symbol).
@@ -85,9 +85,9 @@ struct cplus_specific
/* Define a structure for the information that is common to all symbol types,
including minimal symbols, partial symbols, and full symbols. In a
multilanguage environment, some language specific information may need to
- be recorded along with each symbol. */
+ be recorded along with each symbol. */
-/* This structure is space critical. See space comments at the top. */
+/* This structure is space critical. See space comments at the top. */
struct general_symbol_info
{
@@ -118,7 +118,7 @@ struct general_symbol_info
CORE_ADDR address;
- /* for opaque typedef struct chain */
+ /* For opaque typedef struct chain. */
struct symbol *chain;
}
@@ -130,7 +130,7 @@ struct general_symbol_info
union
{
/* This is used by languages which wish to store a demangled name.
- currently used by Ada, Java, and Objective C.*/
+ currently used by Ada, Java, and Objective C. */
struct mangled_lang
{
char *demangled_name;
@@ -143,7 +143,7 @@ struct general_symbol_info
/* Record the source code language that applies to this symbol.
This is used to select one of the fields from the language specific
- union above. */
+ union above. */
ENUM_BITFIELD(language) language : 8;
@@ -186,7 +186,7 @@ extern CORE_ADDR symbol_overlayed_address (CORE_ADDR, struct obj_section *);
#define SYMBOL_OBJ_SECTION(symbol) (symbol)->ginfo.obj_section
/* Initializes the language dependent portion of a symbol
- depending upon the language for the symbol. */
+ depending upon the language for the symbol. */
#define SYMBOL_SET_LANGUAGE(symbol,language) \
(symbol_set_language (&(symbol)->ginfo, (language)))
extern void symbol_set_language (struct general_symbol_info *symbol,
@@ -233,7 +233,7 @@ extern char *symbol_natural_name (const struct general_symbol_info *symbol);
#define SYMBOL_LINKAGE_NAME(symbol) (symbol)->ginfo.name
/* Return the demangled name for a symbol based on the language for
- that symbol. If no demangled name exists, return NULL. */
+ that symbol. If no demangled name exists, return NULL. */
#define SYMBOL_DEMANGLED_NAME(symbol) \
(symbol_demangled_name (&(symbol)->ginfo))
extern char *symbol_demangled_name (const struct general_symbol_info *symbol);
@@ -254,7 +254,7 @@ extern char *symbol_demangled_name (const struct general_symbol_info *symbol);
name if it exists. Note that whitespace is ignored while attempting to
match a C++ encoded name, so that "foo::bar(int,long)" is the same as
"foo :: bar (int, long)".
- Evaluates to zero if the match fails, or nonzero if it succeeds. */
+ Evaluates to zero if the match fails, or nonzero if it succeeds. */
/* Macro that tests a symbol for a match against a specified name
string. It tests against SYMBOL_NATURAL_NAME, and it ignores
@@ -264,11 +264,11 @@ extern char *symbol_demangled_name (const struct general_symbol_info *symbol);
#define SYMBOL_MATCHES_NATURAL_NAME(symbol, name) \
(strcmp_iw (SYMBOL_NATURAL_NAME (symbol), (name)) == 0)
-/* Macro that returns the name to be used when sorting and searching symbols.
+/* Macro that returns the name to be used when sorting and searching symbols.
In C++, Chill, and Java, we search for the demangled form of a name,
and so sort symbols accordingly. In Ada, however, we search by mangled
name. If there is no distinct demangled name, then SYMBOL_SEARCH_NAME
- returns the same value (same pointer) as SYMBOL_LINKAGE_NAME. */
+ returns the same value (same pointer) as SYMBOL_LINKAGE_NAME. */
#define SYMBOL_SEARCH_NAME(symbol) \
(symbol_search_name (&(symbol)->ginfo))
extern char *symbol_search_name (const struct general_symbol_info *);
@@ -284,7 +284,7 @@ extern char *symbol_search_name (const struct general_symbol_info *);
guess when it can't figure out which is a better match between two
types (mst_data versus mst_bss) for example. Since the minimal
symbol info is sometimes derived from the BFD library's view of a
- file, we need to live with what information bfd supplies. */
+ file, we need to live with what information bfd supplies. */
enum minimal_symbol_type
{
@@ -319,7 +319,7 @@ enum minimal_symbol_type
Even when a file contains enough debugging information to build a full
symbol table, these minimal symbols are still useful for quickly mapping
between names and addresses, and vice versa. They are also sometimes
- used to figure out what full symbol table entries need to be read in. */
+ used to figure out what full symbol table entries need to be read in. */
struct minimal_symbol
{
@@ -369,24 +369,24 @@ struct minimal_symbol
/* Represent one symbol name; a variable, constant, function or typedef. */
/* Different name domains for symbols. Looking up a symbol specifies a
- domain and ignores symbol definitions in other name domains. */
+ domain and ignores symbol definitions in other name domains. */
typedef enum domain_enum_tag
{
/* UNDEF_DOMAIN is used when a domain has not been discovered or
none of the following apply. This usually indicates an error either
- in the symbol information or in gdb's handling of symbols. */
+ in the symbol information or in gdb's handling of symbols. */
UNDEF_DOMAIN,
/* VAR_DOMAIN is the usual domain. In C, this contains variables,
- function names, typedef names and enum type values. */
+ function names, typedef names and enum type values. */
VAR_DOMAIN,
/* STRUCT_DOMAIN is used in C to hold struct, union and enum type names.
Thus, if `struct foo' is used in a C program, it produces a symbol named
- `foo' in the STRUCT_DOMAIN. */
+ `foo' in the STRUCT_DOMAIN. */
STRUCT_DOMAIN,
@@ -394,14 +394,14 @@ typedef enum domain_enum_tag
LABEL_DOMAIN,
- /* Searching domains. These overlap with VAR_DOMAIN, providing
- some granularity with the search_symbols function. */
+ /* Searching domains. These overlap with VAR_DOMAIN, providing
+ some granularity with the search_symbols function. */
/* Everything in VAR_DOMAIN minus FUNCTIONS_DOMAIN and
TYPES_DOMAIN. */
VARIABLES_DOMAIN,
- /* All functions -- for some reason not methods, though. */
+ /* All functions -- for some reason not methods, though. */
FUNCTIONS_DOMAIN,
/* All defined types */
@@ -413,15 +413,15 @@ domain_enum;
enum address_class
{
- /* Not used; catches errors */
+ /* Not used; catches errors. */
LOC_UNDEF,
- /* Value is constant int SYMBOL_VALUE, host byteorder */
+ /* Value is constant int SYMBOL_VALUE, host byteorder. */
LOC_CONST,
- /* Value is at fixed address SYMBOL_VALUE_ADDRESS */
+ /* Value is at fixed address SYMBOL_VALUE_ADDRESS. */
LOC_STATIC,
@@ -449,7 +449,7 @@ enum address_class
/* Value is in specified register. Just like LOC_REGISTER except the
register holds the address of the argument instead of the argument
- itself. This is currently used for the passing of structs and unions
+ itself. This is currently used for the passing of structs and unions
on sparc and hppa. It is also used for call by reference where the
address is in a register, at least by mipsread.c. */
@@ -464,13 +464,13 @@ enum address_class
LOC_TYPEDEF,
- /* Value is address SYMBOL_VALUE_ADDRESS in the code */
+ /* Value is address SYMBOL_VALUE_ADDRESS in the code. */
LOC_LABEL,
/* In a symbol table, value is SYMBOL_BLOCK_VALUE of a `struct block'.
In a partial symbol table, SYMBOL_VALUE_ADDRESS is the start address
- of the block. Function names have this class. */
+ of the block. Function names have this class. */
LOC_BLOCK,
@@ -550,12 +550,12 @@ struct symbol_register_ops
int (*register_number) (struct symbol *symbol, struct gdbarch *gdbarch);
};
-/* This structure is space critical. See space comments at the top. */
+/* This structure is space critical. See space comments at the top. */
struct symbol
{
- /* The general symbol info required for all types of symbols. */
+ /* The general symbol info required for all types of symbols. */
struct general_symbol_info ginfo;
@@ -719,7 +719,7 @@ struct linetable
struct section_offsets
{
- CORE_ADDR offsets[1]; /* As many as needed. */
+ CORE_ADDR offsets[1]; /* As many as needed. */
};
#define ANOFFSET(secoff, whichone) \
@@ -733,7 +733,7 @@ struct section_offsets
(sizeof (struct section_offsets) \
+ sizeof (((struct section_offsets *) 0)->offsets) * ((n)-1))
-/* Each source file or header is represented by a struct symtab.
+/* Each source file or header is represented by a struct symtab.
These objects are chained through the `next' field. */
struct symtab
@@ -812,7 +812,7 @@ struct symtab
/* String that identifies the format of the debugging information, such
as "stabs", "dwarf 1", "dwarf 2", "coff", etc. This is mostly useful
for automated testing of gdb but may also be information that is
- useful to the user. */
+ useful to the user. */
char *debugformat;
@@ -845,17 +845,17 @@ struct symtab
virtual function should be applied.
PFN is a pointer to the virtual function.
- Note that this macro is g++ specific (FIXME). */
+ Note that this macro is g++ specific (FIXME). */
#define VTBL_FNADDR_OFFSET 2
-/* External variables and functions for the objects described above. */
+/* External variables and functions for the objects described above. */
-/* See the comment in symfile.c about how current_objfile is used. */
+/* See the comment in symfile.c about how current_objfile is used. */
extern struct objfile *current_objfile;
-/* True if we are nested inside psymtab_to_symtab. */
+/* True if we are nested inside psymtab_to_symtab. */
extern int currently_reading_symtab;
@@ -875,7 +875,7 @@ int symbol_matches_domain (enum language symbol_language,
domain_enum symbol_domain,
domain_enum domain);
-/* lookup a symbol table by source file name */
+/* lookup a symbol table by source file name. */
extern struct symtab *lookup_symtab (const char *);
@@ -888,7 +888,7 @@ extern struct symbol *lookup_symbol_in_language (const char *,
int *);
/* lookup a symbol by name (optional block, optional symtab)
- in the current language */
+ in the current language. */
extern struct symbol *lookup_symbol (const char *, const struct block *,
const domain_enum, int *);
@@ -931,12 +931,12 @@ struct symbol *lookup_static_symbol_aux (const char *name,
const domain_enum domain);
-/* lookup a symbol by name, within a specified block */
+/* lookup a symbol by name, within a specified block. */
extern struct symbol *lookup_block_symbol (const struct block *, const char *,
const domain_enum);
-/* lookup a [struct, union, enum] by name, within a specified block */
+/* lookup a [struct, union, enum] by name, within a specified block. */
extern struct type *lookup_struct (char *, struct block *);
@@ -946,31 +946,31 @@ extern struct type *lookup_enum (char *, struct block *);
/* from blockframe.c: */
-/* lookup the function symbol corresponding to the address */
+/* lookup the function symbol corresponding to the address. */
extern struct symbol *find_pc_function (CORE_ADDR);
-/* lookup the function corresponding to the address and section */
+/* lookup the function corresponding to the address and section. */
extern struct symbol *find_pc_sect_function (CORE_ADDR, struct obj_section *);
-/* lookup function from address, return name, start addr and end addr */
+/* lookup function from address, return name, start addr and end addr. */
extern int find_pc_partial_function (CORE_ADDR, char **, CORE_ADDR *,
CORE_ADDR *);
extern void clear_pc_function_cache (void);
-/* lookup partial symbol table by address and section */
+/* lookup partial symbol table by address and section. */
extern struct symtab *find_pc_sect_symtab_via_partial (CORE_ADDR,
struct obj_section *);
-/* lookup full symbol table by address */
+/* lookup full symbol table by address. */
extern struct symtab *find_pc_symtab (CORE_ADDR);
-/* lookup full symbol table by address and section */
+/* lookup full symbol table by address and section. */
extern struct symtab *find_pc_sect_symtab (CORE_ADDR, struct obj_section *);
@@ -982,12 +982,12 @@ extern struct type *lookup_transparent_type (const char *);
extern struct type *basic_lookup_transparent_type (const char *);
-/* Macro for name of symbol to indicate a file compiled with gcc. */
+/* Macro for name of symbol to indicate a file compiled with gcc. */
#ifndef GCC_COMPILED_FLAG_SYMBOL
#define GCC_COMPILED_FLAG_SYMBOL "gcc_compiled."
#endif
-/* Macro for name of symbol to indicate a file compiled with gcc2. */
+/* Macro for name of symbol to indicate a file compiled with gcc2. */
#ifndef GCC2_COMPILED_FLAG_SYMBOL
#define GCC2_COMPILED_FLAG_SYMBOL "gcc2_compiled."
#endif
@@ -1087,10 +1087,10 @@ struct symtabs_and_lines
/* Some types and macros needed for exception catchpoints.
Can't put these in target.h because symtab_and_line isn't
- known there. This file will be included by breakpoint.c,
- hppa-tdep.c, etc. */
+ known there. This file will be included by breakpoint.c,
+ hppa-tdep.c, etc. */
-/* Enums for exception-handling support */
+/* Enums for exception-handling support. */
enum exception_event_kind
{
EX_EVENT_THROW,
@@ -1104,7 +1104,7 @@ enum exception_event_kind
extern struct symtab_and_line find_pc_line (CORE_ADDR, int);
-/* Same function, but specify a section as well as an address */
+/* Same function, but specify a section as well as an address. */
extern struct symtab_and_line find_pc_sect_line (CORE_ADDR,
struct obj_section *, int);
@@ -1205,25 +1205,25 @@ extern struct symbol *fixup_symbol_section (struct symbol *,
/* Symbol searching */
/* When using search_symbols, a list of the following structs is returned.
- Callers must free the search list using free_search_symbols! */
+ Callers must free the search list using free_search_symbols! */
struct symbol_search
{
- /* The block in which the match was found. Could be, for example,
- STATIC_BLOCK or GLOBAL_BLOCK. */
+ /* The block in which the match was found. Could be, for example,
+ STATIC_BLOCK or GLOBAL_BLOCK. */
int block;
/* Information describing what was found.
If symtab abd symbol are NOT NULL, then information was found
- for this match. */
+ for this match. */
struct symtab *symtab;
struct symbol *symbol;
/* If msymbol is non-null, then a match was made on something for
- which only minimal_symbols exist. */
+ which only minimal_symbols exist. */
struct minimal_symbol *msymbol;
- /* A link to the next match, or NULL for the end. */
+ /* A link to the next match, or NULL for the end. */
struct symbol_search *next;
};
@@ -1236,7 +1236,7 @@ extern struct cleanup *make_cleanup_free_search_symbols (struct symbol_search
/* The name of the ``main'' function.
FIXME: cagney/2001-03-20: Can't make main_name() const since some
of the calling code currently assumes that the string isn't
- const. */
+ const. */
extern void set_main_name (const char *name);
extern /*const */ char *main_name (void);
extern enum language language_of_main;
diff --git a/gdb/target-descriptions.c b/gdb/target-descriptions.c
index 7d29d17..631d9d6 100644
--- a/gdb/target-descriptions.c
+++ b/gdb/target-descriptions.c
@@ -948,7 +948,7 @@ tdesc_register_type (struct gdbarch *gdbarch, int regno)
else if (reg->bitsize == gdbarch_long_long_bit (gdbarch))
arch_reg->type = builtin_type (gdbarch)->builtin_long_long;
else if (reg->bitsize == gdbarch_ptr_bit (gdbarch))
- /* A bit desperate by this point... */
+ /* A bit desperate by this point... */
arch_reg->type = builtin_type (gdbarch)->builtin_data_ptr;
else
{
diff --git a/gdb/target-descriptions.h b/gdb/target-descriptions.h
index efe4ebf..5f0b7d5 100644
--- a/gdb/target-descriptions.h
+++ b/gdb/target-descriptions.h
@@ -177,7 +177,7 @@ const char *tdesc_register_name (struct gdbarch *gdbarch, int regno);
struct type *tdesc_register_type (struct gdbarch *gdbarch, int regno);
-/* Return the type associated with ID, from the target description. */
+/* Return the type associated with ID, from the target description. */
struct type *tdesc_find_type (struct gdbarch *gdbarch, const char *id);
diff --git a/gdb/target-memory.c b/gdb/target-memory.c
index 3c98241..d9bacb3 100644
--- a/gdb/target-memory.c
+++ b/gdb/target-memory.c
@@ -339,7 +339,7 @@ target_write_memory_blocks (VEC(memory_write_request_s) *requests,
sizeof (struct memory_write_request), compare_block_starting_address);
/* Split blocks into list of regular memory blocks,
- and list of flash memory blocks. */
+ and list of flash memory blocks. */
make_cleanup (cleanup_write_requests_vector, &regular);
make_cleanup (cleanup_write_requests_vector, &flash);
split_regular_and_flash_blocks (blocks, &regular, &flash);
diff --git a/gdb/target.c b/gdb/target.c
index 4854834..ff87931 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -500,7 +500,7 @@ void
target_terminal_inferior (void)
{
/* A background resume (``run&'') should leave GDB in control of the
- terminal. Use target_can_async_p, not target_is_async_p, since at
+ terminal. Use target_can_async_p, not target_is_async_p, since at
this point the target is not async yet. However, if sync_execution
is not set, we know it will become async prior to resume. */
if (target_can_async_p () && !sync_execution)
@@ -515,8 +515,8 @@ static int
nomemory (CORE_ADDR memaddr, char *myaddr, int len, int write,
struct target_ops *t)
{
- errno = EIO; /* Can't read/write this location */
- return 0; /* No bytes handled */
+ errno = EIO; /* Can't read/write this location. */
+ return 0; /* No bytes handled. */
}
static void
@@ -535,7 +535,7 @@ noprocess (void)
static int
nosymbol (char *name, CORE_ADDR *addrp)
{
- return 1; /* Symbol does not exist in target env */
+ return 1; /* Symbol does not exist in target env. */
}
static void
@@ -646,11 +646,11 @@ update_current_target (void)
INHERIT (to_pid_to_exec_file, t);
INHERIT (to_log_command, t);
INHERIT (to_stratum, t);
- /* Do not inherit to_has_all_memory */
- /* Do not inherit to_has_memory */
- /* Do not inherit to_has_stack */
- /* Do not inherit to_has_registers */
- /* Do not inherit to_has_execution */
+ /* Do not inherit to_has_all_memory. */
+ /* Do not inherit to_has_memory. */
+ /* Do not inherit to_has_stack. */
+ /* Do not inherit to_has_registers. */
+ /* Do not inherit to_has_execution. */
INHERIT (to_has_thread_control, t);
INHERIT (to_can_async_p, t);
INHERIT (to_is_async_p, t);
@@ -968,7 +968,7 @@ unpush_target (struct target_ops *t)
_("Attempt to unpush the dummy target"));
/* Look for the specified target. Note that we assume that a target
- can only occur once in the target stack. */
+ can only occur once in the target stack. */
for (cur = &target_stack; (*cur) != NULL; cur = &(*cur)->beneath)
{
@@ -977,7 +977,7 @@ unpush_target (struct target_ops *t)
}
if ((*cur) == NULL)
- return 0; /* Didn't find target_ops, quit now */
+ return 0; /* Didn't find target_ops, quit now. */
/* NOTE: cagney/2003-12-06: In '94 the close call was made
unconditional by moving it to before the above check that the
@@ -987,7 +987,7 @@ unpush_target (struct target_ops *t)
targets should be closed. */
target_close (t, 0);
- /* Unchain the target */
+ /* Unchain the target. */
tmp = (*cur);
(*cur) = (*cur)->beneath;
tmp->beneath = NULL;
@@ -1000,7 +1000,7 @@ unpush_target (struct target_ops *t)
void
pop_target (void)
{
- target_close (target_stack, 0); /* Let it clean up */
+ target_close (target_stack, 0); /* Let it clean up. */
if (unpush_target (target_stack) == 1)
return;
@@ -1195,7 +1195,7 @@ target_read_string (CORE_ADDR memaddr, char **string, int len, int *errnop)
if (errcode != 0)
{
/* The transfer request might have crossed the boundary to an
- unallocated region of memory. Retry the transfer, requesting
+ unallocated region of memory. Retry the transfer, requesting
a single byte. */
tlen = 1;
offset = 0;
@@ -1543,7 +1543,7 @@ target_xfer_partial (struct target_ops *ops,
filling the buffer with good data. There is no way for the caller to know
how much good data might have been transfered anyway. Callers that can
deal with partial reads should call target_read (which will retry until
- it makes no progress, and then return how much was transferred). */
+ it makes no progress, and then return how much was transferred). */
int
target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len)
@@ -1799,17 +1799,17 @@ target_read (struct target_ops *ops,
The function results, in RESULT, either zero or one memory block.
If there's a readable subrange at the beginning, it is completely
- read and returned. Any further readable subrange will not be read.
+ read and returned. Any further readable subrange will not be read.
Otherwise, if there's a readable subrange at the end, it will be
completely read and returned. Any readable subranges before it (obviously,
- not starting at the beginning), will be ignored. In other cases --
+ not starting at the beginning), will be ignored. In other cases --
either no readable subrange, or readable subrange (s) that is neither
at the beginning, or end, nothing is returned.
The purpose of this function is to handle a read across a boundary of
- accessible memory in a case when memory map is not available. The above
+ accessible memory in a case when memory map is not available. The above
restrictions are fine for this case, but will give incorrect results if
- the memory is 'patchy'. However, supporting 'patchy' memory would require
+ the memory is 'patchy'. However, supporting 'patchy' memory would require
trying to read every single byte, and it seems unacceptable solution.
Explicit memory map is recommended for this case -- and
target_read_memory_robust will take care of reading multiple ranges
@@ -1831,7 +1831,7 @@ read_whatever_is_readable (struct target_ops *ops,
return;
/* Check that either first or the last byte is readable, and give up
- if not. This heuristic is meant to permit reading accessible memory
+ if not. This heuristic is meant to permit reading accessible memory
at the boundary of accessible region. */
if (target_read_partial (ops, TARGET_OBJECT_MEMORY, NULL,
buf, begin, 1) == 1)
@@ -1884,15 +1884,15 @@ read_whatever_is_readable (struct target_ops *ops,
if (xfer == first_half_end - first_half_begin)
{
- /* This half reads up fine. So, the error must be in the
+ /* This half reads up fine. So, the error must be in the
other half. */
current_begin = second_half_begin;
current_end = second_half_end;
}
else
{
- /* This half is not readable. Because we've tried one byte, we
- know some part of this half if actually redable. Go to the next
+ /* This half is not readable. Because we've tried one byte, we
+ know some part of this half if actually redable. Go to the next
iteration to divide again and try to read.
We don't handle the other half, because this function only tries
@@ -1957,7 +1957,7 @@ read_memory_robust (struct target_ops *ops, ULONGEST offset, LONGEST len)
if (region->attrib.mode == MEM_NONE || region->attrib.mode == MEM_WO)
{
- /* Cannot read this region. Note that we can end up here only
+ /* Cannot read this region. Note that we can end up here only
if the region is explicitly marked inaccessible, or
'inaccessible-by-default' is in effect. */
xfered += rlen;
@@ -1973,7 +1973,7 @@ read_memory_robust (struct target_ops *ops, ULONGEST offset, LONGEST len)
/* Call an observer, notifying them of the xfer progress? */
if (xfer <= 0)
{
- /* Got an error reading full chunk. See if maybe we can read
+ /* Got an error reading full chunk. See if maybe we can read
some subrange. */
xfree (buffer);
read_whatever_is_readable (ops, offset + xfered,
@@ -2233,9 +2233,9 @@ target_info (char *args, int from_tty)
void
target_pre_inferior (int from_tty)
{
- /* Clear out solib state. Otherwise the solib state of the previous
+ /* Clear out solib state. Otherwise the solib state of the previous
inferior might have survived and is entirely wrong for the new
- target. This has been observed on GNU/Linux using glibc 2.3. How
+ target. This has been observed on GNU/Linux using glibc 2.3. How
to reproduce:
bash$ ./foo&
@@ -2699,7 +2699,7 @@ target_require_runnable (void)
/* This function is only called if the target is running. In that
case there should have been a process_stratum target and it
- should either know how to create inferiors, or not... */
+ should either know how to create inferiors, or not... */
internal_error (__FILE__, __LINE__, _("No targets found"));
}
diff --git a/gdb/target.h b/gdb/target.h
index d76c490..a1288d0 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -127,7 +127,7 @@ enum target_waitkind
/* The program has entered or returned from a system call. On
HP-UX, this is used in the hardware watchpoint implementation.
- The syscall's unique integer ID number is in value.syscall_id */
+ The syscall's unique integer ID number is in value.syscall_id. */
TARGET_WAITKIND_SYSCALL_ENTRY,
TARGET_WAITKIND_SYSCALL_RETURN,
@@ -140,11 +140,11 @@ enum target_waitkind
/* An event has occured, but we should wait again.
Remote_async_wait() returns this when there is an event
on the inferior, but the rest of the world is not interested in
- it. The inferior has not stopped, but has just sent some output
- to the console, for instance. In this case, we want to go back
+ it. The inferior has not stopped, but has just sent some output
+ to the console, for instance. In this case, we want to go back
to the event loop and wait there for another event from the
inferior, rather than being stuck in the remote_async_wait()
- function. This way the event loop is responsive to other events,
+ function. sThis way the event loop is responsive to other events,
like for instance the user typing. */
TARGET_WAITKIND_IGNORE,
@@ -213,7 +213,7 @@ enum inferior_event_type
INF_EXEC_COMPLETE,
/* We are called to do some stuff after the inferior stops, but we
are expected to reenter the proceed() and
- handle_inferior_event() functions. This is used only in case of
+ handle_inferior_event() functions. This is used only in case of
'step n' like commands. */
INF_EXEC_CONTINUE
};
@@ -266,7 +266,7 @@ enum target_object
TARGET_OBJECT_THREADS,
/* Collected static trace data. */
TARGET_OBJECT_STATIC_TRACE_DATA,
- /* Possible future objects: TARGET_OBJECT_FILE, ... */
+ /* Possible future objects: TARGET_OBJECT_FILE, ... */
};
/* Enumeration of the kinds of traceframe searches that a target may
@@ -302,7 +302,7 @@ extern LONGEST target_read (struct target_ops *ops,
struct memory_read_result
{
- /* First address that was read. */
+ /* First address that was read. */
ULONGEST begin;
/* Past-the-end address. */
ULONGEST end;
@@ -563,7 +563,7 @@ struct target_ops
RAM. The returned memory regions should not overlap.
The order of regions does not matter; target_memory_map will
- sort regions by starting address. For that reason, this
+ sort regions by starting address. For that reason, this
function should not be called directly except via
target_memory_map.
@@ -669,7 +669,7 @@ struct target_ops
/* Ask the target to find a trace frame of the given type TYPE,
using NUM, ADDR1, and ADDR2 as search parameters. Returns the
number of the trace frame, and also the tracepoint number at
- TPP. If no trace frame matches, return -1. May throw if the
+ TPP. If no trace frame matches, return -1. May throw if the
operation fails. */
int (*to_trace_find) (enum trace_find_type type, int num,
ULONGEST addr1, ULONGEST addr2, int *tpp);
@@ -871,11 +871,11 @@ void target_flash_done (void);
/* Describes a request for a memory write operation. */
struct memory_write_request
{
- /* Begining address that must be written. */
+ /* Begining address that must be written. */
ULONGEST begin;
- /* Past-the-end address. */
+ /* Past-the-end address. */
ULONGEST end;
- /* The data to write. */
+ /* The data to write. */
gdb_byte *data;
/* A callback baton for progress reporting for this request. */
void *baton;
@@ -1193,27 +1193,27 @@ extern int default_child_has_execution (struct target_ops *ops);
cludge until async mode is a strict superset of sync mode. */
extern int target_async_permitted;
-/* Can the target support asynchronous execution? */
+/* Can the target support asynchronous execution? */
#define target_can_async_p() (current_target.to_can_async_p ())
-/* Is the target in asynchronous execution mode? */
+/* Is the target in asynchronous execution mode? */
#define target_is_async_p() (current_target.to_is_async_p ())
int target_supports_non_stop (void);
-/* Put the target in async mode with the specified callback function. */
+/* Put the target in async mode with the specified callback function. */
#define target_async(CALLBACK,CONTEXT) \
(current_target.to_async ((CALLBACK), (CONTEXT)))
-/* This is to be used ONLY within call_function_by_hand(). It provides
+/* This is to be used ONLY within call_function_by_hand(). It provides
a workaround, to have inferior function calls done in sychronous
- mode, even though the target is asynchronous. After
+ mode, even though the target is asynchronous. After
target_async_mask(0) is called, calls to target_can_async_p() will
return FALSE , so that target_resume() will not try to start the
- target asynchronously. After the inferior stops, we IMMEDIATELY
+ target asynchronously. After the inferior stops, we IMMEDIATELY
restore the previous nature of the target, by calling
- target_async_mask(1). After that, target_can_async_p() will return
- TRUE. ANY OTHER USE OF THIS FEATURE IS DEPRECATED.
+ target_async_mask(1). After that, target_can_async_p() will return
+ TRUE. ANY OTHER USE OF THIS FEATURE IS DEPRECATED.
FIXME ezannoni 1999-12-13: we won't need this once we move
the turning async on and off to the single execution commands,
@@ -1586,7 +1586,7 @@ extern int remote_debug;
/* Speed in bits per second, or -1 which means don't mess with the speed. */
extern int baud_rate;
-/* Timeout limit for response from target. */
+/* Timeout limit for response from target. */
extern int remote_timeout;
@@ -1619,9 +1619,9 @@ extern int may_stop;
extern void update_target_permissions (void);
-/* Imported from machine dependent code */
+/* Imported from machine dependent code. */
-/* Blank target vector entries are initialized to target_ignore. */
+/* Blank target vector entries are initialized to target_ignore. */
void target_ignore (void);
extern struct target_ops deprecated_child_ops;
diff --git a/gdb/terminal.h b/gdb/terminal.h
index 73be02f..6786f51 100644
--- a/gdb/terminal.h
+++ b/gdb/terminal.h
@@ -22,12 +22,12 @@
/* If we're using autoconf, it will define HAVE_TERMIOS_H,
- HAVE_TERMIO_H and HAVE_SGTTY_H for us. One day we can rewrite
+ HAVE_TERMIO_H and HAVE_SGTTY_H for us. One day we can rewrite
ser-unix.c and inflow.c to inspect those names instead of
HAVE_TERMIOS, HAVE_TERMIO and the implicit HAVE_SGTTY (when neither
HAVE_TERMIOS or HAVE_TERMIO is set). Until then, make sure that
nothing has already defined the one of the names, and do the right
- thing. */
+ thing. */
#if !defined (HAVE_TERMIOS) && !defined(HAVE_TERMIO) && !defined(HAVE_SGTTY)
#if defined(HAVE_TERMIOS_H)
diff --git a/gdb/thread.c b/gdb/thread.c
index 99b4a93..d35a2a6 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -44,13 +44,13 @@
#include "annotate.h"
#include "cli/cli-decode.h"
-/* Definition of struct thread_info exported to gdbthread.h */
+/* Definition of struct thread_info exported to gdbthread.h. */
-/* Prototypes for exported functions. */
+/* Prototypes for exported functions. */
void _initialize_thread (void);
-/* Prototypes for local functions. */
+/* Prototypes for local functions. */
static struct thread_info *thread_list = NULL;
static int highest_thread_num;
@@ -432,7 +432,7 @@ in_thread_list (ptid_t ptid)
if (ptid_equal (tp->ptid, ptid))
return 1;
- return 0; /* Never heard of 'im */
+ return 0; /* Never heard of 'im. */
}
/* Finds the first thread of the inferior given by PID. If PID is -1,
@@ -482,7 +482,7 @@ any_live_thread_of_process (int pid)
}
/* Print a list of thread ids currently known, and the total number of
- threads. To be used from within catch_errors. */
+ threads. To be used from within catch_errors. */
static int
do_captured_list_thread_ids (struct ui_out *uiout, void *arg)
{
@@ -516,7 +516,7 @@ do_captured_list_thread_ids (struct ui_out *uiout, void *arg)
}
/* Official gdblib interface function to get a list of thread ids and
- the total number. */
+ the total number. */
enum gdb_rc
gdb_list_thread_ids (struct ui_out *uiout, char **error_message)
{
@@ -526,7 +526,7 @@ gdb_list_thread_ids (struct ui_out *uiout, char **error_message)
return GDB_RC_OK;
}
-/* Return true if TP is an active thread. */
+/* Return true if TP is an active thread. */
static int
thread_alive (struct thread_info *tp)
{
@@ -754,12 +754,12 @@ finish_thread_state_cleanup (void *arg)
/* Prints the list of threads and their details on UIOUT.
This is a version of 'info_thread_command' suitable for
- use from MI.
+ use from MI.
If REQUESTED_THREAD is not -1, it's the GDB id of the thread
that should be printed. Otherwise, all threads are
- printed.
+ printed.
If PID is not -1, only print threads from the process PID.
- Otherwise, threads from all attached PIDs are printed.
+ Otherwise, threads from all attached PIDs are printed.
If both REQUESTED_THREAD and PID are not -1, then the thread
is printed if it belongs to the specified process. Otherwise,
an error is raised. */
@@ -940,7 +940,7 @@ info_threads_command (char *arg, int from_tty)
print_thread_info (uiout, -1, -1);
}
-/* Switch from one thread to another. */
+/* Switch from one thread to another. */
void
switch_to_thread (ptid_t ptid)
@@ -1128,8 +1128,7 @@ make_cleanup_restore_current_thread (void)
thread apply 1 2 7 4 backtrace Apply backtrace cmd to threads 1,2,7,4
thread apply 2-7 9 p foo(1) Apply p foo(1) cmd to threads 2->7 & 9
- thread apply all p x/i $pc Apply x/i $pc cmd to all threads
- */
+ thread apply all p x/i $pc Apply x/i $pc cmd to all threads. */
static void
thread_apply_all_command (char *cmd, int from_tty)
@@ -1146,7 +1145,7 @@ thread_apply_all_command (char *cmd, int from_tty)
old_chain = make_cleanup_restore_current_thread ();
/* Save a copy of the command in case it is clobbered by
- execute_command */
+ execute_command. */
saved_cmd = xstrdup (cmd);
make_cleanup (xfree, saved_cmd);
for (tp = thread_list; tp; tp = tp->next)
@@ -1181,7 +1180,7 @@ thread_apply_command (char *tidlist, int from_tty)
error (_("Please specify a command following the thread ID list"));
/* Save a copy of the command in case it is clobbered by
- execute_command */
+ execute_command. */
saved_cmd = xstrdup (cmd);
old_chain = make_cleanup (xfree, saved_cmd);
while (tidlist < cmd)
@@ -1197,7 +1196,7 @@ thread_apply_command (char *tidlist, int from_tty)
while (*tidlist == ' ' || *tidlist == '\t')
tidlist++;
- if (*tidlist == '-') /* Got a range of IDs? */
+ if (*tidlist == '-') /* Got a range of IDs? */
{
tidlist++; /* Skip the - */
end = strtol (tidlist, &p, 10);
diff --git a/gdb/top.c b/gdb/top.c
index e0feba5..d974897 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -250,7 +250,7 @@ void (*deprecated_detach_hook) (void);
void (*deprecated_interactive_hook) (void);
-/* Tell the GUI someone changed the register REGNO. -1 means
+/* Tell the GUI someone changed the register REGNO. -1 means
that the caller does not know which register changed or
that several registers have changed (see value_assign). */
void (*deprecated_register_changed_hook) (int regno);
@@ -282,7 +282,7 @@ void (*deprecated_context_hook) (int id);
#ifdef SIGHUP
/* NOTE 1999-04-29: This function will be static again, once we modify
gdb to use the event loop as the default command loop and we merge
- event-top.c into this file, top.c */
+ event-top.c into this file, top.c. */
/* static */ int
quit_cover (void *s)
{
@@ -297,13 +297,13 @@ quit_cover (void *s)
/* Line number we are currently in in a file which is being sourced. */
/* NOTE 1999-04-29: This variable will be static again, once we modify
gdb to use the event loop as the default command loop and we merge
- event-top.c into this file, top.c */
+ event-top.c into this file, top.c. */
/* static */ int source_line_number;
/* Name of the file we are sourcing. */
/* NOTE 1999-04-29: This variable will be static again, once we modify
gdb to use the event loop as the default command loop and we merge
- event-top.c into this file, top.c */
+ event-top.c into this file, top.c. */
/* static */ const char *source_file_name;
/* Clean up on error during a "source" command (or execution of a
@@ -528,7 +528,7 @@ command_loop (void)
reinitialize_more_filter ();
old_chain = make_cleanup (null_cleanup, 0);
- /* Get a command-line. This calls the readline package. */
+ /* Get a command-line. This calls the readline package. */
command = command_line_input (instream == stdin ?
get_prompt () : (char *) NULL,
instream == stdin, "prompt");
@@ -630,7 +630,7 @@ static int command_editing_p;
/* NOTE 1999-04-29: This variable will be static again, once we modify
gdb to use the event loop as the default command loop and we merge
- event-top.c into this file, top.c */
+ event-top.c into this file, top.c. */
/* static */ int history_expansion_p;
@@ -1692,7 +1692,7 @@ gdb_init (char *argv0)
set_language (language_c);
expected_language = current_language; /* Don't warn about the change. */
- /* Allow another UI to initialize. If the UI fails to initialize,
+ /* Allow another UI to initialize. If the UI fails to initialize,
and it wants GDB to revert to the CLI, it should clear
deprecated_init_ui_hook. */
if (deprecated_init_ui_hook)
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index e21fec3..dcae841 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -142,13 +142,13 @@ static int traceframe_number;
/* Tracepoint for last traceframe collected. */
static int tracepoint_number;
-/* Symbol for function for last traceframe collected */
+/* Symbol for function for last traceframe collected. */
static struct symbol *traceframe_fun;
-/* Symtab and line for last traceframe collected */
+/* Symtab and line for last traceframe collected. */
static struct symtab_and_line traceframe_sal;
-/* Tracing command lists */
+/* Tracing command lists. */
static struct cmd_list_element *tfindlist;
/* List of expressions to collect by default at each tracepoint hit. */
@@ -225,7 +225,7 @@ set_tracepoint_num (int num)
}
/* Set externally visible debug variables for querying/printing
- the traceframe context (line, function, file) */
+ the traceframe context (line, function, file). */
static void
set_traceframe_context (struct frame_info *trace_frame)
@@ -597,7 +597,7 @@ validate_actionline (char **line, struct breakpoint *t)
struct bp_location *loc;
struct agent_expr *aexpr;
- /* if EOF is typed, *line is NULL */
+ /* If EOF is typed, *line is NULL. */
if (*line == NULL)
return;
@@ -618,12 +618,12 @@ validate_actionline (char **line, struct breakpoint *t)
if (cmd_cfunc_eq (c, collect_pseudocommand))
{
do
- { /* repeat over a comma-separated list */
- QUIT; /* allow user to bail out with ^C */
+ { /* Repeat over a comma-separated list. */
+ QUIT; /* Allow user to bail out with ^C. */
while (isspace ((int) *p))
p++;
- if (*p == '$') /* look for special pseudo-symbols */
+ if (*p == '$') /* Look for special pseudo-symbols. */
{
if (0 == strncasecmp ("reg", p + 1, 3)
|| 0 == strncasecmp ("arg", p + 1, 3)
@@ -682,8 +682,8 @@ validate_actionline (char **line, struct breakpoint *t)
else if (cmd_cfunc_eq (c, teval_pseudocommand))
{
do
- { /* repeat over a comma-separated list */
- QUIT; /* allow user to bail out with ^C */
+ { /* Repeat over a comma-separated list. */
+ QUIT; /* Allow user to bail out with ^C. */
while (isspace ((int) *p))
p++;
@@ -715,7 +715,7 @@ validate_actionline (char **line, struct breakpoint *t)
else if (cmd_cfunc_eq (c, while_stepping_pseudocommand))
{
- char *steparg; /* in case warning is necessary */
+ char *steparg; /* In case warning is necessary. */
while (isspace ((int) *p))
p++;
@@ -739,7 +739,7 @@ enum {
struct memrange
{
int type; /* memrange_absolute for absolute memory range,
- else basereg number */
+ else basereg number. */
bfd_signed_vma start;
bfd_signed_vma end;
};
@@ -764,7 +764,7 @@ tracepoint_list, stepping_list;
static int memrange_cmp (const void *, const void *);
-/* compare memranges for qsort */
+/* Compare memranges for qsort. */
static int
memrange_cmp (const void *va, const void *vb)
{
@@ -833,7 +833,7 @@ add_register (struct collection_list *collection, unsigned int regno)
collection->regs_mask[regno / 8] |= 1 << (regno % 8);
}
-/* Add a memrange to a collection list */
+/* Add a memrange to a collection list. */
static void
add_memrange (struct collection_list *memranges,
int type, bfd_signed_vma base,
@@ -1002,20 +1002,20 @@ collect_symbol (struct collection_list *collect,
discard_cleanups (old_chain1);
add_aexpr (collect, aexpr);
- /* take care of the registers */
+ /* Take care of the registers. */
if (aexpr->reg_mask_len > 0)
{
int ndx1, ndx2;
for (ndx1 = 0; ndx1 < aexpr->reg_mask_len; ndx1++)
{
- QUIT; /* allow user to bail out with ^C */
+ QUIT; /* Allow user to bail out with ^C. */
if (aexpr->reg_mask[ndx1] != 0)
{
- /* assume chars have 8 bits */
+ /* Assume chars have 8 bits. */
for (ndx2 = 0; ndx2 < 8; ndx2++)
if (aexpr->reg_mask[ndx1] & (1 << ndx2))
- /* it's used -- record it */
+ /* It's used -- record it. */
add_register (collect, ndx1 * 8 + ndx2);
}
}
@@ -1036,7 +1036,7 @@ struct add_local_symbols_data
int count;
};
-/* The callback for the locals and args iterators */
+/* The callback for the locals and args iterators. */
static void
do_collect_symbol (const char *print_name,
@@ -1050,7 +1050,7 @@ do_collect_symbol (const char *print_name,
p->count++;
}
-/* Add all locals (or args) symbols to collection list */
+/* Add all locals (or args) symbols to collection list. */
static void
add_local_symbols (struct collection_list *collect,
struct gdbarch *gdbarch, CORE_ADDR pc,
@@ -1121,7 +1121,7 @@ clear_collection_list (struct collection_list *list)
list->strace_data = 0;
}
-/* reduce a collection list to string form (for gdb protocol) */
+/* Reduce a collection list to string form (for gdb protocol). */
static char **
stringify_collection_list (struct collection_list *list, char *string)
{
@@ -1147,9 +1147,9 @@ stringify_collection_list (struct collection_list *list, char *string)
}
for (i = sizeof (list->regs_mask) - 1; i > 0; i--)
- if (list->regs_mask[i] != 0) /* skip leading zeroes in regs_mask */
+ if (list->regs_mask[i] != 0) /* Skip leading zeroes in regs_mask. */
break;
- if (list->regs_mask[i] != 0) /* prepare to send regs_mask to the stub */
+ if (list->regs_mask[i] != 0) /* Prepare to send regs_mask to the stub. */
{
if (info_verbose)
printf_filtered ("\nCollecting registers (mask): 0x");
@@ -1157,7 +1157,7 @@ stringify_collection_list (struct collection_list *list, char *string)
*end++ = 'R';
for (; i >= 0; i--)
{
- QUIT; /* allow user to bail out with ^C */
+ QUIT; /* Allow user to bail out with ^C. */
if (info_verbose)
printf_filtered ("%02X", list->regs_mask[i]);
sprintf (end, "%02X", list->regs_mask[i]);
@@ -1172,7 +1172,7 @@ stringify_collection_list (struct collection_list *list, char *string)
printf_filtered ("Collecting memranges: \n");
for (i = 0, count = 0, end = temp_buf; i < list->next_memrange; i++)
{
- QUIT; /* allow user to bail out with ^C */
+ QUIT; /* Allow user to bail out with ^C. */
sprintf_vma (tmp2, list->list[i].start);
if (info_verbose)
{
@@ -1208,7 +1208,7 @@ stringify_collection_list (struct collection_list *list, char *string)
for (i = 0; i < list->next_aexpr_elt; i++)
{
- QUIT; /* allow user to bail out with ^C */
+ QUIT; /* Allow user to bail out with ^C. */
if ((count + 10 + 2 * list->aexpr_list[i]->len) > MAX_AGENT_EXPR_LEN)
{
(*str_list)[ndx] = savestring (temp_buf, count);
@@ -1262,7 +1262,7 @@ encode_actions_1 (struct command_line *action,
for (; action; action = action->next)
{
- QUIT; /* allow user to bail out with ^C */
+ QUIT; /* Allow user to bail out with ^C. */
action_exp = action->line;
while (isspace ((int) *action_exp))
action_exp++;
@@ -1274,8 +1274,8 @@ encode_actions_1 (struct command_line *action,
if (cmd_cfunc_eq (cmd, collect_pseudocommand))
{
do
- { /* repeat over a comma-separated list */
- QUIT; /* allow user to bail out with ^C */
+ { /* Repeat over a comma-separated list. */
+ QUIT; /* Allow user to bail out with ^C. */
while (isspace ((int) *action_exp))
action_exp++;
@@ -1339,7 +1339,7 @@ encode_actions_1 (struct command_line *action,
}
case UNOP_MEMVAL:
- /* safe because we know it's a simple expression */
+ /* Safe because we know it's a simple expression. */
tempval = evaluate_expression (exp);
addr = value_address (tempval);
len = TYPE_LENGTH (check_typedef (exp->elts[1].type));
@@ -1355,7 +1355,7 @@ encode_actions_1 (struct command_line *action,
tloc->address);
break;
- default: /* full-fledged expression */
+ default: /* Full-fledged expression. */
aexpr = gen_trace_for_expr (tloc->address, exp);
old_chain1 = make_cleanup_free_agent_expr (aexpr);
@@ -1367,7 +1367,7 @@ encode_actions_1 (struct command_line *action,
discard_cleanups (old_chain1);
add_aexpr (collect, aexpr);
- /* take care of the registers */
+ /* Take care of the registers. */
if (aexpr->reg_mask_len > 0)
{
int ndx1;
@@ -1375,13 +1375,13 @@ encode_actions_1 (struct command_line *action,
for (ndx1 = 0; ndx1 < aexpr->reg_mask_len; ndx1++)
{
- QUIT; /* allow user to bail out with ^C */
+ QUIT; /* Allow user to bail out with ^C. */
if (aexpr->reg_mask[ndx1] != 0)
{
- /* assume chars have 8 bits */
+ /* Assume chars have 8 bits. */
for (ndx2 = 0; ndx2 < 8; ndx2++)
if (aexpr->reg_mask[ndx1] & (1 << ndx2))
- /* it's used -- record it */
+ /* It's used -- record it. */
add_register (collect,
ndx1 * 8 + ndx2);
}
@@ -1397,8 +1397,8 @@ encode_actions_1 (struct command_line *action,
else if (cmd_cfunc_eq (cmd, teval_pseudocommand))
{
do
- { /* repeat over a comma-separated list */
- QUIT; /* allow user to bail out with ^C */
+ { /* Repeat over a comma-separated list. */
+ QUIT; /* Allow user to bail out with ^C. */
while (isspace ((int) *action_exp))
action_exp++;
@@ -1528,7 +1528,7 @@ start_tracing (void)
tp_vec = all_tracepoints ();
- /* No point in tracing without any tracepoints... */
+ /* No point in tracing without any tracepoints... */
if (VEC_length (breakpoint_p, tp_vec) == 0)
{
VEC_free (breakpoint_p, tp_vec);
@@ -1635,7 +1635,7 @@ void
stop_tracing (void)
{
target_trace_stop ();
- /* should change in response to reply? */
+ /* Should change in response to reply? */
current_trace_status ()->running = 0;
}
@@ -1950,7 +1950,7 @@ tfind_1 (enum trace_find_type type, int num,
{
if (info_verbose)
printf_filtered ("End of trace buffer.\n");
-#if 0 /* dubious now? */
+#if 0 /* dubious now? */
/* The following will not recurse, since it's
special-cased. */
trace_find_command ("-1", from_tty);
@@ -1992,7 +1992,7 @@ tfind_1 (enum trace_find_type type, int num,
ui_out_field_string (uiout, "found", "0");
else if (type == tfind_number && num == -1)
printf_unfiltered (_("No longer looking at any trace frame\n"));
- else /* this case may never occur, check */
+ else /* This case may never occur, check. */
printf_unfiltered (_("No trace frame found\n"));
}
@@ -2038,7 +2038,7 @@ tfind_1 (enum trace_find_type type, int num,
/* tfind command */
static void
trace_find_command (char *args, int from_tty)
-{ /* this should only be called with a numeric argument */
+{ /* This should only be called with a numeric argument. */
int frameno = -1;
if (current_trace_status ()->running && !current_trace_status ()->from_file)
@@ -2047,7 +2047,7 @@ trace_find_command (char *args, int from_tty)
if (args == 0 || *args == 0)
{ /* TFIND with no args means find NEXT trace frame. */
if (traceframe_number == -1)
- frameno = 0; /* "next" is first one */
+ frameno = 0; /* "next" is first one. */
else
frameno = traceframe_number + 1;
}
@@ -2125,7 +2125,7 @@ trace_find_tracepoint_command (char *args, int from_tty)
if (tracepoint_number == -1)
error (_("No current tracepoint -- please supply an argument."));
else
- tdp = tracepoint_number; /* default is current TDP */
+ tdp = tracepoint_number; /* Default is current TDP. */
}
else
tdp = parse_and_eval_long (args);
@@ -2231,14 +2231,14 @@ trace_find_range_command (char *args, int from_tty)
if (0 != (tmp = strchr (args, ',')))
{
- *tmp++ = '\0'; /* terminate start address */
+ *tmp++ = '\0'; /* Terminate start address. */
while (isspace ((int) *tmp))
tmp++;
start = parse_and_eval_address (args);
stop = parse_and_eval_address (tmp);
}
else
- { /* no explicit end address? */
+ { /* No explicit end address? */
start = parse_and_eval_address (args);
stop = start + 1; /* ??? */
}
@@ -2257,21 +2257,21 @@ trace_find_outside_command (char *args, int from_tty)
error (_("May not look at trace frames while trace is running."));
if (args == 0 || *args == 0)
- { /* XXX FIXME: what should default behavior be? */
+ { /* XXX FIXME: what should default behavior be? */
printf_filtered ("Usage: tfind outside <startaddr>,<endaddr>\n");
return;
}
if (0 != (tmp = strchr (args, ',')))
{
- *tmp++ = '\0'; /* terminate start address */
+ *tmp++ = '\0'; /* Terminate start address. */
while (isspace ((int) *tmp))
tmp++;
start = parse_and_eval_address (args);
stop = parse_and_eval_address (tmp);
}
else
- { /* no explicit end address? */
+ { /* No explicit end address? */
start = parse_and_eval_address (args);
stop = start + 1; /* ??? */
}
@@ -2299,25 +2299,25 @@ scope_info (char *args, int from_tty)
sals = decode_line_1 (&args, 1, NULL, 0, &canonical, NULL);
if (sals.nelts == 0)
- return; /* presumably decode_line_1 has already warned */
+ return; /* Presumably decode_line_1 has already warned. */
- /* Resolve line numbers to PC */
+ /* Resolve line numbers to PC. */
resolve_sal_pc (&sals.sals[0]);
block = block_for_pc (sals.sals[0].pc);
while (block != 0)
{
- QUIT; /* allow user to bail out with ^C */
+ QUIT; /* Allow user to bail out with ^C. */
ALL_BLOCK_SYMBOLS (block, iter, sym)
{
- QUIT; /* allow user to bail out with ^C */
+ QUIT; /* Allow user to bail out with ^C. */
if (count == 0)
printf_filtered ("Scope for %s:\n", save_args);
count++;
symname = SYMBOL_PRINT_NAME (sym);
if (symname == NULL || *symname == '\0')
- continue; /* probably botched, certainly useless */
+ continue; /* Probably botched, certainly useless. */
gdbarch = get_objfile_arch (SYMBOL_SYMTAB (sym)->objfile);
@@ -2325,10 +2325,10 @@ scope_info (char *args, int from_tty)
switch (SYMBOL_CLASS (sym))
{
default:
- case LOC_UNDEF: /* messed up symbol? */
+ case LOC_UNDEF: /* Messed up symbol? */
printf_filtered ("a bogus symbol, class %d.\n",
SYMBOL_CLASS (sym));
- count--; /* don't count this one */
+ count--; /* Don't count this one. */
continue;
case LOC_CONST:
printf_filtered ("a constant with value %ld (0x%lx)",
@@ -2457,7 +2457,7 @@ trace_dump_actions (struct command_line *action,
{
struct cmd_list_element *cmd;
- QUIT; /* allow user to bail out with ^C */
+ QUIT; /* Allow user to bail out with ^C. */
action_exp = action->line;
while (isspace ((int) *action_exp))
action_exp++;
@@ -2491,8 +2491,8 @@ trace_dump_actions (struct command_line *action,
if (stepping_frame == stepping_actions)
{
do
- { /* repeat over a comma-separated list */
- QUIT; /* allow user to bail out with ^C */
+ { /* Repeat over a comma-separated list. */
+ QUIT; /* Allow user to bail out with ^C. */
if (*action_exp == ',')
action_exp++;
while (isspace ((int) *action_exp))
@@ -3039,7 +3039,7 @@ find_matching_tracepoint (struct uploaded_tp *utp)
if (t->type == utp->type
&& t->step_count == utp->step
&& t->pass_count == utp->pass
- /* FIXME also test conditionals and actions */
+ /* FIXME also test conditionals and actions. */
)
{
/* Scan the locations for an address match. */
@@ -3128,7 +3128,7 @@ create_tsv_from_upload (struct uploaded_tsv *utsv)
}
/* Fish for a name that is not in use. */
- /* (should check against all internal vars?) */
+ /* (should check against all internal vars?) */
while (find_trace_state_variable (buf))
sprintf (buf, "%s_%d", namebase, try_num++);
@@ -3220,7 +3220,7 @@ tfile_open (char *filename, int from_tty)
int flags;
int scratch_chan;
char header[TRACE_HEADER_SIZE];
- char linebuf[1000]; /* should be max remote packet size or so */
+ char linebuf[1000]; /* Should be max remote packet size or so. */
char byte;
int bytes, i, gotten;
struct trace_status *ts;
@@ -3249,7 +3249,7 @@ tfile_open (char *filename, int from_tty)
/* Looks semi-reasonable. Toss the old trace file and work on the new. */
- discard_cleanups (old_chain); /* Don't free filename any more */
+ discard_cleanups (old_chain); /* Don't free filename any more. */
unpush_target (&tfile_ops);
push_target (&tfile_ops);
@@ -3338,7 +3338,7 @@ tfile_open (char *filename, int from_tty)
post_create_inferior (&tfile_ops, from_tty);
#if 0
- /* FIXME this will get defined in MI patch submission */
+ /* FIXME this will get defined in MI patch submission. */
tfind_1 (tfind_number, 0, 0, 0, 0);
#endif
}
@@ -3640,7 +3640,7 @@ tfile_close (int quitting)
return;
pid = ptid_get_pid (inferior_ptid);
- inferior_ptid = null_ptid; /* Avoid confusion from thread stuff */
+ inferior_ptid = null_ptid; /* Avoid confusion from thread stuff. */
exit_inferior_silent (pid);
close (trace_fd);
@@ -3652,7 +3652,7 @@ tfile_close (int quitting)
static void
tfile_files_info (struct target_ops *t)
{
- /* (it would be useful to mention the name of the file) */
+ /* (it would be useful to mention the name of the file). */
printf_filtered ("Looking at a trace file.\n");
}
@@ -3681,7 +3681,7 @@ tfile_get_traceframe_address (off_t tframe_offset)
off_t saved_offset = cur_offset;
int gotten;
- /* FIXME dig pc out of collected registers */
+ /* FIXME dig pc out of collected registers. */
/* Fall back to using tracepoint address. */
lseek (trace_fd, tframe_offset, SEEK_SET);
@@ -3695,7 +3695,7 @@ tfile_get_traceframe_address (off_t tframe_offset)
(target_gdbarch));
tp = get_tracepoint_by_number_on_target (tpnum);
- /* FIXME this is a poor heuristic if multiple locations */
+ /* FIXME this is a poor heuristic if multiple locations. */
if (tp && tp->loc)
addr = tp->loc->address;
@@ -4013,7 +4013,7 @@ tfile_xfer_partial (struct target_ops *ops, enum target_object object,
/* It's unduly pedantic to refuse to look at the executable for
read-only pieces; so do the equivalent of readonly regions aka
QTro packet. */
- /* FIXME account for relocation at some point */
+ /* FIXME account for relocation at some point. */
if (exec_bfd)
{
asection *s;
@@ -4483,7 +4483,7 @@ at the start of tracing."));
Delete one or more trace state variables.\n\
Arguments are the names of the variables to delete.\n\
If no arguments are supplied, delete all variables."), &deletelist);
- /* FIXME add a trace variable completer */
+ /* FIXME add a trace variable completer. */
add_info ("tvariables", tvariables_info, _("\
Status of trace state variables and their values.\n\
diff --git a/gdb/tracepoint.h b/gdb/tracepoint.h
index ecde64d..8174918 100644
--- a/gdb/tracepoint.h
+++ b/gdb/tracepoint.h
@@ -24,10 +24,10 @@
#include "target.h"
/* A trace state variable is a value managed by a target being
- traced. A trace state variable (or tsv for short) can be accessed
+ traced. A trace state variable (or tsv for short) can be accessed
and assigned to by tracepoint actions and conditionals, but is not
part of the program being traced, and it doesn't have to be
- collected. Effectively the variables are scratch space for
+ collected. Effectively the variables are scratch space for
tracepoints. */
struct trace_state_variable
diff --git a/gdb/trad-frame.h b/gdb/trad-frame.h
index 13e26c3..16255f3 100644
--- a/gdb/trad-frame.h
+++ b/gdb/trad-frame.h
@@ -31,7 +31,7 @@ struct trad_frame_cache;
The entire cache is populated in a single pass and then generic
routines are used to extract the various cache values. */
-struct trad_frame_cache *trad_frame_cache_zalloc (struct frame_info *this_frame);
+struct trad_frame_cache *trad_frame_cache_zalloc (struct frame_info *);
/* This frame's ID. */
void trad_frame_set_id (struct trad_frame_cache *this_trad_cache,
@@ -106,7 +106,7 @@ int trad_frame_realreg_p (struct trad_frame_saved_reg this_saved_regs[],
/* Return a freshly allocated (and initialized) trad_frame array. */
-struct trad_frame_saved_reg *trad_frame_alloc_saved_regs (struct frame_info *this_frame);
+struct trad_frame_saved_reg *trad_frame_alloc_saved_regs (struct frame_info *);
/* Given the trad_frame info, return the location of the specified
register. */
diff --git a/gdb/typeprint.c b/gdb/typeprint.c
index a1c44f2..03e6332 100644
--- a/gdb/typeprint.c
+++ b/gdb/typeprint.c
@@ -49,7 +49,7 @@ static void whatis_exp (char *, int);
/* Print a description of a type in the format of a
typedef for the current language.
- NEW is the new name for a type TYPE. */
+ NEW is the new name for a type TYPE. */
void
typedef_print (struct type *type, struct symbol *new, struct ui_file *stream)
@@ -290,13 +290,13 @@ maintenance_print_type (char *typename, int from_tty)
old_chain = make_cleanup (free_current_contents, &expr);
if (expr->elts[0].opcode == OP_TYPE)
{
- /* The user expression names a type directly, just use that type. */
+ /* The user expression names a type directly, just use that type. */
type = expr->elts[1].type;
}
else
{
/* The user expression may name a type indirectly by naming an
- object of that type. Find that indirectly named type. */
+ object of that type. Find that indirectly named type. */
val = evaluate_type (expr);
type = value_type (val);
}