* h8300-tdep.c: Comment cleanup, mostly periods and spaces.
* hppa-hpux-tdep.c: Ditto.
* hppa-linux-nat.c: Ditto.
* hppa-linux-tdep.c: Ditto.
* hppanbsd-tdep.c: Ditto.
* hppa-tdep.c: Ditto.
* hppa-tdep.h: Ditto.
* hpux-thread.c: Ditto.
* i386-cygwin-tdep.c: Ditto.
* i386-darwin-nat.c: Ditto.
* i386gnu-nat.c: Ditto.
* i386-linux-nat.c: Ditto.
* i386-linux-tdep.c: Ditto.
* i386-nat.c: Ditto.
* i386-nat.h: Ditto.
* i386nbsd-tdep.c: Ditto.
* i386-sol2-nat.c: Ditto.
* i386-stub.c: Ditto.
* i386-tdep.c: Ditto.
* i386-tdep.h: Ditto.
* i387-tdep.c: Ditto.
* ia64-linux-nat.c: Ditto.
* ia64-linux-tdep.c: Ditto.
* ia64-tdep.c: Ditto.
* infcall.c: Ditto.
* infcall.h: Ditto.
* infcmd.c: Ditto.
* inferior.c: Ditto.
* inferior.h: Ditto.
* infloop.c: Ditto.
* inflow.c: Ditto.
* infrun.c: Ditto.
* interps.c: Ditto.
* interps.h: Ditto.
* iq2000-tdep.c: Ditto.
* irix5-nat.c: Ditto.
* jit.c: Ditto.
* jit.h: Ditto.
* jv-exp.y: Ditto.
* jv-lang.c: Ditto.
* jv-lang.h: Ditto.
* jv-typeprint.c: Ditto.
* jv-valprint.c: Ditto.
* language.c: Ditto.
* language.h: Ditto.
* linespec.c: Ditto.
* linux-fork.c: Ditto.
* linux-nat.c: Ditto.
* linux-thread-db.c: Ditto.
* lm32-tdep.c: Ditto.
+2011-01-08 Michael Snyder <msnyder@vmware.com>
+
+ * h8300-tdep.c: Comment cleanup, mostly periods and spaces.
+ * hppa-hpux-tdep.c: Ditto.
+ * hppa-linux-nat.c: Ditto.
+ * hppa-linux-tdep.c: Ditto.
+ * hppanbsd-tdep.c: Ditto.
+ * hppa-tdep.c: Ditto.
+ * hppa-tdep.h: Ditto.
+ * hpux-thread.c: Ditto.
+ * i386-cygwin-tdep.c: Ditto.
+ * i386-darwin-nat.c: Ditto.
+ * i386gnu-nat.c: Ditto.
+ * i386-linux-nat.c: Ditto.
+ * i386-linux-tdep.c: Ditto.
+ * i386-nat.c: Ditto.
+ * i386-nat.h: Ditto.
+ * i386nbsd-tdep.c: Ditto.
+ * i386-sol2-nat.c: Ditto.
+ * i386-stub.c: Ditto.
+ * i386-tdep.c: Ditto.
+ * i386-tdep.h: Ditto.
+ * i387-tdep.c: Ditto.
+ * ia64-linux-nat.c: Ditto.
+ * ia64-linux-tdep.c: Ditto.
+ * ia64-tdep.c: Ditto.
+ * infcall.c: Ditto.
+ * infcall.h: Ditto.
+ * infcmd.c: Ditto.
+ * inferior.c: Ditto.
+ * inferior.h: Ditto.
+ * infloop.c: Ditto.
+ * inflow.c: Ditto.
+ * infrun.c: Ditto.
+ * interps.c: Ditto.
+ * interps.h: Ditto.
+ * iq2000-tdep.c: Ditto.
+ * irix5-nat.c: Ditto.
+ * jit.c: Ditto.
+ * jit.h: Ditto.
+ * jv-exp.y: Ditto.
+ * jv-lang.c: Ditto.
+ * jv-lang.h: Ditto.
+ * jv-typeprint.c: Ditto.
+ * jv-valprint.c: Ditto.
+ * language.c: Ditto.
+ * language.h: Ditto.
+ * linespec.c: Ditto.
+ * linux-fork.c: Ditto.
+ * linux-nat.c: Ditto.
+ * linux-thread-db.c: Ditto.
+ * lm32-tdep.c: Ditto.
+
2011-01-08 Mike Frysinger <vapier@gentoo.org>
* bfin-tdep.h (BFIN_A0_DOT_W_REGNUM): Fix typo in name.
CORE_ADDR sp_offset;
CORE_ADDR pc;
- /* Flag showing that a frame has been created in the prologue code. */
+ /* Flag showing that a frame has been created in the prologue code. */
int uses_fp;
/* Saved registers. */
#define IS_MOVW_Rn16_SP(x) (((x) & 0xfff0) == 0x6fe0)
#define IS_MOVW_EXT(x) ((x) == 0x78e0)
#define IS_MOVW_Rn24_SP(x) (((x) & 0xfff0) == 0x6ba0)
-/* Same instructions as mov.w, just prefixed with 0x0100 */
+/* Same instructions as mov.w, just prefixed with 0x0100. */
#define IS_MOVL_PRE(x) ((x) == 0x0100)
#define IS_MOVL_Rn16_SP(x) (((x) & 0xfff0) == 0x6fe0)
#define IS_MOVL_EXT(x) ((x) == 0x78e0)
h8300_use_struct_convention (struct type *value_type)
{
/* Types of 1, 2 or 4 bytes are returned in R0/R1, everything else on the
- stack. */
+ stack. */
if (TYPE_CODE (value_type) == TYPE_CODE_STRUCT
|| TYPE_CODE (value_type) == TYPE_CODE_UNION)
h8300h_use_struct_convention (struct type *value_type)
{
/* Types of 1, 2 or 4 bytes are returned in R0, INT types of 8 bytes are
- returned in R0/R1, everything else on the stack. */
+ returned in R0/R1, everything else on the stack. */
if (TYPE_CODE (value_type) == TYPE_CODE_STRUCT
|| TYPE_CODE (value_type) == TYPE_CODE_UNION)
return 1;
switch (len)
{
case 1:
- case 2: /* short... */
+ case 2: /* short... */
val = extract_unsigned_integer (valbuf, len, byte_order);
regcache_cooked_write_unsigned (regcache, E_RET0_REGNUM, val);
break;
(val >> 16) & 0xffff);
regcache_cooked_write_unsigned (regcache, E_RET1_REGNUM, val & 0xffff);
break;
- case 8: /* long long, double and long double are all defined
- as 4 byte types so far so this shouldn't happen. */
+ case 8: /* long long, double and long double
+ are all defined as 4 byte types so
+ far so this shouldn't happen. */
error ("I don't know how to return an 8 byte value.");
break;
}
h8300_register_name (struct gdbarch *gdbarch, int regno)
{
/* The register names change depending on which h8300 processor
- type is selected. */
+ type is selected. */
static char *register_names[] = {
"r0", "r1", "r2", "r3", "r4", "r5", "r6",
"sp", "", "pc", "cycles", "tick", "inst",
/*
* Miscelany
*/
- /* Stack grows up. */
+ /* Stack grows up. */
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
set_gdbarch_breakpoint_from_pc (gdbarch, h8300_breakpoint_from_pc);
}
-extern initialize_file_ftype _initialize_h8300_tdep; /* -Wmissing-prototypes */
+extern initialize_file_ftype _initialize_h8300_tdep; /* -Wmissing-prototypes */
void
_initialize_h8300_tdep (void)
/* PA64 has a completely different stub/trampoline scheme. Is it
better? Maybe. It's certainly harder to determine with any
certainty that we are in a stub because we can not refer to the
- unwinders to help.
+ unwinders to help.
The heuristic is simple. Try to lookup the current PC value in th
minimal symbol table. If that fails, then assume we are not in a
return 0;
/* We might be in a stub. Peek at the instructions. Stubs are 3
- instructions long. */
+ instructions long. */
insn = read_memory_integer (pc, 4, byte_order);
/* Find out where we think we are within the stub. */
the PLT entry for this function, not the address of the function
itself. Bit 31 has meaning too, but only for MPE. */
if (pc & 0x2)
- pc = (CORE_ADDR) read_memory_integer (pc & ~0x3, word_size, byte_order);
+ pc = (CORE_ADDR) read_memory_integer (pc & ~0x3, word_size,
+ byte_order);
}
if (pc == hppa_symbol_address("$$dyncall_external"))
{
/* If this isn't a linker stub, then return now. */
/* elz: attention here! (FIXME) because of a compiler/linker
error, some stubs which should have a non zero stub_unwind.stub_type
- have unfortunately a value of zero. So this function would return here
- as if we were not in a trampoline. To fix this, we go look at the partial
+ have unfortunately a value of zero. So this function would return here
+ as if we were not in a trampoline. To fix this, we go look at the partial
symbol information, which reports this guy as a stub.
(FIXME): Unfortunately, we are not that lucky: it turns out that the
- partial symbol information is also wrong sometimes. This is because
+ partial symbol information is also wrong sometimes. This is because
when it is entered (somread.c::som_symtab_read()) it can happen that
if the type of the symbol (from the som) is Entry, and the symbol is
- in a shared library, then it can also be a trampoline. This would
- be OK, except that I believe the way they decide if we are ina shared library
- does not work. SOOOO..., even if we have a regular function w/o trampolines
- its minimal symbol can be assigned type mst_solib_trampoline.
+ in a shared library, then it can also be a trampoline. This would be OK,
+ except that I believe the way they decide if we are ina shared library
+ does not work. SOOOO..., even if we have a regular function w/o
+ trampolines its minimal symbol can be assigned type mst_solib_trampoline.
Also, if we find that the symbol is a real stub, then we fix the unwind
descriptor, and define the stub type to be EXPORT.
- Hopefully this is correct most of the times. */
+ Hopefully this is correct most of the times. */
if (u->stub_unwind.stub_type == 0)
{
/* elz: NOTE (FIXME!) once the problem with the unwind information is fixed
- we can delete all the code which appears between the lines */
+ we can delete all the code which appears between the lines. */
/*--------------------------------------------------------------------------*/
msym = lookup_minimal_symbol_by_pc (pc);
struct minimal_symbol *msymbol;
int function_found = 0;
- /* go look if there is another minimal symbol with the same name as
- this one, but with type mst_text. This would happen if the msym
+ /* Go look if there is another minimal symbol with the same name as
+ this one, but with type mst_text. This would happen if the msym
is an actual trampoline, in which case there would be another
- symbol with the same name corresponding to the real function */
+ symbol with the same name corresponding to the real function. */
ALL_MSYMBOLS (objfile, msymbol)
{
}
if (function_found)
- /* the type of msym is correct (mst_solib_trampoline), but
- the unwind info is wrong, so set it to the correct value */
+ /* The type of msym is correct (mst_solib_trampoline), but
+ the unwind info is wrong, so set it to the correct value. */
u->stub_unwind.stub_type = EXPORT;
else
- /* the stub type info in the unwind is correct (this is not a
+ /* The stub type info in the unwind is correct (this is not a
trampoline), but the msym type information is wrong, it
- should be mst_text. So we need to fix the msym, and also
- get out of this function */
+ should be mst_text. So we need to fix the msym, and also
+ get out of this function. */
{
MSYMBOL_TYPE (msym) = mst_text;
return orig_pc == pc ? 0 : pc & ~0x3;
/* Yup. See if the previous instruction loaded
a value into %r1. If so compute and return the jump address. */
if ((prev_inst & 0xffe00000) == 0x20200000)
- return (hppa_extract_21 (prev_inst) + hppa_extract_17 (curr_inst)) & ~0x3;
+ return (hppa_extract_21 (prev_inst)
+ + hppa_extract_17 (curr_inst)) & ~0x3;
else
{
- warning (_("Unable to find ldil X,%%r1 before ble Y(%%sr4,%%r1)."));
+ warning (_("Unable to find ldil X,%%r1 "
+ "before ble Y(%%sr4,%%r1)."));
return orig_pc == pc ? 0 : pc & ~0x3;
}
}
return orig_pc == pc ? 0 : pc & ~0x3;
}
- libsym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (stubsym), NULL, NULL);
+ libsym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (stubsym),
+ NULL, NULL);
if (libsym == NULL)
{
warning (_("Unable to find library symbol for %s."),
regcache_cooked_write_unsigned (regcache, HPPA_PCOQ_HEAD_REGNUM, pcoq_tail);
regcache_cooked_write_unsigned (regcache, HPPA_PCSQ_HEAD_REGNUM, pcsq_tail);
- regcache_cooked_write_unsigned (regcache, HPPA_PCOQ_TAIL_REGNUM, pcoq_tail + 4);
+ regcache_cooked_write_unsigned (regcache,
+ HPPA_PCOQ_TAIL_REGNUM, pcoq_tail + 4);
/* We can leave the tail's space the same, since there's no jump. */
}
off = scptr;
- /* See /usr/include/machine/save_state.h for the structure of the save_state_t
- structure. */
+ /* See /usr/include/machine/save_state.h for the structure of the
+ save_state_t structure. */
flag = read_memory_unsigned_integer (scptr + HPPA_HPUX_SS_FLAGS_OFFSET,
4, byte_order);
if (!(flag & HPPA_HPUX_SS_WIDEREGS))
{
- /* Narrow registers. */
+ /* Narrow registers. */
off = scptr + HPPA_HPUX_SS_NARROW_OFFSET;
incr = 4;
szoff = 0;
}
else
{
- /* Wide registers. */
+ /* Wide registers. */
off = scptr + HPPA_HPUX_SS_WIDE_OFFSET + 8;
incr = 8;
szoff = (tdep->bytes_per_address == 4 ? 4 : 0);
struct hppa_hpux_sigtramp_unwind_cache *info
= hppa_hpux_sigtramp_frame_unwind_cache (this_frame, this_prologue_cache);
- return hppa_frame_prev_register_helper (this_frame, info->saved_regs, regnum);
+ return hppa_frame_prev_register_helper (this_frame,
+ info->saved_regs, regnum);
}
static int
if (sec)
{
/* First try the lowest address in the section; we can use it as long
- as it is "regular" code (i.e. not a stub) */
+ as it is "regular" code (i.e. not a stub). */
u = find_unwind_entry (obj_section_addr (sec));
if (!u || u->stub_unwind.stub_type == 0)
return obj_section_addr (sec);
- point the sequence at the trampoline
- set the return address of the trampoline to the current space
(see hppa_hpux_find_dummy_call_bpaddr)
- - set the continuing address of the "dummy code" as the sequence.
-
-*/
+ - set the continuing address of the "dummy code" as the sequence. */
if (IS_32BIT_TARGET (gdbarch))
{
/* Given the current value of the pc, check to see if it is inside a stub, and
if so, change the value of the pc to point to the caller of the stub.
THIS_FRAME is the current frame in the current list of frames.
- BASE contains to stack frame base of the current frame.
- SAVE_REGS is the register file stored in the frame cache. */
+ BASE contains to stack frame base of the current frame.
+ SAVE_REGS is the register file stored in the frame cache. */
static void
hppa_hpux_unwind_adjust_stub (struct frame_info *this_frame, CORE_ADDR base,
struct trad_frame_saved_reg *saved_regs)
#include "hppa-tdep.h"
-/* Prototypes for supply_gregset etc. */
+/* Prototypes for supply_gregset etc. */
#include "gregset.h"
/* These must match the order of the register names.
regcache_raw_supply (regcache, regno, &val);
}
-/* Store one register. */
+/* Store one register. */
static void
store_register (const struct regcache *regcache, int regno)
/* Given a pointer to a floating point register set in /proc format
(fpregset_t *), unpack the register contents and supply them as gdb's
- idea of the current floating point register values. */
+ idea of the current floating point register values. */
void
supply_fpregset (struct regcache *regcache, const gdb_fpregset_t *fpregsetp)
/* Given a pointer to a floating point register set in /proc format
(fpregset_t *), update the register specified by REGNO from gdb's idea
of the current floating point register set. If REGNO is -1, update
- them all. */
+ them all. */
void
fill_fpregset (const struct regcache *regcache,
{
/* Probably this should be done by the kernel, but it isn't. */
regcache_cooked_write_unsigned (regcache, HPPA_PCOQ_HEAD_REGNUM, v | 0x3);
- regcache_cooked_write_unsigned (regcache, HPPA_PCOQ_TAIL_REGNUM, (v + 4) | 0x3);
+ regcache_cooked_write_unsigned (regcache,
+ HPPA_PCOQ_TAIL_REGNUM, (v + 4) | 0x3);
}
/* An instruction to match. */
if (insns_match_pattern (gdbarch, pc, hppa_sigtramp, dummy))
{
/* sigaltstack case: we have no way of knowing which offset to
- use in this case; default to new kernel handling. If this is
+ use in this case; default to new kernel handling. If this is
wrong the unwinding will fail. */
try = 2;
sp = pc - pcoffs[try];
/* sp + sfoffs[try] points to a struct rt_sigframe, which contains
a struct siginfo and a struct ucontext. struct ucontext contains
- a struct sigcontext. Return an offset to this sigcontext here. Too
- bad we cannot include system specific headers :-(.
+ a struct sigcontext. Return an offset to this sigcontext here. Too
+ bad we cannot include system specific headers :-(.
sizeof(struct siginfo) == 128
offsetof(struct ucontext, uc_mcontext) == 24. */
return sp + sfoffs[try] + 128 + 24;
scptr += 4;
}
- /* IASQ/IAOQ. */
+ /* IASQ/IAOQ. */
info->saved_regs[HPPA_PCSQ_HEAD_REGNUM].addr = scptr;
scptr += 4;
info->saved_regs[HPPA_PCSQ_TAIL_REGNUM].addr = scptr;
d_un.d_ptr value is the global pointer. */
static CORE_ADDR
-hppa_linux_find_global_pointer (struct gdbarch *gdbarch, struct value *function)
+hppa_linux_find_global_pointer (struct gdbarch *gdbarch,
+ struct value *function)
{
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
struct obj_section *faddr_sect;
break;
global_pointer = extract_unsigned_integer (buf, sizeof (buf),
byte_order);
- /* The payoff... */
+ /* The payoff... */
return global_pointer;
}
void
_initialize_hppa_linux_tdep (void)
{
- gdbarch_register_osabi (bfd_arch_hppa, 0, GDB_OSABI_LINUX, hppa_linux_init_abi);
- gdbarch_register_osabi (bfd_arch_hppa, bfd_mach_hppa20w, GDB_OSABI_LINUX, hppa_linux_init_abi);
+ gdbarch_register_osabi (bfd_arch_hppa, 0, GDB_OSABI_LINUX,
+ hppa_linux_init_abi);
+ gdbarch_register_osabi (bfd_arch_hppa, bfd_mach_hppa20w,
+ GDB_OSABI_LINUX, hppa_linux_init_abi);
}
#include "osabi.h"
#include "gdb_assert.h"
#include "arch-utils.h"
-/* For argument passing to the inferior */
+/* For argument passing to the inferior. */
#include "symtab.h"
#include "dis-asm.h"
#include "trad-frame.h"
by hppa-hpux-tdep.c and shared with pa64solib.c and somsolib.c. */
const struct objfile_data *hppa_objfile_priv_data = NULL;
-/* Get at various relevent fields of an instruction word. */
+/* Get at various relevent fields of an instruction word. */
#define MASK_5 0x1f
#define MASK_11 0x7ff
#define MASK_14 0x3fff
#define STUB_UNWIND_ENTRY_SIZE 8
/* Routines to extract various sized constants out of hppa
- instructions. */
+ instructions. */
/* This assumes that no garbage lies outside of the lower bits of
- value. */
+ value. */
static int
hppa_sign_extend (unsigned val, unsigned bits)
return (int) (val >> (bits - 1) ? (-1 << bits) | val : val);
}
-/* For many immediate values the sign bit is the low bit! */
+/* For many immediate values the sign bit is the low bit! */
static int
hppa_low_hppa_sign_extend (unsigned val, unsigned bits)
}
/* Extract the bits at positions between FROM and TO, using HP's numbering
- (MSB = 0). */
+ (MSB = 0). */
int
hppa_get_field (unsigned word, int from, int to)
return ((word) >> (31 - (to)) & ((1 << ((to) - (from) + 1)) - 1));
}
-/* extract the immediate field from a ld{bhw}s instruction */
+/* Extract the immediate field from a ld{bhw}s instruction. */
int
hppa_extract_5_load (unsigned word)
return hppa_low_hppa_sign_extend (word >> 16 & MASK_5, 5);
}
-/* extract the immediate field from a break instruction */
+/* Extract the immediate field from a break instruction. */
unsigned
hppa_extract_5r_store (unsigned word)
return (word & MASK_5);
}
-/* extract the immediate field from a {sr}sm instruction */
+/* Extract the immediate field from a {sr}sm instruction. */
unsigned
hppa_extract_5R_store (unsigned word)
return (word >> 16 & MASK_5);
}
-/* extract a 14 bit immediate field */
+/* Extract a 14 bit immediate field. */
int
hppa_extract_14 (unsigned word)
return hppa_low_hppa_sign_extend (word & MASK_14, 14);
}
-/* extract a 21 bit constant */
+/* Extract a 21 bit constant. */
int
hppa_extract_21 (unsigned word)
}
/* extract a 17 bit constant from branch instructions, returning the
- 19 bit signed value. */
+ 19 bit signed value. */
int
hppa_extract_17 (unsigned word)
static void
internalize_unwinds (struct objfile *objfile, struct unwind_table_entry *table,
- asection *section, unsigned int entries, unsigned int size,
- CORE_ADDR text_offset)
+ asection *section, unsigned int entries,
+ unsigned int size, CORE_ADDR text_offset)
{
/* We will read the unwind entries into temporary memory, then
fill in the actual unwind table. */
CORE_ADDR low_text_segment_address;
/* For ELF targets, then unwinds are supposed to
- be segment relative offsets instead of absolute addresses.
+ be segment relative offsets instead of absolute addresses.
Note that when loading a shared library (text_offset != 0) the
unwinds are already relative to the text_offset that will be
table[i].reserved2 = (tmp >> 27) & 0x1;
table[i].Total_frame_size = tmp & 0x7ffffff;
- /* Stub unwinds are handled elsewhere. */
+ /* Stub unwinds are handled elsewhere. */
table[i].stub_unwind.stub_type = 0;
table[i].stub_unwind.padding = 0;
}
/* For reasons unknown the HP PA64 tools generate multiple unwinder
sections in a single executable. So we just iterate over every
section in the BFD looking for unwinder sections intead of trying
- to do a lookup with bfd_get_section_by_name.
+ to do a lookup with bfd_get_section_by_name.
First determine the total size of the unwind tables so that we
can allocate memory in a nice big hunk. */
/* Clear out the next unwind entry. */
memset (&ui->table[index], 0, sizeof (struct unwind_table_entry));
- /* Convert offset & size into region_start and region_end.
+ /* Convert offset & size into region_start and region_end.
Stuff away the stub type into "reserved" fields. */
ui->table[index].region_start = bfd_get_32 (objfile->obfd,
(bfd_byte *) buf);
fprintf_unfiltered (gdb_stdlog, "{ find_unwind_entry %s -> ",
hex_string (pc));
- /* A function at address 0? Not in HP-UX! */
+ /* A function at address 0? Not in HP-UX! */
if (pc == (CORE_ADDR) 0)
{
if (hppa_debug)
ui = ((struct hppa_objfile_private *) priv)->unwind_info;
}
- /* First, check the cache */
+ /* First, check the cache. */
if (ui->cache
&& pc >= ui->cache->region_start
return ui->cache;
}
- /* Not in the cache, do a binary search */
+ /* Not in the cache, do a binary search. */
first = 0;
last = ui->last;
}
/* The epilogue is defined here as the area either on the `bv' instruction
- itself or an instruction which destroys the function's stack frame.
+ itself or an instruction which destroys the function's stack frame.
We do not assume that the epilogue is at the end of a function as we can
also have return sequences in the middle of a function. */
for (write_pass = 0; write_pass < 2; write_pass++)
{
CORE_ADDR struct_ptr = 0;
- /* The first parameter goes into sp-36, each stack slot is 4-bytes.
+ /* The first parameter goes into sp-36, each stack slot is 4-bytes.
struct_ptr is adjusted for each argument below, so the first
argument will end up at sp-36. */
CORE_ADDR param_ptr = 32;
}
/* If a structure has to be returned, set up register 28 to hold its
- address */
+ address. */
if (struct_return)
regcache_cooked_write_unsigned (regcache, 28, struct_addr);
{
/* "Aggregates larger than 8 bytes are aligned on a
16-byte boundary, possibly leaving an unused argument
- slot, which is filled with garbage. If necessary,
+ slot, which is filled with garbage. If necessary,
they are padded on the right (with garbage), to a
multiple of 8 bytes." */
offset = align_up (offset, 16);
}
/* For the given instruction (INST), return any adjustment it makes
- to the stack pointer or zero for no adjustment.
+ to the stack pointer or zero for no adjustment.
This only handles instructions commonly found in prologues. */
&& ((inst >> 6) & 0xf) == 0xb))
return hppa_extract_5R_store (inst);
- /* Does it look like a stwm? GCC & HPC may use this in prologues. */
+ /* Does it look like a stwm? GCC & HPC may use this in prologues. */
if ((inst >> 26) == 0x1b)
return hppa_extract_5R_store (inst);
static int
inst_saves_fr (unsigned long inst)
{
- /* is this an FSTD ? */
+ /* Is this an FSTD? */
if ((inst & 0xfc00dfc0) == 0x2c001200)
return hppa_extract_5r_store (inst);
if ((inst & 0xfc000002) == 0x70000002)
return hppa_extract_5R_store (inst);
- /* is this an FSTW ? */
+ /* Is this an FSTW? */
if ((inst & 0xfc00df80) == 0x24001200)
return hppa_extract_5r_store (inst);
if ((inst & 0xfc000002) == 0x7c000000)
}
/* Advance PC across any function entry prologue instructions
- to reach some "real" code.
+ to reach some "real" code.
Use information in the unwind table to determine what exactly should
be in the prologue. */
if (!u)
return pc;
- /* If we are not at the beginning of a function, then return now. */
+ /* If we are not at the beginning of a function, then return now. */
if ((pc & ~0x3) != u->region_start)
return pc;
is within the function bounds. In that case we return the end of the
source line. Second is the end of the source line extends beyond the
bounds of the current function. We need to use the slow code to
- examine instructions in that case.
+ examine instructions in that case.
Anything else is simply a bug elsewhere. Fixing it here is absolutely
the wrong thing to do. In fact, it should be entirely possible for this
/* To skip prologues, I use this predicate. Returns either PC itself
if the code at PC does not look like a function prologue; otherwise
- returns an address that (if we're lucky) follows the prologue.
+ returns an address that (if we're lucky) follows the prologue.
hppa_skip_prologue is called by gdb to place a breakpoint in a function.
- It doesn't necessarily skips all the insns in the prologue. In fact
+ It doesn't necessarily skips all the insns in the prologue. In fact
we might not want to skip all the insns because a prologue insn may
appear in the delay slot of the first branch, and we don't want to
skip over the branch in that case. */
skip_prologue_using_sal, in case we stepped into a function without
symbol information. hppa_skip_prologue also bounds the returned
pc by the passed in pc, so it will not return a pc in the next
- function.
+ function.
We used to call hppa_skip_prologue to find the end of the prologue,
but if some non-prologue instructions get scheduled into the prologue,
/* We used to use get_frame_func to locate the beginning of the
function to pass to skip_prologue. However, when objects are
compiled without debug symbols, get_frame_func can return the wrong
- function (or 0). We can do better than that by using unwind records.
+ function (or 0). We can do better than that by using unwind records.
This only works if the Region_description of the unwind record
- indicates that it includes the entry point of the function.
+ indicates that it includes the entry point of the function.
HP compilers sometimes generate unwind records for regions that
do not include the entry or exit point of a function. GNU tools
do not do this. */
CORE_ADDR offset;
if ((inst >> 26) == 0x1c)
- offset = (inst & 0x1 ? -1 << 13 : 0) | (((inst >> 4) & 0x3ff) << 3);
+ offset = (inst & 0x1 ? -1 << 13 : 0)
+ | (((inst >> 4) & 0x3ff) << 3);
else if ((inst >> 26) == 0x03)
offset = hppa_low_hppa_sign_extend (inst & 0x1f, 5);
else
if (u->Save_SP)
cache->saved_regs[reg].addr = offset;
else
- cache->saved_regs[reg].addr = (u->Total_frame_size << 3) + offset;
+ cache->saved_regs[reg].addr
+ = (u->Total_frame_size << 3) + offset;
}
}
}
}
- /* Quit if we hit any kind of branch the previous iteration. */
+ /* Quit if we hit any kind of branch the previous iteration. */
if (final_iteration)
break;
/* We want to look precisely one instruction beyond the branch
{
struct hppa_frame_cache *info = hppa_frame_cache (this_frame, this_cache);
- return hppa_frame_prev_register_helper (this_frame, info->saved_regs, regnum);
+ return hppa_frame_prev_register_helper (this_frame,
+ info->saved_regs, regnum);
}
static int
hppa_fallback_frame_prev_register (struct frame_info *this_frame,
void **this_cache, int regnum)
{
- struct hppa_frame_cache *info =
- hppa_fallback_frame_cache (this_frame, this_cache);
+ struct hppa_frame_cache *info
+ = hppa_fallback_frame_cache (this_frame, this_cache);
- return hppa_frame_prev_register_helper (this_frame, info->saved_regs, regnum);
+ return hppa_frame_prev_register_helper (this_frame,
+ info->saved_regs, regnum);
}
static const struct frame_unwind hppa_fallback_frame_unwind =
if (info == NULL)
error (_("Requesting registers from null frame."));
- return hppa_frame_prev_register_helper (this_frame, info->saved_regs, regnum);
+ return hppa_frame_prev_register_helper (this_frame,
+ info->saved_regs, regnum);
}
static int
_("Print unwind table entry at given address."),
&maintenanceprintlist);
- /* Debug this files internals. */
+ /* Debug this files internals. */
add_setshow_boolean_cmd ("hppa", class_maintenance, &hppa_debug, _("\
Set whether hppa target specific debugging information should be displayed."),
_("\
HPPA_CCR_REGNUM = 54, /* Coprocessor Configuration Register */
HPPA_TR0_REGNUM = 57, /* Temporary Registers (cr24 -> cr31) */
HPPA_CR26_REGNUM = 59,
- HPPA_CR27_REGNUM = 60, /* Base register for thread-local storage, cr27 */
+ HPPA_CR27_REGNUM = 60, /* Base register for thread-local
+ storage, cr27 */
HPPA_FP0_REGNUM = 64, /* First floating-point. */
HPPA_FP4_REGNUM = 72,
HPPA64_FP4_REGNUM = 68,
HPPA_FP31R_REGNUM = 127, /* Last floating-point. */
- HPPA_ARG0_REGNUM = 26, /* The first argument of a callee. */
- HPPA_ARG1_REGNUM = 25, /* The second argument of a callee. */
- HPPA_ARG2_REGNUM = 24, /* The third argument of a callee. */
- HPPA_ARG3_REGNUM = 23 /* The fourth argument of a callee. */
+ HPPA_ARG0_REGNUM = 26, /* The first argument of a callee. */
+ HPPA_ARG1_REGNUM = 25, /* The second argument of a callee. */
+ HPPA_ARG2_REGNUM = 24, /* The third argument of a callee. */
+ HPPA_ARG3_REGNUM = 23 /* The fourth argument of a callee. */
};
/* Instruction size. */
/* This is *NOT* part of an actual unwind_descriptor in an object
file. It is *ONLY* part of the "internalized" descriptors that
- we create from those in a file.
- */
+ we create from those in a file. */
+
struct
{
unsigned int stub_type:4; /* 0..3 */
{
struct unwind_table_entry *table; /* Pointer to unwind info */
struct unwind_table_entry *cache; /* Pointer to last entry we found */
- int last; /* Index of last entry */
+ int last; /* Index of last entry */
};
struct hppa_objfile_private
{
struct hppa_unwind_info *unwind_info; /* a pointer */
- struct so_list *so_info; /* a pointer */
+ struct so_list *so_info; /* a pointer */
CORE_ADDR dp;
int dummy_call_sequence_reg;
REGCACHE. If REGNUM is -1, do this for all registers in REGSET. */
static void
-hppanbsd_supply_gregset (const struct regset *regset, struct regcache *regcache,
- int regnum, const void *gregs, size_t len)
+hppanbsd_supply_gregset (const struct regset *regset,
+ struct regcache *regcache,
+ int regnum, const void *gregs, size_t len)
{
const gdb_byte *regs = gregs;
size_t offset;
provide access to the HPUX user-mode thread implementation.
HPUX threads are true user-mode threads, which are invoked via the cma_*
- and pthread_* (DCE and Posix respectivly) interfaces. These are mostly
+ and pthread_* (DCE and Posix respectively) interfaces. These are mostly
implemented in user-space, with all thread context kept in various
structures that live in the user's heap. For the most part, the kernel has
- no knowlege of these threads.
-
- */
+ no knowlege of these threads. */
#include "defs.h"
tcb_ptr = cma__base (queue_ptr, threads, cma__t_int_tcb);
- read_memory ((CORE_ADDR) tcb_ptr, (char *) &cached_tcb, sizeof cached_tcb);
+ read_memory ((CORE_ADDR) tcb_ptr, (char *) &cached_tcb,
+ sizeof cached_tcb);
if (cached_tcb.header.type == cma__c_obj_tcb)
if (cma_thread_get_unique (&cached_tcb.prolog.client_thread) == thread)
{
deprecated_child_ops.to_attach (&deprecated_child_ops, args, from_tty);
- /* XXX - might want to iterate over all the threads and register them. */
+ /* XXX - might want to iterate over all the threads and register them. */
}
/* Take a program previously attached to and detaches it.
to a LWP id, and vice versa on the way out. */
static ptid_t
-hpux_thread_wait (struct target_ops *ops,
- ptid_t ptid, struct target_waitstatus *ourstatus, int options)
+hpux_thread_wait (struct target_ops *ops, ptid_t ptid,
+ struct target_waitstatus *ourstatus, int options)
{
ptid_t rtnval;
struct cleanup *old_chain;
sp = (CORE_ADDR) tcb_ptr->static_ctx.sp - 160;
if (regno == HPPA_FLAGS_REGNUM)
- /* Flags must be 0 to avoid bogus value for SS_INSYSCALL */
+ /* Flags must be 0 to avoid bogus value for SS_INSYSCALL. */
memset (buf, '\000', register_size (gdbarch, regno));
else if (regno == HPPA_SP_REGNUM)
store_unsigned_integer (buf, sizeof sp, byte_order, sp);
if (regno == HPPA_FLAGS_REGNUM)
{
- /* Let lower layer handle this... */
+ /* Let lower layer handle this... */
deprecated_child_ops.to_store_registers
(&deprecated_child_ops, regcache, regno);
}
inferior_ptid = main_ptid;
retval =
- deprecated_child_ops.deprecated_xfer_memory (memaddr, myaddr, len, dowrite, attribs, target);
+ deprecated_child_ops.deprecated_xfer_memory (memaddr, myaddr, len,
+ dowrite, attribs, target);
do_cleanups (old_chain);
deprecated_child_ops.to_mourn_inferior (&deprecated_child_ops);
}
-/* Mark our target-struct as eligible for stray "run" and "attach" commands. */
+/* Mark our target-struct as eligible for stray "run" and "attach"
+ commands. */
static int
hpux_thread_can_run (void)
deprecated_child_ops.to_stop (ptid);
}
\f
-/* Convert a pid to printable form. */
+/* Convert a pid to printable form. */
char *
hpux_pid_to_str (ptid_t ptid)
char *target_name = bfd_get_target (abfd);
/* Interix also uses pei-i386.
- We need a way to distinguish between the two. */
+ We need a way to distinguish between the two. */
if (strcmp (target_name, "pei-i386") == 0)
return GDB_OSABI_CYGWIN;
&gp_count);
if (ret != KERN_SUCCESS)
{
- printf_unfiltered (_("Error calling thread_get_state for GP registers for thread 0x%ulx"), current_thread);
+ printf_unfiltered (_("Error calling thread_get_state for "
+ "GP registers for thread 0x%ulx"),
+ current_thread);
MACH_CHECK_ERROR (ret);
}
amd64_supply_native_gregset (regcache, &gp_regs.uts, -1);
&fp_count);
if (ret != KERN_SUCCESS)
{
- printf_unfiltered (_("Error calling thread_get_state for float registers for thread 0x%ulx"), current_thread);
+ printf_unfiltered (_("Error calling thread_get_state for "
+ "float registers for thread 0x%ulx"),
+ current_thread);
MACH_CHECK_ERROR (ret);
}
amd64_supply_fxsave (regcache, -1, &fp_regs.ufs.fs64.__fpu_fcw);
&gp_count);
if (ret != KERN_SUCCESS)
{
- printf_unfiltered (_("Error calling thread_get_state for GP registers for thread 0x%ulx"), current_thread);
+ printf_unfiltered (_("Error calling thread_get_state for "
+ "GP registers for thread 0x%ulx"),
+ current_thread);
MACH_CHECK_ERROR (ret);
}
for (i = 0; i < I386_NUM_GREGS; i++)
&fp_count);
if (ret != KERN_SUCCESS)
{
- printf_unfiltered (_("Error calling thread_get_state for float registers for thread 0x%ulx"), current_thread);
+ printf_unfiltered (_("Error calling thread_get_state for "
+ "float registers for thread 0x%ulx"),
+ current_thread);
MACH_CHECK_ERROR (ret);
}
i387_supply_fxsave (regcache, -1, &fp_regs.__fpu_fcw);
if (ret != KERN_SUCCESS)
{
- printf_unfiltered (_("Error reading debug registers thread 0x%x via thread_get_state\n"), (int) current_thread);
+ printf_unfiltered (_("Error reading debug registers "
+ "thread 0x%x via thread_get_state\n"),
+ (int) current_thread);
MACH_CHECK_ERROR (ret);
}
if (ret != KERN_SUCCESS)
{
- printf_unfiltered (_("Error writing debug registers thread 0x%x via thread_get_state\n"), (int) current_thread);
+ printf_unfiltered (_("Error writing debug registers "
+ "thread 0x%x via thread_get_state\n"),
+ (int) current_thread);
MACH_CHECK_ERROR (ret);
}
}
if (ret != KERN_SUCCESS)
{
- printf_unfiltered (_("Error reading debug registers thread 0x%x via thread_get_state\n"), (int) current_thread);
+ printf_unfiltered (_("Error reading debug registers "
+ "thread 0x%x via thread_get_state\n"),
+ (int) current_thread);
MACH_CHECK_ERROR (ret);
}
return;
if ((regs.uts.ts32.__eflags & X86_EFLAGS_T) == bit)
return;
- regs.uts.ts32.__eflags = (regs.uts.ts32.__eflags & ~X86_EFLAGS_T) | bit;
+ regs.uts.ts32.__eflags
+ = (regs.uts.ts32.__eflags & ~X86_EFLAGS_T) | bit;
kret = thread_set_state (thread, x86_THREAD_STATE,
(thread_state_t) ®s, count);
MACH_CHECK_ERROR (kret);
return;
if ((regs.uts.ts64.__rflags & X86_EFLAGS_T) == bit)
return;
- regs.uts.ts64.__rflags = (regs.uts.ts64.__rflags & ~X86_EFLAGS_T) | bit;
+ regs.uts.ts64.__rflags
+ = (regs.uts.ts64.__rflags & ~X86_EFLAGS_T) | bit;
kret = thread_set_state (thread, x86_THREAD_STATE,
(thread_state_t) ®s, count);
MACH_CHECK_ERROR (kret);
regcache_raw_supply (regcache, regno, &val);
}
-/* Store one register. */
+/* Store one register. */
static void
store_register (const struct regcache *regcache, int regno)
if (I386_LINUX_ORIG_EAX_REGNUM
< gdbarch_num_regs (get_regcache_arch (regcache)))
- regcache_raw_supply (regcache, I386_LINUX_ORIG_EAX_REGNUM,
- regp + i386_linux_gregset_reg_offset[I386_LINUX_ORIG_EAX_REGNUM]);
+ regcache_raw_supply (regcache, I386_LINUX_ORIG_EAX_REGNUM, regp
+ + i386_linux_gregset_reg_offset[I386_LINUX_ORIG_EAX_REGNUM]);
}
/* Fill register REGNO (if it is a general-purpose register) in
if ((regno == -1 || regno == I386_LINUX_ORIG_EAX_REGNUM)
&& I386_LINUX_ORIG_EAX_REGNUM
< gdbarch_num_regs (get_regcache_arch (regcache)))
- regcache_raw_collect (regcache, I386_LINUX_ORIG_EAX_REGNUM,
- regp + i386_linux_gregset_reg_offset[I386_LINUX_ORIG_EAX_REGNUM]);
+ regcache_raw_collect (regcache, I386_LINUX_ORIG_EAX_REGNUM, regp
+ + i386_linux_gregset_reg_offset[I386_LINUX_ORIG_EAX_REGNUM]);
}
#ifdef HAVE_PTRACE_GETREGS
#else
-static void fetch_fpregs (struct regcache *regcache, int tid) {}
-static void store_fpregs (const struct regcache *regcache, int tid, int regno) {}
+static void
+fetch_fpregs (struct regcache *regcache, int tid)
+{
+}
+
+static void
+store_fpregs (const struct regcache *regcache, int tid, int regno)
+{
+}
#endif
\f
#else
-static int fetch_fpxregs (struct regcache *regcache, int tid) { return 0; }
-static int store_fpxregs (const struct regcache *regcache, int tid, int regno) { return 0; }
+static int
+fetch_fpxregs (struct regcache *regcache, int tid)
+{
+ return 0;
+}
+
+static int
+store_fpxregs (const struct regcache *regcache, int tid, int regno)
+{
+ return 0;
+}
#endif /* HAVE_PTRACE_GETFPXREGS */
\f
I386_LINUX_XSAVE_XCR0_OFFSET,
8))
{
- warning (_("Couldn't read `xcr0' bytes from `.reg-xstate' section in core file."));
+ warning (_("Couldn't read `xcr0' bytes from "
+ "`.reg-xstate' section in core file."));
return 0;
}
tdep->i386_sysenter_record = i386_linux_intx80_sysenter_record;
/* N_FUN symbols in shared libaries have 0 for their values and need
- to be relocated. */
+ to be relocated. */
set_gdbarch_sofun_address_maybe_missing (gdbarch, 1);
/* GNU/Linux uses SVR4-style shared libraries. */
gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_LINUX,
i386_linux_init_abi);
- /* Initialize the Linux target description */
+ /* Initialize the Linux target description. */
initialize_tdesc_i386_linux ();
initialize_tdesc_i386_mmx_linux ();
initialize_tdesc_i386_avx_linux ();
/* Debug registers' indices. */
#define DR_NADDR 4 /* The number of debug address registers. */
#define DR_STATUS 6 /* Index of debug status register (DR6). */
-#define DR_CONTROL 7 /* Index of debug control register (DR7). */
+#define DR_CONTROL 7 /* Index of debug control register (DR7). */
/* DR7 Debug Control register fields. */
break;
case hw_read:
internal_error (__FILE__, __LINE__,
- _("The i386 doesn't support data-read watchpoints.\n"));
+ _("The i386 doesn't support "
+ "data-read watchpoints.\n"));
case hw_access:
rw = DR_RW_READ;
break;
&& dr_mirror[i] == addr
&& I386_DR_GET_RW_LEN (i) == len_rw_bits)
{
- if (--dr_ref_count[i] == 0) /* no longer in use? */
+ if (--dr_ref_count[i] == 0) /* no longer in use? */
{
/* Reset our mirror. */
dr_mirror[i] = 0;
}
/* If the inferior has some watchpoint that triggered, set the
- address associated with that watchpoint and return non-zero.
+ address associated with that watchpoint and return non-zero.
Otherwise, return zero. */
static int
whether a given region can be watched, etc.
In addition, each target should provide several low-level functions
- regrouped into i386_dr_low_type struct below. These functions
+ regrouped into i386_dr_low_type struct below. These functions
that will be called to insert watchpoints and hardware breakpoints
into the inferior, remove them, and check their status. These
functions are:
8 * 8, /* %rdi */
10 * 8, /* %rbp */
20 * 8, /* %rsp */
- 7 * 8, /* %r8 ... */
+ 7 * 8, /* %r8 ... */
6 * 8,
5 * 8,
4 * 8,
/* Fill in the generic procfs methods. */
t = procfs_target ();
-#ifdef NEW_PROC_API /* Solaris 6 and above can do HW watchpoints */
+#ifdef NEW_PROC_API /* Solaris 6 and above can do HW watchpoints. */
procfs_use_watchpoints (t);
#endif
int count;
char ch;
- /* $<packet info>#<checksum>. */
+ /* $<packet info>#<checksum>. */
do
{
putDebugChar ('$');
/* This function will generate a breakpoint exception. It is used at the
beginning of a program to sync up with a debugger and can be used
otherwise as a quick means to stop program execution and "break" into
- the debugger. */
+ the debugger. */
void
breakpoint (void)
static int
i386_absolute_jmp_p (const gdb_byte *insn)
{
- /* jmp far (absolute address in operand) */
+ /* jmp far (absolute address in operand). */
if (insn[0] == 0xea)
return 1;
if (insn[0] == 0xff)
{
- /* jump near, absolute indirect (/4) */
+ /* jump near, absolute indirect (/4). */
if ((insn[1] & 0x38) == 0x20)
return 1;
- /* jump far, absolute indirect (/5) */
+ /* jump far, absolute indirect (/5). */
if ((insn[1] & 0x38) == 0x28)
return 1;
}
static int
i386_absolute_call_p (const gdb_byte *insn)
{
- /* call far, absolute */
+ /* call far, absolute. */
if (insn[0] == 0x9a)
return 1;
if (insn[0] == 0xff)
{
- /* Call near, absolute indirect (/2) */
+ /* Call near, absolute indirect (/2). */
if ((insn[1] & 0x38) == 0x10)
return 1;
- /* Call far, absolute indirect (/3) */
+ /* Call far, absolute indirect (/3). */
if ((insn[1] & 0x38) == 0x18)
return 1;
}
{
switch (insn[0])
{
- case 0xc2: /* ret near, pop N bytes */
+ case 0xc2: /* ret near, pop N bytes. */
case 0xc3: /* ret near */
- case 0xca: /* ret far, pop N bytes */
+ case 0xca: /* ret far, pop N bytes. */
case 0xcb: /* ret far */
case 0xcf: /* iret */
return 1;
if (i386_absolute_call_p (insn))
return 1;
- /* call near, relative */
+ /* call near, relative. */
if (insn[0] == 0xe8)
return 1;
/* Where "ret" in the original code will return to. */
ret_addr = oldloc + insn_length;
- push_buf[0] = 0x68; /* pushq $... */
+ push_buf[0] = 0x68; /* pushq $... */
memcpy (&push_buf[1], &ret_addr, 4);
/* Push the push. */
append_insns (to, 5, push_buf);
struct i386_insn i386_frame_setup_skip_insns[] =
{
- /* Check for `movb imm8, r' and `movl imm32, r'.
+ /* Check for `movb imm8, r' and `movl imm32, r'.
??? Should we handle 16-bit operand-sizes here? */
}
else
internal_error (__FILE__, __LINE__,
- _("Cannot extract return value of %d bytes long."), len);
+ _("Cannot extract return value of %d bytes long."),
+ len);
}
}
}
/* Return the GDB type object for the "standard" data type of data in
- register REGNUM. */
+ register REGNUM. */
static struct type *
i386_pseudo_register_type (struct gdbarch *gdbarch, int regnum)
{
regnum -= tdep->ymm0_regnum;
- /* Extract (always little endian). Read lower 128bits. */
+ /* Extract (always little endian). Read lower 128bits. */
regcache_raw_read (regcache,
I387_XMM0_REGNUM (tdep) + regnum,
raw_buf);
needs any special handling. */
static int
-i386_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type)
+i386_convert_register_p (struct gdbarch *gdbarch,
+ int regnum, struct type *type)
{
int len = TYPE_LENGTH (type);
};
/* Parse "modrm" part in current memory address that irp->addr point to
- Return -1 if something wrong. */
+ Return -1 if something wrong. */
static int
i386_record_modrm (struct i386_record_s *irp)
/* Get the memory address that current instruction write to and set it to
the argument "addr".
- Return -1 if something wrong. */
+ Return -1 if something wrong. */
static int
i386_record_lea_modrm_addr (struct i386_record_s *irp, uint64_t *addr)
/* Record the value of the memory that willbe changed in current instruction
to "record_arch_list".
- Return -1 if something wrong. */
+ Return -1 if something wrong. */
static int
i386_record_lea_modrm (struct i386_record_s *irp)
}
/* Record the push operation to "record_arch_list".
- Return -1 if something wrong. */
+ Return -1 if something wrong. */
static int
i386_record_push (struct i386_record_s *irp, int size)
#define I386_SAVE_FPU_ENV 0xfffe
#define I386_SAVE_FPU_ENV_REG_STACK 0xffff
-/* Record the value of floating point registers which will be changed by the
- current instruction to "record_arch_list". Return -1 if something is wrong.
-*/
+/* Record the value of floating point registers which will be changed
+ by the current instruction to "record_arch_list". Return -1 if
+ something is wrong. */
static int i386_record_floats (struct gdbarch *gdbarch,
struct i386_record_s *ir,
/* Parse the current instruction and record the values of the registers and
memory that will be changed in current instruction to "record_arch_list".
- Return -1 if something wrong. */
+ Return -1 if something wrong. */
#define I386_RECORD_ARCH_LIST_ADD_REG(regnum) \
record_arch_list_add_reg (ir.regcache, ir.regmap[(regnum)])
else if (ir.regmap[X86_RECORD_R8_REGNUM])
ir.aflag = 2;
- /* now check op code */
+ /* Now check op code. */
opcode = (uint32_t) opcode8;
reswitch:
switch (opcode)
ir.reg |= ((opcode & 7) << 3);
if (ir.mod != 3)
{
- /* Memory. */
+ /* Memory. */
uint64_t addr64;
if (i386_record_lea_modrm_addr (&ir, &addr64))
|| opcode == 0x0f17 || opcode == 0x660f17)
goto no_support;
ir.rm |= ir.rex_b;
- if (!i386_xmm_regnum_p (gdbarch, I387_XMM0_REGNUM (tdep) + ir.rm))
+ if (!i386_xmm_regnum_p (gdbarch,
+ I387_XMM0_REGNUM (tdep) + ir.rm))
goto no_support;
record_arch_list_add_reg (ir.regcache,
I387_XMM0_REGNUM (tdep) + ir.rm);
if (ir.mod == 3)
{
ir.rm |= ir.rex_b;
- if (!i386_xmm_regnum_p (gdbarch, I387_XMM0_REGNUM (tdep) + ir.rm))
+ if (!i386_xmm_regnum_p (gdbarch,
+ I387_XMM0_REGNUM (tdep) + ir.rm))
goto no_support;
record_arch_list_add_reg (ir.regcache,
I387_XMM0_REGNUM (tdep) + ir.rm);
/* Return a bit of target-specific detail to add to the caller's
generic failure message. */
if (msg)
- *msg = xstrprintf (_("; instruction is only %d bytes long, need at least %d bytes for the jump"),
+ *msg = xstrprintf (_("; instruction is only %d bytes long, "
+ "need at least %d bytes for the jump"),
len, jumplen);
return 0;
}
int num_xmm_regs;
/* Bits of the extended control register 0 (the XFEATURE_ENABLED_MASK
- register), excluding the x87 bit, which are supported by this GDB.
- */
+ register), excluding the x87 bit, which are supported by this GDB. */
+
uint64_t xcr0;
/* Offset of XCR0 in XSAVE extended state. */
/* Segment selectors. */
#define I386_SEL_RPL 0x0003 /* Requester's Privilege Level mask. */
-#define I386_SEL_UPL 0x0003 /* User Privilige Level. */
-#define I386_SEL_KPL 0x0000 /* Kernel Privilige Level. */
+#define I386_SEL_UPL 0x0003 /* User Privilige Level. */
+#define I386_SEL_KPL 0x0000 /* Kernel Privilige Level. */
/* The length of the longest i386 instruction (according to
include/asm-i386/kprobes.h in Linux 2.6. */
/* Functions exported from i386-tdep.c. */
extern CORE_ADDR i386_pe_skip_trampoline_code (struct frame_info *frame,
CORE_ADDR pc, char *name);
-extern CORE_ADDR i386_skip_main_prologue (struct gdbarch *gdbarch, CORE_ADDR pc);
+extern CORE_ADDR i386_skip_main_prologue (struct gdbarch *gdbarch,
+ CORE_ADDR pc);
/* Return whether the THIS_FRAME corresponds to a sigtramp routine. */
extern int i386_sigtramp_p (struct frame_info *this_frame);
state = proc_get_state (thread, 1);
if (!state)
{
- warning (_("Couldn't store registers into %s"), proc_string (thread));
+ warning (_("Couldn't store registers into %s"),
+ proc_string (thread));
return;
}
regcache_raw_supply (regcache, check_regno,
REG_ADDR (state, check_regno));
else
- warning (_("... also writing this register! Suspicious..."));
+ warning (_("... also writing this register! "
+ "Suspicious..."));
}
}
reg_offset = i386nbsd_sc_reg_offset;
num_regs = ARRAY_SIZE (i386nbsd_sc_reg_offset);
- /* Read in the sigcontext address */
+ /* Read in the sigcontext address. */
base = read_memory_unsigned_integer (sp + 8, 4, byte_order);
}
else
reg_offset = i386nbsd_mc_reg_offset;
num_regs = ARRAY_SIZE (i386nbsd_mc_reg_offset);
- /* Read in the ucontext address */
+ /* Read in the ucontext address. */
base = read_memory_unsigned_integer (sp + 8, 4, byte_order);
/* offsetof(ucontext_t, uc_mcontext) == 36 */
base += 36;
/* NetBSD uses -freg-struct-return by default. */
tdep->struct_return = reg_struct_return;
- /* NetBSD uses tramp_frame sniffers for signal trampolines. */
+ /* NetBSD uses tramp_frame sniffers for signal trampolines. */
tdep->sigcontext_addr= 0;
tdep->sigtramp_start = 0;
tdep->sigtramp_end = 0;
break;
}
- get_frame_register (frame, (fpreg + 8 - top) % 8 + I387_ST0_REGNUM (tdep),
+ get_frame_register (frame,
+ (fpreg + 8 - top) % 8 + I387_ST0_REGNUM (tdep),
raw);
fputs_filtered ("0x", file);
needs any special handling. */
int
-i387_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type)
+i387_convert_register_p (struct gdbarch *gdbarch, int regnum,
+ struct type *type)
{
if (i386_fp_regnum_p (gdbarch, regnum))
{
gdb_byte raw[I386_MAX_REGISTER_SIZE];
gdb_byte *xstate_bv_p = XSAVE_XSTATE_BV_ADDR (regs);
unsigned int xstate_bv = 0;
- /* The supported bits in `xstat_bv' are 1 byte. */
+ /* The supported bits in `xstat_bv' are 1 byte. */
unsigned int clear_bv = (~(*xstate_bv_p)) & tdep->xcr0;
gdb_byte *p;
#include <asm/ptrace_offsets.h>
#include <sys/procfs.h>
-/* Prototypes for supply_gregset etc. */
+/* Prototypes for supply_gregset etc. */
#include "gregset.h"
/* These must match the order of the register names.
static int u_offsets[] =
{
/* general registers */
- -1, /* gr0 not available; i.e, it's always zero */
+ -1, /* gr0 not available; i.e, it's always zero. */
PT_R1,
PT_R2,
PT_R3,
PT_R29,
PT_R30,
PT_R31,
- /* gr32 through gr127 not directly available via the ptrace interface */
+ /* gr32 through gr127 not directly available via the ptrace interface. */
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
/* Floating point registers */
- -1, -1, /* f0 and f1 not available (f0 is +0.0 and f1 is +1.0) */
+ -1, -1, /* f0 and f1 not available (f0 is +0.0 and f1 is +1.0). */
PT_F2,
PT_F3,
PT_F4,
PT_F125,
PT_F126,
PT_F127,
- /* predicate registers - we don't fetch these individually */
+ /* Predicate registers - we don't fetch these individually. */
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
PT_B5,
PT_B6,
PT_B7,
- /* virtual frame pointer and virtual return address pointer */
+ /* Virtual frame pointer and virtual return address pointer. */
-1, -1,
/* other registers */
PT_PR,
PT_CR_IIP, /* ip */
PT_CR_IPSR, /* psr */
PT_CFM, /* cfm */
- /* kernel registers not visible via ptrace interface (?) */
+ /* kernel registers not visible via ptrace interface (?) */
-1, -1, -1, -1, -1, -1, -1, -1,
/* hole */
-1, -1, -1, -1, -1, -1, -1, -1,
PT_AR_BSPSTORE,
PT_AR_RNAT,
-1,
- -1, /* Not available: FCR, IA32 floating control register */
+ -1, /* Not available: FCR, IA32 floating control register. */
-1, -1,
-1, /* Not available: EFLAG */
-1, /* Not available: CSD */
-1, -1, -1, -1, -1, -1, -1, -1, -1,
PT_AR_PFS,
PT_AR_LC,
- -1, /* Not available: EC, the Epilog Count register */
+ -1, /* Not available: EC, the Epilog Count register. */
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1,
/* nat bits - not fetched directly; instead we obtain these bits from
- either rnat or unat or from memory. */
+ either rnat or unat or from memory. */
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
}
/* FIXME: NAT collection bits are at index 32; gotta deal with these
- somehow... */
+ somehow... */
regcache_raw_supply (regcache, IA64_PR_REGNUM, regp + 33);
COPY_REG (regi - IA64_GR0_REGNUM, regi);
}
- /* FIXME: NAT collection bits at index 32? */
+ /* FIXME: NAT collection bits at index 32? */
COPY_REG (33, IA64_PR_REGNUM);
/* Given a pointer to a floating point register set in /proc format
(fpregset_t *), unpack the register contents and supply them as gdb's
- idea of the current floating point register values. */
+ idea of the current floating point register values. */
void
supply_fpregset (struct regcache *regcache, const fpregset_t *fpregsetp)
/* Given a pointer to a floating point register set in /proc format
(fpregset_t *), update the register specified by REGNO from gdb's idea
of the current floating point register set. If REGNO is -1, update
- them all. */
+ them all. */
void
fill_fpregset (const struct regcache *regcache,
if (!(psr & IA64_PSR_DB))
{
psr |= IA64_PSR_DB; /* Set the db bit - this enables hardware
- watchpoints and breakpoints. */
+ watchpoints and breakpoints. */
regcache_cooked_write_unsigned (regcache, IA64_PSR_REGNUM, psr);
}
}
}
static void
-store_debug_register_pair (ptid_t ptid, int idx, long *dbr_addr, long *dbr_mask)
+store_debug_register_pair (ptid_t ptid, int idx, long *dbr_addr,
+ long *dbr_mask)
{
if (dbr_addr)
store_debug_register (ptid, 2 * idx, *dbr_addr);
dbr_mask = debug_registers[idx * 2 + 1];
if ((dbr_mask & (0x3UL << 62)) == 0)
{
- /* Exit loop if both r and w bits clear */
+ /* Exit loop if both r and w bits clear. */
break;
}
}
regcache_cooked_read_unsigned (regcache, IA64_PSR_REGNUM, &psr);
psr |= IA64_PSR_DD; /* Set the dd bit - this will disable the watchpoint
- for the next instruction */
+ for the next instruction. */
regcache_cooked_write_unsigned (regcache, IA64_PSR_REGNUM, psr);
*addr_p = (CORE_ADDR)siginfo_p->si_addr;
static LONGEST (*super_xfer_partial) (struct target_ops *, enum target_object,
- const char *, gdb_byte *, const gdb_byte *,
- ULONGEST, LONGEST);
+ const char *, gdb_byte *,
+ const gdb_byte *, ULONGEST, LONGEST);
static LONGEST
ia64_linux_xfer_partial (struct target_ops *ops,
This PSR bit is set in ia64_linux_stopped_by_watchpoint when the
code there has determined that a hardware watchpoint has indeed
been hit. The CPU will then be able to execute one instruction
- without triggering a watchpoint. */
+ without triggering a watchpoint. */
t->to_have_steppable_watchpoint = 1;
t->to_can_use_hw_breakpoint = ia64_linux_can_use_hw_breakpoint;
/* The sigtramp code is in a non-readable (executable-only) region
of memory called the ``gate page''. The addresses in question
were determined by examining the system headers. They are
- overly generous to allow for different pages sizes. */
+ overly generous to allow for different pages sizes. */
#define GATE_AREA_START 0xa000000000000100LL
#define GATE_AREA_END 0xa000000000020000LL
-/* Offset to sigcontext structure from frame of handler */
+/* Offset to sigcontext structure from frame of handler. */
#define IA64_LINUX_SIGCONTEXT_OFFSET 192
static int
/* IA-64 GNU/Linux specific function which, given a frame address and
a register number, returns the address at which that register may be
found. 0 is returned for registers which aren't stored in the the
- sigcontext structure. */
+ sigcontext structure. */
static CORE_ADDR
ia64_linux_sigcontext_register_address (struct gdbarch *gdbarch,
char buf[8];
CORE_ADDR sigcontext_addr = 0;
- /* The address of the sigcontext area is found at offset 16 in the sigframe. */
+ /* The address of the sigcontext area is found at offset 16 in the
+ sigframe. */
read_memory (sp + 16, buf, 8);
sigcontext_addr = extract_unsigned_integer (buf, 8, byte_order);
return sigcontext_addr + 56; /* user mask only */
/* sc_ar_rsc is provided, from which we could compute bspstore, but
I don't think it's worth it. Anyway, if we want it, it's at offset
- 64 */
+ 64. */
case IA64_BSP_REGNUM :
return sigcontext_addr + 72;
case IA64_RNAT_REGNUM :
is set to six (which is how it was set up initially). -- objdump
displays pretty disassembly dumps with this value. For our purposes,
we'll set bytes_per_line to SLOT_MULTIPLIER. This is okay since we
- never want to also display the raw bytes the way objdump does. */
+ never want to also display the raw bytes the way objdump does. */
#define SLOT_MULTIPLIER 1
-/* Length in bytes of an instruction bundle */
+/* Length in bytes of an instruction bundle. */
#define BUNDLE_LEN 16
static int fp_regnum = IA64_VFP_REGNUM;
static int lr_regnum = IA64_VRAP_REGNUM;
-/* NOTE: we treat the register stack registers r32-r127 as pseudo-registers because
- they may not be accessible via the ptrace register get/set interfaces. */
-enum pseudo_regs { FIRST_PSEUDO_REGNUM = NUM_IA64_RAW_REGS, VBOF_REGNUM = IA64_NAT127_REGNUM + 1, V32_REGNUM,
+/* NOTE: we treat the register stack registers r32-r127 as
+ pseudo-registers because they may not be accessible via the ptrace
+ register get/set interfaces. */
+
+enum pseudo_regs { FIRST_PSEUDO_REGNUM = NUM_IA64_RAW_REGS,
+ VBOF_REGNUM = IA64_NAT127_REGNUM + 1, V32_REGNUM,
V127_REGNUM = V32_REGNUM + 95,
- VP0_REGNUM, VP16_REGNUM = VP0_REGNUM + 16, VP63_REGNUM = VP0_REGNUM + 63, LAST_PSEUDO_REGNUM };
+ VP0_REGNUM, VP16_REGNUM = VP0_REGNUM + 16,
+ VP63_REGNUM = VP0_REGNUM + 63, LAST_PSEUDO_REGNUM };
/* Array of register names; There should be ia64_num_regs strings in
the initializer. */
CORE_ADDR cfm; /* cfm value for current frame */
CORE_ADDR prev_cfm; /* cfm value for previous frame */
int frameless;
- int sof; /* Size of frame (decoded from cfm value) */
- int sol; /* Size of locals (decoded from cfm value) */
- int sor; /* Number of rotating registers. (decoded from cfm value) */
+ int sof; /* Size of frame (decoded from cfm value). */
+ int sol; /* Size of locals (decoded from cfm value). */
+ int sor; /* Number of rotating registers (decoded from
+ cfm value). */
CORE_ADDR after_prologue;
/* Address of first instruction after the last
prologue instruction; Note that there may
be instructions from the function's body
- intermingled with the prologue. */
+ intermingled with the prologue. */
int mem_stack_frame_size;
/* Size of the memory stack frame (may be zero),
- or -1 if it has not been determined yet. */
+ or -1 if it has not been determined yet. */
int fp_reg; /* Register number (if any) used a frame pointer
for this frame. 0 if no register is being used
- as the frame pointer. */
+ as the frame pointer. */
/* Saved registers. */
CORE_ADDR saved_regs[NUM_IA64_RAW_REGS];
return result;
}
-/* Replace the specified bits in an instruction bundle */
+/* Replace the specified bits in an instruction bundle. */
static void
replace_bit_field (char *bundle, long long val, int from, int len)
}
/* Return the contents of slot N (for N = 0, 1, or 2) in
- and instruction bundle */
+ and instruction bundle. */
static long long
slotN_contents (char *bundle, int slotnum)
return extract_bit_field (bundle, 5+41*slotnum, 41);
}
-/* Store an instruction in an instruction bundle */
+/* Store an instruction in an instruction bundle. */
static void
replace_slotN_contents (char *bundle, long long instr, int slotnum)
/* Store the whole bundle, except for the initial skipped bytes by the slot
number interpreted as bytes offset in PLACED_ADDRESS. */
- memcpy (bp_tgt->shadow_contents, bundle + shadow_slotnum, bp_tgt->shadow_len);
+ memcpy (bp_tgt->shadow_contents, bundle + shadow_slotnum,
+ bp_tgt->shadow_len);
/* Re-read the same bundle as above except that, this time, read it in order
to compute the new bundle inside which we will be inserting the
make a match for permanent breakpoints. */
static const gdb_byte *
-ia64_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr)
+ia64_breakpoint_from_pc (struct gdbarch *gdbarch,
+ CORE_ADDR *pcptr, int *lenptr)
{
CORE_ADDR addr = *pcptr;
static gdb_byte bundle[BUNDLE_LEN];
#define IS_NaT_COLLECTION_ADDR(addr) ((((addr) >> 3) & 0x3f) == 0x3f)
/* Returns the address of the slot that's NSLOTS slots away from
- the address ADDR. NSLOTS may be positive or negative. */
+ the address ADDR. NSLOTS may be positive or negative. */
static CORE_ADDR
rse_address_add(CORE_ADDR addr, int nslots)
{
if (regnum >= V32_REGNUM && regnum <= V127_REGNUM)
{
#ifdef HAVE_LIBUNWIND_IA64_H
- /* First try and use the libunwind special reg accessor, otherwise fallback to
- standard logic. */
+ /* First try and use the libunwind special reg accessor,
+ otherwise fallback to standard logic. */
if (!libunwind_is_initialized ()
|| libunwind_get_reg_special (gdbarch, regcache, regnum, buf) != 0)
#endif
{
- /* The fallback position is to assume that r32-r127 are found sequentially
- in memory starting at $bof. This isn't always true, but without libunwind,
- this is the best we can do. */
+ /* The fallback position is to assume that r32-r127 are
+ found sequentially in memory starting at $bof. This
+ isn't always true, but without libunwind, this is the
+ best we can do. */
ULONGEST cfm;
ULONGEST bsp;
CORE_ADDR reg;
regcache_cooked_read_unsigned (regcache, IA64_CFM_REGNUM, &cfm);
/* The bsp points at the end of the register frame so we
- subtract the size of frame from it to get start of register frame. */
+ subtract the size of frame from it to get start of
+ register frame. */
bsp = rse_address_add (bsp, -(cfm & 0x7f));
if ((cfm & 0x7f) > regnum - V32_REGNUM)
the nat collection from rnat. Otherwise, we fetch the nat
collection from the computed address. */
if (nat_addr >= bsp)
- regcache_cooked_read_unsigned (regcache, IA64_RNAT_REGNUM, &nat_collection);
+ regcache_cooked_read_unsigned (regcache, IA64_RNAT_REGNUM,
+ &nat_collection);
else
nat_collection = read_memory_integer (nat_addr, 8, byte_order);
nat_bit = (gr_addr >> 3) & 0x3f;
else if (regnum == VBOF_REGNUM)
{
/* A virtual register frame start is provided for user convenience.
- It can be calculated as the bsp - sof (sizeof frame). */
+ It can be calculated as the bsp - sof (sizeof frame). */
ULONGEST bsp, vbsp;
ULONGEST cfm;
CORE_ADDR reg;
if (VP16_REGNUM <= regnum && regnum <= VP63_REGNUM)
{
/* Fetch predicate register rename base from current frame
- marker for this frame. */
+ marker for this frame. */
int rrb_pr = (cfm >> 32) & 0x3f;
- /* Adjust the register number to account for register rotation. */
+ /* Adjust the register number to account for register rotation. */
regnum = VP16_REGNUM
+ ((regnum - VP16_REGNUM) + rrb_pr) % 48;
}
if ((cfm & 0x7f) > regnum - V32_REGNUM)
{
ULONGEST reg_addr = rse_address_add (bsp, (regnum - V32_REGNUM));
- write_memory (reg_addr, (void *)buf, 8);
+ write_memory (reg_addr, (void *) buf, 8);
}
}
else if (IA64_NAT0_REGNUM <= regnum && regnum <= IA64_NAT31_REGNUM)
{
ULONGEST unatN_val, unat, unatN_mask;
regcache_cooked_read_unsigned (regcache, IA64_UNAT_REGNUM, &unat);
- unatN_val = extract_unsigned_integer (buf, register_size (gdbarch, regnum),
+ unatN_val = extract_unsigned_integer (buf, register_size (gdbarch,
+ regnum),
byte_order);
unatN_mask = (1LL << (regnum - IA64_NAT0_REGNUM));
if (unatN_val == 0)
if ((cfm & 0x7f) > regnum - V32_REGNUM)
gr_addr = rse_address_add (bsp, (regnum - V32_REGNUM));
- natN_val = extract_unsigned_integer (buf, register_size (gdbarch, regnum),
+ natN_val = extract_unsigned_integer (buf, register_size (gdbarch,
+ regnum),
byte_order);
if (gr_addr != 0 && (natN_val == 0 || natN_val == 1))
collection from the computed address. */
if (nat_addr >= bsp)
{
- regcache_cooked_read_unsigned (regcache, IA64_RNAT_REGNUM, &nat_collection);
+ regcache_cooked_read_unsigned (regcache, IA64_RNAT_REGNUM,
+ &nat_collection);
if (natN_val)
nat_collection |= natN_mask;
else
nat_collection &= ~natN_mask;
- regcache_cooked_write_unsigned (regcache, IA64_RNAT_REGNUM, nat_collection);
+ regcache_cooked_write_unsigned (regcache, IA64_RNAT_REGNUM,
+ nat_collection);
}
else
{
if (VP16_REGNUM <= regnum && regnum <= VP63_REGNUM)
{
/* Fetch predicate register rename base from current frame
- marker for this frame. */
+ marker for this frame. */
int rrb_pr = (cfm >> 32) & 0x3f;
- /* Adjust the register number to account for register rotation. */
+ /* Adjust the register number to account for register rotation. */
regnum = VP16_REGNUM
+ ((regnum - VP16_REGNUM) + rrb_pr) % 48;
}
/* Verify that the current cfm matches what we think is the
function start. If we have somehow jumped within a function,
we do not want to interpret the prologue and calculate the
- addresses of various registers such as the return address.
- We will instead treat the frame as frameless. */
+ addresses of various registers such as the return address.
+ We will instead treat the frame as frameless. */
if (!this_frame ||
(sof == (cache->cfm & 0x7f) &&
sol == ((cache->cfm >> 7) & 0x7f)))
int qp = (int) (instr & 0x0000000003fLL);
if (qp == 0 && rN == 2 && imm == 0 && rM == 12 && fp_reg == 0)
{
- /* mov r2, r12 - beginning of leaf routine */
+ /* mov r2, r12 - beginning of leaf routine. */
fp_reg = rN;
last_prologue_pc = next_pc;
}
}
/* Loop, looking for prologue instructions, keeping track of
- where preserved registers were spilled. */
+ where preserved registers were spilled. */
while (pc < lim_pc)
{
next_pc = fetch_instruction (pc, &it, &instr);
if (it == B && ((instr & 0x1e1f800003fLL) != 0x04000000000LL))
{
- /* Exit loop upon hitting a non-nop branch instruction. */
+ /* Exit loop upon hitting a non-nop branch instruction. */
if (trust_limit)
lim_pc = pc;
break;
adds r2, spilloffset, r12
Get ready for stf.spill or st8.spill instructions.
- The address to start spilling at is loaded into r2.
+ The address to start spilling at is loaded into r2.
FIXME: Why r2? That's what gcc currently uses; it
could well be different for other compilers. */
- /* Hmm... whether or not this will work will depend on
+ /* Hmm... whether or not this will work will depend on
where the pc is. If it's still early in the prologue
this'll be wrong. FIXME */
if (this_frame)
else if (qp == 0 && rM >= 32 && rM < 40 && !instores[rM-32] &&
rN < 256 && imm == 0)
{
- /* mov rN, rM where rM is an input register */
+ /* mov rN, rM where rM is an input register. */
reg_contents[rN] = rM;
last_prologue_pc = next_pc;
}
if ((instr & 0x1efc0000000LL) == 0x0eec0000000LL)
spill_addr += imm;
else
- spill_addr = 0; /* last one; must be done */
+ spill_addr = 0; /* last one; must be done. */
last_prologue_pc = next_pc;
}
}
if (qp == 0 && isScratch (rN) && arM == 36 /* ar.unat */)
{
/* We have something like "mov.m r3 = ar.unat". Remember the
- r3 (or whatever) and watch for a store of this register... */
+ r3 (or whatever) and watch for a store of this register... */
unat_save_reg = rN;
last_prologue_pc = next_pc;
}
/* We've found a spill of either the UNAT register or the PR
register. (Well, not exactly; what we've actually found is
a spill of the register that UNAT or PR was moved to).
- Record that fact and move on... */
+ Record that fact and move on... */
if (rM == unat_save_reg)
{
- /* Track UNAT register */
+ /* Track UNAT register. */
cache->saved_regs[IA64_UNAT_REGNUM] = spill_addr;
unat_save_reg = 0;
}
else
{
- /* Track PR register */
+ /* Track PR register. */
cache->saved_regs[IA64_PR_REGNUM] = spill_addr;
pr_save_reg = 0;
}
/* st8 [rN] = rM, imm9 */
spill_addr += imm9(instr);
else
- spill_addr = 0; /* must be done spilling */
+ spill_addr = 0; /* Must be done spilling. */
last_prologue_pc = next_pc;
}
else if (qp == 0 && 32 <= rM && rM < 40 && !instores[rM-32])
{
- /* Allow up to one store of each input register. */
+ /* Allow up to one store of each input register. */
instores[rM-32] = 1;
last_prologue_pc = next_pc;
}
st8 [rN] = rM
Note that the st8 case is handled in the clause above.
- Advance over stores of input registers. One store per input
- register is permitted. */
+ Advance over stores of input registers. One store per input
+ register is permitted. */
int rM = (int) ((instr & 0x000000fe000LL) >> 13);
int qp = (int) (instr & 0x0000000003fLL);
int indirect = rM < 256 ? reg_contents[rM] : 0;
stfd [rN] = fM
Advance over stores of floating point input registers. Again
- one store per register is permitted */
+ one store per register is permitted. */
int fM = (int) ((instr & 0x000000fe000LL) >> 13);
int qp = (int) (instr & 0x0000000003fLL);
if (qp == 0 && 8 <= fM && fM < 16 && !infpstores[fM - 8])
{
/* We've found a spill of one of the preserved general purpose
regs. Record the spill address and advance the spill
- register if appropriate. */
+ register if appropriate. */
cache->saved_regs[IA64_GR0_REGNUM + rM] = spill_addr;
if ((instr & 0x1efc0000000LL) == 0x0aec0000000LL)
/* st8.spill [rN] = rM, imm9 */
spill_addr += imm9(instr);
else
- spill_addr = 0; /* Done spilling */
+ spill_addr = 0; /* Done spilling. */
last_prologue_pc = next_pc;
}
}
/* Extract the size of the rotating portion of the stack
frame and the register rename base from the current
- frame marker. */
+ frame marker. */
cfm = cache->cfm;
sor = cache->sor;
sof = cache->sof;
cache->saved_regs[IA64_VFP_REGNUM] = addr;
}
- /* For the previous argument registers we require the previous bof.
+ /* For the previous argument registers we require the previous bof.
If we can't find the previous cfm, then we can do nothing. */
cfm = 0;
if (cache->saved_regs[IA64_CFM_REGNUM] != 0)
addr += 8;
}
if (i < sor)
- cache->saved_regs[IA64_GR32_REGNUM + ((i + (sor - rrb_gr)) % sor)]
+ cache->saved_regs[IA64_GR32_REGNUM
+ + ((i + (sor - rrb_gr)) % sor)]
= addr;
else
cache->saved_regs[IA64_GR32_REGNUM + i] = addr;
cache.cfm = 0;
cache.bsp = 0;
- /* Call examine_prologue with - as third argument since we don't have a next frame pointer to send. */
+ /* Call examine_prologue with - as third argument since we don't
+ have a next frame pointer to send. */
return examine_prologue (pc, pc+1024, 0, &cache);
}
(*this_id) = frame_id_build_special (cache->base, cache->pc, cache->bsp);
if (gdbarch_debug >= 1)
fprintf_unfiltered (gdb_stdlog,
- "regular frame id: code %s, stack %s, special %s, this_frame %s\n",
+ "regular frame id: code %s, stack %s, "
+ "special %s, this_frame %s\n",
paddress (gdbarch, this_id->code_addr),
paddress (gdbarch, this_id->stack_addr),
paddress (gdbarch, cache->bsp),
{
int regno;
- cache->saved_regs[IA64_VRAP_REGNUM] =
- tdep->sigcontext_register_address (gdbarch, cache->base, IA64_IP_REGNUM);
- cache->saved_regs[IA64_CFM_REGNUM] =
- tdep->sigcontext_register_address (gdbarch, cache->base, IA64_CFM_REGNUM);
- cache->saved_regs[IA64_PSR_REGNUM] =
- tdep->sigcontext_register_address (gdbarch, cache->base, IA64_PSR_REGNUM);
- cache->saved_regs[IA64_BSP_REGNUM] =
- tdep->sigcontext_register_address (gdbarch, cache->base, IA64_BSP_REGNUM);
- cache->saved_regs[IA64_RNAT_REGNUM] =
- tdep->sigcontext_register_address (gdbarch, cache->base, IA64_RNAT_REGNUM);
- cache->saved_regs[IA64_CCV_REGNUM] =
- tdep->sigcontext_register_address (gdbarch, cache->base, IA64_CCV_REGNUM);
- cache->saved_regs[IA64_UNAT_REGNUM] =
- tdep->sigcontext_register_address (gdbarch, cache->base, IA64_UNAT_REGNUM);
- cache->saved_regs[IA64_FPSR_REGNUM] =
- tdep->sigcontext_register_address (gdbarch, cache->base, IA64_FPSR_REGNUM);
- cache->saved_regs[IA64_PFS_REGNUM] =
- tdep->sigcontext_register_address (gdbarch, cache->base, IA64_PFS_REGNUM);
- cache->saved_regs[IA64_LC_REGNUM] =
- tdep->sigcontext_register_address (gdbarch, cache->base, IA64_LC_REGNUM);
+ cache->saved_regs[IA64_VRAP_REGNUM]
+ = tdep->sigcontext_register_address (gdbarch, cache->base,
+ IA64_IP_REGNUM);
+ cache->saved_regs[IA64_CFM_REGNUM]
+ = tdep->sigcontext_register_address (gdbarch, cache->base,
+ IA64_CFM_REGNUM);
+ cache->saved_regs[IA64_PSR_REGNUM]
+ = tdep->sigcontext_register_address (gdbarch, cache->base,
+ IA64_PSR_REGNUM);
+ cache->saved_regs[IA64_BSP_REGNUM]
+ = tdep->sigcontext_register_address (gdbarch, cache->base,
+ IA64_BSP_REGNUM);
+ cache->saved_regs[IA64_RNAT_REGNUM]
+ = tdep->sigcontext_register_address (gdbarch, cache->base,
+ IA64_RNAT_REGNUM);
+ cache->saved_regs[IA64_CCV_REGNUM]
+ = tdep->sigcontext_register_address (gdbarch, cache->base,
+ IA64_CCV_REGNUM);
+ cache->saved_regs[IA64_UNAT_REGNUM]
+ = tdep->sigcontext_register_address (gdbarch, cache->base,
+ IA64_UNAT_REGNUM);
+ cache->saved_regs[IA64_FPSR_REGNUM]
+ = tdep->sigcontext_register_address (gdbarch, cache->base,
+ IA64_FPSR_REGNUM);
+ cache->saved_regs[IA64_PFS_REGNUM]
+ = tdep->sigcontext_register_address (gdbarch, cache->base,
+ IA64_PFS_REGNUM);
+ cache->saved_regs[IA64_LC_REGNUM]
+ = tdep->sigcontext_register_address (gdbarch, cache->base,
+ IA64_LC_REGNUM);
+
for (regno = IA64_GR1_REGNUM; regno <= IA64_GR31_REGNUM; regno++)
cache->saved_regs[regno] =
tdep->sigcontext_register_address (gdbarch, cache->base, regno);
cache->bsp);
if (gdbarch_debug >= 1)
fprintf_unfiltered (gdb_stdlog,
- "sigtramp frame id: code %s, stack %s, special %s, this_frame %s\n",
+ "sigtramp frame id: code %s, stack %s, "
+ "special %s, this_frame %s\n",
paddress (gdbarch, this_id->code_addr),
paddress (gdbarch, this_id->stack_addr),
paddress (gdbarch, cache->bsp),
break;
case UNW_IA64_AR_BSP:
- /* Libunwind expects to see the beginning of the current register
- frame so we must account for the fact that ptrace() will return a value
- for bsp that points *after* the current register frame. */
+ /* Libunwind expects to see the beginning of the current
+ register frame so we must account for the fact that
+ ptrace() will return a value for bsp that points *after*
+ the current register frame. */
get_frame_register (this_frame, IA64_BSP_REGNUM, buf);
bsp = extract_unsigned_integer (buf, 8, byte_order);
get_frame_register (this_frame, IA64_CFM_REGNUM, buf);
/* Libunwind callback accessor function for floating-point registers. */
static int
-ia64_access_fpreg (unw_addr_space_t as, unw_regnum_t uw_regnum, unw_fpreg_t *val,
- int write, void *arg)
+ia64_access_fpreg (unw_addr_space_t as, unw_regnum_t uw_regnum,
+ unw_fpreg_t *val, int write, void *arg)
{
int regnum = ia64_uw2gdb_regnum (uw_regnum);
struct frame_info *this_frame = arg;
/* Libunwind callback accessor function for top-level rse registers. */
static int
-ia64_access_rse_reg (unw_addr_space_t as, unw_regnum_t uw_regnum, unw_word_t *val,
- int write, void *arg)
+ia64_access_rse_reg (unw_addr_space_t as, unw_regnum_t uw_regnum,
+ unw_word_t *val, int write, void *arg)
{
int regnum = ia64_uw2gdb_regnum (uw_regnum);
unw_word_t bsp, sof, sol, cfm, psr, ip;
break;
case UNW_IA64_AR_BSP:
- /* Libunwind expects to see the beginning of the current register
- frame so we must account for the fact that ptrace() will return a value
- for bsp that points *after* the current register frame. */
+ /* Libunwind expects to see the beginning of the current
+ register frame so we must account for the fact that
+ ptrace() will return a value for bsp that points *after*
+ the current register frame. */
regcache_cooked_read (regcache, IA64_BSP_REGNUM, buf);
bsp = extract_unsigned_integer (buf, 8, byte_order);
regcache_cooked_read (regcache, IA64_CFM_REGNUM, buf);
/* Verify that the segment that contains the IP also contains
the static unwind table. If not, we may be in the Linux kernel's
- DSO gate page in which case the unwind table is another segment.
+ DSO gate page in which case the unwind table is another segment.
Otherwise, we are dealing with runtime-generated code, for which we
have no info here. */
segbase = p_text->p_vaddr + load_base;
if (gdbarch_debug >= 1)
fprintf_unfiltered (gdb_stdlog,
- "libunwind frame id: code %s, stack %s, special %s, this_frame %s\n",
+ "libunwind frame id: code %s, stack %s, "
+ "special %s, this_frame %s\n",
paddress (gdbarch, id.code_addr),
paddress (gdbarch, id.stack_addr),
paddress (gdbarch, bsp),
register stack frame. This corresponds to what the hardware bsp
register will be if we pop the frame back which is why we might
have been called. We know that libunwind will pass us back the
- beginning of the current frame so we should just add sof to it. */
+ beginning of the current frame so we should just add sof to it. */
prev_bsp = extract_unsigned_integer (value_contents_all (val),
8, byte_order);
cfm_val = libunwind_frame_prev_register (this_frame, this_cache,
if (gdbarch_debug >= 1)
fprintf_unfiltered (gdb_stdlog,
- "libunwind sigtramp frame id: code %s, stack %s, special %s, this_frame %s\n",
+ "libunwind sigtramp frame id: code %s, "
+ "stack %s, special %s, this_frame %s\n",
paddress (gdbarch, id.code_addr),
paddress (gdbarch, id.stack_addr),
paddress (gdbarch, bsp),
/* Set of special libunwind callback acccessor functions specific for accessing
the rse registers. At the top of the stack, we want libunwind to figure out
- how to read r32 - r127. Though usually they are found sequentially in memory
- starting from $bof, this is not always true. */
+ how to read r32 - r127. Though usually they are found sequentially in
+ memory starting from $bof, this is not always true. */
static unw_accessors_t ia64_unw_rse_accessors =
{
ia64_find_proc_info_x,
/* get_proc_name */
};
-/* Set of ia64 gdb libunwind-frame callbacks and data for generic libunwind-frame code to use. */
+/* Set of ia64 gdb libunwind-frame callbacks and data for generic
+ libunwind-frame code to use. */
static struct libunwind_descr ia64_libunwind_descr =
{
ia64_gdb2uw_regnum,
{
regcache_cooked_read (regcache, regnum, from);
convert_typed_floating (from, ia64_ext_type (gdbarch),
- (char *)valbuf + offset, float_elt_type);
+ (char *)valbuf + offset, float_elt_type);
offset += TYPE_LENGTH (float_elt_type);
regnum++;
}
global_pointer = extract_unsigned_integer (buf, sizeof (buf),
byte_order);
- /* The payoff... */
+ /* The payoff... */
return global_pointer;
}
char val_buf[8];
memset (val_buf, 0, 8);
- memcpy (val_buf, value_contents (arg) + argoffset, (len > 8) ? 8 : len);
+ memcpy (val_buf, value_contents (arg) + argoffset,
+ (len > 8) ? 8 : len);
if (slotnum < rseslots)
write_memory (rse_address_add (bsp, slotnum), val_buf, 8);
while (len > 0 && floatreg < IA64_FR16_REGNUM)
{
char to[MAX_REGISTER_SIZE];
- convert_typed_floating (value_contents (arg) + argoffset, float_elt_type,
- to, ia64_ext_type (gdbarch));
+ convert_typed_floating (value_contents (arg) + argoffset,
+ float_elt_type, to,
+ ia64_ext_type (gdbarch));
regcache_cooked_write (regcache, floatreg, (void *)to);
floatreg++;
argoffset += TYPE_LENGTH (float_elt_type);
/* Store the struct return value in r8 if necessary. */
if (struct_return)
{
- regcache_cooked_write_unsigned (regcache, IA64_GR8_REGNUM, (ULONGEST)struct_addr);
+ regcache_cooked_write_unsigned (regcache, IA64_GR8_REGNUM,
+ (ULONGEST) struct_addr);
}
global_pointer = ia64_find_global_pointer (gdbarch, func_addr);
set_gdbarch_ptr_bit (gdbarch, 64);
set_gdbarch_num_regs (gdbarch, NUM_IA64_RAW_REGS);
- set_gdbarch_num_pseudo_regs (gdbarch, LAST_PSEUDO_REGNUM - FIRST_PSEUDO_REGNUM);
+ set_gdbarch_num_pseudo_regs (gdbarch,
+ LAST_PSEUDO_REGNUM - FIRST_PSEUDO_REGNUM);
set_gdbarch_sp_regnum (gdbarch, sp_regnum);
set_gdbarch_fp0_regnum (gdbarch, IA64_FR0_REGNUM);
set_gdbarch_return_value (gdbarch, ia64_return_value);
- set_gdbarch_memory_insert_breakpoint (gdbarch, ia64_memory_insert_breakpoint);
- set_gdbarch_memory_remove_breakpoint (gdbarch, ia64_memory_remove_breakpoint);
+ set_gdbarch_memory_insert_breakpoint (gdbarch,
+ ia64_memory_insert_breakpoint);
+ set_gdbarch_memory_remove_breakpoint (gdbarch,
+ ia64_memory_remove_breakpoint);
set_gdbarch_breakpoint_from_pc (gdbarch, ia64_breakpoint_from_pc);
set_gdbarch_read_pc (gdbarch, ia64_read_pc);
set_gdbarch_write_pc (gdbarch, ia64_write_pc);
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
set_gdbarch_print_insn (gdbarch, ia64_print_insn);
- set_gdbarch_convert_from_func_ptr_addr (gdbarch, ia64_convert_from_func_ptr_addr);
+ set_gdbarch_convert_from_func_ptr_addr (gdbarch,
+ ia64_convert_from_func_ptr_addr);
/* The virtual table contains 16-byte descriptors, not pointers to
descriptors. */
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "inferior.h" /* For fetch_inferior_event. */
-#include "target.h" /* For enum inferior_event_type. */
+#include "inferior.h" /* For fetch_inferior_event. */
+#include "target.h" /* For enum inferior_event_type. */
#include "event-loop.h"
#include "event-top.h"
#include "inf-loop.h"
inferior_event_handler (INF_QUIT_REQ, client_data);
}
-/* General function to handle events in the inferior. So far it just
+/* General function to handle events in the inferior. So far it just
takes care of detecting errors reported by select() or poll(),
otherwise it assumes that all is OK, and goes on reading data from
- the fd. This however may not always be what we want to do. */
+ the fd. This however may not always be what we want to do. */
void
inferior_event_handler (enum inferior_event_type event_type,
gdb_client_data client_data)
/* Use catch errors for now, until the inner layers of
fetch_inferior_event (i.e. readchar) can return meaningful
error status. If an error occurs while getting an event from
- the target, just get rid of the target. */
+ the target, just get rid of the target. */
if (!catch_errors (fetch_inferior_event_wrapper,
client_data, "", RETURN_MASK_ALL))
{
if (!non_stop)
{
- /* Unregister the inferior from the event loop. This is done
+ /* Unregister the inferior from the event loop. This is done
so that when the inferior is not running we don't get
distracted by spurious inferior output. */
if (target_has_execution)
case INF_EXEC_CONTINUE:
/* Is there anything left to do for the command issued to
- complete? */
+ complete? */
if (non_stop)
do_all_intermediate_continuations_thread (inferior_thread ());
break;
case INF_QUIT_REQ:
- /* FIXME: ezannoni 1999-10-04. This call should really be a
+ /* FIXME: ezannoni 1999-10-04. This call should really be a
target vector entry, so that it can be used for any kind of
- targets. */
+ targets. */
async_remote_interrupt_twice (NULL);
break;
the stack and restore the context to what as it was before the
call.
- The default is to stop in the frame where the signal was received. */
+ The default is to stop in the frame where the signal was received. */
int unwind_on_signal_p = 0;
static void
else if (code == TYPE_CODE_INT)
{
/* Handle the case of functions lacking debugging info.
- Their values are characters since their addresses are char */
+ Their values are characters since their addresses are char. */
if (TYPE_LENGTH (ftype) == 1)
funaddr = value_as_address (value_addr (function));
else
disable_watchpoints_before_interactive_call_start ();
- /* We want stop_registers, please... */
+ /* We want stop_registers, please... */
call_thread->control.proceed_to_finish = 1;
if (target_can_async_p ())
May fail to return, if a breakpoint or signal is hit
during the execution of the function.
- ARGS is modified to contain coerced values. */
+ ARGS is modified to contain coerced values. */
struct value *
call_function_by_hand (struct value *function, int nargs, struct value **args)
If the generic dummy frame ends up empty (because nothing is
pushed) GDB won't be able to correctly perform back traces.
If a target is having trouble with backtraces, first thing to
- do is add FRAME_ALIGN() to the architecture vector. If that
+ do is add FRAME_ALIGN() to the architecture vector. If that
fails, try dummy_id().
If the ABI specifies a "Red Zone" (see the doco) the code
/* Reserve space for the return structure to be written on the
stack, if necessary. Make certain that the value is correctly
- aligned. */
+ aligned. */
if (struct_return || lang_struct_return)
{
else
{
/* Stack grows upward. Align the frame, allocate space, and
- then again, re-align the frame??? */
+ then again, re-align the frame??? */
if (gdbarch_frame_align_p (gdbarch))
sp = gdbarch_frame_align (gdbarch, sp);
struct_addr = sp;
{
/* We stopped inside the FUNCTION because of a random
signal. Further execution of the FUNCTION is not
- allowed. */
+ allowed. */
if (unwind_on_signal_p)
{
- /* The user wants the context restored. */
+ /* The user wants the context restored. */
/* We must get back to the frame we were before the
dummy call. */
representing what the function returned. May fail to return, if a
breakpoint or signal is hit during the execution of the function.
- ARGS is modified to contain coerced values. */
+ ARGS is modified to contain coerced values. */
extern struct value *call_function_by_hand (struct value *function, int nargs,
struct value **args);
/* Scratch area where string containing arguments to give to the
program will be stored by 'set args'. As soon as anything is
stored, notice_args_set will move it into per-inferior storage.
- Arguments are separated by spaces. Empty string (pointer to '\0')
+ Arguments are separated by spaces. Empty string (pointer to '\0')
means no args. */
static char *inferior_args_scratch;
int stopped_by_random_signal;
\f
-/* Accessor routines. */
+/* Accessor routines. */
/* Set the io terminal for the current inferior. Ownership of
TERMINAL_NAME is not transferred. */
/* This function detects whether or not a '&' character (indicating
background execution) has been added as *the last* of the arguments ARGS
- of a command. If it has, it removes it and returns 1. Otherwise it
- does nothing and returns 0. */
+ of a command. If it has, it removes it and returns 1. Otherwise it
+ does nothing and returns 0. */
static int
strip_bg_char (char **args)
{
}
}
-/* Implement the "run" command. If TBREAK_AT_MAIN is set, then insert
+/* Implement the "run" command. If TBREAK_AT_MAIN is set, then insert
a temporary breakpoint at the begining of the main program before
running the program. */
int async_exec = strip_bg_char (&args);
/* If we get a request for running in the bg but the target
- doesn't support it, error out. */
+ doesn't support it, error out. */
if (async_exec && !target_can_async_p ())
error (_("Asynchronous execution not supported on this target."));
/* If we don't get a request of running in the bg, then we need
- to simulate synchronous (fg) execution. */
+ to simulate synchronous (fg) execution. */
if (!async_exec && target_can_async_p ())
{
- /* Simulate synchronous execution */
+ /* Simulate synchronous execution. */
async_disable_stdin ();
}
- /* If there were other args, beside '&', process them. */
+ /* If there were other args, beside '&', process them. */
if (args)
set_inferior_args (args);
}
}
/* If the user is looking at trace frames, any resumption of execution
- is likely to mix up recorded and live target data. So simply
+ is likely to mix up recorded and live target data. So simply
disallow those commands. */
void
int all_threads = 0;
ERROR_NO_INFERIOR;
- /* Find out whether we must run in the background. */
+ /* Find out whether we must run in the background. */
if (args != NULL)
async_exec = strip_bg_char (&args);
/* If we must run in the background, but the target can't do it,
- error out. */
+ error out. */
if (async_exec && !target_can_async_p ())
error (_("Asynchronous execution not supported on this target."));
/* If we are not asked to run in the bg, then prepare to run in the
- foreground, synchronously. */
+ foreground, synchronously. */
if (!async_exec && target_can_async_p ())
{
- /* Simulate synchronous execution */
+ /* Simulate synchronous execution. */
async_disable_stdin ();
}
async_exec = strip_bg_char (&count_string);
/* If we get a request for running in the bg but the target
- doesn't support it, error out. */
+ doesn't support it, error out. */
if (async_exec && !target_can_async_p ())
error (_("Asynchronous execution not supported on this target."));
/* If we don't get a request of running in the bg, then we need
- to simulate synchronous (fg) execution. */
+ to simulate synchronous (fg) execution. */
if (!async_exec && target_can_async_p ())
{
- /* Simulate synchronous execution */
+ /* Simulate synchronous execution. */
async_disable_stdin ();
}
count = count_string ? parse_and_eval_long (count_string) : 1;
- if (!single_inst || skip_subroutines) /* leave si command alone */
+ if (!single_inst || skip_subroutines) /* Leave si command alone. */
{
struct thread_info *tp = inferior_thread ();
/* Called after we are done with one step operation, to check whether
we need to step again, before we print the prompt and return control
- to the user. If count is > 1, we will need to do one more call to
- proceed(), via step_once(). Basically it is like step_once and
- step_1_continuation are co-recursive. */
+ to the user. If count is > 1, we will need to do one more call to
+ proceed(), via step_once(). Basically it is like step_once and
+ step_1_continuation are co-recursive. */
static void
step_1_continuation (void *args)
{
ensure_valid_thread ();
ensure_not_running ();
- /* Find out whether we must run in the background. */
+ /* Find out whether we must run in the background. */
if (arg != NULL)
async_exec = strip_bg_char (&arg);
/* If we must run in the background, but the target can't do it,
- error out. */
+ error out. */
if (async_exec && !target_can_async_p ())
error (_("Asynchronous execution not supported on this target."));
if (sal.symtab == 0 && sal.pc == 0)
error (_("No source file has been specified."));
- resolve_sal_pc (&sal); /* May error out */
+ resolve_sal_pc (&sal); /* May error out. */
- /* See if we are trying to jump to another function. */
+ /* See if we are trying to jump to another function. */
fn = get_frame_function (get_current_frame ());
sfn = find_pc_function (sal.pc);
if (fn != NULL && sfn != fn)
}
/* If we are not asked to run in the bg, then prepare to run in the
- foreground, synchronously. */
+ foreground, synchronously. */
if (!async_exec && target_can_async_p ())
{
- /* Simulate synchronous execution */
+ /* Simulate synchronous execution. */
async_disable_stdin ();
}
}
\f
-/* Go to line or address in current procedure */
+/* Go to line or address in current procedure. */
static void
go_command (char *line_no, int from_tty)
{
/* Step until either exited from this function or greater
than the current line (if in symbolic section) or pc (if
- not). */
+ not). */
pc = get_frame_pc (frame);
func = find_pc_function (pc);
ensure_valid_thread ();
ensure_not_running ();
- /* Find out whether we must run in the background. */
+ /* Find out whether we must run in the background. */
if (arg != NULL)
async_exec = strip_bg_char (&arg);
/* If we must run in the background, but the target can't do it,
- error out. */
+ error out. */
if (async_exec && !target_can_async_p ())
error (_("Asynchronous execution not supported on this target."));
/* If we are not asked to run in the bg, then prepare to run in the
- foreground, synchronously. */
+ foreground, synchronously. */
if (!async_exec && target_can_async_p ())
{
- /* Simulate synchronous execution */
+ /* Simulate synchronous execution. */
async_disable_stdin ();
}
impossible to do all the stuff as part of the finish_command
function itself. The only chance we have to complete this command
is in fetch_inferior_event, which is called by the event loop as
- soon as it detects that the target has stopped. This function is
+ soon as it detects that the target has stopped. This function is
called via the cmd_continuation pointer. */
struct finish_command_continuation_args
if (arg == 0)
error_no_arg (_("environment variable and value"));
- /* Find seperation between variable name and value */
+ /* Find seperation between variable name and value. */
p = (char *) strchr (arg, '=');
val = (char *) strchr (arg, ' ');
{
/* We have both a space and an equals. If the space is before the
equals, walk forward over the spaces til we see a nonspace
- (possibly the equals). */
+ (possibly the equals). */
if (p > val)
while (*val == ' ')
val++;
{
nullset = 1;
if (p == 0)
- p = arg + strlen (arg); /* So that savestring below will work */
+ p = arg + strlen (arg); /* So that savestring below will work. */
}
else
{
- /* Not setting variable value to null */
+ /* Not setting variable value to null. */
val = p + 1;
while (*val == ' ' || *val == '\t')
val++;
unset_in_environ (current_inferior ()->environment, var);
}
-/* Handle the execution path (PATH variable) */
+/* Handle the execution path (PATH variable). */
static const char path_var_name[] = "PATH";
dont_repeat ();
env = get_in_environ (current_inferior ()->environment, path_var_name);
- /* Can be null if path is not set */
+ /* Can be null if path is not set. */
if (!env)
env = "";
exec_path = xstrdup (env);
}
\f
-/* Print out the machine register regnum. If regnum is -1, print all
+/* Print out the machine register regnum. If regnum is -1, print all
registers (print_all == 1) or all non-float and non-vector
registers (print_all == 0).
{
/* FIXME: This should not really be inferior_ptid (or target_has_execution).
It should be a distinct flag that indicates that a target is active, cuz
- some targets don't have processes! */
+ some targets don't have processes! */
if (ptid_equal (inferior_ptid, null_ptid))
error (_("The program is not being run."));
with their threads. */
if (!have_inferiors ())
{
- init_thread_list (); /* Destroy thread info */
+ init_thread_list (); /* Destroy thread info. */
/* Killing off the inferior can leave us with a core file. If
so, print the state we are left in. */
* This only needs to be done if we are attaching to a process.
*/
-/*
- attach_command --
+/* attach_command --
takes a program started up outside of gdb and ``attaches'' to it.
This stops it cold in its tracks and allows us to start debugging it.
and wait for the trace-trap that results from attaching. */
Attempt to qualify the filename against the source path.
(If that fails, we'll just fall back on the original
- filename. Not much more we can do...)
- */
+ filename. Not much more we can do...) */
+
if (!source_full_path_of (exec_file, &full_exec_path))
full_exec_path = xstrdup (exec_file);
async_exec = strip_bg_char (&args);
/* If we get a request for running in the bg but the target
- doesn't support it, error out. */
+ doesn't support it, error out. */
if (async_exec && !target_can_async_p ())
error (_("Asynchronous execution not supported on this target."));
}
to simulate synchronous (fg) execution. */
if (!async_exec && target_can_async_p ())
{
- /* Simulate synchronous execution */
+ /* Simulate synchronous execution. */
async_disable_stdin ();
make_cleanup ((make_cleanup_ftype *)async_enable_stdin, NULL);
}
{
struct inferior *inferior = current_inferior ();
- /* Careful here. See comments in inferior.h. Basically some
+ /* Careful here. See comments in inferior.h. Basically some
OSes don't ignore SIGSTOPs on continue requests anymore. We
need a way for handle_inferior_event to reset the stop_signal
variable after an attach, and this is what
static void
disconnect_command (char *args, int from_tty)
{
- dont_repeat (); /* Not for the faint of heart */
+ dont_repeat (); /* Not for the faint of heart. */
target_disconnect (args, from_tty);
no_shared_libraries (NULL, from_tty);
init_thread_list ();
{
int all_threads = 0;
- dont_repeat (); /* Not for the faint of heart */
+ dont_repeat (); /* Not for the faint of heart. */
if (args != NULL
&& strncmp (args, "-a", sizeof ("-a") - 1) == 0)
{
struct cmd_list_element *c = NULL;
- /* add the filename of the terminal connected to inferior I/O */
+ /* Add the filename of the terminal connected to inferior I/O. */
add_setshow_filename_cmd ("inferior-tty", class_run,
&inferior_io_terminal_scratch, _("\
Set terminal for future runs of program being debugged."), _("\
if (exec != NULL)
{
/* Switch over temporarily, while reading executable and
- symbols.q */
+ symbols.q. */
set_current_program_space (inf->pspace);
set_current_inferior (inf);
switch_to_thread (null_ptid);
or a "don't care" condition, i.e, "run all threads." */
extern ptid_t minus_one_ptid;
-/* The null or zero ptid, often used to indicate no process. */
+/* The null or zero ptid, often used to indicate no process. */
extern ptid_t null_ptid;
/* Attempt to find and return an existing ptid with the given PID, LWP,
that. */
ptid_t ptid_build (int pid, long lwp, long tid);
-/* Find/Create a ptid from just a pid. */
+/* Find/Create a ptid from just a pid. */
ptid_t pid_to_ptid (int pid);
-/* Fetch the pid (process id) component from a ptid. */
+/* Fetch the pid (process id) component from a ptid. */
int ptid_get_pid (ptid_t ptid);
-/* Fetch the lwp (lightweight process) component from a ptid. */
+/* Fetch the lwp (lightweight process) component from a ptid. */
long ptid_get_lwp (ptid_t ptid);
-/* Fetch the tid (thread id) component from a ptid. */
+/* Fetch the tid (thread id) component from a ptid. */
long ptid_get_tid (ptid_t ptid);
-/* Compare two ptids to see if they are equal */
+/* Compare two ptids to see if they are equal. */
extern int ptid_equal (ptid_t p1, ptid_t p2);
/* Return true if PTID represents a process id. */
extern const char *get_inferior_io_terminal (void);
/* Collected pid, tid, etc. of the debugged inferior. When there's
- no inferior, PIDGET (inferior_ptid) will be 0. */
+ no inferior, PIDGET (inferior_ptid) will be 0. */
extern ptid_t inferior_ptid;
/* Are we simulating synchronous execution? This is used in async gdb
to implement the 'run', 'continue' etc commands, which will not
- redisplay the prompt until the execution is actually over. */
+ redisplay the prompt until the execution is actually over. */
extern int sync_execution;
-/* Inferior environment. */
+/* Inferior environment. */
extern void clear_proceed_status (void);
setting up a remote connection; it is like STOP_QUIETLY_NO_SIGSTOP
except that there is no need to hide a signal. */
-/* It is also used after attach, due to attaching to a process. This
+/* It is also used after attach, due to attaching to a process. This
is a bit trickier. When doing an attach, the kernel stops the
debuggee with a SIGSTOP. On newer GNU/Linux kernels (>= 2.5.61)
- the handling of SIGSTOP for a ptraced process has changed. Earlier
+ the handling of SIGSTOP for a ptraced process has changed. Earlier
versions of the kernel would ignore these SIGSTOPs, while now
SIGSTOP is treated like any other signal, i.e. it is not muffled.
the global variable stop_signal (which stores the signal from the
attach, SIGSTOP) to the ptrace(PTRACE_CONT,...) call. This is
problematic, because the kernel doesn't ignore such SIGSTOP
- now. I.e. it is reported back to gdb, which in turn presents it
+ now. I.e. it is reported back to gdb, which in turn presents it
back to the user.
To avoid the problem, we use STOP_QUIETLY_NO_SIGSTOP, which allows
/* If STARTUP_WITH_SHELL is set, GDB's "run"
will attempts to start up the debugee under a shell.
- This is in order for argument-expansion to occur. E.g.,
+ This is in order for argument-expansion to occur. E.g.,
(gdb) run *
The "*" gets expanded by the shell into a list of files.
While this is a nice feature, it turns out to interact badly
be 1 if target is not started up with a shell, 2 if it is.
- RT
If you disable this, you need to decrement
- START_INFERIOR_TRAPS_EXPECTED in tm.h. */
+ START_INFERIOR_TRAPS_EXPECTED in tm.h. */
#define STARTUP_WITH_SHELL 1
#if !defined(START_INFERIOR_TRAPS_EXPECTED)
#define START_INFERIOR_TRAPS_EXPECTED 2
mode, to avoid flushing input. We need to do the same thing
regardless of output_only, because we don't have separate
terminal_is_ours and terminal_is_ours_for_output flags. It's OK,
- though, since readline will deal with raw mode when/if it needs to.
- */
+ though, since readline will deal with raw mode when/if it needs
+ to. */
serial_noflush_set_tty_state (stdin_serial, our_terminal_info.ttystate,
tinfo->ttystate);
#ifndef O_ACCMODE
#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
#endif
- /* (O_ACCMODE) parens are to avoid Ultrix header file bug */
+ /* (O_ACCMODE) parens are to avoid Ultrix header file bug. */
switch (flags & (O_ACCMODE))
{
case O_RDONLY:
#ifdef TIOCNOTTY
/* Disconnect the child process from our controlling terminal. On some
systems (SVR4 for example), this may cause a SIGTTOU, so temporarily
- ignore SIGTTOU. */
+ ignore SIGTTOU. */
tty = open ("/dev/tty", O_RDWR);
if (tty > 0)
{
\f
/* Call set_sigint_trap when you need to pass a signal on to an attached
- process when handling SIGINT */
+ process when handling SIGINT. */
static void
pass_signal (int signo)
#ifdef _SC_JOB_CONTROL
job_control = sysconf (_SC_JOB_CONTROL);
#else
- job_control = 0; /* have to assume the worst */
+ job_control = 0; /* Have to assume the worst. */
#endif /* _SC_JOB_CONTROL */
#endif /* _POSIX_JOB_CONTROL */
#endif /* HAVE_TERMIOS */
fprintf_filtered (file, _("Mode of the step operation is %s.\n"), value);
}
-/* In asynchronous mode, but simulating synchronous execution. */
+/* In asynchronous mode, but simulating synchronous execution. */
int sync_execution = 0;
(flags)[signum] = 0; \
} while (0)
-/* Value to pass to target_resume() to cause all threads to resume */
+/* Value to pass to target_resume() to cause all threads to resume. */
#define RESUME_ALL minus_one_ptid
over from WAIT_PID" logic above. */
nullify_last_target_wait_ptid ();
- /* If we followed the child, switch to it... */
+ /* If we followed the child, switch to it... */
if (follow_child)
{
switch_to_thread (child);
struct program_space *pspace;
struct address_space *aspace;
- /* follow-fork child, detach-on-fork on */
+ /* follow-fork child, detach-on-fork on. */
old_chain = make_cleanup_restore_current_thread ();
inf->aspace = pspace->aspace;
/* Put back inferior_ptid. We'll continue mourning this
- inferior. */
+ inferior. */
do_cleanups (old_chain);
resume_parent = inf->vfork_parent->pid;
fprintf_filtered (file, _("Follow exec mode is \"%s\".\n"), value);
}
-/* EXECD_PATHNAME is assumed to be non-NULL. */
+/* EXECD_PATHNAME is assumed to be non-NULL. */
static void
follow_exec (ptid_t pid, char *execd_pathname)
And, we DON'T want to call delete_breakpoints() here, since
that may write the bp's "shadow contents" (the instruction
value that was overwritten witha TRAP instruction). Since
- we now have a new a.out, those shadow contents aren't valid. */
+ we now have a new a.out, those shadow contents aren't valid. */
mark_breakpoints_out ();
update_breakpoints_after_exec ();
/* If there was one, it's gone now. We cannot truly step-to-next
- statement through an exec(). */
+ statement through an exec(). */
th->control.step_resume_breakpoint = NULL;
th->control.exception_resume_breakpoint = NULL;
th->control.step_range_start = 0;
with scheduler-locking on in all-stop mode. */
th->stop_requested = 0;
- /* What is this a.out's name? */
+ /* What is this a.out's name? */
printf_unfiltered (_("%s is executing new program: %s\n"),
target_pid_to_str (inferior_ptid),
execd_pathname);
/* We've followed the inferior through an exec. Therefore, the
- inferior has essentially been killed & reborn. */
+ inferior has essentially been killed & reborn. */
gdb_flush (gdb_stdout);
gdb_assert (current_program_space == inf->pspace);
- /* That a.out is now the one to use. */
+ /* That a.out is now the one to use. */
exec_file_attach (execd_pathname, 0);
/* SYMFILE_DEFER_BP_RESET is used as the proper displacement for PIE
/* Reinsert all breakpoints. (Those which were symbolic have
been reset to the proper address in the new a.out, thanks
- to symbol_file_command...) */
+ to symbol_file_command...). */
insert_breakpoints ();
/* The next resume of this inferior should bring it to the shlib
startup breakpoints. (If the user had also set bp's on
"main" from the old (parent) process, then they'll auto-
- matically get reset there in the new process.) */
+ matically get reset there in the new process.). */
}
/* Non-zero if we just simulating a single-step. This is needed
is finished, we need to switch to deferred_step_ptid, and step it.
The use case is when one thread has hit a breakpoint, and then the user
- has switched to another thread and issued 'step'. We need to step over
+ has switched to another thread and issued 'step'. We need to step over
breakpoint in the thread which hit the breakpoint, but then continue
stepping the thread user has selected. */
static ptid_t deferred_step_ptid;
{
hw_step = 0;
/* Do not pull these breakpoints until after a `wait' in
- `wait_for_inferior' */
+ `wait_for_inferior'. */
singlestep_breakpoints_inserted_p = 1;
singlestep_ptid = inferior_ptid;
singlestep_pc = pc;
|| (scheduler_mode == schedlock_step
&& (step || singlestep_breakpoints_inserted_p)))
{
- /* User-settable 'scheduler' mode requires solo thread resume. */
+ /* User-settable 'scheduler' mode requires solo thread resume. */
resume_ptid = inferior_ptid;
}
event. If a step-over is required return TRUE and set the current thread
to the old thread. Otherwise return FALSE.
- This should be suitable for any targets that support threads. */
+ This should be suitable for any targets that support threads. */
static int
prepare_to_proceed (int step)
/* We return 1 to indicate that there is a breakpoint here,
so we need to step over it before continuing to avoid
- hitting it straight away. */
+ hitting it straight away. */
return 1;
}
}
prepare_to_proceed checks the current thread against the
thread that reported the most recent event. If a step-over
is required it returns TRUE and sets the current thread to
- the old thread. */
+ the old thread. */
if (prepare_to_proceed (step))
oneproc = 1;
}
/* Wait for it to stop (if not standalone)
and in any case decode why it stopped, and act accordingly. */
/* Do this only if we are not using the event loop, or if the target
- does not support asynchronous execution. */
+ does not support asynchronous execution. */
if (!target_can_async_p ())
{
wait_for_inferior (0);
inferior = current_inferior ();
inferior->control.stop_soon = STOP_QUIETLY_REMOTE;
- /* Always go on waiting for the target, regardless of the mode. */
+ /* Always go on waiting for the target, regardless of the mode. */
/* FIXME: cagney/1999-09-23: At present it isn't possible to
indicate to wait_for_inferior that a target should timeout if
nothing is returned (instead of just blocking). Because of this,
targets expecting an immediate response need to, internally, set
things up so that the target_wait() is forced to eventually
- timeout. */
+ timeout. */
/* FIXME: cagney/1999-09-24: It isn't possible for target_open() to
differentiate to its caller what the state of the target is after
the initial open has been performed. Here we're assuming that
the target has stopped. It should be possible to eventually have
target_open() return to the caller an indication that the target
is currently running and GDB state should be set to the same as
- for an async run. */
+ for an async run. */
wait_for_inferior (0);
/* Now that the inferior has stopped, do any bookkeeping like
iterate_over_threads (delete_step_resume_breakpoint_callback, NULL);
}
-/* A cleanup wrapper. */
+/* A cleanup wrapper. */
static void
delete_step_thread_step_resume_breakpoint_cleanup (void *arg)
target_wait because they can be loaded from the target while
in target_wait. This makes remote debugging a bit more
efficient for those targets that provide critical registers
- as part of their normal status mechanism. */
+ as part of their normal status mechanism. */
registers_changed ();
because they can be loaded from the target while in target_wait.
This makes remote debugging a bit more efficient for those
targets that provide critical registers as part of their normal
- status mechanism. */
+ status mechanism. */
overlay_cache_invalid = 1;
registers_changed ();
do_cleanups (old_cleanups);
}
-/* Asynchronous version of wait_for_inferior. It is called by the
+/* Asynchronous version of wait_for_inferior. It is called by the
event loop whenever a change of state is detected on the file
- descriptor corresponding to the target. It can be called more than
- once to complete a single execution command. In such cases we need
- to keep the state in a global variable ECSS. If it is the last time
+ descriptor corresponding to the target. It can be called more than
+ once to complete a single execution command. In such cases we need
+ to keep the state in a global variable ECSS. If it is the last time
that this function is called for a single execution command, then
report to the user that the inferior has stopped, and do the
- necessary cleanups. */
+ necessary cleanups. */
void
fetch_inferior_event (void *client_data)
because they can be loaded from the target while in target_wait.
This makes remote debugging a bit more efficient for those
targets that provide critical registers as part of their normal
- status mechanism. */
+ status mechanism. */
overlay_cache_invalid = 1;
registers_changed ();
else
stop_soon = NO_STOP_QUIETLY;
- /* Cache the last pid/waitstatus. */
+ /* Cache the last pid/waitstatus. */
target_last_wait_ptid = ecs->ptid;
target_last_waitstatus = ecs->ws;
/* Always clear state belonging to the previous time we stopped. */
stop_stack_dummy = STOP_NONE;
- /* If it's a new process, add it to the thread database */
+ /* If it's a new process, add it to the thread database. */
ecs->new_thread_event = (!ptid_equal (ecs->ptid, inferior_ptid)
&& !ptid_equal (ecs->ptid, minus_one_ptid)
set_current_inferior (find_inferior_pid (ptid_get_pid (ecs->ptid)));
set_current_program_space (current_inferior ()->pspace);
handle_vfork_child_exec_or_exit (0);
- target_terminal_ours (); /* Must do this before mourn anyway */
+ target_terminal_ours (); /* Must do this before mourn anyway. */
print_exited_reason (ecs->ws.value.integer);
/* Record the exit code in the convenience variable $_exitcode, so
set_current_program_space (current_inferior ()->pspace);
handle_vfork_child_exec_or_exit (0);
stop_print_frame = 0;
- target_terminal_ours (); /* Must do this before mourn anyway */
+ target_terminal_ours (); /* Must do this before mourn anyway. */
/* Note: By definition of TARGET_WAITKIND_SIGNALLED, we shouldn't
reach here unless the inferior is dead. However, for years
target_kill() was called here, which hints that fatal signals aren't
really fatal on some systems. If that's true, then some changes
- may be needed. */
+ may be needed. */
target_mourn_inferior ();
print_signal_exited_reason (ecs->ws.value.sig);
return;
/* The following are the only cases in which we keep going;
- the above cases end in a continue or goto. */
+ the above cases end in a continue or goto. */
case TARGET_WAITKIND_FORKED:
case TARGET_WAITKIND_VFORKED:
if (debug_infrun)
if (singlestep_breakpoints_inserted_p)
{
- /* Pull the single step breakpoints out of the target. */
+ /* Pull the single step breakpoints out of the target. */
remove_single_step_breakpoints ();
singlestep_breakpoints_inserted_p = 0;
}
if (debug_infrun)
fprintf_unfiltered (gdb_stdlog,
"infrun: TARGET_WAITKIND_SYSCALL_ENTRY\n");
- /* Getting the current syscall number */
+ /* Getting the current syscall number. */
if (handle_syscall_event (ecs) != 0)
return;
goto process_event_stop_test;
get_regcache_aspace (get_thread_regcache (ecs->ptid));
/* Check if a regular breakpoint has been hit before checking
- for a potential single step breakpoint. Otherwise, GDB will
+ for a potential single step breakpoint. Otherwise, GDB will
not see this breakpoint hit when stepping onto breakpoints. */
if (regular_breakpoint_inserted_here_p (aspace, stop_pc))
{
context_switch (ecs->ptid);
/* Saw a breakpoint, but it was hit by the wrong thread.
- Just continue. */
+ Just continue. */
if (singlestep_breakpoints_inserted_p)
{
- /* Pull the single step breakpoints out of the target. */
+ /* Pull the single step breakpoints out of the target. */
remove_single_step_breakpoints ();
singlestep_breakpoints_inserted_p = 0;
}
the bp's: On HP-UX's that use ttrace, we can't
change the address space of a vforking child
process until the child exits (well, okay, not
- then either :-) or execs. */
+ then either :-) or execs. */
if (remove_status != 0)
error (_("Cannot step over breakpoint hit in wrong thread"));
else
if (singlestep_breakpoints_inserted_p)
{
- /* Pull the single step breakpoints out of the target. */
+ /* Pull the single step breakpoints out of the target. */
remove_single_step_breakpoints ();
singlestep_breakpoints_inserted_p = 0;
}
{
/* We're trying to step off a breakpoint. Turns out that we're
also on an instruction that needs to be stepped multiple
- times before it's been fully executing. E.g., architectures
+ times before it's been fully executing. E.g., architectures
with a delay slot. It needs to be stepped twice, once for
the instruction and once for the delay slot. */
int step_through_delay
/* When we reach this point, we've pretty much decided
that the reason for stopping must've been a random
- (unexpected) signal. */
+ (unexpected) signal. */
else
ecs->random_signal = 1;
if (ecs->event_thread->stepping_through_solib_after_catch)
{
#if defined(SOLIB_ADD)
- /* Have we reached our destination? If not, keep going. */
+ /* Have we reached our destination? If not, keep going. */
if (SOLIB_IN_DYNAMIC_LINKER (PIDGET (ecs->ptid), stop_pc))
{
if (debug_infrun)
if (debug_infrun)
fprintf_unfiltered (gdb_stdlog, "infrun: step past dynamic linker\n");
/* Else, stop and report the catchpoint(s) whose triggering
- caused us to begin stepping. */
+ caused us to begin stepping. */
ecs->event_thread->stepping_through_solib_after_catch = 0;
bpstat_clear (&ecs->event_thread->control.stop_bpstat);
ecs->event_thread->control.stop_bpstat
/* Only proceed through if we know where it's going. */
if (real_stop_pc)
{
- /* And put the step-breakpoint there and go until there. */
+ /* And put the step-breakpoint there and go until there. */
struct symtab_and_line sr_sal;
init_sal (&sr_sal); /* initialize to zeroes */
/* This function handles various cases where we need to continue
waiting for the inferior. */
-/* (Used to be the keep_going: label in the old wait_for_inferior) */
+/* (Used to be the keep_going: label in the old wait_for_inferior). */
static void
keep_going (struct execution_control_state *ecs)
halts the simulation handing control to GDB; GDB, noteing
that the break-point isn't valid, returns control back to the
simulator; the simulator then delivers the hardware
- equivalent of a SIGNAL_TRAP to the program being debugged. */
+ equivalent of a SIGNAL_TRAP to the program being debugged. */
if (ecs->event_thread->suspend.stop_signal == TARGET_SIGNAL_TRAP
&& !signal_program[ecs->event_thread->suspend.stop_signal])
}
/* Signal received, print why the inferior has stopped. The signal table
- tells us to print about it. */
+ tells us to print about it. */
static void
print_signal_received_reason (enum target_signal siggnal)
/* Select innermost stack frame - i.e., current frame is frame 0,
and current location is based on that.
Don't do this on return from a stack dummy routine,
- or if the program has exited. */
+ or if the program has exited. */
if (!stop_stack_dummy)
{
we have changed functions or hit a breakpoint.
Print source line if we have one.
bpstat_print() contains the logic deciding in detail
- what to print, based on the event(s) that just occurred. */
+ what to print, based on the event(s) that just occurred. */
/* If --batch-silent is enabled then there's no need to print the current
source location, and to try risks causing an error message about
&& frame_id_eq (tp->control.step_frame_id,
get_frame_id (get_current_frame ()))
&& step_start_function == find_pc_function (stop_pc))
- source_flag = SRC_LINE; /* finished step, just
- print source line */
+ source_flag = SRC_LINE; /* Finished step, just
+ print source line. */
else
- source_flag = SRC_AND_LOC; /* print location and
- source line */
+ source_flag = SRC_AND_LOC; /* Print location and
+ source line. */
break;
case PRINT_SRC_AND_LOC:
- source_flag = SRC_AND_LOC; /* print location and
- source line */
+ source_flag = SRC_AND_LOC; /* Print location and
+ source line. */
break;
case PRINT_SRC_ONLY:
source_flag = SRC_LINE;
flag is:
SRC_LINE: Print only source line
LOCATION: Print only location
- SRC_AND_LOC: Print location and source line */
+ SRC_AND_LOC: Print location and source line. */
if (do_frame_printing)
print_stack_frame (get_selected_frame (NULL), 0, source_flag);
error_no_arg (_("signal to handle"));
}
- /* Allocate and zero an array of flags for which signals to handle. */
+ /* Allocate and zero an array of flags for which signals to handle. */
nsigs = (int) TARGET_SIGNAL_LAST;
sigs = (unsigned char *) alloca (nsigs);
memset (sigs, 0, nsigs);
- /* Break the command line up into args. */
+ /* Break the command line up into args. */
argv = gdb_buildargv (args);
old_chain = make_cleanup_freeargv (argv);
/* Walk through the args, looking for signal oursigs, signal names, and
actions. Signal numbers and signal names may be interspersed with
actions, with the actions being performed for all signals cumulatively
- specified. Signal ranges can be specified as <LOW>-<HIGH>. */
+ specified. Signal ranges can be specified as <LOW>-<HIGH>. */
while (*argv != NULL)
{
if (wordlen >= 1 && !strncmp (*argv, "all", wordlen))
{
/* Apply action to all signals except those used by the
- debugger. Silently skip those. */
+ debugger. Silently skip those. */
allsigs = 1;
sigfirst = 0;
siglast = nsigs - 1;
}
if (sigfirst > siglast)
{
- /* Bet he didn't figure we'd think of this case... */
+ /* Bet he didn't figure we'd think of this case... */
signum = sigfirst;
sigfirst = siglast;
siglast = signum;
}
/* If any signal numbers or symbol names were found, set flags for
- which signals to apply actions to. */
+ which signals to apply actions to. */
for (signum = sigfirst; signum >= 0 && signum <= siglast; signum++)
{
if (args == NULL)
error_no_arg (_("xdb command"));
- /* Break the command line up into args. */
+ /* Break the command line up into args. */
argv = gdb_buildargv (args);
old_chain = make_cleanup_freeargv (argv);
inf_status->thread_control.exception_resume_breakpoint->disposition
= disp_del_at_next_stop;
- /* See save_infcall_control_state for info on stop_bpstat. */
+ /* See save_infcall_control_state for info on stop_bpstat. */
bpstat_clear (&inf_status->thread_control.stop_bpstat);
xfree (inf_status);
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* This is just a first cut at separating out the "interpreter"
functions of gdb into self-contained modules. There are a couple
struct interp
{
- /* This is the name in "-i=" and set interpreter. */
+ /* This is the name in "-i=" and set interpreter. */
const char *name;
/* Interpreters are stored in a linked list, this is the next
object is a bit confused. */
void *data;
- /* Has the init_proc been run? */
+ /* Has the init_proc been run? */
int inited;
/* This is the ui_out used to collect results for this interpreter.
int quiet_p;
};
-/* Functions local to this file. */
+/* Functions local to this file. */
static void initialize_interps (void);
static char **interpreter_completer (struct cmd_list_element *cmd,
char *text, char *word);
-/* The magic initialization routine for this module. */
+/* The magic initialization routine for this module. */
void _initialize_interpreter (void);
/* interp_new - This allocates space for a new interpreter,
fills the fields from the inputs, and returns a pointer to the
- interpreter. */
+ interpreter. */
struct interp *
interp_new (const char *name, void *data, struct ui_out *uiout,
const struct interp_procs *procs)
init proc is successful, return 1, if it fails, set the old
interpreter back in place and return 0. If we can't restore the
old interpreter, then raise an internal error, since we are in
- pretty bad shape at this point.
+ pretty bad shape at this point.
The TOP_LEVEL parameter tells if this new interpreter is
the top-level one. The top-level is what is requested
top_level_interpreter_ptr = interp;
/* We use interpreter_p for the "set interpreter" variable, so we need
- to make sure we have a malloc'ed copy for the set command to free. */
+ to make sure we have a malloc'ed copy for the set command to free. */
if (interpreter_p != NULL
&& strcmp (current_interpreter->name, interpreter_p) != 0)
{
uiout = interp->interpreter_out;
- /* Run the init proc. If it fails, try to restore the old interp. */
+ /* Run the init proc. If it fails, try to restore the old interp. */
if (!interp->inited)
{
/* Finally, put up the new prompt to show that we are indeed here.
Also, display_gdb_prompt for the console does some readline magic
- which is needed for the console interpreter, at least... */
+ which is needed for the console interpreter, at least... */
if (!first_time)
{
return NULL;
}
-/* Returns the current interpreter. */
+/* Returns the current interpreter. */
struct ui_out *
interp_ui_out (struct interp *interp)
return current_interpreter->interpreter_out;
}
-/* Returns true if the current interp is the passed in name. */
+/* Returns true if the current interp is the passed in name. */
int
current_interp_named_p (const char *interp_name)
{
}
/* interp_exec - This executes COMMAND_STR in the current
- interpreter. */
+ interpreter. */
int
interp_exec_p (struct interp *interp)
{
initialize_interps (void)
{
interpreter_initialized = 1;
- /* Don't know if anything needs to be done here... */
+ /* Don't know if anything needs to be done here... */
}
static void
if (interp_to_use == NULL)
error (_("Could not find interpreter \"%s\"."), prules[0]);
- /* Temporarily set interpreters quiet */
+ /* Temporarily set interpreters quiet. */
old_quiet = interp_set_quiet (old_interp, 1);
use_quiet = interp_set_quiet (interp_to_use, 1);
interp_set_quiet (old_interp, old_quiet);
}
-/* List the possible interpreters which could complete the given text. */
+/* List the possible interpreters which could complete the given text. */
static char **
interpreter_completer (struct cmd_list_element *ignore, char *text, char *word)
{
/* We expect only a very limited number of interpreters, so just
allocate room for all of them plus one for the last that must be NULL
- to correctly end the list. */
+ to correctly end the list. */
for (interp = interp_list; interp != NULL; interp = interp->next)
++alloced;
matches = (char **) xcalloc (alloced + 1, sizeof (char *));
strcpy (matches[num_matches], interp->name);
else if (word > text)
{
- /* Return some portion of interp->name */
+ /* Return some portion of interp->name. */
strcpy (matches[num_matches], interp->name + (word - text));
}
else
{
- /* Return some of text plus interp->name */
+ /* Return some of text plus interp->name. */
strncpy (matches[num_matches], word, text - word);
matches[num_matches][text - word] = '\0';
strcat (matches[num_matches], interp->name);
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef INTERPS_H
#define INTERPS_H
}
/* Function: pointer_to_address
- Convert a target pointer to an address in host (CORE_ADDR) format. */
+ Convert a target pointer to an address in host (CORE_ADDR) format. */
static CORE_ADDR
iq2000_pointer_to_address (struct gdbarch *gdbarch,
only later do we compute its actual address. Since the
offset can be zero, we must first initialize all the
saved regs to minus one (so we can later distinguish
- between one that's not saved, and one that's saved at zero). */
+ between one that's not saved, and one that's saved at zero). */
for (srcreg = 0; srcreg < E_NUM_REGS; srcreg ++)
cache->saved_regs[srcreg] = -1;
cache->using_fp = 0;
{
LONGEST insn = read_memory_unsigned_integer (pc, 4, byte_order);
/* Skip any instructions writing to (sp) or decrementing the
- SP. */
+ SP. */
if ((insn & 0xffe00000) == 0xac200000)
{
/* sw using SP/%1 as base. */
if ((insn & 0xffff8000) == 0x20218000)
{
/* addi %1, %1, -N == addi %sp, %sp, -N */
- /* LEGACY -- from assembly-only port */
+ /* LEGACY -- from assembly-only port. */
found_decr_sp = 1;
cache->framesize = -((signed short) (insn & 0xffff));
continue;
if (tgtreg == E_SP_REGNUM || tgtreg == E_FP_REGNUM)
{
- /* "push" to stack (via SP or FP reg) */
+ /* "push" to stack (via SP or FP reg). */
if (cache->saved_regs[srcreg] == -1) /* Don't save twice. */
cache->saved_regs[srcreg] = offset;
continue;
iq2000_frame_prev_register (struct frame_info *this_frame, void **this_cache,
int regnum)
{
- struct iq2000_frame_cache *cache = iq2000_frame_cache (this_frame, this_cache);
+ struct iq2000_frame_cache *cache = iq2000_frame_cache (this_frame,
+ this_cache);
if (regnum == E_SP_REGNUM && cache->saved_sp)
return frame_unwind_got_constant (this_frame, regnum, cache->saved_sp);
iq2000_frame_this_id (struct frame_info *this_frame, void **this_cache,
struct frame_id *this_id)
{
- struct iq2000_frame_cache *cache = iq2000_frame_cache (this_frame, this_cache);
+ struct iq2000_frame_cache *cache = iq2000_frame_cache (this_frame,
+ this_cache);
/* This marks the outermost frame. */
if (cache->base == 0)
static CORE_ADDR
iq2000_frame_base_address (struct frame_info *this_frame, void **this_cache)
{
- struct iq2000_frame_cache *cache = iq2000_frame_cache (this_frame, this_cache);
+ struct iq2000_frame_cache *cache = iq2000_frame_cache (this_frame,
+ this_cache);
return cache->base;
}
}
/* Convenience function to check 8-byte types for being a scalar type
- or a struct with only one long long or double member. */
+ or a struct with only one long long or double member. */
static int
iq2000_pass_8bytetype_by_address (struct type *type)
{
if (TYPE_CODE (ftype) == TYPE_CODE_FLT
|| TYPE_CODE (ftype) == TYPE_CODE_INT)
return 0;
- /* Everything else, pass by address. */
+ /* Everything else, pass by address. */
return 1;
}
struct type *type;
int i, argreg, typelen, slacklen;
int stackspace = 0;
- /* Used to copy struct arguments into the stack. */
+ /* Used to copy struct arguments into the stack. */
CORE_ADDR struct_ptr;
- /* First determine how much stack space we will need. */
+ /* First determine how much stack space we will need. */
for (i = 0, argreg = E_1ST_ARGREG + (struct_return != 0); i < nargs; i++)
{
type = value_type (args[i]);
{
/* long long,
double, and possibly
- structs with a single field of long long or double. */
+ structs with a single field of long long or double. */
if (argreg <= E_LAST_ARGREG - 1)
{
/* 8-byte arg goes into a register pair
- (must start with an even-numbered reg) */
+ (must start with an even-numbered reg). */
if (((argreg - E_1ST_ARGREG) % 2) != 0)
argreg ++;
argreg += 2;
}
else
{
- argreg = E_LAST_ARGREG + 1; /* no more argregs. */
- /* 8-byte arg goes on stack, must be 8-byte aligned. */
+ argreg = E_LAST_ARGREG + 1; /* no more argregs. */
+ /* 8-byte arg goes on stack, must be 8-byte aligned. */
stackspace = ((stackspace + 7) & ~7);
stackspace += 8;
}
{
/* Structs are passed as pointer to a copy of the struct.
So we need room on the stack for a copy of the struct
- plus for the argument pointer. */
+ plus for the argument pointer. */
if (argreg <= E_LAST_ARGREG)
argreg++;
else
}
/* Now copy params, in ascending order, into their assigned location
- (either in a register or on the stack). */
+ (either in a register or on the stack). */
sp -= (sp % 8); /* align */
struct_ptr = sp;
argreg = E_1ST_ARGREG;
if (struct_return)
{
- /* A function that returns a struct will consume one argreg to do so.
+ /* A function that returns a struct will consume one argreg to do so.
*/
regcache_cooked_write_unsigned (regcache, argreg++, struct_addr);
}
val = value_contents (args[i]);
if (typelen <= 4)
{
- /* Char, short, int, float, pointer, and structs <= four bytes. */
+ /* Char, short, int, float, pointer, and structs <= four bytes. */
slacklen = (4 - (typelen % 4)) % 4;
memset (buf, 0, sizeof (buf));
memcpy (buf + slacklen, val, typelen);
if (argreg <= E_LAST_ARGREG)
{
- /* Passed in a register. */
+ /* Passed in a register. */
regcache_raw_write (regcache, argreg++, buf);
}
else
{
- /* Passed on the stack. */
+ /* Passed on the stack. */
write_memory (sp + stackspace, buf, 4);
stackspace += 4;
}
else if (typelen == 8 && !iq2000_pass_8bytetype_by_address (type))
{
/* (long long), (double), or struct consisting of
- a single (long long) or (double). */
+ a single (long long) or (double). */
if (argreg <= E_LAST_ARGREG - 1)
{
/* 8-byte arg goes into a register pair
- (must start with an even-numbered reg) */
+ (must start with an even-numbered reg). */
if (((argreg - E_1ST_ARGREG) % 2) != 0)
argreg++;
regcache_raw_write (regcache, argreg++, val);
}
else
{
- /* 8-byte arg goes on stack, must be 8-byte aligned. */
- argreg = E_LAST_ARGREG + 1; /* no more argregs. */
+ /* 8-byte arg goes on stack, must be 8-byte aligned. */
+ argreg = E_LAST_ARGREG + 1; /* no more argregs. */
stackspace = ((stackspace + 7) & ~7);
write_memory (sp + stackspace, val, typelen);
stackspace += 8;
}
}
- /* Store return address. */
+ /* Store return address. */
regcache_cooked_write_unsigned (regcache, E_LR_REGNUM, bp_addr);
/* Update stack pointer. */
regcache_cooked_write_unsigned (regcache, E_SP_REGNUM, sp);
- /* And that should do it. Return the new stack pointer. */
+ /* And that should do it. Return the new stack pointer. */
return sp;
}
/* Function: _initialize_iq2000_tdep
Initializer function for the iq2000 module.
- Called by gdb at start-up. */
+ Called by gdb at start-up. */
/* Provide a prototype to silence -Wmissing-prototypes. */
extern initialize_file_ftype _initialize_iq2000_tdep;
#include <sys/procfs.h>
#include <setjmp.h> /* For JB_XXX. */
-/* Prototypes for supply_gregset etc. */
+/* Prototypes for supply_gregset etc. */
#include "gregset.h"
#include "mips-tdep.h"
char fsrbuf[8];
struct gdbarch *gdbarch = get_regcache_arch (regcache);
- /* FIXME, this is wrong for the N32 ABI which has 64 bit FP regs. */
+ /* FIXME, this is wrong for the N32 ABI which has 64 bit FP regs. */
for (regi = 0; regi < 32; regi++)
regcache_raw_supply (regcache, gdbarch_fp0_regnum (gdbarch) + regi,
regcache_raw_supply (regcache,
mips_regnum (gdbarch)->fp_control_status, fsrbuf);
- /* FIXME: how can we supply FCRIR? SGI doesn't tell us. */
+ /* FIXME: how can we supply FCRIR? SGI doesn't tell us. */
regcache_raw_supply (regcache,
mips_regnum (gdbarch)->fp_implementation_revision,
zerobuf);
}
void
-fill_fpregset (const struct regcache *regcache, fpregset_t *fpregsetp, int regno)
+fill_fpregset (const struct regcache *regcache,
+ fpregset_t *fpregsetp, int regno)
{
int regi;
char *from, *to;
struct gdbarch *gdbarch = get_regcache_arch (regcache);
- /* FIXME, this is wrong for the N32 ABI which has 64 bit FP regs. */
+ /* FIXME, this is wrong for the N32 ABI which has 64 bit FP regs. */
for (regi = gdbarch_fp0_regnum (gdbarch);
regi < gdbarch_fp0_regnum (gdbarch) + 32; regi++)
}
/* Register that we are able to handle irix5 core file formats.
- This really is bfd_target_unknown_flavour */
+ This really is bfd_target_unknown_flavour. */
static struct core_fns irix5_core_fns =
{
mem_bfd_iovec_stat);
}
-/* Helper function for reading the global JIT descriptor from remote memory. */
+/* Helper function for reading the global JIT descriptor from remote
+ memory. */
static void
jit_read_descriptor (struct gdbarch *gdbarch,
discard_cleanups (old_cleanups);
}
-/* This function unregisters JITed code and frees the corresponding objfile. */
+/* This function unregisters JITed code and frees the corresponding
+ objfile. */
static void
jit_unregister_code (struct objfile *objfile)
"jit_inferior_init, jit_descriptor_addr = %s\n",
paddress (gdbarch, jit_descriptor_addr));
- /* Read the descriptor so we can check the version number and load any already
- JITed functions. */
+ /* Read the descriptor so we can check the version number and load
+ any already JITed functions. */
jit_read_descriptor (gdbarch, &descriptor);
/* Check that the version number agrees with that we support. */
/* Put a breakpoint in the registration symbol. */
create_jit_event_breakpoint (gdbarch, reg_addr);
- /* If we've attached to a running program, we need to check the descriptor to
- register any functions that were already generated. */
+ /* If we've attached to a running program, we need to check the descriptor
+ to register any functions that were already generated. */
for (cur_entry_addr = descriptor.first_entry;
cur_entry_addr != 0;
cur_entry_addr = cur_entry.next_entry)
jit_inferior_init (target_gdbarch);
}
-/* This function cleans up any code entries left over when the inferior exits.
- We get left over code when the inferior exits without unregistering its code,
- for example when it crashes. */
+/* This function cleans up any code entries left over when the
+ inferior exits. We get left over code when the inferior exits
+ without unregistering its code, for example when it crashes. */
static void
jit_inferior_exit_hook (struct inferior *inf)
jit_read_descriptor (gdbarch, &descriptor);
entry_addr = descriptor.relevant_entry;
- /* Do the corresponding action. */
+ /* Do the corresponding action. */
switch (descriptor.action_flag)
{
case JIT_NOACTION:
case JIT_UNREGISTER:
objf = jit_find_objf_with_entry_addr (entry_addr);
if (objf == NULL)
- printf_unfiltered (_("Unable to find JITed code entry at address: %s\n"),
+ printf_unfiltered (_("Unable to find JITed code "
+ "entry at address: %s\n"),
paddress (gdbarch, entry_addr));
else
jit_unregister_code (objf);
void
_initialize_jit (void)
{
- add_setshow_zinteger_cmd ("jit", class_maintenance, &jit_debug, _("\
-Set JIT debugging."), _("\
-Show JIT debugging."), _("\
-When non-zero, JIT debugging is enabled."),
+ add_setshow_zinteger_cmd ("jit", class_maintenance, &jit_debug,
+ _("Set JIT debugging."),
+ _("Show JIT debugging."),
+ _("When non-zero, JIT debugging is enabled."),
NULL,
show_jit_debug,
&setdebuglist, &showdebuglist);
#ifndef JIT_H
#define JIT_H
-/* When the JIT breakpoint fires, the inferior wants us to take one of these
- actions. These values are used by the inferior, so the values of these enums
- cannot be changed. */
+/* When the JIT breakpoint fires, the inferior wants us to take one of
+ these actions. These values are used by the inferior, so the
+ values of these enums cannot be changed. */
typedef enum
{
JIT_UNREGISTER
} jit_actions_t;
-/* This struct describes a single symbol file in a linked list of symbol files
- describing generated code. As the inferior generates code, it adds these
- entries to the list, and when we attach to the inferior, we read them all.
- For the first element prev_entry should be NULL, and for the last element
- next_entry should be NULL. */
+/* This struct describes a single symbol file in a linked list of
+ symbol files describing generated code. As the inferior generates
+ code, it adds these entries to the list, and when we attach to the
+ inferior, we read them all. For the first element prev_entry
+ should be NULL, and for the last element next_entry should be
+ NULL. */
struct jit_code_entry
{
};
/* This is the global descriptor that the inferior uses to communicate
- information to the debugger. To alert the debugger to take an action, the
- inferior sets the action_flag to the appropriate enum value, updates
- relevant_entry to point to the relevant code entry, and calls the function at
- the well-known symbol with our breakpoint. We then read this descriptor from
- another global well-known symbol. */
+ information to the debugger. To alert the debugger to take an
+ action, the inferior sets the action_flag to the appropriate enum
+ value, updates relevant_entry to point to the relevant code entry,
+ and calls the function at the well-known symbol with our
+ breakpoint. We then read this descriptor from another global
+ well-known symbol. */
struct jit_descriptor
{
CORE_ADDR first_entry;
};
-/* Looks for the descriptor and registration symbols and breakpoints the
- registration function. If it finds both, it registers all the already JITed
- code. If it has already found the symbols, then it doesn't try again. */
+/* Looks for the descriptor and registration symbols and breakpoints
+ the registration function. If it finds both, it registers all the
+ already JITed code. If it has already found the symbols, then it
+ doesn't try again. */
extern void jit_inferior_created_hook (void);
extern void jit_breakpoint_re_set (void);
-/* This function is called by handle_inferior_event when it decides that the JIT
- event breakpoint has fired. */
+/* This function is called by handle_inferior_event when it decides
+ that the JIT event breakpoint has fired. */
extern void jit_event_handler (struct gdbarch *gdbarch);
yacc generated parsers in gdb. Note that these are only the variables
produced by yacc. If other parser generators (bison, byacc, etc) produce
additional global names that conflict at link time, then those parser
- generators need to be fixed instead of adding those names to this list. */
+ generators need to be fixed instead of adding those names to this list. */
#define yymaxdepth java_maxdepth
#define yyparse java_parse
{ $$.length = $1.length + $3.length + 1;
if ($1.ptr + $1.length + 1 == $3.ptr
&& $1.ptr[$1.length] == '.')
- $$.ptr = $1.ptr; /* Optimization. */
+ $$.ptr = $1.ptr; /* Optimization. */
else
{
$$.ptr = (char *) malloc ($$.length + 1);
| Name
{ push_expression_name ($1); }
| VARIABLE
- /* Already written by write_dollar_variable. */
+ /* Already written by write_dollar_variable. */
| PostIncrementExpression
| PostDecrementExpression
;
error (_("Invalid cast expression"));
type = expout->elts[base+1].type;
/* Remove the 'Expression' and slide the
- UnaryExpressionNotPlusMinus down to replace it. */
+ UnaryExpressionNotPlusMinus down to replace it. */
for (i = 0; i < last_exp_size; i++)
expout->elts[base + i] = expout->elts[base + i + 3];
expout_ptr -= 3;
ForcedName
{ push_expression_name ($1); }
| VARIABLE
- /* Already written by write_dollar_variable. */
+ /* Already written by write_dollar_variable. */
| FieldAccess
| ArrayAccess
;
}
c = p[len-1];
- /* A paranoid calculation of (1<<64)-1. */
+ /* A paranoid calculation of (1<<64)-1. */
limit = (ULONGEST)0xffffffff;
limit = ((limit << 16) << 16) | limit;
if (c == 'l' || c == 'L')
case '\'':
/* We either have a character constant ('0' or '\177' for example)
or we have a quoted symbol reference ('foo(int,int)' in C++
- for example). */
+ for example). */
lexptr++;
c = *lexptr++;
if (c == '\\')
case '.':
/* Might be a floating point number. */
if (lexptr[1] < '0' || lexptr[1] > '9')
- goto symbol; /* Nope, must be a symbol. */
+ goto symbol; /* Nope, must be a symbol. */
/* FALL THRU into number case. */
case '0':
do {
/* Grow the static temp buffer if necessary, including allocating
- the first one on demand. */
+ the first one on demand. */
if (tempbufindex + 1 >= tempbufsize)
{
tempbuf = (char *) realloc (tempbuf, tempbufsize += 64);
{
case '\0':
case '"':
- /* Do nothing, loop will terminate. */
+ /* Do nothing, loop will terminate. */
break;
case '\\':
tokptr++;
}
/* If NAME is a valid variable name in this scope, push it and return 1.
- Otherwise, return 0. */
+ Otherwise, return 0. */
static int
push_variable (struct stoken name)
/* Assuming a reference expression has been pushed, emit the
STRUCTOP_PTR ops to access the field named NAME. If NAME is a
- qualified name (has '.'), generate a field access for each part. */
+ qualified name (has '.'), generate a field access for each part. */
static void
push_fieldnames (struct stoken name)
{
if (i == name.length || name.ptr[i] == '.')
{
- /* token.ptr is start of current field name. */
+ /* token.ptr is start of current field name. */
token.length = &name.ptr[i] - token.ptr;
write_exp_elt_opcode (STRUCTOP_PTR);
write_exp_string (token);
}
/* Handle Name in an expression (or LHS).
- Handle VAR, TYPE, TYPE.FIELD1....FIELDN and VAR.FIELD1....FIELDN. */
+ Handle VAR, TYPE, TYPE.FIELD1....FIELDN and VAR.FIELD1....FIELDN. */
static void
push_expression_name (struct stoken name)
{
if (name.ptr[i] == '.')
{
- /* It's a Qualified Expression Name. */
+ /* It's a Qualified Expression Name. */
push_qualified_expression_name (name, i);
return;
}
}
- /* It's a Simple Expression Name. */
+ /* It's a Simple Expression Name. */
if (push_variable (name))
return;
/* This objfile contains symtabs that have been dynamically created
to record dynamically loaded Java classes and dynamically
- compiled java methods. */
+ compiled java methods. */
static struct objfile *dynamics_objfile = NULL;
-/* symtab contains classes read from the inferior. */
+/* symtab contains classes read from the inferior. */
static struct symtab *class_symtab = NULL;
BLOCKVECTOR_NBLOCKS (bv) = 1;
BLOCKVECTOR (class_symtab) = bv;
- /* Allocate dummy STATIC_BLOCK. */
+ /* Allocate dummy STATIC_BLOCK. */
bl = allocate_block (&objfile->objfile_obstack);
BLOCK_DICT (bl) = dict_create_linear (&objfile->objfile_obstack,
NULL);
sym = lookup_symbol (name, expression_context_block, STRUCT_DOMAIN, NULL);
if (sym != NULL)
return SYMBOL_TYPE (sym);
- /* FIXME - should search inferior's symbol table. */
+ /* FIXME - should search inferior's symbol table. */
return NULL;
}
/* Return a nul-terminated string (allocated on OBSTACK) for
- a name given by NAME (which has type Utf8Const*). */
+ a name given by NAME (which has type Utf8Const*). */
char *
get_java_utf8_name (struct obstack *obstack, struct value *name)
static int
java_class_is_primitive (struct value *clas)
{
- struct value *vtable = value_struct_elt (&clas, NULL, "vtable", NULL, "struct");
+ struct value *vtable = value_struct_elt (&clas, NULL, "vtable",
+ NULL, "struct");
CORE_ADDR i = value_as_address (vtable);
return (int) (i & 0x7fffffff) == (int) 0x7fffffff;
}
-/* Read a GCJ Class object, and generated a gdb (TYPE_CODE_STRUCT) type. */
+/* Read a GCJ Class object, and generated a gdb (TYPE_CODE_STRUCT) type. */
struct type *
type_from_class (struct gdbarch *gdbarch, struct value *clas)
return java_primitive_type (gdbarch, value_as_long (sig));
}
- /* Get Class name. */
- /* if clasloader non-null, prepend loader address. FIXME */
+ /* Get Class name. */
+ /* If clasloader non-null, prepend loader address. FIXME */
temp = clas;
utf8_name = value_struct_elt (&temp, NULL, "name", NULL, "structure");
name = get_java_utf8_name (&objfile->objfile_obstack, utf8_name);
name[namelen] = '\0';
is_array = 1;
temp = clas;
- /* Set array element type. */
+ /* Set array element type. */
temp = value_struct_elt (&temp, NULL, "methods", NULL, "structure");
- deprecated_set_value_type (temp, lookup_pointer_type (value_type (clas)));
+ deprecated_set_value_type (temp,
+ lookup_pointer_type (value_type (clas)));
TYPE_TARGET_TYPE (type) = type_from_class (gdbarch, temp);
}
return java_link_class_type (gdbarch, type, clas);
}
-/* Fill in class TYPE with data from the CLAS value. */
+/* Fill in class TYPE with data from the CLAS value. */
static struct type *
java_link_class_type (struct gdbarch *gdbarch,
ninterfaces = 0;
#else
temp = clas;
- ninterfaces = value_as_long (value_struct_elt (&temp, NULL, "interface_len", NULL, "structure"));
+ ninterfaces = value_as_long (value_struct_elt (&temp, NULL, "interface_len",
+ NULL, "structure"));
#endif
TYPE_N_BASECLASSES (type) = (tsuper == NULL ? 0 : 1) + ninterfaces;
temp = clas;
- nfields = value_as_long (value_struct_elt (&temp, NULL, "field_count", NULL, "structure"));
+ nfields = value_as_long (value_struct_elt (&temp, NULL, "field_count",
+ NULL, "structure"));
nfields += TYPE_N_BASECLASSES (type);
- nfields++; /* Add one for dummy "class" field. */
+ nfields++; /* Add one for dummy "class" field. */
TYPE_NFIELDS (type) = nfields;
TYPE_FIELDS (type) = (struct field *)
TYPE_ALLOC (type, sizeof (struct field) * nfields);
if (i > 2 && name[i - 1] == ']' && tsuper != NULL)
{
/* FIXME */
- TYPE_LENGTH (type) = TYPE_LENGTH (tsuper) + 4; /* size with "length" */
+ TYPE_LENGTH (type) = TYPE_LENGTH (tsuper) + 4; /* size with "length" */
}
else
{
temp = clas;
- temp = value_struct_elt (&temp, NULL, "size_in_bytes", NULL, "structure");
+ temp = value_struct_elt (&temp, NULL, "size_in_bytes",
+ NULL, "structure");
TYPE_LENGTH (type) = value_as_long (temp);
}
fields = NULL;
- nfields--; /* First set up dummy "class" field. */
+ nfields--; /* First set up dummy "class" field. */
SET_FIELD_PHYSADDR (TYPE_FIELD (type, nfields), value_address (clas));
TYPE_FIELD_NAME (type, nfields) = "class";
TYPE_FIELD_TYPE (type, nfields) = value_type (clas);
field = value_ind (fields);
}
else
- { /* Re-use field value for next field. */
+ { /* Re-use field value for next field. */
CORE_ADDR addr
= value_address (field) + TYPE_LENGTH (value_type (field));
if (methods == NULL)
{
temp = clas;
- methods = value_struct_elt (&temp, NULL, "methods", NULL, "structure");
+ methods = value_struct_elt (&temp, NULL, "methods",
+ NULL, "structure");
method = value_ind (methods);
}
else
- { /* Re-use method value for next method. */
+ { /* Re-use method value for next method. */
CORE_ADDR addr
= value_address (method) + TYPE_LENGTH (value_type (method));
set_value_lazy (method, 1);
}
- /* Get method name. */
+ /* Get method name. */
temp = method;
temp = value_struct_elt (&temp, NULL, "name", NULL, "structure");
mname = get_java_utf8_name (&objfile->objfile_obstack, temp);
for (k = 0, j = TYPE_NFN_FIELDS (type);;)
{
if (--j < 0)
- { /* No match - new method name. */
+ { /* No match - new method name. */
j = TYPE_NFN_FIELDS (type)++;
fn_fieldlists[j].name = mname;
fn_fieldlists[j].length = 1;
break;
}
if (strcmp (mname, fn_fieldlists[j].name) == 0)
- { /* Found an existing method with the same name. */
+ { /* Found an existing method with the same name. */
int l;
if (mname != unqualified_name)
obstack_free (&objfile->objfile_obstack, mname);
mname = fn_fieldlists[j].name;
fn_fieldlists[j].length++;
- k = i - k; /* Index of new slot. */
- /* Shift intervening fn_fields (between k and i) down. */
+ k = i - k; /* Index of new slot. */
+ /* Shift intervening fn_fields (between k and i) down. */
for (l = i; l > k; l--)
fn_fields[l] = fn_fields[l - 1];
for (l = TYPE_NFN_FIELDS (type); --l > j;)
name = TYPE_TAG_NAME (ttype);
if (name != NULL && strcmp (name, "java.lang.Object") == 0)
return 1;
- name = TYPE_NFIELDS (ttype) > 0 ? TYPE_FIELD_NAME (ttype, 0) : (char *) 0;
+ name
+ = TYPE_NFIELDS (ttype) > 0 ? TYPE_FIELD_NAME (ttype, 0) : (char *) 0;
if (name != NULL && strcmp (name, "vtable") == 0)
{
if (java_object_type == NULL)
}
/* If name[0 .. namelen-1] is the name of a primitive Java type,
- return that type. Otherwise, return NULL. */
+ return that type. Otherwise, return NULL. */
struct type *
java_primitive_type_from_name (struct gdbarch *gdbarch,
}
/* Return the length (in bytes) of demangled name of the Java type
- signature string SIGNATURE. */
+ signature string SIGNATURE. */
static int
java_demangled_signature_length (char *signature)
int array = 0;
for (; *signature == '['; signature++)
- array += 2; /* Two chars for "[]". */
+ array += 2; /* Two chars for "[]". */
switch (signature[0])
{
case 'L':
- /* Subtract 2 for 'L' and ';'. */
+ /* Subtract 2 for 'L' and ';'. */
return strlen (signature) - 2 + array;
default:
return strlen (java_primitive_type_name (signature[0])) + array;
}
}
-/* Demangle the Java type signature SIGNATURE, leaving the result in RESULT. */
+/* Demangle the Java type signature SIGNATURE, leaving the result in
+ RESULT. */
static void
java_demangled_signature_copy (char *result, char *signature)
switch (signature[0])
{
case 'L':
- /* Subtract 2 for 'L' and ';', but add 1 for final nul. */
+ /* Subtract 2 for 'L' and ';', but add 1 for final nul. */
signature++;
ptr = result;
for (; *signature != ';' && *signature != '\0'; signature++)
}
/* Return the demangled name of the Java type signature string SIGNATURE,
- as a freshly allocated copy. */
+ as a freshly allocated copy. */
char *
java_demangle_type_signature (char *signature)
}
/* Return the type of TYPE followed by DIMS pairs of [ ].
- If DIMS == 0, TYPE is returned. */
+ If DIMS == 0, TYPE is returned. */
struct type *
java_array_type (struct type *type, int dims)
{
while (dims-- > 0)
{
- /* FIXME This is bogus! Java arrays are not gdb arrays! */
+ /* FIXME This is bogus! Java arrays are not gdb arrays! */
type = lookup_array_range_type (type, 0, 0);
}
return type;
}
-/* Create a Java string in the inferior from a (Utf8) literal. */
+/* Create a Java string in the inferior from a (Utf8) literal. */
static struct value *
java_value_string (char *ptr, int len)
/* Print the character C on STREAM as part of the contents of a literal
string whose delimiter is QUOTER. Note that that format for printing
- characters and strings is language specific. */
+ characters and strings is language specific. */
static void
java_emit_char (int c, struct type *type, struct ui_file *stream, int quoter)
goto nosideret;
/* If the user attempts to subscript something that is not an
array or pointer type (like a plain int variable for example),
- then report this as an error. */
+ then report this as an error. */
arg1 = coerce_ref (arg1);
type = check_typedef (value_type (arg1));
struct value *clas = java_class_from_object (arg1);
struct value *temp = clas;
- /* Get CLASS_ELEMENT_TYPE of the array type. */
+ /* Get CLASS_ELEMENT_TYPE of the array type. */
temp = value_struct_elt (&temp, NULL, "methods",
NULL, "structure");
deprecated_set_value_type (temp, value_type (clas));
case STRUCTOP_PTR:
arg1 = evaluate_subexp_standard (expect_type, exp, pos, noside);
- /* Convert object field (such as TYPE.class) to reference. */
+ /* Convert object field (such as TYPE.class) to reference. */
if (TYPE_CODE (value_type (arg1)) == TYPE_CODE_STRUCT)
arg1 = value_addr (arg1);
return arg1;
struct value;
-extern int java_parse (void); /* Defined in jv-exp.y */
+extern int java_parse (void); /* Defined in jv-exp.y */
extern void java_error (char *); /* Defined in jv-exp.y */
extern int is_object_type (struct type *);
/* Defined in jv-typeprint.c */
-extern void java_print_type (struct type *, const char *, struct ui_file *, int,
- int);
+extern void java_print_type (struct type *, const char *,
+ struct ui_file *, int, int);
extern char *java_demangle_type_signature (char *);
&& is_cplus_marker ((TYPE_FIELD_NAME (type, i))[5]))
continue;
- /* Don't print the dummy field "class". */
+ /* Don't print the dummy field "class". */
if (strncmp (TYPE_FIELD_NAME (type, i), "class", 5) == 0)
continue;
fprintf_filtered (stream, ";\n");
}
- /* If there are both fields and methods, put a space between. */
+ /* If there are both fields and methods, put a space between. */
len = TYPE_NFN_FIELDS (type);
if (len)
fprintf_filtered (stream, "\n");
- /* Print out the methods */
+ /* Print out the methods. */
for (i = 0; i < len; i++)
{
}
/* For demangled function names, we have the arglist as part of the name,
- so don't print an additional pair of ()'s */
+ so don't print an additional pair of ()'s. */
demangled_args = varstring != NULL && strchr (varstring, '(') != NULL;
c_type_print_varspec_suffix (type, stream, show, 0, demangled_args);
{
CORE_ADDR obj_addr;
- /* Get the run-time type, and cast the object into that */
+ /* Get the run-time type, and cast the object into that. */
obj_addr = unpack_pointer (type, value_contents (val));
if (el_type == NULL)
{
CORE_ADDR element;
- CORE_ADDR next_element = -1; /* dummy initial value */
+ CORE_ADDR next_element = -1; /* Dummy initial value. */
- /* Skip object header and length. */
+ /* Skip object header and length. */
address += get_java_object_header_size (gdbarch) + 4;
while (i < length && things_printed < options->print_max)
for (reps = 1; i + reps < length; reps++)
{
set_value_lazy (next_v, 1);
- set_value_offset (next_v, value_offset (next_v) + TYPE_LENGTH (el_type));
+ set_value_offset (next_v, value_offset (next_v)
+ + TYPE_LENGTH (el_type));
if (memcmp (value_contents (v), value_contents (next_v),
TYPE_LENGTH (el_type)) != 0)
break;
return 0;
}
- /* If it's type String, print it */
+ /* If it's type String, print it. */
if (TYPE_CODE (type) == TYPE_CODE_PTR
&& TYPE_TARGET_TYPE (type)
unsigned long count;
struct value *mark;
- mark = value_mark (); /* Remember start of new values */
+ mark = value_mark (); /* Remember start of new values. */
data_val = value_struct_elt (&val, NULL, "data", NULL, NULL);
data = value_as_address (data_val);
count_val = value_struct_elt (&val, NULL, "count", NULL, NULL);
count = value_as_address (count_val);
- value_free_to_mark (mark); /* Release unnecessary values */
+ value_free_to_mark (mark); /* Release unnecessary values. */
char_type = builtin_java_type (gdbarch)->builtin_char;
val_print_string (char_type, NULL, data + boffset, count, stream,
const struct value_print_options *options)
{
struct gdbarch *gdbarch = get_type_arch (type);
- unsigned int i = 0; /* Number of characters printed */
+ unsigned int i = 0; /* Number of characters printed. */
struct type *target_type;
CORE_ADDR addr;
{
/* Print the unmangled name if desired. */
/* Print vtable entry - we only get here if we ARE using
- -fvtable_thunks. (Otherwise, look under TYPE_CODE_STRUCT.) */
+ -fvtable_thunks. (Otherwise, look under TYPE_CODE_STRUCT.) */
/* Extract an address, assume that it is unsigned. */
print_address_demangle (gdbarch,
- extract_unsigned_integer (valaddr, TYPE_LENGTH (type)),
+ extract_unsigned_integer (valaddr,
+ TYPE_LENGTH (type)),
stream, demangle);
break;
}
/* This file contains functions that return things that are specific
to languages. Each function should examine current_language if necessary,
- and return the appropriate result. */
+ and return the appropriate result. */
/* FIXME: Most of these would be better organized as macros which
return data out of a "language-specific" struct pointer that is set
enum case_mode case_mode = case_mode_auto;
enum case_sensitivity case_sensitivity = case_sensitive_on;
-/* The current language and language_mode (see language.h) */
+/* The current language and language_mode (see language.h). */
const struct language_defn *current_language = &unknown_language_defn;
enum language_mode language_mode = language_mode_auto;
static const char *case_sensitive;
/* Warning issued when current_language and the language of the current
- frame do not match. */
+ frame do not match. */
char lang_frame_mismatch_warn[] =
"Warning: the current language does not match this frame.";
\f
/* This page contains the functions corresponding to GDB commands
- and their helpers. */
+ and their helpers. */
/* Show command. Display a warning if the language set
- does not match the frame. */
+ does not match the frame. */
static void
show_language_command (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
{
- enum language flang; /* The language of the current frame */
+ enum language flang; /* The language of the current frame. */
if (language_mode == language_mode_auto)
fprintf_filtered (gdb_stdout,
printf_filtered ("%s\n", lang_frame_mismatch_warn);
}
-/* Set command. Change the current working language. */
+/* Set command. Change the current working language. */
static void
set_language_command (char *ignore, int from_tty, struct cmd_list_element *c)
{
}
/* Show command. Display a warning if the type setting does
- not match the current language. */
+ not match the current language. */
static void
show_type_command (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
" does not match the language.\n"));
}
-/* Set command. Change the setting for type checking. */
+/* Set command. Change the setting for type checking. */
static void
set_type_command (char *ignore, int from_tty, struct cmd_list_element *c)
{
}
/* Show command. Display a warning if the range setting does
- not match the current language. */
+ not match the current language. */
static void
show_range_command (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
"does not match the language.\n"));
}
-/* Set command. Change the setting for range checking. */
+/* Set command. Change the setting for range checking. */
static void
set_range_command (char *ignore, int from_tty, struct cmd_list_element *c)
{
}
/* Show command. Display a warning if the case sensitivity setting does
- not match the current language. */
+ not match the current language. */
static void
show_case_command (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
/* Set the status of range and type checking and case sensitivity based on
the current modes and the current language.
If SHOW is non-zero, then print out the current language,
- type and range checking status. */
+ type and range checking status. */
static void
set_type_range_case (void)
{
case_sensitivity = current_language->la_case_sensitivity;
}
-/* Set current language to (enum language) LANG. Returns previous language. */
+/* Set current language to (enum language) LANG. Returns previous
+ language. */
enum language
set_language (enum language lang)
}
}
\f
-/* Return the result of a binary operation. */
+/* Return the result of a binary operation. */
#if 0 /* Currently unused */
break;
case language_m2:
/* If we are doing type-checking, l1 should equal l2, so this is
- not needed. */
+ not needed. */
return l1 > l2 ? VALUE_TYPE (v1) : VALUE_TYPE (v2);
break;
}
Note that some of them are not currently dependent upon which language
is currently being parsed. For example, floats are the same in
C and Modula-2 (ie. the only floating point type has TYPE_CODE of
- TYPE_CODE_FLT), while booleans are different. */
+ TYPE_CODE_FLT), while booleans are different. */
/* Returns non-zero if its argument is a simple type. This is the same for
both Modula-2 and for C. In the C case, TYPE_CODE_CHAR will never occur,
- and thus will never cause the failure of the test. */
+ and thus will never cause the failure of the test. */
int
simple_type (struct type *type)
{
/* Returns non-zero if its argument is of an ordered type.
An ordered type is one in which the elements can be tested for the
properties of "greater than", "less than", etc, or for which the
- operations "increment" or "decrement" make sense. */
+ operations "increment" or "decrement" make sense. */
int
ordered_type (struct type *type)
{
}
}
-/* Returns non-zero if the two types are the same */
+/* Returns non-zero if the two types are the same. */
int
same_type (struct type *arg1, struct type *arg2)
{
CHECK_TYPEDEF (type);
if (structured_type (arg1)
? !structured_type (arg2) : structured_type (arg2))
- /* One is structured and one isn't */
+ /* One is structured and one isn't. */
return 0;
else if (structured_type (arg1) && structured_type (arg2))
return arg1 == arg2;
return arg1 == arg2;
}
-/* Returns non-zero if the type is integral */
+/* Returns non-zero if the type is integral. */
int
integral_type (struct type *type)
{
}
}
-/* Returns non-zero if the value is numeric */
+/* Returns non-zero if the value is numeric. */
int
numeric_type (struct type *type)
{
}
}
-/* Returns non-zero if the value is a character type */
+/* Returns non-zero if the value is a character type. */
int
character_type (struct type *type)
{
}
}
-/* Returns non-zero if the value is a string type */
+/* Returns non-zero if the value is a string type. */
int
string_type (struct type *type)
{
case language_cplus:
case language_d:
case language_objc:
- /* C does not have distinct string type. */
+ /* C does not have distinct string type. */
return (0);
default:
return (0);
}
}
-/* Returns non-zero if the value is a boolean type */
+/* Returns non-zero if the value is a boolean type. */
int
boolean_type (struct type *type)
{
return 0;
}
-/* Returns non-zero if the value is a floating-point type */
+/* Returns non-zero if the value is a floating-point type. */
int
float_type (struct type *type)
{
}
#endif
-/* Returns non-zero if the value is a pointer type */
+/* Returns non-zero if the value is a pointer type. */
int
pointer_type (struct type *type)
{
}
#if 0
-/* Returns non-zero if the value is a structured type */
+/* Returns non-zero if the value is a structured type. */
int
structured_type (struct type *type)
{
#endif
\f
/* This page contains functions that return info about
- (struct value) values used in GDB. */
+ (struct value) values used in GDB. */
-/* Returns non-zero if the value VAL represents a true value. */
+/* Returns non-zero if the value VAL represents a true value. */
int
value_true (struct value *val)
{
\f
/* This page contains functions for the printing out of
error messages that occur during type- and range-
- checking. */
+ checking. */
/* These are called when a language fails a type- or range-check. The
first argument should be a printf()-style format string, and the
rest of the arguments should be its arguments. If
[type|range]_check is [type|range]_check_on, an error is printed;
if [type|range]_check_warn, a warning; otherwise just the
- message. */
+ message. */
void
type_error (const char *string,...)
}
\f
-/* This page contains miscellaneous functions */
+/* This page contains miscellaneous functions. */
-/* Return the language enum for a given language string. */
+/* Return the language enum for a given language string. */
enum language
language_enum (char *str)
return language_unknown;
}
-/* Return the language struct for a given language enum. */
+/* Return the language struct for a given language enum. */
const struct language_defn *
language_def (enum language lang)
return NULL;
}
-/* Return the language as a string */
+/* Return the language as a string. */
char *
language_str (enum language lang)
{
return 0;
}
-/* Return demangled language symbol, or NULL.
+/* Return demangled language symbol, or NULL.
FIXME: Options are only useful for certain languages and ignored
by others, so it would be better to remove them here and have a
- more flexible demangler for the languages that need it.
+ more flexible demangler for the languages that need it.
FIXME: Sometimes the demangler is invoked when we don't know the
language, so we can't use this everywhere. */
char *
/* Return class name from physname or NULL. */
char *
-language_class_name_from_physname (const struct language_defn *current_language,
+language_class_name_from_physname (const struct language_defn *curr_language,
const char *physname)
{
if (current_language != NULL
LANG_MAGIC
};
-/* These two structs define fake entries for the "local" and "auto" options. */
+/* These two structs define fake entries for the "local" and "auto"
+ options. */
const struct language_defn auto_language_defn =
{
"auto",
return (NULL);
}
-/* Initialize the language routines */
+/* Initialize the language routines. */
void
_initialize_language (void)
language_gdbarch_data
= gdbarch_data_register_post_init (language_gdbarch_post_init);
- /* GDB commands for language specific stuff */
+ /* GDB commands for language specific stuff. */
add_prefix_cmd ("check", no_class, set_check,
_("Set the status of the type/range checker."),
range = xstrdup ("auto");
case_sensitive = xstrdup ("auto");
- /* Have the above take effect */
+ /* Have the above take effect. */
set_language (language_auto);
}
#if !defined (LANGUAGE_H)
#define LANGUAGE_H 1
-/* Forward decls for prototypes */
+/* Forward decls for prototypes. */
struct value;
struct objfile;
struct frame_info;
struct ui_file;
struct value_print_options;
-#define MAX_FORTRAN_DIMS 7 /* Maximum number of F77 array dims */
+#define MAX_FORTRAN_DIMS 7 /* Maximum number of F77 array dims. */
/* range_mode ==
range_mode_auto: range_check set automatically to default of language.
range_check;
/* type_mode ==
- type_mode_auto: type_check set automatically to default of language
- type_mode_manual: type_check set manually by user. */
+ type_mode_auto: type_check set automatically to default of language.
+ type_mode_manual: type_check set manually by user. */
extern enum type_mode
{
type_check;
/* case_mode ==
- case_mode_auto: case_sensitivity set upon selection of scope
+ case_mode_auto: case_sensitivity set upon selection of scope.
case_mode_manual: case_sensitivity set only by user. */
extern enum case_mode
case_mode;
/* array_ordering ==
- array_row_major: Arrays are in row major order
- array_column_major: Arrays are in column major order.*/
+ array_row_major: Arrays are in row major order.
+ array_column_major: Arrays are in column major order. */
extern enum array_ordering
{
/* case_sensitivity ==
- case_sensitive_on: Case sensitivity in name matching is used
- case_sensitive_off: Case sensitivity in name matching is not used */
+ case_sensitive_on: Case sensitivity in name matching is used.
+ case_sensitive_off: Case sensitivity in name matching is not used. */
extern enum case_sensitivity
{
/* macro_expansion ==
- macro_expansion_no: No macro expansion is available
- macro_expansion_c: C-like macro expansion is available */
+ macro_expansion_no: No macro expansion is available.
+ macro_expansion_c: C-like macro expansion is available. */
enum macro_expansion
{
expressions, regardless of whether the program being debugged
actually defines such a type. */
struct type **primitive_type_vector;
- /* Type of elements of strings. */
+ /* Type of elements of strings. */
struct type *string_char_type;
/* Symbol name of type to use as boolean type, if defined. */
struct language_defn
{
- /* Name of the language */
+ /* Name of the language. */
char *la_name;
- /* its symtab language-enum (defs.h) */
+ /* its symtab language-enum (defs.h). */
enum language la_language;
- /* Default range checking */
+ /* Default range checking. */
enum range_check la_range_check;
- /* Default type checking */
+ /* Default type checking. */
enum type_check la_type_check;
- /* Default case sensitivity */
+ /* Default case sensitivity. */
enum case_sensitivity la_case_sensitivity;
- /* Multi-dimensional array ordering */
+ /* Multi-dimensional array ordering. */
enum array_ordering la_array_ordering;
/* Style of macro expansion, if any, supported by this language. */
enum macro_expansion la_macro_expansion;
/* Definitions related to expression printing, prefixifying, and
- dumping */
+ dumping. */
const struct exp_descriptor *la_exp_desc;
- /* Parser function. */
+ /* Parser function. */
int (*la_parser) (void);
- /* Parser error function */
+ /* Parser error function. */
void (*la_error) (char *);
void (*la_emitchar) (int ch, struct type *chtype,
struct ui_file * stream, int quoter);
- /* Print a type using syntax appropriate for this language. */
+ /* Print a type using syntax appropriate for this language. */
void (*la_print_type) (struct type *, const char *, struct ui_file *, int,
int);
const struct value *val,
const struct value_print_options *options);
- /* Print a top-level value using syntax appropriate for this language. */
+ /* Print a top-level value using syntax appropriate for this language. */
int (*la_value_print) (struct value *, struct ui_file *,
const struct value_print_options *);
/* Return class name of a mangled method name or NULL. */
char *(*la_class_name_from_physname) (const char *physname);
- /* Table for printing expressions */
+ /* Table for printing expressions. */
const struct op_print *la_op_print_tab;
/* Zero if the language has first-class arrays. True if there are no
- array values, and array objects decay to pointers, as in C. */
+ array values, and array objects decay to pointers, as in C. */
char c_style_arrays;
- /* Index to use for extracting the first element of a string. */
+ /* Index to use for extracting the first element of a string. */
char string_lower_bound;
/* The list of characters forming word boundaries. */
void (*la_get_string) (struct value *value, gdb_byte **buffer, int *length,
struct type **chartype, const char **charset);
- /* Add fields above this point, so the magic number is always last. */
- /* Magic number for compat checking */
+ /* Add fields above this point, so the magic number is always last. */
+ /* Magic number for compat checking. */
long la_magic;
/* These macros define the behaviour of the expression
evaluator. */
-/* Should we strictly type check expressions? */
+/* Should we strictly type check expressions? */
#define STRICT_TYPE (type_check != type_check_off)
-/* Should we range check values against the domain of their type? */
+/* Should we range check values against the domain of their type? */
#define RANGE_CHECK (range_check != range_check_off)
-/* "cast" really means conversion */
-/* FIXME -- should be a setting in language_defn */
+/* "cast" really means conversion. */
+/* FIXME -- should be a setting in language_defn. */
#define CAST_IS_CONVERSION(LANG) ((LANG)->la_language == language_c || \
(LANG)->la_language == language_cplus || \
(LANG)->la_language == language_objc)
/* This page contains functions that return things that are
specific to languages. Each of these functions is based on
the current setting of working_lang, which the user sets
- with the "set language" command. */
+ with the "set language" command. */
#define LA_PRINT_TYPE(type,varstring,stream,show,level) \
(current_language->la_print_type(type,varstring,stream,show,level))
or needs to be printed in another representation. For example,
in C the literal form of the character with octal value 141 is 'a'
and the "other representation" is '\141'. The "other representation"
- is program language dependent. */
+ is program language dependent. */
#define PRINT_LITERAL_FORM(c) \
((c) >= 0x20 \
extern int structured_type (struct type *);
-/* Checks Binary and Unary operations for semantic type correctness */
-/* FIXME: Does not appear to be used */
+/* Checks Binary and Unary operations for semantic type correctness. */
+/* FIXME: Does not appear to be used. */
#define unop_type_check(v,o) binop_type_check((v),NULL,(o))
extern void binop_type_check (struct value *, struct value *, int);
extern enum language get_frame_language (void); /* In stack.c */
-/* Check for a language-specific trampoline. */
+/* Check for a language-specific trampoline. */
extern CORE_ADDR skip_language_trampoline (struct frame_info *, CORE_ADDR pc);
#include "target.h"
#include "arch-utils.h"
-/* We share this one with symtab.c, but it is not exported widely. */
+/* We share this one with symtab.c, but it is not exported widely. */
extern char *operator_chars (char *, char **);
-/* Prototypes for local functions */
+/* Prototypes for local functions. */
static void initialize_defaults (struct symtab **default_symtab,
int *default_line);
symtabs_and_lines minsym_found (int funfirstline,
struct minimal_symbol *msymbol);
-/* Helper functions. */
+/* Helper functions. */
/* Issue a helpful hint on using the command completion feature on
single quoted demangled C++ symbols as part of the completion
}
/* Return the number of methods described for TYPE, including the
- methods from types it derives from. This can't be done in the symbol
+ methods from types it derives from. This can't be done in the symbol
reader because the type of the baseclass might still be stubbed
when the definition of the derived class is parsed. */
else
{
/* This error message gets printed, but the method
- still seems to be found
+ still seems to be found.
fputs_filtered("(Cannot find method ", gdb_stdout);
fprintf_symbol_filtered (gdb_stdout, phys_name,
- language_cplus,
- DMGL_PARAMS | DMGL_ANSI);
+ language_cplus,
+ DMGL_PARAMS | DMGL_ANSI);
fputs_filtered(" - possibly inlined.)\n", gdb_stdout);
*/
}
}
/* Determines if the gives string corresponds to an Objective-C method
- representation, such as -[Foo bar:] or +[Foo bar]. Objective-C symbols
+ representation, such as -[Foo bar:] or +[Foo bar]. Objective-C symbols
are allowed to have spaces and parentheses in them. */
static int
return p;
}
\f
-/* The parser of linespec itself. */
+/* The parser of linespec itself. */
/* Parse a string that specifies a line number.
Pass the address of a char * variable; that variable will be
DEFAULT_LINE specifies the line number to use for relative
line numbers (that start with signs). Defaults to current_source_line.
If CANONICAL is non-NULL, store an array of strings containing the canonical
- line specs there if necessary. Currently overloaded member functions and
+ line specs there if necessary. Currently overloaded member functions and
line numbers or static functions without a filename yield a canonical
- line spec. The array and the line spec strings are allocated on the heap,
+ line spec. The array and the line spec strings are allocated on the heap,
it is the callers responsibility to free them.
Note that it is possible to return zero for the symtab
/* Locate the end of the first half of the linespec.
After the call, for instance, if the argptr string is "foo.c:123"
p will point at "123". If there is only one part, like "foo", p
- will point to "". If this is a C++ name, like "A::B::foo", p will
- point to "::B::foo". Argptr is not changed by this call. */
+ will point to "". If this is a C++ name, like "A::B::foo", p will
+ point to "::B::foo". Argptr is not changed by this call. */
first_half = p = locate_first_half (argptr, &is_quote_enclosed);
{
/* Is it a C++ or Java compound data structure?
The check on p[1] == ':' is capturing the case of "::",
- since p[0]==':' was checked above.
+ since p[0]==':' was checked above.
Note that the call to decode_compound does everything
for us, including the lookup on the symbol table, so we
- can return now. */
+ can return now. */
if (p[0] == '.' || p[1] == ':')
{
}
else if (is_objc_method)
{
- /* allow word separators in method names for Obj-C */
+ /* allow word separators in method names for Obj-C. */
p = skip_quoted_chars (*argptr, NULL, "");
}
else
p = skip_quoted (*argptr);
}
- /* Keep any template parameters */
+ /* Keep any template parameters. */
if (*p == '<')
p = find_template_name_end (p);
if (*p == '(')
p = find_method_overload_end (p);
- /* Make sure we keep important kewords like "const" */
+ /* Make sure we keep important kewords like "const". */
if (strncmp (p, " const", 6) == 0)
p += 6;
{
/* Use whatever we have for the default source line. We don't use
get_current_or_default_symtab_and_line as it can recurse and call
- us back! */
+ us back! */
struct symtab_and_line cursal =
get_current_source_symtab_and_line ();
has_comma = (ii != 0);
/* Temporarily zap out second half to not confuse the code below.
- This is undone below. Do not change ii!! */
+ This is undone below. Do not change ii!! */
if (has_comma)
{
*ii = '\0';
p = temp_end;
}
/* Check for a colon and a plus or minus and a [ (which
- indicates an Objective-C method) */
+ indicates an Objective-C method). */
if (is_objc_method_format (p))
{
break;
if (i1 > 0)
{
- sym_arr = (struct symbol **) alloca ((i1 + 1) * sizeof (struct symbol *));
+ sym_arr = (struct symbol **)
+ alloca ((i1 + 1) * sizeof (struct symbol *));
sym_arr[i1] = NULL;
copy = find_imps (file_symtab, block, *argptr, sym_arr, &i1, &i2);
if (i1 > 1)
{
- /* More than one match. The user must choose one or more. */
+ /* More than one match. The user must choose one or more. */
return decode_line_2 (sym_arr, i2, funfirstline, canonical);
}
/* First check for "global" namespace specification, of the form
"::foo". If found, skip over the colons and jump to normal
symbol processing. I.e. the whole line specification starts with
- "::" (note the condition that *argptr == p). */
+ "::" (note the condition that *argptr == p). */
if (p[0] == ':'
&& ((*argptr == p) || (p[-1] == ' ') || (p[-1] == '\t')))
saved_arg2 += 2;
p2 = p; /* Save for restart. */
- /* This is very messy. Following the example above we have now the
+ /* This is very messy. Following the example above we have now the
following pointers:
p -> "::inA::fun"
argptr -> "AAA::inA::fun
saved_arg -> "AAA::inA::fun
saved_arg2 -> "AAA::inA::fun
- p2 -> "::inA::fun". */
+ p2 -> "::inA::fun". */
/* In the loop below, with these strings, we'll make 2 passes, each
- is marked in comments.*/
+ is marked in comments. */
while (1)
{
/* PASS1: at this point p2->"::inA::fun", so p->":inA::fun",
i.e. if there is a double-colon, p will now point to the
- second colon. */
+ second colon. */
/* PASS2: p2->"::fun", p->":fun" */
/* Move pointer ahead to next double-colon. */
/* Note that, since, at the start of this loop, p would be
pointing to the second colon in a double-colon, we only
satisfy the condition below if there is another
- double-colon to the right (after). I.e. there is another
- component that can be a class or a namespace. I.e, if at
+ double-colon to the right (after). I.e. there is another
+ component that can be a class or a namespace. I.e, if at
the beginning of this loop (PASS1), we had
p->":inA::fun", we'll trigger this when p has been
advanced to point to "::fun". */
- /* PASS2: we will not trigger this. */
+ /* PASS2: we will not trigger this. */
else if ((p[0] == ':') && (p[1] == ':'))
break; /* Found double-colon. */
else
break; /* Out of the while (1). This would happen
for instance if we have looked up
unsuccessfully all the components of the
- string, and p->""(PASS2) */
+ string, and p->""(PASS2). */
/* We get here if p points to ' ', '\t', '\'', "::" or ""(i.e
- string ended). */
+ string ended). */
/* Save restart for next time around. */
p2 = p;
/* Restore argptr as it was on entry to this function. */
} /* while (1) */
- /* Start of lookup in the symbol tables. */
+ /* Start of lookup in the symbol tables. */
/* Lookup in the symbol table the substring between argptr and
- p. Note, this call changes the value of argptr. */
+ p. Note, this call changes the value of argptr. */
/* Before the call, argptr->"AAA::inA::fun",
p->"", p2->"::fun". After the call: argptr->"fun", p, p2
unchanged. */
p += cp_validate_operator (p - 8) - 8;
}
- /* Keep any template parameters */
+ /* Keep any template parameters. */
if (*p == '<')
p = find_template_name_end (p);
if (a != NULL)
p = find_method_overload_end (a);
- /* Make sure we keep important kewords like "const" */
+ /* Make sure we keep important kewords like "const". */
if (strncmp (p, " const", 6) == 0)
p += 6;
}
/* Allocate our own copy of the substring between argptr and
- p. */
+ p. */
copy = (char *) alloca (p - *argptr + 1);
memcpy (copy, *argptr, p - *argptr);
copy[p - *argptr] = '\0';
copy[p - *argptr - 1]) != NULL)
copy[p - *argptr - 1] = '\0';
- /* At this point copy->"fun", p->"" */
+ /* At this point copy->"fun", p->"". */
/* No line number may be specified. */
while (*p == ' ' || *p == '\t')
*argptr = p;
/* At this point arptr->"". */
- /* Look for copy as a method of sym_class. */
+ /* Look for copy as a method of sym_class. */
/* At this point copy->"fun", sym_class is "AAA:inA",
saved_arg->"AAA::inA::fun". This concludes the scanning of
the string for possible components matches. If we find it
- here, we return. If not, and we are at the and of the string,
+ here, we return. If not, and we are at the and of the string,
we'll lookup the whole string in the symbol tables. */
values = find_method (funfirstline, canonical, saved_arg,
}
}
return values;
- } /* End if symbol found */
+ } /* End if symbol found. */
/* We couldn't find a class, so we're in case 2 above. We check the
/* Set argptr to skip over the name. */
*argptr = (*p == '\'') ? p + 1 : p;
- /* Look up entire name */
+ /* Look up entire name. */
sym = lookup_symbol (copy, 0, VAR_DOMAIN, 0);
if (sym)
return symbol_found (funfirstline, canonical, copy, sym, NULL);
*argptr = p;
/* At this point p1->"::inA::fun", p->"inA::fun" copy->"AAA",
- argptr->"inA::fun" */
+ argptr->"inA::fun". */
sym = lookup_symbol (copy, 0, STRUCT_DOMAIN, 0);
if (sym == NULL)
if (SYMBOL_CLASS (sym) == LOC_BLOCK)
{
- /* Arg is the name of a function */
+ /* Arg is the name of a function. */
values.sals = (struct symtab_and_line *)
xmalloc (sizeof (struct symtab_and_line));
values.sals[0] = find_function_start_sal (sym, funfirstline);
struct fork_info *next;
ptid_t ptid;
ptid_t parent_ptid;
- int num; /* Convenient handle (GDB fork id) */
+ int num; /* Convenient handle (GDB fork id). */
struct regcache *savedregs; /* Convenient for info fork, saves
having to actually switch contexts. */
int clobber_regs; /* True if we should restore saved regs. */
if (oldfp)
{
- /* Switch back to inferior_ptid. */
+ /* Switch back to inferior_ptid. */
remove_breakpoints ();
fork_load_infrun_state (oldfp);
insert_breakpoints ();
#include "inf-ptrace.h"
#include "auxv.h"
#include <sys/param.h> /* for MAXPATHLEN */
-#include <sys/procfs.h> /* for elf_gregset etc. */
+#include <sys/procfs.h> /* for elf_gregset etc. */
#include "elf-bfd.h" /* for elfcore_write_* */
#include "gregset.h" /* for gregset */
#include "gdbcore.h" /* for get_exec_file */
#include <ctype.h> /* for isdigit */
-#include "gdbthread.h" /* for struct thread_info etc. */
+#include "gdbthread.h" /* for struct thread_info etc. */
#include "gdb_stat.h" /* for struct stat */
#include <fcntl.h> /* for O_RDONLY */
#include "inf-loop.h"
# endif
#endif /* HAVE_PERSONALITY */
-/* This comment documents high-level logic of this file.
+/* This comment documents high-level logic of this file.
Waiting for events in sync mode
===============================
When waiting for an event in a specific thread, we just use waitpid, passing
the specific pid, and not passing WNOHANG.
-When waiting for an event in all threads, waitpid is not quite good. Prior to
+When waiting for an event in all threads, waitpid is not quite good. Prior to
version 2.4, Linux can either wait for event in main thread, or in secondary
-threads. (2.4 has the __WALL flag). So, if we use blocking waitpid, we might
+threads. (2.4 has the __WALL flag). So, if we use blocking waitpid, we might
miss an event. The solution is to use non-blocking waitpid, together with
sigsuspend. First, we use non-blocking waitpid to get an event in the main
-process, if any. Second, we use non-blocking waitpid with the __WCLONED
+process, if any. Second, we use non-blocking waitpid with the __WCLONED
flag to check for events in cloned processes. If nothing is found, we use
sigsuspend to wait for SIGCHLD. When SIGCHLD arrives, it means something
happened to a child process -- and SIGCHLD will be delivered both for events
__WCLONED.
Note that SIGCHLD should be blocked between waitpid and sigsuspend calls,
-so that we don't miss a signal. If SIGCHLD arrives in between, when it's
+so that we don't miss a signal. If SIGCHLD arrives in between, when it's
blocked, the signal becomes pending and sigsuspend immediately
notices it and returns.
#define PTRACE_SETOPTIONS 0x4200
#define PTRACE_GETEVENTMSG 0x4201
-/* options set using PTRACE_SETOPTIONS */
+/* Options set using PTRACE_SETOPTIONS. */
#define PTRACE_O_TRACESYSGOOD 0x00000001
#define PTRACE_O_TRACEFORK 0x00000002
#define PTRACE_O_TRACEVFORK 0x00000004
static int linux_supports_tracevforkdone_flag = -1;
-/* Async mode support */
+/* Async mode support. */
/* Zero if the async mode, although enabled, is masked, which means
linux_nat_wait should behave as if async mode was off. */
{
struct lwp_info *child_lp = NULL;
- /* We're already attached to the parent, by default. */
+ /* We're already attached to the parent, by default. */
/* Detach new forked process? */
if (detach_fork)
save_sigtrap (lp);
- /* Now resume this LWP and get the SIGSTOP event. */
+ /* Now resume this LWP and get the SIGSTOP event. */
errno = 0;
ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, 0);
if (debug_linux_nat)
target_pid_to_str (lp->ptid));
}
/* Hold this event/waitstatus while we check to see if
- there are any more (we still want to get that SIGSTOP). */
+ there are any more (we still want to get that SIGSTOP). */
stop_wait_callback (lp, NULL);
/* Hold the SIGTRAP for handling by linux_nat_wait. If
there's another event, throw it back into the
- queue. */
+ queue. */
if (lp->status)
{
if (debug_linux_nat)
kill_lwp (GET_LWP (lp->ptid), WSTOPSIG (lp->status));
}
- /* Save the sigtrap event. */
+ /* Save the sigtrap event. */
lp->status = status;
return 0;
}
else
{
/* The thread was stopped with a signal other than
- SIGSTOP, and didn't accidentally trip a breakpoint. */
+ SIGSTOP, and didn't accidentally trip a breakpoint. */
if (debug_linux_nat)
{
status_to_str ((int) status),
target_pid_to_str (lp->ptid));
}
- /* Now resume this LWP and get the SIGSTOP event. */
+ /* Now resume this LWP and get the SIGSTOP event. */
errno = 0;
ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, 0);
if (debug_linux_nat)
errno ? safe_strerror (errno) : "OK");
/* Hold this event/waitstatus while we check to see if
- there are any more (we still want to get that SIGSTOP). */
+ there are any more (we still want to get that SIGSTOP). */
stop_wait_callback (lp, NULL);
/* If the lp->status field is still empty, use it to
gdb_assert (selector != NULL);
- /* Select only resumed LWPs that have a SIGTRAP event pending. */
+ /* Select only resumed LWPs that have a SIGTRAP event pending. */
if (lp->resumed && linux_nat_lp_status_is_event (lp))
if ((*selector)-- == 0)
return 1;
}
/* Make sure we don't report an event for the exit of an LWP not in
- our list, i.e. not part of the current process. This can happen
+ our list, i.e. not part of the current process. This can happen
if we detach from a program we original forked and then it
exits. */
if (!WIFSTOPPED (status) && !lp)
}
else
{
- /* [...] (future options here) */
+ /* [...] (future options here). */
}
argv++;
}
printf_filtered (_("Start of stack: 0x%lx\n"), ltmp);
#if 0 /* Don't know how architecture-dependent the rest is...
Anyway the signal bitmap info is available from "status". */
- if (fscanf (procfile, "%lu ", <mp) > 0) /* FIXME arch? */
+ if (fscanf (procfile, "%lu ", <mp) > 0) /* FIXME arch? */
printf_filtered (_("Kernel stack pointer: 0x%lx\n"), ltmp);
- if (fscanf (procfile, "%lu ", <mp) > 0) /* FIXME arch? */
+ if (fscanf (procfile, "%lu ", <mp) > 0) /* FIXME arch? */
printf_filtered (_("Kernel instr pointer: 0x%lx\n"), ltmp);
if (fscanf (procfile, "%ld ", <mp) > 0)
printf_filtered (_("Pending signals bitmap: 0x%lx\n"), ltmp);
printf_filtered (_("Ignored signals bitmap: 0x%lx\n"), ltmp);
if (fscanf (procfile, "%ld ", <mp) > 0)
printf_filtered (_("Catched signals bitmap: 0x%lx\n"), ltmp);
- if (fscanf (procfile, "%lu ", <mp) > 0) /* FIXME arch? */
+ if (fscanf (procfile, "%lu ", <mp) > 0) /* FIXME arch? */
printf_filtered (_("wchan (system call): 0x%lx\n"), ltmp);
#endif
do_cleanups (cleanup);
}
/* Attempt to load and initialize libthread_db.
- Return 1 on success.
- */
+ Return 1 on success. */
static int
thread_db_load (void)
executable -- there could be mutiple versions of glibc,
compiled with LinuxThreads or NPTL, and until there is
a running inferior, we can't tell which libthread_db is
- the correct one to load. */
+ the correct one to load. */
libthread_db_search_path = xstrdup (LIBTHREAD_DB_SEARCH_PATH);
struct gdbarch_tdep
{
- /* gdbarch target dependent data here. Currently unused for LM32. */
+ /* gdbarch target dependent data here. Currently unused for LM32. */
};
struct lm32_frame_cache
if ((LM32_OPCODE (instruction) == OP_SW)
&& (LM32_REG0 (instruction) == SIM_LM32_SP_REGNUM))
{
- /* Any stack displaced store is likely part of the prologue.
+ /* Any stack displaced store is likely part of the prologue.
Record that the register is being saved, and the offset
into the stack. */
info->saved_regs[LM32_REG1 (instruction)].addr =
else if ((LM32_OPCODE (instruction) == OP_ADDI)
&& (LM32_REG1 (instruction) == SIM_LM32_SP_REGNUM))
{
- /* An add to the SP is likely to be part of the prologue.
+ /* An add to the SP is likely to be part of the prologue.
Adjust stack size by whatever the instruction adds to the sp. */
info->size -= LM32_IMM16 (instruction);
}
}
else
{
- /* Any other instruction is likely not to be part of the prologue. */
+ /* Any other instruction is likely not to be part of the
+ prologue. */
break;
}
}
}
else
{
- /* Aggregate types greater than a single register are returned in memory.
- FIXME: Unless they are only 2 regs?. */
+ /* Aggregate types greater than a single register are returned
+ in memory. FIXME: Unless they are only 2 regs?. */
regcache_cooked_read_unsigned (regcache, SIM_LM32_R1_REGNUM, &l);
return_buffer = l;
read_memory (return_buffer, valbuf, TYPE_LENGTH (type));
converted into a request for the RA register. */
info->saved_regs[SIM_LM32_PC_REGNUM] = info->saved_regs[SIM_LM32_RA_REGNUM];
- /* The previous frame's SP needed to be computed. Save the computed value. */
+ /* The previous frame's SP needed to be computed. Save the computed
+ value. */
trad_frame_set_value (info->saved_regs, SIM_LM32_SP_REGNUM, prev_sp);
return info;