/* Ravenscar Aarch64 target support.
-
+
Copyright (C) 2017-2025 Free Software Foundation, Inc.
This file is part of GDB.
ada_unqualified_name (const char *decoded_name)
{
const char *result;
-
+
/* If the decoded name starts with '<', it means that the encoded
name does not follow standard naming conventions, and thus that
it is not your typical Ada symbol name. Trying to unqualify it
&& c_isdigit (encoded [i+4]))
{
int k = i + 5;
-
+
while (k < len0 && c_isdigit (encoded[k]))
k++; /* Skip any extra digit. */
/* Table for keeping permanent unique copies of decoded names. Once
allocated, names in this table are never released. While this is a
storage leak, it should not be significant unless there are massive
- changes in the set of decoded names in successive versions of a
+ changes in the set of decoded names in successive versions of a
symbol table loaded during a single session. */
static gdb::string_set decoded_names_store;
return 0;
}
-/* Non-zero iff TYPE is a simple array type (not a pointer to one) or
+/* Non-zero iff TYPE is a simple array type (not a pointer to one) or
an array descriptor type (representing an unconstrained array
type). */
proceeding for BIT_SIZE bits. If OBJ is an lval in memory, then
assigning through the result will set the field fetched from.
VALADDR is ignored unless OBJ is NULL, in which case,
- VALADDR+OFFSET must address the start of storage containing the
+ VALADDR+OFFSET must address the start of storage containing the
packed value. The value returned in this case is never an lval.
Assumes 0 <= BIT_OFFSET < HOST_CHAR_BIT. */
\f
/* Renaming */
-/* NOTES:
+/* NOTES:
1. In the following, we assume that a renaming type's name may
have an ___XD suffix. It would be nice if this went away at some
point.
- 2. We handle both the (old) purely type-based representation of
+ 2. We handle both the (old) purely type-based representation of
renamings and the (new) variable-based encoding. At some point,
- it is devoutly to be hoped that the former goes away
+ it is devoutly to be hoped that the former goes away
(FIXME: hilfinger-2007-07-09).
3. Subprogram renamings are not implemented, although the XRS
suffix is recognized (FIXME: hilfinger-2007-07-09). */
-/* If SYM encodes a renaming,
+/* If SYM encodes a renaming,
<renaming> renames <renamed entity>,
enum ada_renaming_category
ada_parse_renaming (struct symbol *sym,
- const char **renamed_entity, int *len,
+ const char **renamed_entity, int *len,
const char **renaming_expr)
{
enum ada_renaming_category kind;
/* Non-zero iff there is at least one non-function/non-enumeral symbol
- in the symbol fields of SYMS. We treat enumerals as functions,
+ in the symbol fields of SYMS. We treat enumerals as functions,
since they contend in overloading in the same way. */
static int
is_nonfunction (const std::vector<struct block_symbol> &syms)
remove_p = true;
}
}
-
+
/* Two functions with the same block are identical. */
else if (syms[i].symbol->loc_class () == LOC_BLOCK)
remove from the SYMS list renaming symbols that should be visible
from CURRENT_BLOCK. However, there does not seem be a 100% reliable
method with the current information available. The implementation
- below has a couple of limitations (FIXME: brobecker-2003-05-12):
-
+ below has a couple of limitations (FIXME: brobecker-2003-05-12):
+
- When the user tries to print a rename in a function while there
is another rename entity defined in a package: Normally, the
rename in the function has precedence over the rename in the
package, so the latter should be removed from the list. This is
currently not the case.
-
+
- This function will incorrectly remove valid renames if
the CURRENT_BLOCK corresponds to a function which symbol name
has been changed by an "Export" pragma. As a consequence,
found_sym = false;
arg_sym = NULL;
}
- else
+ else
{
if (sym->loc_class () == LOC_UNRESOLVED)
return true;
*made_global_lookup_p = 1;
/* Search symbols from all global blocks. */
-
+
add_nonlocal_symbols (result, lookup_name, domain, 1);
/* Now add symbols from all per-file blocks if we've gotten no hits
while (c_isdigit (str[0]))
str += 1;
}
-
+
/* [.$][0-9]+ */
if (str[0] == '.' || str[0] == '$')
return arg1->primitive_field (offset, fieldno, arg_type);
}
-/* Find field with name NAME in object of type TYPE. If found,
+/* Find field with name NAME in object of type TYPE. If found,
set the following for each argument that is non-null:
- - *FIELD_TYPE_P to the field's type;
- - *BYTE_OFFSET_P to OFFSET + the byte offset of the field within
+ - *FIELD_TYPE_P to the field's type;
+ - *BYTE_OFFSET_P to OFFSET + the byte offset of the field within
an object of that type;
- - *BIT_OFFSET_P to the bit offset modulo byte size of the field;
- - *BIT_SIZE_P to its size in bits if the field is packed, and
+ - *BIT_OFFSET_P to the bit offset modulo byte size of the field;
+ - *BIT_SIZE_P to its size in bits if the field is packed, and
0 otherwise;
If INDEX_P is non-null, increment *INDEX_P by the number of source-visible
fields up to but not including the desired field, or by the total
number of fields if not found. A NULL value of NAME never
matches; the function just counts visible fields in this case.
-
+
Notice that we need to handle when a tagged record hierarchy
has some components with the same name, like in this scenario:
}
else if (ada_is_variant_part (type, i))
{
- /* PNH: Wait. Do we ever execute this section, or is ARG always of
+ /* PNH: Wait. Do we ever execute this section, or is ARG always of
fixed type?? */
int j;
struct type *field_type
Matches any field whose name has NAME as a prefix, possibly
followed by "___".
- TYPE can be either a struct or union. If REFOK, TYPE may also
+ TYPE can be either a struct or union. If REFOK, TYPE may also
be a (pointer or reference)+ to a struct or union, and the
ultimate target type will be searched.
DVAL describes a record containing any discriminants used in TYPE0,
and may be NULL if there are none, or if the object of type TYPE at
ADDRESS or in VALADDR contains these discriminants.
-
+
If CHECK_TAG is not null, in the case of tagged types, this function
attempts to locate the object's tag and use it to compute the actual
type. However, when ADDRESS is null, we cannot use it to determine the
location of the tag, and therefore compute the tagged type's actual type.
So we return the tagged type without consulting the tag. */
-
+
static struct type *
ada_to_fixed_type_1 (struct type *type, const gdb_byte *valaddr,
CORE_ADDR address, struct value *dval, int check_tag)
and don't check any further. */
if (type->code () == TYPE_CODE_CHAR)
return true;
-
+
/* Otherwise, assume it's a character type iff it is a discrete type
with a known character type name. */
name = ada_type_name (type);
else if (to < indices[i])
break;
}
-
+
indices.resize (indices.size () + 2);
for (j = indices.size () - 1; j >= i + 2; j -= 1)
indices[j] = indices[j - 2];
default:
error (_("unexpected attribute encountered"));
case OP_ATR_FIRST:
- return value_from_longest
+ return value_from_longest
(range_type, ada_discrete_type_low_bound (range_type));
case OP_ATR_LAST:
return value_from_longest
/* Assuming that the inferior just triggered an unhandled exception
catchpoint, return the address in inferior memory where the name
of the exception is stored.
-
+
Return zero if the address could not be computed. */
static CORE_ADDR
fi = get_current_frame ();
for (frame_level = 0; frame_level < 3; frame_level += 1)
if (fi != NULL)
- fi = get_prev_frame (fi);
+ fi = get_prev_frame (fi);
while (fi != NULL)
{
bool
ada_catchpoint::print_one (const bp_location **last_loc) const
-{
+{
struct ui_out *uiout = current_uiout;
struct value_print_options opts;
}
else
uiout->field_string ("what", "all Ada exceptions");
-
+
break;
case ada_catch_exception_unhandled:
uiout->field_string ("what", "unhandled Ada exceptions");
break;
-
+
case ada_catch_handlers:
if (!m_excep_string.empty ())
{
return dynamic_cast<ada_catchpoint *> (bp) != nullptr;
}
-/* Split the arguments specified in a "catch exception" command.
+/* Split the arguments specified in a "catch exception" command.
Set EX to the appropriate catchpoint type.
Set EXCEP_STRING to the name of the specific exception if
specified by the user.
/* Return the task number of the task running in inferior INF which
matches TASK_ID , or zero if the task could not be found. */
-
+
static int
get_task_number_from_id (CORE_ADDR task_id, struct inferior *inf)
{
/* If ARG is empty or null, then print a list of all Ada tasks.
Otherwise, print detailed information about the task whose ID
is ARG.
-
+
Does nothing if the program doesn't use Ada tasking. */
static void
if (!ada_task_is_alive (task_info))
error (_("Cannot switch to task %s: Task is no longer running"),
task_to_str (taskno, task_info).c_str ());
-
+
/* On some platforms, the thread list is not updated until the user
performs a thread-related operation (by using the "info threads"
command, for instance). So this thread list may not be up to date
/* Assuming that field FIELD_NUM of TYPE represents variants whose
discriminant is contained in OUTER_TYPE, print its components on STREAM.
LEVEL is the recursion (indentation) level, in case any of the fields
- themselves have nested structure, and SHOW is the number of levels of
+ themselves have nested structure, and SHOW is the number of levels of
internal structure to show (see ada_print_type). For this purpose,
fields nested in a variant part are taken to be at the same level as
the fields immediately outside the variant part. */
0, type->num_fields () - 1,
stream, show, level, flags);
}
-
+
/* Print record type TYPE on STREAM. LEVEL is the recursion (indentation)
level, in case the element type itself has nested structure, and SHOW is
gdb_printf (stream, ">");
}
else if (ada_is_modular_type (type))
- gdb_printf (stream, "mod %s",
+ gdb_printf (stream, "mod %s",
int_string (ada_modulus (type), 10, 0, 0, 1));
else
{
transitions[0].addr = 0;
transitions[0].value = NULL;
- /* Copy all entries from the splay tree to the array, in order
+ /* Copy all entries from the splay tree to the array, in order
of increasing address. */
mut->foreach ([&] (CORE_ADDR start, const void *obj)
{
transition at address T if T-1 and T map to different objects.
Any addresses below the first node map to NULL. (Unlike
- fixed maps, we have no entry at (CORE_ADDR) 0; it doesn't
+ fixed maps, we have no entry at (CORE_ADDR) 0; it doesn't
simplify enough.)
The last region is assumed to end at CORE_ADDR_MAX.
static int pdc_read_data (pthdb_user_t, void *, pthdb_addr_t, size_t);
static int pdc_write_data (pthdb_user_t, void *, pthdb_addr_t, size_t);
static int pdc_read_regs (pthdb_user_t user, pthdb_tid_t tid,
- unsigned long long flags,
+ unsigned long long flags,
pthdb_context_t *context);
static int pdc_write_regs (pthdb_user_t user, pthdb_tid_t tid,
- unsigned long long flags,
+ unsigned long long flags,
pthdb_context_t *context);
static int pdc_alloc (pthdb_user_t, size_t, void **);
static int pdc_realloc (pthdb_user_t, void *, size_t, void **);
if (ret == -1 && errno == EPERM)
{
if (debug_aix_thread)
- gdb_printf (gdb_stdlog,
+ gdb_printf (gdb_stdlog,
"ptrace (%d, %d) = %d (errno = %d)\n",
req, id, ret, errno);
return ret == -1 ? 0 : 1;
ptrace32 (int req, int id, addr_ptr addr, int data, int *buf)
{
errno = 0;
- return ptrace_check (req, id,
+ return ptrace_check (req, id,
ptrace (req, id, addr, data, buf));
}
{
name = symbols[i].name;
if (debug_aix_thread)
- gdb_printf (gdb_stdlog,
+ gdb_printf (gdb_stdlog,
" symbols[%d].name = \"%s\"\n", i, name);
if (!*name)
/* Read registers call back function should be able to read the
context information of a debuggee kernel thread from an active
process or from a core file. The information should be formatted
- in context64 form for both 32-bit and 64-bit process.
+ in context64 form for both 32-bit and 64-bit process.
If successful return 0, else non-zero is returned. */
static int
{
if (data->arch64)
{
- if (!ptrace64aix (PTT_READ_GPRS, tid,
+ if (!ptrace64aix (PTT_READ_GPRS, tid,
(unsigned long) gprs64, 0, NULL))
memset (gprs64, 0, sizeof (gprs64));
memcpy (context->gpr, gprs64, sizeof(gprs64));
{
if (data->arch64)
{
- if (!ptrace64aix (PTT_READ_SPRS, tid,
+ if (!ptrace64aix (PTT_READ_SPRS, tid,
(unsigned long) &sprs64, 0, NULL))
memset (&sprs64, 0, sizeof (sprs64));
memcpy (&context->msr, &sprs64, sizeof(sprs64));
memset (&sprs32, 0, sizeof (sprs32));
memcpy (&context->msr, &sprs32, sizeof(sprs32));
}
- }
+ }
/* vector registers. */
__vmx_context_t vmx;
pthdb_tid_t tid,
unsigned long long flags,
pthdb_context_t *context)
-{
+{
/* This function doesn't appear to be used, so we could probably
just return 0 here. HOWEVER, if it is not defined, the OS will
complain and several thread debug functions will fail. In case
if (flags & PTHDB_FLAG_GPRS)
{
if (data->arch64)
- ptrace64aix (PTT_WRITE_GPRS, tid,
+ ptrace64aix (PTT_WRITE_GPRS, tid,
(unsigned long) context->gpr, 0, NULL);
else
ptrace32 (PTT_WRITE_GPRS, tid, (uintptr_t) context->gpr, 0, NULL);
{
if (data->arch64)
{
- ptrace64aix (PTT_WRITE_SPRS, tid,
+ ptrace64aix (PTT_WRITE_SPRS, tid,
(unsigned long) &context->msr, 0, NULL);
}
else
user_current_pid, len, (long) bufp);
*bufp = xmalloc (len);
if (debug_aix_thread)
- gdb_printf (gdb_stdlog,
+ gdb_printf (gdb_stdlog,
" malloc returned 0x%lx\n", (long) *bufp);
/* Note: xmalloc() can't return 0; therefore PDC_FAILURE will never
user_current_pid, (long) buf, len, (long) bufp);
*bufp = xrealloc (buf, len);
if (debug_aix_thread)
- gdb_printf (gdb_stdlog,
+ gdb_printf (gdb_stdlog,
" realloc returned 0x%lx\n", (long) *bufp);
return *bufp ? PDC_SUCCESS : PDC_FAILURE;
}
pdc_dealloc (pthdb_user_t user_current_pid, void *buf)
{
if (debug_aix_thread)
- gdb_printf (gdb_stdlog,
+ gdb_printf (gdb_stdlog,
"pdc_free (user_current_pid = %ld, buf = 0x%lx)\n", user_current_pid,
(long) buf);
xfree (buf);
/* Supply AIX altivec registers, both 64 and 32 bit. */
-static void
+static void
supply_altivec_regs (struct regcache *regcache, __vmx_context_t vmx)
{
ppc_gdbarch_tdep *tdep
data = get_thread_data_helper_for_ptid (inferior_ptid);
if (debug_aix_thread)
- gdb_printf (gdb_stdlog,
+ gdb_printf (gdb_stdlog,
"fetch_regs_user_thread %lx\n", (long) pdtid);
status = pthdb_pthread_context (data->pd_session, pdtid, &ctx);
if (status != PTHDB_SUCCESS)
{
if (data->arch64)
{
- if (!ptrace64aix (PTT_READ_GPRS, tid,
+ if (!ptrace64aix (PTT_READ_GPRS, tid,
(unsigned long) gprs64, 0, NULL))
memset (gprs64, 0, sizeof (gprs64));
supply_gprs64 (regcache, gprs64);
{
if (data->arch64)
{
- if (!ptrace64aix (PTT_READ_SPRS, tid,
+ if (!ptrace64aix (PTT_READ_SPRS, tid,
(unsigned long) &sprs64, 0, NULL))
memset (&sprs64, 0, sizeof (sprs64));
supply_sprs64 (regcache, sprs64.pt_iar, sprs64.pt_msr,
regcache->raw_collect (tdep->ppc_gp0_regnum + regno, vals + regno);
}
-static void
+static void
fill_gprs32 (const struct regcache *regcache, uint32_t *vals)
{
ppc_gdbarch_tdep *tdep
__vsx_context_t vsx;
if (debug_aix_thread)
- gdb_printf (gdb_stdlog,
+ gdb_printf (gdb_stdlog,
"store_regs_user_thread %lx\n", (long) pdtid);
/* Retrieve the thread's current context for its non-register
data = get_thread_data_helper_for_ptid (regcache->ptid ());
if (debug_aix_thread)
- gdb_printf (gdb_stdlog,
+ gdb_printf (gdb_stdlog,
"store_regs_kernel_thread tid=%lx regno=%d\n",
(long) tid, regno);
if (data->arch64)
{
/* Pre-fetch: some registers won't be in the cache. */
- ptrace64aix (PTT_READ_SPRS, tid,
+ ptrace64aix (PTT_READ_SPRS, tid,
(unsigned long) &sprs64, 0, NULL);
fill_sprs64 (regcache, &sprs64.pt_iar, &sprs64.pt_msr,
&sprs64.pt_cr, &sprs64.pt_lr, &sprs64.pt_ctr,
&sprs64.pt_xer, &sprs64.pt_fpscr);
- ptrace64aix (PTT_WRITE_SPRS, tid,
+ ptrace64aix (PTT_WRITE_SPRS, tid,
(unsigned long) &sprs64, 0, NULL);
}
else
ptrace32 (PTT_WRITE_SPRS, tid, (uintptr_t) &sprs32, 0, NULL);
}
}
-
+
/* Vector registers. */
if (tdep->ppc_vr0_regnum != -1 && tdep->ppc_vrsave_regnum != -1
&& (regno == -1 || (regno >= tdep->ppc_vr0_regnum
the correct place. */
if (regnum == ALPHA_PC_REGNUM)
regnum = PROC_PC_REG (info->proc_desc);
-
+
return trad_frame_get_prev_register (this_frame, info->saved_regs, regnum);
}
0, 1, 2, 3,
4, 5, 6, 7,
8, 9, 10, 11,
- 12, 13, 14, 15,
- 30, 31, 32, 16,
+ 12, 13, 14, 15,
+ 30, 31, 32, 16,
17, 18, 19, 20,
21, 22, 23, 24,
25, 29, 26
alpha_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
const struct reggroup *group)
{
- /* Filter out any registers eliminated, but whose regnum is
+ /* Filter out any registers eliminated, but whose regnum is
reserved for backward compatibility, e.g. the vfp. */
if (*gdbarch_register_name (gdbarch, regnum) == '\0')
return 0;
}
}
-/* Insert the given value into REGCACHE as if it was being
+/* Insert the given value into REGCACHE as if it was being
returned by a function. */
static void
/* Checks for an atomic sequence of instructions beginning with a LDL_L/LDQ_L
instruction and ending with a STL_C/STQ_C instruction. If such a sequence
- is found, attempt to step through it. A breakpoint is placed at the end of
+ is found, attempt to step through it. A breakpoint is placed at the end of
the sequence. */
static std::vector<CORE_ADDR>
unsigned int insn = alpha_read_insn (gdbarch, loc);
int insn_count;
int index;
- int last_breakpoint = 0; /* Defaults to 0 (no breakpoints placed). */
+ int last_breakpoint = 0; /* Defaults to 0 (no breakpoints placed). */
const int atomic_sequence_length = 16; /* Instruction sequence length. */
int bc_insn_count = 0; /* Conditional branch instruction count. */
&& INSN_OPCODE (insn) != ldq_l_opcode)
return {};
- /* Assume that no atomic sequence is longer than "atomic_sequence_length"
+ /* Assume that no atomic sequence is longer than "atomic_sequence_length"
instructions. */
for (insn_count = 0; insn_count < atomic_sequence_length; ++insn_count)
{
insn = alpha_read_insn (gdbarch, loc);
/* Assume that there is at most one branch in the atomic
- sequence. If a branch is found, put a breakpoint in
+ sequence. If a branch is found, put a breakpoint in
its destination address. */
if (INSN_OPCODE (insn) >= br_opcode)
{
breaks[0] = loc;
/* Check for duplicated breakpoints. Check also for a breakpoint
- placed (branch instruction's destination) anywhere in sequence. */
+ placed (branch instruction's destination) anywhere in sequence. */
if (last_breakpoint
&& (breaks[1] == breaks[0]
|| (breaks[1] >= pc && breaks[1] <= closing_insn)))
static CORE_ADDR
alpha_sigtramp_register_address (struct gdbarch *gdbarch,
CORE_ADDR sigcontext_addr, int regnum)
-{
+{
alpha_gdbarch_tdep *tdep = gdbarch_tdep<alpha_gdbarch_tdep> (gdbarch);
if (regnum >= 0 && regnum < 32)
else if (regnum >= ALPHA_FP0_REGNUM && regnum < ALPHA_FP0_REGNUM + 32)
return sigcontext_addr + tdep->sc_fpregs_offset + regnum * 8;
else if (regnum == ALPHA_PC_REGNUM)
- return sigcontext_addr + tdep->sc_pc_offset;
+ return sigcontext_addr + tdep->sc_pc_offset;
return 0;
}
something about the traditional layout of alpha stack frames. */
struct alpha_heuristic_unwind_cache
-{
+{
CORE_ADDR vfp;
CORE_ADDR start_pc;
trad_frame_saved_reg *saved_regs;
subq REG_INDEX,0x1,REG_INDEX
lda REG_PROBE,<immediate>(REG_PROBE)
bne REG_INDEX, LOOP_START
-
+
lda sp,<immediate>(REG_PROBE)
If anything different is found, the function returns without
cur_frame_size -= MEM_DISP (insn);
/* stq zero,<immediate>(REG_PROBE) */
-
+
cur_pc += ALPHA_INSN_SIZE;
insn = alpha_read_insn (gdbarch, cur_pc);
if (INSN_OPCODE (insn) != stq_opcode
|| MEM_RA (insn) != 0x1f
|| MEM_RB (insn) != reg_probe)
return;
-
+
/* subq REG_INDEX,0x1,REG_INDEX */
cur_pc += ALPHA_INSN_SIZE;
|| OPR_RA (insn) != reg_index
|| OPR_RC (insn) != reg_index)
return;
-
+
/* lda REG_PROBE,<immediate>(REG_PROBE) */
-
+
cur_pc += ALPHA_INSN_SIZE;
insn = alpha_read_insn (gdbarch, cur_pc);
if (INSN_OPCODE (insn) != lda_opcode
the correct place. */
if (regnum == ALPHA_PC_REGNUM)
regnum = info->return_reg;
-
+
return trad_frame_get_prev_register (this_frame, info->saved_regs, regnum);
}
/* Return nonzero if the G_floating register value in REG is equal to
zero for FP control instructions. */
-
+
static int
fp_register_zero_p (LONGEST reg)
{
case 0x35: /* FBNE */
regno += gdbarch_fp0_regnum (gdbarch);
}
-
+
rav = regcache_raw_get_signed (regcache, regno);
switch (op)
break;
/* Floating point branches. */
-
+
case 0x31: /* FBEQ */
if (fp_register_zero_p (rav))
goto branch_taken;
#define ALPHA_INSN_SIZE 4
/* The alpha has two different virtual pointers for arguments and locals.
-
+
The virtual argument pointer is pointing to the bottom of the argument
transfer area, which is located immediately below the virtual frame
pointer. Its size is fixed for the native compiler, it is either zero
gcc uses a variable sized argument transfer area. As it has
to stay compatible with the native debugging tools it has to use the same
virtual argument pointer and adjust the argument offsets accordingly.
-
+
The virtual local pointer is localoff bytes below the virtual frame
pointer, the value of localoff is obtained from the PDR. */
#define ALPHA_NUM_ARG_REGS 6
20 * 8 /* %gs */
};
-const int amd64_darwin_thread_state_num_regs =
+const int amd64_darwin_thread_state_num_regs =
ARRAY_SIZE (amd64_darwin_thread_state_reg_offset);
/* Assuming THIS_FRAME is a Darwin sigtramp routine, return the
if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 32)
{
/* Sign extend EAX value to avoid potential syscall restart
- problems.
+ problems.
On Linux, when a syscall is interrupted by a signal, the
(kernel function implementing the) syscall may return
handler is called, the kernel can then either return -EINTR
or it can cause the syscall to be restarted. We are
concerned with the latter case here.
-
+
On (32-bit) i386, the status (-ERESTARTSYS) is placed in the
EAX register. When debugging a 32-bit process from a 64-bit
(amd64) GDB, the debugger fetches 64-bit registers even
syscall after a signal expects to see a negative value
(specifically -ERESTARTSYS) in the 64-bit RAX register in
order to correctly cause a syscall to be restarted.
-
+
The call to amd64_collect_native_gregset, above, is setting
the high 32 bits of RAX (and other registers too) to 0. For
syscall restart, we need to sign extend EAX so that RAX will
- appear as a negative value when EAX is set to -ERESTARTSYS.
+ appear as a negative value when EAX is set to -ERESTARTSYS.
This in turn will cause the signal handling code in the
kernel to recognize -ERESTARTSYS which will in turn cause the
syscall to be restarted.
if (regnum == -1 || regnum == I386_EAX_REGNUM)
{
- void *ptr = ((gdb_byte *) gregs
+ void *ptr = ((gdb_byte *) gregs
+ amd64_linux_gregset32_reg_offset[I386_EAX_REGNUM]);
*(int64_t *) ptr = *(int32_t *) ptr;
static int
amd64_linux_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
const struct reggroup *group)
-{
+{
if (regnum == AMD64_LINUX_ORIG_RAX_REGNUM)
return (group == system_reggroup
|| group == save_reggroup
return 0;
}
-/* amd64_canonicalize_syscall maps from the native amd64 Linux set
- of syscall ids into a canonical set of syscall ids used by
+/* amd64_canonicalize_syscall maps from the native amd64 Linux set
+ of syscall ids into a canonical set of syscall ids used by
process record. */
static enum gdb_syscall
{
gdb_printf (gdb_stderr,
_("Process record and replay target doesn't "
- "support syscall number %s\n"),
+ "support syscall number %s\n"),
pulongest (syscall_native));
return -1;
}
Note that ADDR is offset 3 bytes from the beginning of these
sequences. */
-
+
read_code (addr - 3, buf, 5);
return (memcmp (buf, amd64_dtrace_disabled_probe_sequence_1, 5) != 0
&& memcmp (buf, amd64_dtrace_disabled_probe_sequence_2, 5) != 0);
{
struct trad_frame_cache *cache =
amd64obsd_trapframe_cache (this_frame, this_cache);
-
+
trad_frame_get_id (cache, this_id);
}
/* Register information. */
-static const char * const amd64_register_names[] =
+static const char * const amd64_register_names[] =
{
"rax", "rbx", "rcx", "rdx", "rsi", "rdi", "rbp", "rsp",
"mxcsr",
};
-static const char * const amd64_ymm_names[] =
+static const char * const amd64_ymm_names[] =
{
"ymm0", "ymm1", "ymm2", "ymm3",
"ymm4", "ymm5", "ymm6", "ymm7",
"ymm28", "ymm29", "ymm30", "ymm31"
};
-static const char * const amd64_ymmh_names[] =
+static const char * const amd64_ymmh_names[] =
{
"ymm0h", "ymm1h", "ymm2h", "ymm3h",
"ymm4h", "ymm5h", "ymm6h", "ymm7h",
static const char * const amd64_word_names[] =
{
- "ax", "bx", "cx", "dx", "si", "di", "bp", "",
+ "ax", "bx", "cx", "dx", "si", "di", "bp", "",
"r8w", "r9w", "r10w", "r11w", "r12w", "r13w", "r14w", "r15w"
};
static const char * const amd64_dword_names[] =
{
- "eax", "ebx", "ecx", "edx", "esi", "edi", "ebp", "esp",
+ "eax", "ebx", "ecx", "edx", "esi", "edi", "ebp", "esp",
"r8d", "r9d", "r10d", "r11d", "r12d", "r13d", "r14d", "r15d",
"eip"
};
containing ellipsis (...) in the declaration) %al is used as
hidden argument to specify the number of SSE registers used. */
regcache_raw_write_unsigned (regcache, AMD64_RAX_REGNUM, sse_reg);
- return sp;
+ return sp;
}
static CORE_ADDR
pushq -8(%reg)
"andq $-XXX, %rsp" can be either 4 bytes or 7 bytes:
-
+
0x48 0x83 0xe4 0xf0 andq $-16, %rsp
0x48 0x81 0xe4 0x00 0xff 0xff 0xff andq $-256, %rsp
*/
/* MOD must be binary 10 and R/M must be binary 100. */
if ((buf[offset + 2] & 0xc7) != 0x44)
return pc;
-
+
/* REG has register number. */
r = (buf[offset + 2] >> 3) & 7;
static CORE_ADDR
amd64_x32_analyze_stack_align (CORE_ADDR pc, CORE_ADDR current_pc,
- struct amd64_frame_cache *cache)
+ struct amd64_frame_cache *cache)
{
/* There are 2 code sequences to re-align stack before the frame
gets set up:
[addr32] pushq -8(%reg)
"andq $-XXX, %rsp" can be either 4 bytes or 7 bytes:
-
+
0x48 0x83 0xe4 0xf0 andq $-16, %rsp
0x48 0x81 0xe4 0x00 0xff 0xff 0xff andq $-256, %rsp
"andl $-XXX, %esp" can be either 3 bytes or 6 bytes:
-
+
0x83 0xe4 0xf0 andl $-16, %esp
0x81 0xe4 0x00 0xff 0xff 0xff andl $-256, %esp
*/
/* MOD must be binary 10 and R/M must be binary 100. */
if ((buf[offset + 2] & 0xc7) != 0x44)
return pc;
-
+
/* REG has register number. */
r = (buf[offset + 2] >> 3) & 7;
amd64_epilogue_frame_unwind_stop_reason,
amd64_epilogue_frame_this_id,
amd64_frame_prev_register,
- NULL,
+ NULL,
amd64_epilogue_frame_sniffer
);
cooked or raw. */
void
-legacy_virtual_frame_pointer (struct gdbarch *gdbarch,
+legacy_virtual_frame_pointer (struct gdbarch *gdbarch,
CORE_ADDR pc,
int *frame_regnum,
LONGEST *frame_offset)
initialize_current_architecture (void)
{
arches = gdbarch_printable_names ();
-
+
/* Find a default architecture. */
if (default_bfd_arch == NULL)
{
INIT_GDB_FILE (gdbarch_utils)
{
add_setshow_enum_cmd ("endian", class_support,
- endian_enum, &set_endian_string,
+ endian_enum, &set_endian_string,
_("Set endianness of target."),
_("Show endianness of target."),
NULL, set_endian, show_endian,
thread debugging. */
void
-fill_gregset (const struct regcache *regcache,
+fill_gregset (const struct regcache *regcache,
gdb_gregset_t *gregsetp, int regno)
{
arm_linux_collect_gregset (NULL, regcache, regno, gregsetp, 0);
#define MAX_WPTS 16
/* Get hold of the Hardware Breakpoint information for the target we are
- attached to. Returns NULL if the kernel doesn't support Hardware
+ attached to. Returns NULL if the kernel doesn't support Hardware
breakpoints at all, or a pointer to the information structure. */
static const struct arm_linux_hwbp_cap *
arm_linux_get_hwbp_cap (void)
/* Structure containing arrays of per process hardware break-/watchpoints
for caching address and control information.
- The Linux ptrace interface to hardware break-/watch-points presents the
+ The Linux ptrace interface to hardware break-/watch-points presents the
values in a vector centred around 0 (which is used fo generic information).
Positive indices refer to breakpoint addresses/control registers, negative
indices to watchpoint addresses/control registers.
((i << 1) + 1): Address register for breakpoint i.
((i << 1) + 2): Control register for breakpoint i.
- This structure is used as a per-thread cache of the state stored by the
- kernel, so that we don't need to keep calling into the kernel to find a
+ This structure is used as a per-thread cache of the state stored by the
+ kernel, so that we don't need to keep calling into the kernel to find a
free breakpoint.
We treat break-/watch-points with their enable bit clear as being deleted.
}
/* Initialize an ARM hardware break-/watch-point control register value.
- BYTE_ADDRESS_SELECT is the mask of bytes to trigger on; HWBP_TYPE is the
+ BYTE_ADDRESS_SELECT is the mask of bytes to trigger on; HWBP_TYPE is the
type of break-/watch-point; ENABLE indicates whether the point is enabled.
*/
-static arm_hwbp_control_t
+static arm_hwbp_control_t
arm_hwbp_control_initialize (unsigned byte_address_select,
arm_hwbp_type hwbp_type,
int enable)
{
gdb_assert ((byte_address_select & ~0xffU) == 0);
- gdb_assert (hwbp_type != arm_hwbp_break
+ gdb_assert (hwbp_type != arm_hwbp_break
|| ((byte_address_select & 0xfU) != 0));
return (byte_address_select << 5) | (hwbp_type << 3) | (3 << 1) | enable;
/* Get the ARM hardware breakpoint type from the TYPE value we're
given when asked to set a watchpoint. */
-static arm_hwbp_type
+static arm_hwbp_type
arm_linux_get_hwbp_type (enum target_hw_bp_type type)
{
if (type == hw_read)
mask = (1 << len) - 1;
p->address = (unsigned int) addr;
- p->control = arm_hwbp_control_initialize (mask,
+ p->control = arm_hwbp_control_initialize (mask,
arm_linux_get_hwbp_type (type), 1);
}
/* Insert the hardware breakpoint (WATCHPOINT = 0) or watchpoint (WATCHPOINT
=1) BPT for thread TID. */
static void
-arm_linux_insert_hw_breakpoint1 (const struct arm_linux_hw_breakpoint* bpt,
+arm_linux_insert_hw_breakpoint1 (const struct arm_linux_hw_breakpoint* bpt,
int watchpoint)
{
int pid;
/* Remove the hardware breakpoint (WATCHPOINT = 0) or watchpoint
(WATCHPOINT = 1) BPT for thread TID. */
static void
-arm_linux_remove_hw_breakpoint1 (const struct arm_linux_hw_breakpoint *bpt,
+arm_linux_remove_hw_breakpoint1 (const struct arm_linux_hw_breakpoint *bpt,
int watchpoint)
{
int pid;
return 0;
}
-/* Are we able to use a hardware watchpoint for the LEN bytes starting at
+/* Are we able to use a hardware watchpoint for the LEN bytes starting at
ADDR? */
int
arm_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, int len)
static const gdb_byte arm_linux_thumb2_le_breakpoint[] = { 0xf0, 0xf7, 0x00, 0xa0 };
-/* Description of the longjmp buffer. The buffer is treated as an array of
+/* Description of the longjmp buffer. The buffer is treated as an array of
elements of size ARM_LINUX_JB_ELEMENT_SIZE.
The location of saved registers in this buffer (in particular the PC
- to use after longjmp is called) varies depending on the ABI (in
+ to use after longjmp is called) varies depending on the ABI (in
particular the FP model) and also (possibly) the C Library. */
#define ARM_LINUX_JB_ELEMENT_SIZE ARM_INT_REGISTER_SIZE
/* For the FPA model the PC is at offset 21 in the buffer. */
with the real function address. Subsequent calls go through steps
1, 2 and 3 and end up calling the real code.
- 1) In the code:
+ 1) In the code:
b function_call
bl function_call
}
else
{
- enum bfd_endian byte_order_for_code =
+ enum bfd_endian byte_order_for_code =
gdbarch_byte_order_for_code (gdbarch);
/* PC gets incremented before the syscall-stop, so read the
else
{
struct gdbarch *gdbarch = regcache->arch ();
- enum bfd_endian byte_order_for_code =
+ enum bfd_endian byte_order_for_code =
gdbarch_byte_order_for_code (gdbarch);
- unsigned long this_instr =
+ unsigned long this_instr =
read_memory_unsigned_integer (pc, 4, byte_order_for_code);
unsigned long svc_operand = (0x00ffffff & this_instr);
unsigned pc_val;
regcache->raw_collect (ARM_PC_REGNUM, (char *) &pc_val);
-
+
pc_val = gdbarch_addr_bits_remove (gdbarch, pc_val);
inferior_registers.r_pc ^= gdbarch_addr_bits_remove
(gdbarch, inferior_registers.r_pc);
regcache->raw_collect (ARM_PC_REGNUM, (char *) &pc_val);
regcache->raw_collect (ARM_PS_REGNUM, (char *) &psr_val);
-
+
pc_val = gdbarch_addr_bits_remove (gdbarch, pc_val);
psr_val ^= gdbarch_addr_bits_remove (gdbarch, psr_val);
SP -> -12 additional stack space (12 bytes)
The frame size would thus be 36 bytes, and the frame offset would be
12 bytes. The frame register is R7.
-
+
The comments for thumb_skip_prolog() describe the algorithm we use
to detect the end of the prolog. */
Be careful, however, and if it doesn't look like a prologue,
don't try to scan it. If, for instance, a frameless function
begins with stmfd sp!, then we will tell ourselves there is
- a frame, which will confuse stack traceback, as well as "finish"
+ a frame, which will confuse stack traceback, as well as "finish"
and other operations that rely on a knowledge of the stack
traceback. */
The extracted and normalized instructions are stored for later
retrieval by the arm_find_exidx_entry routine. */
-
+
static void
arm_exidx_new_objfile (struct objfile *objfile)
{
pers_sec = arm_obj_section_from_vma (objfile, pers);
if (pers_sec)
{
- static const char *personality[] =
+ static const char *personality[] =
{
"__gcc_personality_v0",
"__gxx_personality_v0",
exc_valid = 1;
}
}
-
+
/* Bail out if we don't know that exception information is valid. */
if (!exc_valid)
return 0;
si = push_stack_item (si, val, ARM_INT_REGISTER_SIZE);
nstack += ARM_INT_REGISTER_SIZE;
}
-
+
/* Doubleword aligned quantities must go in even register pairs. */
if (may_use_core_reg
&& argreg <= ARM_LAST_ARG_REGNUM
si = push_stack_item (si, buf, ARM_INT_REGISTER_SIZE);
nstack += ARM_INT_REGISTER_SIZE;
}
-
+
len -= partial_len;
val += partial_len;
}
if (csym.native == NULL)
{
/* Create a fake symbol vector containing a Thumb symbol.
- This is solely so that the code in print_insn_little_arm()
+ This is solely so that the code in print_insn_little_arm()
and print_insn_big_arm() in opcodes/arm-dis.c will detect
the presence of a Thumb symbol and switch to decoding
Thumb instructions. */
/* The following define instruction sequences that will cause ARM
cpu's to take an undefined instruction trap. These are used to
signal a breakpoint to GDB.
-
+
The newer ARMv4T cpu's are capable of operating in ARM or Thumb
modes. A different instruction is required for each mode. The ARM
cpu's can also be big or little endian. Thus four different
instructions are needed to support all cases.
-
+
Note: ARMv4 defines several new instructions that will take the
undefined instruction trap. ARM7TDMI is nominally ARMv4T, but does
not in fact add the new instructions. The new undefined
behavior in earlier chips. There is no guarantee that they will
raise an exception, but may be treated as NOP's. In practice, it
may only safe to rely on instructions matching:
-
- 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
+
+ 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
C C C C 0 1 1 x x x x x x x x x x x x x x x x x x x x 1 x x x x
-
+
Even this may only true if the condition predicate is true. The
following use a condition predicate of ALWAYS so it is always TRUE.
-
+
There are other ways of forcing a breakpoint. GNU/Linux, RISC iX,
and NetBSD all use a software interrupt rather than an undefined
instruction to force a trap. This can be handled by by the
/* By using store_unsigned_integer we avoid having to do
anything special for small big-endian values. */
regcache_cooked_read_unsigned (regs, regno++, &tmp);
- store_unsigned_integer (valbuf,
+ store_unsigned_integer (valbuf,
(len > ARM_INT_REGISTER_SIZE
? ARM_INT_REGISTER_SIZE : len),
byte_order, tmp);
else
{
/* For a structure or union the behavior is as if the value had
- been stored to word-aligned memory and then loaded into
+ been stored to word-aligned memory and then loaded into
registers with 32-bit load instruction(s). */
int len = type->length ();
int regno = ARM_A1_REGNUM;
/* If bitpos != 0, then we have to care about it. */
if (type->field (i).loc_bitpos () != 0)
{
- /* Bitfields are not addressable. If the field bitsize is
+ /* Bitfields are not addressable. If the field bitsize is
zero, then the field is not packed. Hence it cannot be
a bitfield or any other packed type. */
if (type->field (i).bitsize () == 0)
else
{
/* For a structure or union the behavior is as if the value had
- been stored to word-aligned memory and then loaded into
+ been stored to word-aligned memory and then loaded into
registers with 32-bit load instruction(s). */
int len = type->length ();
int regno = ARM_A1_REGNUM;
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
CORE_ADDR jb_addr;
gdb_byte buf[ARM_INT_REGISTER_SIZE];
-
+
jb_addr = get_frame_register_unsigned (frame, ARM_A1_REGNUM);
if (target_read_memory (jb_addr + tdep->jb_pc * tdep->jb_elt_size, buf,
/* arm_coff_make_msymbol_special()
arm_elf_make_msymbol_special()
-
+
These functions test whether the COFF or ELF symbol corresponds to
an address in thumb code, and set a "special" bit in a minimal
symbol to indicate that it does. */
-
+
static void
arm_elf_make_msymbol_special (const asymbol *sym, struct minimal_symbol *msym)
{
/* ARM-reversible process record data structures. */
-#define ARM_INSN_SIZE_BYTES 4
+#define ARM_INSN_SIZE_BYTES 4
#define THUMB_INSN_SIZE_BYTES 2
#define THUMB2_INSN_SIZE_BYTES 4
static int
-arm_record_strx (arm_insn_decode_record *arm_insn_r, uint32_t *record_buf,
+arm_record_strx (arm_insn_decode_record *arm_insn_r, uint32_t *record_buf,
uint32_t *record_buf_mem, arm_record_strx_t str_type)
{
if (3 == opcode1 && bit (arm_insn_r->arm_insn, 4))
{
ret = -1;
- /* Undefined instruction on ARM V5; need to handle if later
+ /* Undefined instruction on ARM V5; need to handle if later
versions define it. */
}
/* Save SPSR also;how? */
return -1;
}
- else if(8 == bits (arm_insn_r->arm_insn, 4, 7)
+ else if(8 == bits (arm_insn_r->arm_insn, 4, 7)
|| 10 == bits (arm_insn_r->arm_insn, 4, 7)
|| 12 == bits (arm_insn_r->arm_insn, 4, 7)
|| 14 == bits (arm_insn_r->arm_insn, 4, 7)
/* Handle load/store insn extension space. */
- if (!opcode1 && bit (arm_insn_r->arm_insn, 7)
+ if (!opcode1 && bit (arm_insn_r->arm_insn, 7)
&& bit (arm_insn_r->arm_insn, 4) && 1 != arm_insn_r->cond
&& !INSN_RECORDED(arm_insn_r))
{
/* STR. */
case 8:
case 12:
- /* STR. */
+ /* STR. */
case 9:
case 13:
/* STRT. */
/* STRB. */
case 11:
case 15:
- /* STRBT. */
+ /* STRBT. */
case 3:
case 7:
/* STRB. */
/* STR. */
case 8:
case 12:
- /* STR. */
+ /* STR. */
case 9:
case 13:
/* STRT. */
/* STRB. */
case 11:
case 15:
- /* STRBT. */
+ /* STRBT. */
case 3:
case 7:
/* STRB. */
register_count++;
}
-
+
/* If wback is true, also save the base register, which is going to be
written to. */
if (wback)
{
/* STM (STMIA, STMEA), STMDA (STMED), STMDB (STMFD) and STMIB (STMFA). */
- addr_mode = bits (arm_insn_r->arm_insn, 23, 24);
+ addr_mode = bits (arm_insn_r->arm_insn, 23, 24);
regcache_raw_read_unsigned (reg_cache, reg_base, &u_regval);
}
REG_ALLOC (thumb_insn_r->arm_regs, thumb_insn_r->reg_rec_count, record_buf);
- MEM_ALLOC (thumb_insn_r->arm_mems, thumb_insn_r->mem_rec_count,
+ MEM_ALLOC (thumb_insn_r->arm_mems, thumb_insn_r->mem_rec_count,
record_buf_mem);
return 0;
/* CPSR is changed to be executed in ARM state, disabling normal
interrupts, entering abort mode. */
/* According to high vector configuration PC is set. */
- /* User hits breakpoint and type reverse, in that case, we need to go back with
+ /* User hits breakpoint and type reverse, in that case, we need to go back with
previous CPSR and Program Counter. */
record_buf[0] = ARM_PS_REGNUM;
record_buf[1] = ARM_LR_REGNUM;
thumb_insn_r->reg_rec_count = 2;
}
- /* B(2) is automatically taken care in process_record, as PC is
+ /* B(2) is automatically taken care in process_record, as PC is
saved there. */
REG_ALLOC (thumb_insn_r->arm_regs, thumb_insn_r->reg_rec_count, record_buf);
- return 0;
+ return 0;
}
/* Handler for thumb2 load/store multiple instructions. */
/* Cleans up local record registers and memory allocations. */
-static void
+static void
deallocate_reg_mem (arm_insn_decode_record *record)
{
xfree (record->arm_regs);
- xfree (record->arm_mems);
+ xfree (record->arm_mems);
}
#include <vector>
-/* Number of machine registers. The only define actually required
+/* Number of machine registers. The only define actually required
is gdbarch_num_regs. The other definitions are used for documentation
purposes and code readability. */
/* For 26 bit ARM code, a fake copy of the PC is placed in register 25 (PS)
/* Type of floating-point code in use by inferior. There are really 3 models
that are traditionally supported (plus the endianness issue), but gcc can
only generate 2 of those. The third is APCS_FLOAT, where arguments to
- functions are passed in floating-point registers.
+ functions are passed in floating-point registers.
- In addition to the traditional models, VFP adds two more.
+ In addition to the traditional models, VFP adds two more.
- If you update this enum, don't forget to update fp_model_strings in
+ If you update this enum, don't forget to update fp_model_strings in
arm-tdep.c. */
enum arm_float_model
instruction? */
extern int arm_pc_is_thumb (struct gdbarch *, CORE_ADDR);
-extern int arm_process_record (struct gdbarch *gdbarch,
+extern int arm_process_record (struct gdbarch *gdbarch,
struct regcache *regcache, CORE_ADDR addr);
/* Functions exported from arm-bsd-tdep.h. */
/* Create an asynchronous handler, allocating memory for it.
Return a pointer to the newly created handler.
- This pointer will be used to invoke the handler by
+ This pointer will be used to invoke the handler by
invoke_async_signal_handler.
- PROC is the function to call with CLIENT_DATA argument
+ PROC is the function to call with CLIENT_DATA argument
whenever the handler is invoked. */
async_signal_handler *
create_async_signal_handler (sig_handler_func * proc,
pattern = p.get ();
break;
}
-
+
if (pattern == NULL)
{
if (*filename_realp == NULL)
sbiw r28, <LOCALS_SIZE>
out __SP_H__, r29
out __SP_L__, r28
-
+
A interrupt handler prologue looks like this:
sei
push __zero_reg__
sbiw r28, <LOCALS_SIZE>
cli
out __SP_H__, r29
- sei
+ sei
out __SP_L__, r28
A `-mcall-prologues' prologue looks like this (Note that the megas use a
/* FIXME: TRoth/2003-06-11: This could be made more efficient by only
reading in the bytes of the prologue. The problem is that the figuring
- out where the end of the prologue is is a bit difficult. The old code
+ out where the end of the prologue is is a bit difficult. The old code
tried to do that, but failed quite often. */
read_memory (pc_beg, prologue, len);
{
vpc += sizeof (img_sig);
}
- else if (vpc + sizeof (img_int) < len
+ else if (vpc + sizeof (img_int) < len
&& memcmp (prologue + vpc, img_int, sizeof (img_int)) == 0)
{
vpc += sizeof (img_int);
else
break;
}
-
+
return pc_beg + vpc;
}
trad_frame_saved_reg saved_regs[AVR_NUM_REGS];
info.saved_regs = saved_regs;
-
+
/* Need to run the prologue scanner to figure out if the function has a
prologue and possibly skip over moving arguments passed via registers
to other registers. */
-
+
prologue_end = avr_scan_prologue (gdbarch, func_addr, func_end, &info);
-
+
if (info.prologue_type != AVR_PROLOGUE_NONE)
return prologue_end;
}
this_base = get_frame_register_unsigned (this_frame, AVR_FP_REGNUM);
high_base = get_frame_register_unsigned (this_frame, AVR_FP_REGNUM + 1);
this_base += (high_base << 8);
-
+
/* The FP points at the last saved register. Adjust the FP back
to before the first saved register giving the SP. */
- prev_sp = this_base + info->size;
+ prev_sp = this_base + info->size;
}
else
{
Also, note that the value on the stack is an addr to a word
not a byte, so we will need to multiply it by two at some
- point.
+ point.
And to confuse matters even more, the return address stored
on the stack is in big endian byte order, even though most
optimization. I suspect this is a compiler bug. Arguments of these odd
sizes are left-justified within the word (as opposed to arguments smaller
than WORDSIZE bytes, which are right-justified).
-
+
If the function is to return an aggregate type such as a struct, the caller
must allocate space into which the callee will copy the return value. In
this case, a pointer to the return value location is passed into the callee
gdbarch *gdbarch
= gdbarch_alloc (&info, gdbarch_tdep_up (new avr_gdbarch_tdep));
avr_gdbarch_tdep *tdep = gdbarch_tdep<avr_gdbarch_tdep> (gdbarch);
-
+
tdep->call_length = call_length;
/* Create a type for PC. We can't use builtin types here, as they may not
larger than will fit in a stack, so just mark it for
collection and be done with it. */
ax_reg_mask (ax, value->u.reg);
-
+
/* But if the register points to a string, assume the value
will fit on the stack and push it anyway. */
if (string_trace)
/* Search through fields and base classes recursively. */
found = gen_struct_ref_recursive (ax, value, field, 0, type);
-
+
if (!found)
error (_("Couldn't find member named `%s' in struct/union/class `%s'"),
field, type->name ());
if (sym)
{
gen_var_ref (ax, value, sym);
-
+
/* Don't error if the value was optimized out, we may be
scanning all static fields and just want to pass over this
and continue with the rest. */
if (t->field (i).is_packed ())
error (_("pointers to bitfield members not allowed"));
- /* FIXME we need a way to do "want_address" equivalent */
+ /* FIXME we need a way to do "want_address" equivalent */
error (_("Cannot reference non-static field \"%s\""), fieldname);
}
int found = gen_maybe_namespace_elt (ax, value, curtype, name);
if (!found)
- error (_("No symbol \"%s\" in namespace \"%s\"."),
+ error (_("No symbol \"%s\" in namespace \"%s\"."),
name, curtype->name ());
return found;
gen_binop (ax, value, value1, value2,
aop_bit_or, aop_bit_or, 0, "bitwise or");
break;
-
+
case BINOP_BITWISE_XOR:
gen_binop (ax, value, value1, value2,
aop_bit_xor, aop_bit_xor, 0, "bitwise exclusive-or");
if (*cmdrest++ != '"')
error (_("Bad format string, non-terminated '\"'."));
-
+
cmdrest = skip_spaces (cmdrest);
if (*cmdrest != ',' && *cmdrest != 0)
{
/* A table of good hash table sizes. Whenever we grow, we pick the
next larger size from this table. sizes[i] is close to 1 << (i+10),
- so we roughly double the table size each time. After we fall off
+ so we roughly double the table size each time. After we fall off
the end of this table, we just double. Don't laugh --- there have
been executables sighted with a gigabyte of debug info. */
static const unsigned long sizes[] = {
if (s)
{
occupied_buckets++;
-
+
while (s)
{
gdb_assert (b < m_num_buckets);
gdb_printf ("%ld\n", m_unique_size / m_unique_count);
else
/* i18n: "Average entry size: (not applicable)". */
- gdb_printf (_("(not applicable)\n"));
+ gdb_printf (_("(not applicable)\n"));
gdb_printf (_(" Median entry size: %d\n"), median_entry_size);
gdb_printf ("\n");
print_percentage (m_total_size - m_structure_size, m_total_size);
gdb_printf ("\n");
- gdb_printf (_(" Hash table size: %3d\n"),
+ gdb_printf (_(" Hash table size: %3d\n"),
m_num_buckets);
gdb_printf (_(" Hash table expands: %lu\n"),
m_expand_count);
else
/* i18n: "Average hash chain length: (not applicable)". */
gdb_printf (_("(not applicable)\n"));
- gdb_printf (_(" Maximum hash chain length: %3d\n"),
+ gdb_printf (_(" Maximum hash chain length: %3d\n"),
max_chain_length);
gdb_printf ("\n");
}
Mind you, looking at the wall clock, the same GDB debugging GDB
showed only marginal speed up (0.780 vs 0.773s). Seems GDB is too
busy doing something else :-(
-
+
*/
namespace gdb {
}
/* Return the function containing pc value PC.
- Returns 0 if function is not known.
+ Returns 0 if function is not known.
Backward compatibility, no section */
struct symbol *
/* Implement the "catch syscall" command. */
static void
-catch_syscall_command_1 (const char *arg, int from_tty,
+catch_syscall_command_1 (const char *arg, int from_tty,
struct cmd_list_element *command)
{
int tempflag;
/* Look for an "if" token in *STRING. The "if" token must be preceded
by whitespace.
-
+
If there is any non-whitespace text between *STRING and the "if"
token, then it is returned in a newly-xmalloc'd string. Otherwise,
this returns NULL.
-
+
STRING is updated to point to the "if" token, if it exists, or to
the end of the string. */
for (breakpoint &b : all_breakpoints ())
if (b.number == num)
return &b;
-
+
return nullptr;
}
validate that only allowed commands are included. */
void
-breakpoint_set_commands (struct breakpoint *b,
+breakpoint_set_commands (struct breakpoint *b,
counted_command_line &&commands)
{
/* If the commands have not changed then there's no need to update
* target_stopped_by_watchpoint and target_stopped_data_address are
called several times when GDB stops.
- [linux]
+ [linux]
* Multiple hardware watchpoints can be hit at the same time,
causing GDB to stop. GDB only presents one hardware watchpoint
hit at a time as the reason for stopping, and all the other hits
if (*cmdrest++ != '"')
error (_("Bad format string, non-terminated '\"'."));
-
+
cmdrest = skip_spaces (cmdrest);
if (!(*cmdrest == ',' || *cmdrest == '\0'))
Shall we set a breakpoint at the LMA? */
if (!overlay_events_enabled)
{
- /* Yes -- overlay event support is not active,
+ /* Yes -- overlay event support is not active,
so we must try to set a breakpoint at the LMA.
This will not work for a hardware breakpoint. */
if (bl->loc_type == bp_loc_hardware_breakpoint)
}
else
{
- /* No. This breakpoint will not be inserted.
+ /* No. This breakpoint will not be inserted.
No error, but do not mark the bp as 'inserted'. */
return 0;
}
notify_breakpoint_modified (bl->owner);
if (!*disabled_breaks)
{
- gdb_printf (tmp_error_stream,
- "Cannot insert breakpoint %d.\n",
+ gdb_printf (tmp_error_stream,
+ "Cannot insert breakpoint %d.\n",
bl->owner->number);
- gdb_printf (tmp_error_stream,
+ gdb_printf (tmp_error_stream,
"Temporarily disabling shared "
"library breakpoints:\n");
}
if (!overlay_events_enabled)
{
/* Yes -- overlay event support is not active, so we
- should have set a breakpoint at the LMA. Remove it.
+ should have set a breakpoint at the LMA. Remove it.
*/
/* Ignore any failures: if the LMA is in ROM, we will
have already warned when we failed to insert it. */
&bl->overlay_target_info,
reason);
}
- /* Did we set a breakpoint at the VMA?
+ /* Did we set a breakpoint at the VMA?
If so, we will have marked the breakpoint 'inserted'. */
if (bl->inserted)
{
|| bl->permanent)
&& breakpoint_location_address_match (bl, aspace, pc))
{
- if (overlay_debugging
+ if (overlay_debugging
&& section_is_overlay (bl->section)
&& !section_is_mapped (bl->section))
continue; /* unmapped overlay -- can't be a match */
PRINT_UNKNOWN: Means we printed nothing.
PRINT_SRC_AND_LOC: Means we printed something, and expect subsequent
- code to print the location. An example is
+ code to print the location. An example is
"Breakpoint 1, " which should be followed by
the location.
PRINT_SRC_ONLY: Means we printed something, but there is no need
to also print the location part of the message.
An example is the catch/throw messages, which
don't require a location appended to the end.
- PRINT_NOTHING: We have done some printing and we don't need any
+ PRINT_NOTHING: We have done some printing and we don't need any
further info to be printed. */
enum print_stop_action
for (; bs; bs = bs->next)
{
val = print_bp_stop_message (bs);
- if (val == PRINT_SRC_ONLY
+ if (val == PRINT_SRC_ONLY
|| val == PRINT_SRC_AND_LOC
|| val == PRINT_NOTHING)
return val;
if (uiout->is_mi_like_p ())
uiout->field_string ("fullname", symtab_to_fullname (loc->symtab));
-
+
uiout->field_signed ("line", loc->line_number,
line_number_style.style ());
}
uiout->text (" inf ");
else
uiout->text (", ");
-
+
uiout->text (plongest (inf_nums[i]));
}
}
gdb_assert (!loc || loc_number != 0);
/* See comment in print_one_breakpoint concerning treatment of
breakpoints with single disabled location. */
- if (loc == NULL
+ if (loc == NULL
&& (b->has_locations ()
&& (b->has_multiple_locations ()
|| !b->first_loc ().enabled || b->first_loc ().disabled_by_cond)))
b->gdbarch, b->frame_id.stack_addr);
uiout->text ("\n");
}
-
+
if (!part_of_multiple && b->cond_string)
{
annotate_field (7);
uiout->field_string ("default-collect", default_collect);
uiout->text (" \n");
}
-
+
static void
info_breakpoints_command (const char *args, int from_tty)
{
|| b.enable_state == bp_call_disabled)
? " (disabled)"
: ""),
- (others > 1) ? ","
+ (others > 1) ? ","
: ((others == 1) ? " and" : ""));
}
current_uiout->message (_("also set at pc %ps.\n"),
true, not giving a chance for GDB to check the condition of the
other watchpoint. */
if ((w1->cond_exp
- && target_can_accel_watchpoint_condition (loc1->address,
+ && target_can_accel_watchpoint_condition (loc1->address,
loc1->length,
loc1->watchpoint_type,
w1->cond_exp.get ()))
|| (w2->cond_exp
- && target_can_accel_watchpoint_condition (loc2->address,
+ && target_can_accel_watchpoint_condition (loc2->address,
loc2->length,
loc2->watchpoint_type,
w2->cond_exp.get ())))
function. In that case, it's still not possible to specify
separate conditions for different overloaded functions, so
we take just a single condition string.
-
+
NOTE: If the function succeeds, the caller is expected to cleanup
the arrays ADDR_STRING, COND_STRING, and SALS (but not the
array contents). If the function fails (error() is called), the
static void
breakpoint_sals_to_pc (std::vector<symtab_and_line> &sals)
-{
+{
for (auto &sal : sals)
resolve_sal_pc (&sal);
}
return dynamic_cast<const masked_watchpoint *> (b) != nullptr;
}
-/* accessflag: hw_write: watch write,
- hw_read: watch read,
+/* accessflag: hw_write: watch write,
+ hw_read: watch read,
hw_access: watch access (read or write) */
static void
watch_command_1 (const char *arg, int accessflag, int from_tty,
file/line and pc set. So, if clear is given file/line, we can
match this to existing breakpoint without obtaining pc at all.
- We only support clearing given the address explicitly
- present in breakpoint table. Say, we've set breakpoint
+ We only support clearing given the address explicitly
+ present in breakpoint table. Say, we've set breakpoint
at file:line. There were several PC values for that file:line,
due to optimization, all in one block.
We've picked one PC value. If "clear" is issued with another
PC corresponding to the same file:line, the breakpoint won't
- be cleared. We probably can still clear the breakpoint, but
+ be cleared. We probably can still clear the breakpoint, but
since the other PC value is never presented to user, user
can only find it by guessing, and it does not seem important
to support that. */
if there's another location at the same address (previously
marked as duplicate), we don't need to remove/insert the
location.
-
+
LOCP is kept in sync with OLD_LOCP, each pointing to the current
and former bp_location array state respectively. */
this location on the global list, and try to
remove it next time, but there's no particular
reason why we will succeed next time.
-
+
Note that at this point, old_loc->owner is still
valid, as delete_breakpoint frees the breakpoint
only after calling us. */
if (!b || b->number != bp_num)
error (_("Bad breakpoint number '%d'"), bp_num);
-
+
if (loc_num == 0)
error (_("Bad breakpoint location number '%d'"), loc_num);
{
int i;
i = hw_breakpoint_used_count ();
- target_resources_ok =
- target_can_use_hardware_watchpoint (bp_hardware_breakpoint,
+ target_resources_ok =
+ target_can_use_hardware_watchpoint (bp_hardware_breakpoint,
i + 1, 0);
if (target_resources_ok == 0)
error (_("No hardware breakpoint support in the target."));
equivalent GDB tracepoint. This is not a reliable process, since
the target does not necessarily have all the information used when
the tracepoint was originally defined. */
-
+
struct tracepoint *
create_tracepoint_from_upload (struct uploaded_tp *utp)
{
return tp;
}
-
+
/* Print information on tracepoint number TPNUM_EXP, or all if
omitted. */
/* Delete all tracepoints if no argument.
Do not delete internal or call-dummy breakpoints, these
- have to be deleted with an explicit breakpoint number
+ have to be deleted with an explicit breakpoint number
argument. */
for (breakpoint &tp : all_tracepoints ())
if (is_tracepoint (&tp) && user_breakpoint_p (&tp))
if (tpnum <= 0)
{
if (instring && *instring)
- gdb_printf (_("bad tracepoint number at or near '%s'\n"),
+ gdb_printf (_("bad tracepoint number at or near '%s'\n"),
instring);
else
gdb_printf (_("No previous tracepoint\n"));
dynamic libraries. */
bp_shlib_event,
- /* Some multi-threaded systems can arrange for a location in the
+ /* Some multi-threaded systems can arrange for a location in the
inferior to be executed when certain thread-related events occur
(such as thread creation or thread death).
/* On the same principal, an overlay manager can arrange to call a
magic location in the inferior whenever there is an interesting
change in overlay status. GDB can update its overlay tables
- and fiddle with breakpoints in overlays when this breakpoint
+ and fiddle with breakpoints in overlays when this breakpoint
is hit. */
- bp_overlay_event,
+ bp_overlay_event,
/* Master copies of longjmp breakpoints. These are always installed
as soon as an objfile containing longjmp is loaded, but they are
enum bpdisp
{
disp_del, /* Delete it */
- disp_del_at_next_stop, /* Delete at next stop,
+ disp_del_at_next_stop, /* Delete at next stop,
whether hit or not */
disp_disable, /* Disable it */
disp_donttouch /* Leave it alone */
/* Is this particular location enabled. */
bool enabled = false;
-
+
/* Is this particular location disabled because the condition
expression is invalid at this location. For a location to be
reported as enabled, the ENABLED field above has to be true *and*
watch_triggered_unknown,
/* This hardware watchpoint definitely did trigger. */
- watch_triggered_yes
+ watch_triggered_yes
};
/* Some targets (e.g., embedded PowerPC) need two debug registers to set
extern void enable_breakpoint (struct breakpoint *);
-extern void breakpoint_set_commands (struct breakpoint *b,
+extern void breakpoint_set_commands (struct breakpoint *b,
counted_command_line &&commands);
extern void breakpoint_set_silent (struct breakpoint *b, int silent);
bsd_kvm_supply_pcb = supply_pcb;
add_target (bsd_kvm_target_info, bsd_kvm_target_open);
-
+
add_prefix_cmd ("kvm", class_obscure, bsd_kvm_cmd, _("\
Generic command for manipulating the kernel memory interface."),
&bsd_kvm_cmdlist, 0, &cmdlist);
opblock = NULL;
for (pblock = m_pending_blocks;
- pblock && pblock != old_blocks;
+ pblock && pblock != old_blocks;
pblock = pblock->next)
{
if (pblock->block->superblock () == NULL)
if (extract_unsigned_integer (contents + i * width,
width, byte_order) == 0)
break;
-
+
/* I is now either a user-defined length, the number of non-null
characters, or FETCHLIMIT. */
*length = i * width;
&& extract_unsigned_integer (buffer->get () + *length - width,
width, byte_order) == 0)
*length -= width;
-
+
/* The read_string function will return the number of bytes read.
If length returned from read_string was > 0, return the number of
characters read by dividing the number of bytes by width. */
On outermost call, SHOW > 0 means should ignore
any typename for TYPE and show its details.
SHOW is always zero on recursive calls.
-
+
NEED_POST_SPACE is non-zero when a space will be be needed
between a trailing qualifier and a field, variable, or function
name. */
|| type->bounds ()->high.kind () == PROP_LOCLIST)
gdb_printf (stream, "variable length");
else if (get_array_bounds (type, &low_bound, &high_bound))
- gdb_printf (stream, "%s",
+ gdb_printf (stream, "%s",
plongest (high_bound - low_bound + 1));
gdb_printf (stream, (is_vector ? ")))" : "]"));
if (type->is_declared_class ())
gdb_printf (stream, "class ");
/* Print the tag name if it exists.
- The aCC compiler emits a spurious
+ The aCC compiler emits a spurious
"{unnamed struct}"/"{unnamed union}"/"{unnamed enum}"
tag for unnamed struct/union/enum's, which we don't
want to print. */
\f
void
-c_value_print (struct value *val, struct ui_file *stream,
+c_value_print (struct value *val, struct ui_file *stream,
const struct value_print_options *options)
{
struct type *type, *real_type;
if (real_type)
{
/* We have RTTI information, so use it. */
- val = value_full_object (val, real_type,
+ val = value_full_object (val, real_type,
full, top, using_enc);
/* In a destructor we might see a real type that is a
superclass of the object's type. In this case it is
*was_ptr = 0;
*type = check_typedef (*type);
-
+
/* The type of value stored in varobj, that is passed
to us, is already supposed to be
reference-stripped. */
We can show char* so we allow it to be dereferenced. If you decide
to test for it, please mind that a little magic is necessary to
- properly identify it: char* has TYPE_CODE == TYPE_CODE_INT and
+ properly identify it: char* has TYPE_CODE == TYPE_CODE_INT and
TYPE_NAME == "char". */
if (target->code () == TYPE_CODE_FUNC
|| target->code () == TYPE_CODE_VOID)
information cannot be determined, set *CNAME, *CVALUE, or *CTYPE
to empty. */
-static void
+static void
c_describe_child (const struct varobj *parent, int index,
std::string *cname, struct value **cvalue,
struct type **ctype, std::string *cfull_expression)
{
std::string path_expr;
- c_describe_child (child->parent, child->index, NULL, NULL, NULL,
+ c_describe_child (child->parent, child->index, NULL, NULL, NULL,
&path_expr);
return path_expr;
}
gdb_assert (varobj_value_is_changeable_p (var));
gdb_assert (!var->value->lazy ());
-
+
/* If the specified format is the current one,
we can reuse print_value. */
if (format == var->format)
const char *ptr = was_ptr ? "*" : "";
/* Cast the parent to the base' type. Note that in gdb,
- expression like
+ expression like
(Base1)d
will create an lvalue, for all appearances, so we don't
need to use more fancy:
access = "public";
else if (children[v_private] > 0)
access = "private";
- else
+ else
access = "protected";
break;
case 1:
else
{
c_describe_child (parent, index, cname, cvalue, ctype, cfull_expression);
- }
+ }
}
static std::string
{
std::string path_expr;
- cplus_describe_child (child->parent, child->index, NULL, NULL, NULL,
+ cplus_describe_child (child->parent, child->index, NULL, NULL, NULL,
&path_expr);
return path_expr;
}
/* Note that the first entry must always be "auto".
The remaining entries were created by running this script:
-
+
iconv -l | sed -e '/[/]...*$/d' -e 's@^\(.*\)//$@"\1", \\@'
-
+
.. and then removing the final backslash. It would be nice to
separate narrow and wide character sets, but there is no good way
to do that. */
conversions),
and so on.
-
+
To avoid excessive code duplication and maintenance efforts,
GDB simply requires a capable iconv function. Users on platforms
without a suitable iconv can use the GNU iconv library. */
#else
# define GDB_DEFAULT_HOST_CHARSET "ISO-8859-1"
#endif
-#define GDB_DEFAULT_TARGET_CHARSET GDB_DEFAULT_HOST_CHARSET
+#define GDB_DEFAULT_TARGET_CHARSET GDB_DEFAULT_HOST_CHARSET
#define GDB_DEFAULT_TARGET_WIDE_CHARSET "UTF-32"
#undef DEFAULT_CHARSET_NAMES
#define DEFAULT_CHARSET_NAMES GDB_DEFAULT_HOST_CHARSET ,
static const char *target_wide_charset_name = "auto";
static void
-show_target_wide_charset_name (struct ui_file *file,
+show_target_wide_charset_name (struct ui_file *file,
int from_tty,
- struct cmd_list_element *c,
+ struct cmd_list_element *c,
const char *value)
{
if (!strcmp (value, "auto"))
/* This is the sfunc for the 'set charset' command. */
static void
-set_charset_sfunc (const char *charset, int from_tty,
+set_charset_sfunc (const char *charset, int from_tty,
struct cmd_list_element *c)
{
/* CAREFUL: set the target charset here as well. */
/* sfunc for the 'show charset' command. */
static void
-show_charset (struct ui_file *file, int from_tty,
+show_charset (struct ui_file *file, int from_tty,
struct cmd_list_element *c,
const char *name)
{
show_host_charset_name (file, from_tty, c, host_charset_name);
show_target_charset_name (file, from_tty, c, target_charset_name);
- show_target_wide_charset_name (file, from_tty, c,
+ show_target_wide_charset_name (file, from_tty, c,
target_wide_charset_name);
}
\f
/* Create a new iterator. */
-wchar_iterator::wchar_iterator (const gdb_byte *input, size_t bytes,
+wchar_iterator::wchar_iterator (const gdb_byte *input, size_t bytes,
const char *charset, size_t width)
: m_input (input),
m_bytes (bytes),
converted a character; if so, return it. */
if (out_avail < out_request * sizeof (gdb_wchar_t))
break;
-
+
/* Otherwise skip the first invalid character, and let
the caller know about it. */
*out_result = wchar_iterate_invalid;
~wchar_iterator ();
/* Perform a single iteration of a wchar_t iterator.
-
+
Returns the number of characters converted. A negative result
means that EOF has been reached. A positive result indicates the
number of valid wchar_ts in the result; *OUT_CHARS is updated to
wchar_iterate_incomplete means that an incomplete character was
seen at the end of the input sequence.
-
+
wchar_iterate_eof means that all bytes were successfully
converted. The other output arguments are not set. */
int iterate (enum wchar_iterate_result *out_result, gdb_wchar_t **out_chars,
Add this command to command list *LIST.
- Returns a pointer to the added command (not necessarily the head
+ Returns a pointer to the added command (not necessarily the head
of *LIST). */
static struct cmd_list_element *
deprecated and a warning message should be generated. This
function decodes TEXT and potentially generates a warning message
as outlined below.
-
+
Example for 'set endian big' which has a fictitious alias 'seb'.
-
+
If alias wasn't used in TEXT, and the command is deprecated:
- "warning: 'set endian big' is deprecated."
-
+ "warning: 'set endian big' is deprecated."
+
If alias was used, and only the alias is deprecated:
"warning: 'seb' an alias for the command 'set endian big' is deprecated."
-
+
If alias was used and command is deprecated (regardless of whether
the alias itself is deprecated:
-
+
"warning: 'set endian big' (seb) is deprecated."
After the message has been sent, clear the appropriate flags in the
command and/or the alias so the user is no longer bothered.
-
+
*/
void
deprecated_cmd_warning (const char *text, struct cmd_list_element *list)
static struct cmd_list_element *binary_append_cmdlist;
static void
-dump_binary_file (const char *filename, const char *mode,
+dump_binary_file (const char *filename, const char *mode,
const bfd_byte *buf, ULONGEST len)
{
int status;
}
static void
-dump_bfd_file (const char *filename, const char *mode,
- const char *target, CORE_ADDR vaddr,
+dump_bfd_file (const char *filename, const char *mode,
+ const char *target, CORE_ADDR vaddr,
const bfd_byte *buf, ULONGEST len)
{
asection *osection;
value. */
gdb::byte_vector buf (count);
read_memory (lo, buf.data (), count);
-
+
/* Have everything. Open/write the data. */
if (file_format == NULL || strcmp (file_format, "binary") == 0)
dump_binary_file (filename.get (), mode, buf.data (), count);
}
dump_bfd_file (filename.get (), mode, file_format, vaddr,
- val->contents ().data (),
+ val->contents ().data (),
val->type ()->length ());
}
}
/* Replace "Dump " at start of docstring with "Append " (borrowed
from [deleted] deprecated_add_show_from_set). */
- if ( c->doc[0] == 'W'
- && c->doc[1] == 'r'
+ if ( c->doc[0] == 'W'
+ && c->doc[1] == 'r'
&& c->doc[2] == 'i'
- && c->doc[3] == 't'
+ && c->doc[3] == 't'
&& c->doc[4] == 'e'
&& c->doc[5] == ' ')
c->doc = concat ("Append ", c->doc + 6, (char *)NULL);
|| (load_end > 0 && sec_start >= load_end))
{
/* No, no usable data in this section. */
- gdb_printf (_("skipping section %s...\n"),
+ gdb_printf (_("skipping section %s...\n"),
bfd_section_name (isec));
return;
}
/* Get the data. */
gdb::byte_vector buf (size);
if (!bfd_get_section_contents (ibfd, isec, buf.data (), 0, size))
- error (_("Failed to read bfd file %s: '%s'."), bfd_get_filename (ibfd),
+ error (_("Failed to read bfd file %s: '%s'."), bfd_get_filename (ibfd),
bfd_errmsg (bfd_get_error ()));
gdb_printf ("Restoring section %s (0x%lx to 0x%lx)",
- bfd_section_name (isec),
- (unsigned long) sec_start,
+ bfd_section_name (isec),
+ (unsigned long) sec_start,
(unsigned long) sec_end);
if (load_offset != 0 || load_start != 0 || load_end != 0)
perror_with_name (filename);
if (len <= load_start)
- error (_("Start address is greater than length of binary file %s."),
+ error (_("Start address is greater than length of binary file %s."),
filename);
/* Chop off "len" if it exceeds the requested load_end addr. */
if (load_start > 0)
len -= load_start;
- gdb_printf
- ("Restoring binary file %s into memory (0x%lx to 0x%lx)\n",
- filename,
+ gdb_printf
+ ("Restoring binary file %s into memory (0x%lx to 0x%lx)\n",
+ filename,
(unsigned long) (load_start + load_offset),
(unsigned long) (load_start + load_offset + len));
add_basic_prefix_cmd ("srec", all_commands,
_("Write target code/data to an srec file."),
&srec_cmdlist,
- 0 /*allow-unknown*/,
+ 0 /*allow-unknown*/,
&dump_cmdlist);
add_basic_prefix_cmd ("ihex", all_commands,
_("Write target code/data to an intel hex file."),
&ihex_cmdlist,
- 0 /*allow-unknown*/,
+ 0 /*allow-unknown*/,
&dump_cmdlist);
add_basic_prefix_cmd ("verilog", all_commands,
add_basic_prefix_cmd ("tekhex", all_commands,
_("Write target code/data to a tekhex file."),
&tekhex_cmdlist,
- 0 /*allow-unknown*/,
+ 0 /*allow-unknown*/,
&dump_cmdlist);
add_basic_prefix_cmd ("binary", all_commands,
_("Write target code/data to a raw binary file."),
&binary_dump_cmdlist,
- 0 /*allow-unknown*/,
+ 0 /*allow-unknown*/,
&dump_cmdlist);
add_basic_prefix_cmd ("binary", all_commands,
_("Append target code/data to a raw binary file."),
&binary_append_cmdlist,
- 0 /*allow-unknown*/,
+ 0 /*allow-unknown*/,
&append_cmdlist);
add_cmd ("memory", all_commands, dump_srec_memory, _("\
handle_redirections (from_tty);
}
-static void
+static void
set_logging_off (const char *args, int from_tty)
{
if (saved_filename.empty ())
{
const char *first_arg = p + find_command_name_length (p);
- return skip_spaces (first_arg);
+ return skip_spaces (first_arg);
}
/* Process one input line. If the command is an "end", return such an
const char *comfull;
int hook_type = CMD_NO_HOOK;
int hook_name_size = 0;
-
+
#define HOOK_STRING "hook-"
#define HOOK_LEN 5
#define HOOK_POST_STRING "hookpost-"
&& (c_isdigit (m_cur_tok[1]) || m_cur_tok[1] == '$'))));
}
-/* Accept a number and a string-form list of numbers such as is
+/* Accept a number and a string-form list of numbers such as is
accepted by get_number_or_range. Return TRUE if the number is
in the list.
- By definition, an empty list includes all numbers. This is to
- be interpreted as typing a command such as "delete break" with
+ By definition, an empty list includes all numbers. This is to
+ be interpreted as typing a command such as "delete break" with
no arguments. */
int
bool m_in_range;
};
-/* Accept a number and a string-form list of numbers such as is
+/* Accept a number and a string-form list of numbers such as is
accepted by get_number_or_range. Return TRUE if the number is
in the list.
- By definition, an empty list includes all numbers. This is to
- be interpreted as typing a command such as "delete break" with
+ By definition, an empty list includes all numbers. This is to
+ be interpreted as typing a command such as "delete break" with
no arguments. */
extern int number_is_in_list (const char *list, int number);
/* Look up a coff type-number index. Return the address of the slot
where the type for that index is stored.
- The type-number is in INDEX.
+ The type-number is in INDEX.
This can be used for finding the type associated with that index
or for associating a new type with the index. */
static struct minimal_symbol *
record_minimal_symbol (minimal_symbol_reader &reader,
struct coff_symbol *cs, unrelocated_addr address,
- enum minimal_symbol_type type, int section,
+ enum minimal_symbol_type type, int section,
struct objfile *objfile)
{
/* We don't want TDESC entry points in the minimal symbol table. */
file_ptr symtab_offset;
file_ptr stringtab_offset;
unsigned int stabstrsize;
-
+
info = coff_objfile_data_key.get (objfile);
symfile_bfd = abfd; /* Kludge for swap routines. */
newobj = push_context (depth, fcn_start_addr);
fcn_cs_saved.c_name = getsymname (&fcn_sym_saved);
newobj->name =
- process_coff_symbol (&fcn_cs_saved,
+ process_coff_symbol (&fcn_cs_saved,
&fcn_aux_saved, objfile);
}
else if (strcmp (cs->c_name, ".ef") == 0)
/* If we are giving a name to a type such as
"pointer to foo" or "function returning foo", we
better not set the TYPE_NAME. If the program
- contains "typedef char *caddr_t;", we don't want
+ contains "typedef char *caddr_t;", we don't want
all variables of type char * to print as caddr_t.
This is not just a consequence of GDB's type
management; CC and GCC (at least through version
return the type that the function returns. */
static struct type *
-decode_function_type (struct coff_symbol *cs,
+decode_function_type (struct coff_symbol *cs,
unsigned int c_type,
- union internal_auxent *aux,
+ union internal_auxent *aux,
struct objfile *objfile)
{
if (aux->x_sym.x_tagndx.u32 == 0)
/* Basic C types. */
static struct type *
-decode_base_type (struct coff_symbol *cs,
+decode_base_type (struct coff_symbol *cs,
unsigned int c_type,
- union internal_auxent *aux,
+ union internal_auxent *aux,
struct objfile *objfile)
{
struct gdbarch *gdbarch = objfile->arch ();
"in compiled module \"%s\"."),
gdb_type_from_ptr->code (), COMPILE_I_EXPR_VAL,
objfile_name (objfile));
-
+
retval = gdb_type_from_ptr;
switch (gdb_type_from_ptr->code ())
{
INIT_GDB_FILE (complaints)
{
- add_setshow_zinteger_cmd ("complaints", class_support,
+ add_setshow_zinteger_cmd ("complaints", class_support,
&stop_whining, _("\
Set max number of complaints about incorrect symbols."), _("\
Show max number of complaints about incorrect symbols."), NULL,
will quote it. That's why we switch between
current_language->word_break_characters () and
gdb_completer_command_word_break_characters. I'm not sure when
- we need this behavior (perhaps for funky characters in C++
+ we need this behavior (perhaps for funky characters in C++
symbols?). */
/* Variables which are necessary for fancy command line editing. */
symbols but don't want to complete on anything else either. */
void
-noop_completer (struct cmd_list_element *ignore,
+noop_completer (struct cmd_list_element *ignore,
completion_tracker &tracker,
const char *text, const char *prefix)
{
/* Complete on command names. Used by "help". */
void
-command_completer (struct cmd_list_element *ignore,
+command_completer (struct cmd_list_element *ignore,
completion_tracker &tracker,
const char *text, const char *word)
{
print "bugs/oks: " bugs "/" oks
print bugs "/ (" oks "+" legacy "+" deprecated ")"
}
- # This value should be as low as possible
+ # This value should be as low as possible
print bugs / ( oks + legacy + deprecated )
}
' ${wwwdir}/ari.doc`
{
printf " gdb_printf (\"\\n\");\n";
}
- else if ($0 !~ /^[ ]*15\. Disclaimer of Warranty\.[ ]*$/)
+ else if ($0 !~ /^[ ]*15\. Disclaimer of Warranty\.[ ]*$/)
{
printf " gdb_printf (\"";
for (i = 1; i < NF; i++)
print "show_warranty_command (const char *ignore, int from_tty)";
print "{";
}
-/^[ ]*15\. Disclaimer of Warranty\.[ ]*$/, /^[ ]*END OF TERMS AND CONDITIONS[ ]*$/{
- if (! ($0 ~ /^[ ]*END OF TERMS AND CONDITIONS[ ]*$/))
+/^[ ]*15\. Disclaimer of Warranty\.[ ]*$/, /^[ ]*END OF TERMS AND CONDITIONS[ ]*$/{
+ if (! ($0 ~ /^[ ]*END OF TERMS AND CONDITIONS[ ]*$/))
{
printf " gdb_printf (\"";
for (i = 1; i < NF; i++)
if successful. */
int
-safe_read_memory_integer (CORE_ADDR memaddr, int len,
+safe_read_memory_integer (CORE_ADDR memaddr, int len,
enum bfd_endian byte_order,
LONGEST *return_value)
{
/* See gdbcore.h. */
void
-write_memory (CORE_ADDR memaddr,
+write_memory (CORE_ADDR memaddr,
const bfd_byte *myaddr, ssize_t len)
{
int status;
/* Store VALUE at ADDR in the inferior as a LEN-byte unsigned
integer. */
void
-write_memory_unsigned_integer (CORE_ADDR addr, int len,
+write_memory_unsigned_integer (CORE_ADDR addr, int len,
enum bfd_endian byte_order,
ULONGEST value)
{
/* Store VALUE at ADDR in the inferior as a LEN-byte signed
integer. */
void
-write_memory_signed_integer (CORE_ADDR addr, int len,
+write_memory_signed_integer (CORE_ADDR addr, int len,
enum bfd_endian byte_order,
LONGEST value)
{
}
}
-/* Implement "maintenance print core-file-backed-mappings" command.
+/* Implement "maintenance print core-file-backed-mappings" command.
If mappings are loaded, the results should be similar to the
mappings shown by "info proc mappings". This command is mainly a
object. */
base_object_dtor
};
-
+
/* Return non-zero iff NAME is the mangled name of a destructor.
Actually, return an `enum dtor_kind' value describing what *kind*
of destructor it is. */
options);
if (demangled_name == NULL)
return NULL;
-
+
/* If we could demangle the name, parse it to build the component
tree. */
std::unique_ptr<demangle_parse_info> info
{
/* There are no floating point registers. Used in gdbserver low-linux.c. */
NUM_FREGS = 0,
-
+
/* There are 16 general registers. */
NUM_GENREGS = 16,
-
+
/* There are 16 special registers. */
NUM_SPECREGS = 16,
/* CRISv32 has a pseudo PC register, not noted here. */
-
+
/* CRISv32 has 16 support registers. */
NUM_SUPPREGS = 16
};
enum cris_regnums
{
- /* Enums with respect to the general registers, valid for all
+ /* Enums with respect to the general registers, valid for all
CRIS versions. The frame pointer is always in R8. */
CRIS_FP_REGNUM = 8,
/* ABI related registers. */
ARG2_REGNUM = 11,
ARG3_REGNUM = 12,
ARG4_REGNUM = 13,
-
+
/* Registers which happen to be common. */
VR_REGNUM = 17,
MOF_REGNUM = 23,
info->base = extract_unsigned_integer (buf, 4, byte_order);
addr = cris_sigcontext_addr (this_frame);
-
+
/* Layout of the sigcontext struct:
struct sigcontext {
struct pt_regs regs;
unsigned long oldmask;
unsigned long usp;
}; */
-
+
if (tdep->cris_version == 10)
{
- /* R0 to R13 are stored in reverse order at offset (2 * 4) in
+ /* R0 to R13 are stored in reverse order at offset (2 * 4) in
struct pt_regs. */
for (i = 0; i <= 13; i++)
info->saved_regs[i].set_addr (addr + ((15 - i) * 4));
info->saved_regs[DCCR_REGNUM].set_addr (addr + (17 * 4));
info->saved_regs[SRP_REGNUM].set_addr (addr + (18 * 4));
/* Note: IRP is off by 2 at this point. There's no point in correcting
- it though since that will mean that the backtrace will show a PC
+ it though since that will mean that the backtrace will show a PC
different from what is shown when stopped. */
info->saved_regs[IRP_REGNUM].set_addr (addr + (19 * 4));
info->saved_regs[gdbarch_pc_regnum (gdbarch)]
else
{
/* CRISv32. */
- /* R0 to R13 are stored in order at offset (1 * 4) in
+ /* R0 to R13 are stored in order at offset (1 * 4) in
struct pt_regs. */
for (i = 0; i <= 13; i++)
info->saved_regs[i].set_addr (addr + ((i + 1) * 4));
be wrong at this point. This problem manifests itself in the
sigaltstack.exp test case, which occasionally generates FAILs when
the signal is received while in a delay slot.
-
+
This could be solved by a couple of read_memory_unsigned_integer and a
trad_frame_set_value. */
info->saved_regs[gdbarch_pc_regnum (gdbarch)]
info->saved_regs[gdbarch_sp_regnum (gdbarch)].set_addr (addr + (25 * 4));
}
-
+
return info;
}
const frame_info_ptr &this_frame,
void **this_cache)
{
- if (cris_sigtramp_start (this_frame)
+ if (cris_sigtramp_start (this_frame)
|| cris_rt_sigtramp_start (this_frame))
return 1;
/* The instruction environment needed to find single-step breakpoints. */
-typedef
+typedef
struct instruction_environment
{
unsigned long reg[NUM_GENREGS];
5 - 4 Size
3 - 0 Operand1 */
-static int
+static int
cris_get_operand2 (unsigned short insn)
{
return ((insn & 0xF000) >> 12);
static void
cris_set_size_to_dword (unsigned short *insn)
{
- *insn &= 0xFFCF;
- *insn |= 0x20;
+ *insn &= 0xFFCF;
+ *insn |= 0x20;
}
static signed char
static void cris_dump_tdep (struct gdbarch *, struct ui_file *);
-static void set_cris_version (const char *ignore_args, int from_tty,
+static void set_cris_version (const char *ignore_args, int from_tty,
struct cmd_list_element *c);
-static void set_cris_mode (const char *ignore_args, int from_tty,
+static void set_cris_mode (const char *ignore_args, int from_tty,
struct cmd_list_element *c);
-static void set_cris_dwarf2_cfi (const char *ignore_args, int from_tty,
+static void set_cris_dwarf2_cfi (const char *ignore_args, int from_tty,
struct cmd_list_element *c);
-static CORE_ADDR cris_scan_prologue (CORE_ADDR pc,
+static CORE_ADDR cris_scan_prologue (CORE_ADDR pc,
const frame_info_ptr &this_frame,
struct cris_unwind_cache *info);
-static CORE_ADDR crisv32_scan_prologue (CORE_ADDR pc,
+static CORE_ADDR crisv32_scan_prologue (CORE_ADDR pc,
const frame_info_ptr &this_frame,
struct cris_unwind_cache *info);
const gdb_byte *val;
int reg_demand;
int i;
-
+
len = args[argnum]->type ()->length ();
val = args[argnum]->contents ().data ();
-
+
/* How may registers worth of storage do we need for this argument? */
reg_demand = (len / 4) + (len % 4 != 0 ? 1 : 0);
-
+
if (len <= (2 * 4) && (argreg + reg_demand - 1 <= ARG4_REGNUM))
{
/* Data passed by value. Fits in available register(s). */
return info->base;
}
-static const struct frame_base cris_frame_base =
+static const struct frame_base cris_frame_base =
{
&cris_frame_unwind,
cris_frame_base_address,
If local variables are declared or register contents are saved on stack
the subq-instruction will be present with X as the number of bytes
needed for storage. The reshuffle with respect to r8 may be performed
- with any size S (b, w, d) and any of the general registers Z={0..13}.
+ with any size S (b, w, d) and any of the general registers Z={0..13}.
The offset U should be representable by a signed 8-bit value in all cases.
Thus, the prefix word is assumed to be immediate byte offset mode followed
by another word containing the instruction.
push r8
move.d sp,r8
move.d r8,sp
- pop r8
+ pop r8
Prologue instructions C++-code.
Case 1) and 2) in the C-code may be followed by
move.d r13,rV ; P3
move.S [r8+U],rZ ; P4
- if any of the call parameters are stored. The host expects these
+ if any of the call parameters are stored. The host expects these
instructions to be executed in order to get the call parameters right. */
-/* Examine the prologue of a function. The variable ip is the address of
- the first instruction of the prologue. The variable limit is the address
- of the first instruction after the prologue. The variable fi contains the
+/* Examine the prologue of a function. The variable ip is the address of
+ the first instruction of the prologue. The variable limit is the address
+ of the first instruction after the prologue. The variable fi contains the
information in struct frame_info. The variable frameless_p controls whether
- the entire prologue is examined (0) or just enough instructions to
+ the entire prologue is examined (0) or just enough instructions to
determine that it is a prologue (1). */
-static CORE_ADDR
+static CORE_ADDR
cris_scan_prologue (CORE_ADDR pc, const frame_info_ptr &this_frame,
struct cris_unwind_cache *info)
{
unsigned short insn;
/* Next instruction, lookahead. */
- unsigned short insn_next;
+ unsigned short insn_next;
int regno;
/* Number of byte on stack used for local variables and movem. */
- int val;
+ int val;
/* Highest register number in a movem. */
int regsave;
/* move.d r<source_register>,rS */
- short source_register;
+ short source_register;
/* Scan limit. */
int limit;
{
info->sp_offset += 4;
}
- /* This check, meant to recognize srp, used to be regno ==
+ /* This check, meant to recognize srp, used to be regno ==
(SRP_REGNUM - NUM_GENREGS), but that covers r11 also. */
if (insn_next == 0xBE7E)
{
info->sp_offset += cris_get_quick_value (insn);
}
}
- else if (cris_get_mode (insn) == 0x0002
+ else if (cris_get_mode (insn) == 0x0002
&& cris_get_opcode (insn) == 0x000F
&& cris_get_size (insn) == 0x0003
&& cris_get_operand1 (insn) == gdbarch_sp_regnum (gdbarch))
&& ((insn & 0x0F00) >> 8) == 0x0001
&& (cris_get_signed_offset (insn) < 0))
{
- /* Immediate byte offset addressing prefix word with sp as base
- register. Used for CRIS v8 i.e. ETRAX 100 and newer if <val>
- is between 64 and 128.
+ /* Immediate byte offset addressing prefix word with sp as base
+ register. Used for CRIS v8 i.e. ETRAX 100 and newer if <val>
+ is between 64 and 128.
movem r<regsave>,[sp=sp-<val>] */
if (info)
{
break;
}
}
- else if (cris_get_operand2 (insn) == CRIS_FP_REGNUM
+ else if (cris_get_operand2 (insn) == CRIS_FP_REGNUM
/* The size is a fixed-size. */
- && ((insn & 0x0F00) >> 8) == 0x0001
+ && ((insn & 0x0F00) >> 8) == 0x0001
/* A negative offset. */
- && (cris_get_signed_offset (insn) < 0))
+ && (cris_get_signed_offset (insn) < 0))
{
/* move.S rZ,[r8-U] (?) */
insn_next = read_memory_unsigned_integer (pc, 2, byte_order);
break;
}
}
- else if (cris_get_operand2 (insn) == CRIS_FP_REGNUM
+ else if (cris_get_operand2 (insn) == CRIS_FP_REGNUM
/* The size is a fixed-size. */
- && ((insn & 0x0F00) >> 8) == 0x0001
+ && ((insn & 0x0F00) >> 8) == 0x0001
/* A positive offset. */
- && (cris_get_signed_offset (insn) > 0))
+ && (cris_get_signed_offset (insn) > 0))
{
/* move.S [r8+U],rZ (?) */
insn_next = read_memory_unsigned_integer (pc, 2, byte_order);
this_base = get_frame_register_unsigned (this_frame, CRIS_FP_REGNUM);
info->base = this_base;
info->saved_regs[CRIS_FP_REGNUM].set_addr (info->base);
-
+
/* The FP points at the last saved register. Adjust the FP back
to before the first saved register giving the SP. */
info->prev_sp = info->base + info->r8_offset;
}
else
{
- ULONGEST this_base;
+ ULONGEST this_base;
/* Assume that the FP is this frame's SP but with that pushed
stack space added back. */
this_base = get_frame_register_unsigned (this_frame,
info->base = this_base;
info->prev_sp = info->base + info->size;
}
-
+
/* Calculate the addresses for the saved registers on the stack. */
/* FIXME: The address calculation should really be done on the fly while
- we're analyzing the prologue (we only hold one regsave value as it is
+ we're analyzing the prologue (we only hold one regsave value as it is
now). */
val = info->sp_offset;
return pc;
}
-static CORE_ADDR
+static CORE_ADDR
crisv32_scan_prologue (CORE_ADDR pc, const frame_info_ptr &this_frame,
struct cris_unwind_cache *info)
{
ULONGEST this_base;
/* Unlike the CRISv10 prologue scanner (cris_scan_prologue), this is not
- meant to be a full-fledged prologue scanner. It is only needed for
+ meant to be a full-fledged prologue scanner. It is only needed for
the cases where we end up in code always lacking DWARF-2 CFI, notably:
* PLT stubs (library calls)
* call dummys
* signal trampolines
- For those cases, it is assumed that there is no actual prologue; that
+ For those cases, it is assumed that there is no actual prologue; that
the stack pointer is not adjusted, and (as a consequence) the return
address is not pushed onto the stack. */
gdbarch_sp_regnum (gdbarch));
info->base = this_base;
info->prev_sp = this_base;
-
+
/* The PC is assumed to be found in SRP. */
info->saved_regs[gdbarch_pc_regnum (gdbarch)]
= info->saved_regs[SRP_REGNUM];
CORE_ADDR func_addr, func_end;
struct symtab_and_line sal;
CORE_ADDR pc_after_prologue;
-
+
/* If we have line debugging information, then the end of the prologue
should the first assembly instruction of the first source line. */
if (find_pc_partial_function (pc, NULL, &func_addr, &func_end))
{
cris_gdbarch_tdep *tdep = gdbarch_tdep<cris_gdbarch_tdep> (gdbarch);
unsigned int version = tdep->cris_version;
-
+
switch (spec_reg.applicable_version)
{
case cris_ver_version_all:
{
int i;
int spec_regno;
-
+
if (regno >= 0 && regno < NUM_GENREGS)
{
/* General registers (R0 - R15) are 32 bits. */
}
else if (regno >= NUM_GENREGS && regno < (NUM_GENREGS + NUM_SPECREGS))
{
- /* Special register (R16 - R31). cris_spec_regs is zero-based.
+ /* Special register (R16 - R31). cris_spec_regs is zero-based.
Adjust regno accordingly. */
spec_regno = regno - NUM_GENREGS;
-
+
for (i = 0; cris_spec_regs[i].name != NULL; i++)
{
- if (cris_spec_regs[i].number == spec_regno
+ if (cris_spec_regs[i].number == spec_regno
&& cris_spec_reg_applicable (gdbarch, cris_spec_regs[i]))
/* Go with the first applicable register. */
return cris_spec_regs[i].reg_size;
return 4;
}
-
+
return -1;
}
|| (cris_register_size (gdbarch, regno) == 0));
}
-/* Nonzero if regno should not be written to the target, for various
+/* Nonzero if regno should not be written to the target, for various
reasons. */
static int
/* IBR, BAR, BRP and IRP are read-only in user mode. Let the debug
agent decide whether they are writable. */
-
+
return 0;
}
|| (cris_register_size (gdbarch, regno) == 0));
}
-/* Nonzero if regno should not be written to the target, for various
+/* Nonzero if regno should not be written to the target, for various
reasons. */
static int
/* Many special registers are read-only in user mode. Let the debug
agent decide whether they are writable. */
-
+
return 0;
}
}
}
-/* Stores a function return value of type type, where valbuf is the address
+/* Stores a function return value of type type, where valbuf is the address
of the value to be stored. */
/* In the CRIS ABI, R10 and R11 are used to store return values. */
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
ULONGEST val;
int len = type->length ();
-
+
if (len <= 4)
{
/* Put the return value in R10. */
int spec_regno;
int i;
- /* Special register (R16 - R31). cris_spec_regs is zero-based.
+ /* Special register (R16 - R31). cris_spec_regs is zero-based.
Adjust regno accordingly. */
spec_regno = regno - NUM_GENREGS;
-
+
/* Assume nothing about the layout of the cris_spec_regs struct
when searching. */
for (i = 0; cris_spec_regs[i].name != NULL; i++)
{
- if (cris_spec_regs[i].number == spec_regno
+ if (cris_spec_regs[i].number == spec_regno
&& cris_spec_reg_applicable (gdbarch, cris_spec_regs[i]))
/* Go with the first applicable register. */
return cris_spec_regs[i].name;
}
/* Extract from an array regbuf containing the raw register state a function
- return value of type type, and copy that, in virtual format, into
+ return value of type type, and copy that, in virtual format, into
valbuf. */
/* In the CRIS ABI, R10 and R11 are used to store return values. */
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
ULONGEST val;
int len = type->length ();
-
+
if (len <= 4)
{
/* Get the return value from R10. */
return RETURN_VALUE_REGISTER_CONVENTION;
}
-/* Calculates a value that measures how good inst_args constraints an
+/* Calculates a value that measures how good inst_args constraints an
instruction. It stems from cris_constraint, found in cris-dis.c. */
static int
const gdb_byte *s = (const gdb_byte *) inst_args;
for (; *s; s++)
- switch (*s)
+ switch (*s)
{
case 'm':
if ((insn & 0x30) == 0x30)
return -1;
break;
-
+
case 'S':
/* A prefix operand. */
if (inst_env->prefix_found)
retval = (((insn >> 0xC) & 0xF) == (insn & 0xF));
if (!retval)
return -1;
- else
+ else
retval += 4;
break;
break;
}
}
-
+
if (cris_spec_regs[i].name == NULL)
return -1;
break;
number_of_bits (unsigned int value)
{
int number_of_bits = 0;
-
+
while (value != 0)
{
number_of_bits += 1;
return number_of_bits;
}
-/* Finds the address that should contain the single step breakpoint(s).
+/* Finds the address that should contain the single step breakpoint(s).
It stems from code in cris-dis.c. */
static int
for (i = 0; cris_opcodes[i].name != NULL; i++)
{
- if (((cris_opcodes[i].match & insn) == cris_opcodes[i].match)
+ if (((cris_opcodes[i].match & insn) == cris_opcodes[i].match)
&& ((cris_opcodes[i].lose & insn) == 0)
/* Only CRISv10 instructions, please. */
&& (cris_opcodes[i].applicable_version != cris_ver_v32p))
/* Create a local register image and set the initial state. */
for (i = 0; i < NUM_GENREGS; i++)
{
- inst_env->reg[i] =
+ inst_env->reg[i] =
(unsigned long) regcache_raw_get_unsigned (regcache, i);
}
offset = NUM_GENREGS;
for (i = 0; i < NUM_SPECREGS; i++)
{
- inst_env->preg[i] =
+ inst_env->preg[i] =
(unsigned long) regcache_raw_get_unsigned (regcache, offset + i);
}
inst_env->branch_found = 0;
/* If the instruction is not in a delay slot the new content of the
PC is [PC] + 2. If the instruction is in a delay slot it is not
- that simple. Since a instruction in a delay slot cannot change
- the content of the PC, it does not matter what value PC will have.
+ that simple. Since a instruction in a delay slot cannot change
+ the content of the PC, it does not matter what value PC will have.
Just make sure it is a valid instruction. */
if (!inst_env->delay_slot_pc_active)
{
{
cris_gdb_func (gdbarch, cris_opcodes[i].op, insn, inst_env);
}
- } while (!inst_env->invalid
- && (inst_env->prefix_found || inst_env->xflag_found
+ } while (!inst_env->invalid
+ && (inst_env->prefix_found || inst_env->xflag_found
|| inst_env->slot_needed));
return i;
}
inst_env_type inst_env;
std::vector<CORE_ADDR> next_pcs;
- /* Analyse the present instruction environment and insert
+ /* Analyse the present instruction environment and insert
breakpoints. */
int status = find_step_target (regcache, &inst_env);
if (status == -1)
{
- /* Could not find a target. Things are likely to go downhill
+ /* Could not find a target. Things are likely to go downhill
from here. */
warning (_("CRIS software single step could not find a step target."));
}
= (CORE_ADDR) inst_env.reg[gdbarch_pc_regnum (gdbarch)];
next_pcs.push_back (next_pc);
- if (inst_env.branch_found
+ if (inst_env.branch_found
&& (CORE_ADDR) inst_env.branch_break_address != next_pc)
{
CORE_ADDR branch_target_address
if (inst_env->slot_needed || inst_env->prefix_found)
{
inst_env->invalid = 1;
- return;
+ return;
}
-
+
inst_env->prefix_value = inst_env->reg[cris_get_operand2 (inst)];
inst_env->prefix_value += cris_get_bdap_quick_offset (inst);
inst_env->prefix_found = 1;
}
-/* Updates the autoincrement register. The size of the increment is derived
+/* Updates the autoincrement register. The size of the increment is derived
from the size of the operation. The PC is always kept aligned on even
word addresses. */
-static void
+static void
process_autoincrement (int size, unsigned short inst, inst_env_type *inst_env)
{
if (size == INST_BYTE_SIZE)
CORE_ADDR address,
enum bfd_endian byte_order);
-/* Calculates the prefix value for the general case of offset addressing
+/* Calculates the prefix value for the general case of offset addressing
mode. */
static void
if (inst_env->slot_needed || inst_env->prefix_found)
{
inst_env->invalid = 1;
- return;
+ return;
}
/* The calculation of prefix_value used to be after process_autoincrement,
inst_env->prefix_value = inst_env->reg[cris_get_operand2 (inst)];
/* The offset is an indirection of the contents of the operand1 register. */
- inst_env->prefix_value +=
+ inst_env->prefix_value +=
get_data_from_address (&inst, inst_env->reg[cris_get_operand1 (inst)],
inst_env->byte_order);
-
+
if (cris_get_mode (inst) == AUTOINC_MODE)
{
- process_autoincrement (cris_get_size (inst), inst, inst_env);
+ process_autoincrement (cris_get_size (inst), inst, inst_env);
}
-
+
/* A prefix doesn't change the xflag_found. But the rest of the flags
need updating. */
inst_env->slot_needed = 0;
inst_env->invalid = 1;
return;
}
-
+
inst_env->prefix_value = inst_env->reg[cris_get_operand1 (inst)];
- /* The offset is the operand2 value shifted the size of the instruction
+ /* The offset is the operand2 value shifted the size of the instruction
to the left. */
- inst_env->prefix_value +=
+ inst_env->prefix_value +=
inst_env->reg[cris_get_operand2 (inst)] << cris_get_size (inst);
-
- /* If the PC is operand1 (base) the address used is the address after
+
+ /* If the PC is operand1 (base) the address used is the address after
the main instruction, i.e. address + 2 (the PC is already compensated
for the prefix operation). */
if (cris_get_operand1 (inst) == REG_PC)
/* Calculates the prefix value for the double indirect addressing mode. */
-static void
+static void
dip_prefix (unsigned short inst, inst_env_type *inst_env)
{
inst_env->invalid = 1;
return;
}
-
+
/* The prefix value is one dereference of the contents of the operand1
register. */
address = (CORE_ADDR) inst_env->reg[cris_get_operand1 (inst)];
inst_env->prefix_value
= read_memory_unsigned_integer (address, 4, inst_env->byte_order);
-
+
/* Check if the mode is autoincrement. */
if (cris_get_mode (inst) == AUTOINC_MODE)
{
inst_env->invalid = 1;
return;
}
-
+
/* We have a branch, find out where the branch will land. */
offset = cris_get_branch_short_offset (inst);
{
offset |= 0xFF00;
}
-
+
/* The offset ends with the sign bit, set it to zero. The address
should always be word aligned. */
offset &= ~BRANCH_SIGNED_SHORT_OFFSET_MASK;
-
+
inst_env->branch_found = 1;
inst_env->branch_break_address = inst_env->reg[REG_PC] + offset;
/* Finds the destination for a branch with 16-bits offset. */
-static void
+static void
sixteen_bit_offset_branch_op (unsigned short inst, inst_env_type *inst_env)
{
short offset;
/* Handles the ABS instruction. */
-static void
+static void
abs_op (unsigned short inst, inst_env_type *inst_env)
{
long value;
-
+
/* ABS can't have a prefix, so it's bad if it does. */
if (inst_env->prefix_found)
{
/* Check if the operation affects the PC. */
if (cris_get_operand2 (inst) == REG_PC)
{
-
+
/* It's invalid to change to the PC if we are in a delay slot. */
if (inst_env->slot_needed)
{
/* Handles the ADDI instruction. */
-static void
+static void
addi_op (unsigned short inst, inst_env_type *inst_env)
{
/* It's invalid to have the PC as base register. And ADDI can't have
/* Handles the ASR instruction. */
-static void
+static void
asr_op (unsigned short inst, inst_env_type *inst_env)
{
int shift_steps;
/* Handles the ASRQ instruction. */
-static void
+static void
asrq_op (unsigned short inst, inst_env_type *inst_env)
{
int shift_steps;
unsigned long value;
unsigned long signed_extend_mask = 0;
-
+
/* ASRQ can't have a prefix, so check that it doesn't. */
if (inst_env->prefix_found)
{
/* Handles the AX, EI and SETF instruction. */
-static void
+static void
ax_ei_setf_op (unsigned short inst, inst_env_type *inst_env)
{
if (inst_env->prefix_found)
inst_env->disable_interrupt = 1;
}
-/* Checks if the instruction is in assign mode. If so, it updates the assign
+/* Checks if the instruction is in assign mode. If so, it updates the assign
register. Note that check_assign assumes that the caller has checked that
there is a prefix to this instruction. The mode check depends on this. */
-static void
+static void
check_assign (unsigned short inst, inst_env_type *inst_env)
{
/* Check if it's an assign addressing mode. */
/* Handles the 2-operand BOUND instruction. */
-static void
+static void
two_operand_bound_op (unsigned short inst, inst_env_type *inst_env)
{
/* It's invalid to have the PC as the index operand. */
/* Handles the 3-operand BOUND instruction. */
-static void
+static void
three_operand_bound_op (unsigned short inst, inst_env_type *inst_env)
{
/* It's an error if we haven't got a prefix. And it's also an error
/* Clears the status flags in inst_env. */
-static void
+static void
btst_nop_op (unsigned short inst, inst_env_type *inst_env)
{
/* It's an error if we have got a prefix. */
/* Clears the status flags in inst_env. */
-static void
+static void
clearf_di_op (unsigned short inst, inst_env_type *inst_env)
{
/* It's an error if we have got a prefix. */
/* Handles the CLEAR instruction if it's in register mode. */
-static void
+static void
reg_mode_clear_op (unsigned short inst, inst_env_type *inst_env)
{
/* Check if the target is the PC. */
{
inst_env->delay_slot_pc = 0x0;
}
- /* The jump will be delayed with one delay slot. So we need a delay
+ /* The jump will be delayed with one delay slot. So we need a delay
slot. */
inst_env->slot_needed = 1;
inst_env->delay_slot_pc_active = 1;
}
-/* Handles the CLEAR and TEST instruction if the instruction isn't
+/* Handles the CLEAR and TEST instruction if the instruction isn't
in register mode. */
-static void
+static void
none_reg_mode_clear_test_op (unsigned short inst, inst_env_type *inst_env)
{
/* Check if we are in a prefix mode. */
/* Checks that the PC isn't the destination register or the instructions has
a prefix. */
-static void
+static void
dstep_logshift_mstep_neg_not_op (unsigned short inst, inst_env_type *inst_env)
{
/* It's invalid to have the PC as the destination. The instruction can't
/* Handles the register mode JUMP instruction. */
-static void
+static void
reg_mode_jump_op (unsigned short inst, inst_env_type *inst_env)
{
- /* It's invalid to do a JUMP in a delay slot. The mode is register, so
+ /* It's invalid to do a JUMP in a delay slot. The mode is register, so
you can't have a prefix. */
if ((inst_env->slot_needed) || (inst_env->prefix_found))
{
inst_env->invalid = 1;
return;
}
-
+
/* Just change the PC. */
inst_env->reg[REG_PC] = inst_env->reg[cris_get_operand1 (inst)];
inst_env->slot_needed = 0;
check_assign (inst, inst_env);
/* Get the new value for the PC. */
- newpc =
+ newpc =
read_memory_unsigned_integer ((CORE_ADDR) inst_env->prefix_value,
4, inst_env->byte_order);
}
/* Handles moves to special registers (aka P-register) for all modes. */
-static void
+static void
move_to_preg_op (struct gdbarch *gdbarch, unsigned short inst,
inst_env_type *inst_env)
{
are interested in is the autoincrement mode. */
if (cris_get_operand1 (inst) == REG_PC)
{
- /* If the PC is to be incremented it's invalid to be in a
+ /* If the PC is to be incremented it's invalid to be in a
delay slot. */
if (inst_env->slot_needed)
{
/* Handles moves from special registers (aka P-register) for all modes
except register. */
-static void
+static void
none_reg_mode_move_from_preg_op (struct gdbarch *gdbarch, unsigned short inst,
inst_env_type *inst_env)
{
check_assign (inst, inst_env);
}
}
- }
+ }
/* The instruction doesn't have a prefix, the only case left that we
are interested in is the autoincrement mode. */
else if (cris_get_mode (inst) == AUTOINC_MODE)
{
if (cris_get_operand1 (inst) == REG_PC)
{
- /* If the PC is to be incremented it's invalid to be in a
+ /* If the PC is to be incremented it's invalid to be in a
delay slot. */
if (inst_env->slot_needed)
{
inst_env->invalid = 1;
return;
}
-
+
/* The increment depends on the size of the special register. */
if (cris_register_size (gdbarch, cris_get_operand2 (inst)) == 1)
{
/* Handles moves from special registers (aka P-register) when the mode
is register. */
-static void
+static void
reg_mode_move_from_preg_op (unsigned short inst, inst_env_type *inst_env)
{
/* Register mode move from special register can't have a prefix. */
/* Handles the MOVEM from memory to general register instruction. */
-static void
+static void
move_mem_to_reg_movem_op (unsigned short inst, inst_env_type *inst_env)
{
if (inst_env->prefix_found)
MOVEM instruction going to change the PC? */
if (cris_get_operand2 (inst) >= REG_PC)
{
- inst_env->reg[REG_PC] =
+ inst_env->reg[REG_PC] =
read_memory_unsigned_integer (inst_env->prefix_value,
4, inst_env->byte_order);
}
- /* The assign value is the value after the increment. Normally, the
+ /* The assign value is the value after the increment. Normally, the
assign value is the value before the increment. */
- if ((cris_get_operand1 (inst) == REG_PC)
+ if ((cris_get_operand1 (inst) == REG_PC)
&& (cris_get_mode (inst) == PREFIX_ASSIGN_MODE))
{
inst_env->reg[REG_PC] = inst_env->prefix_value;
return;
}
inst_env->reg[REG_PC] =
- read_memory_unsigned_integer (inst_env->reg[cris_get_operand1 (inst)],
+ read_memory_unsigned_integer (inst_env->reg[cris_get_operand1 (inst)],
4, inst_env->byte_order);
}
/* The increment is not depending on the size, instead it's depending
inst_env->invalid = 1;
return;
}
- inst_env->reg[REG_PC] += 4 * (cris_get_operand2 (inst) + 1);
+ inst_env->reg[REG_PC] += 4 * (cris_get_operand2 (inst) + 1);
}
}
inst_env->slot_needed = 0;
/* Handles the MOVEM to memory from general register instruction. */
-static void
+static void
move_reg_to_mem_movem_op (unsigned short inst, inst_env_type *inst_env)
{
if (inst_env->prefix_found)
/* Handles the instructions that's not yet implemented, by setting
inst_env->invalid to true. */
-static void
+static void
not_implemented_op (unsigned short inst, inst_env_type *inst_env)
{
inst_env->invalid = 1;
/* Handles the XOR instruction. */
-static void
+static void
xor_op (unsigned short inst, inst_env_type *inst_env)
{
/* XOR can't have a prefix. */
/* Handles the MULS instruction. */
-static void
+static void
muls_op (unsigned short inst, inst_env_type *inst_env)
{
/* MULS/U can't have a prefix. */
/* Handles the MULU instruction. */
-static void
+static void
mulu_op (unsigned short inst, inst_env_type *inst_env)
{
/* MULS/U can't have a prefix. */
/* Calculate the result of the instruction for ADD, SUB, CMP AND, OR and MOVE.
The MOVE instruction is the move from source to register. */
-static void
-add_sub_cmp_and_or_move_action (unsigned short inst, inst_env_type *inst_env,
+static void
+add_sub_cmp_and_or_move_action (unsigned short inst, inst_env_type *inst_env,
unsigned long source1, unsigned long source2)
{
unsigned long pc_mask;
unsigned long operation_mask;
-
+
/* Find out how many bits the operation should apply to. */
if (cris_get_size (inst) == INST_BYTE_SIZE)
{
- pc_mask = 0xFFFFFF00;
+ pc_mask = 0xFFFFFF00;
operation_mask = 0xFF;
}
else if (cris_get_size (inst) == INST_WORD_SIZE)
is zero extend then the value is extended with zero. If instead the mode
is signed extend the sign bit of the value is taken into consideration. */
-static unsigned long
+static unsigned long
do_sign_or_zero_extend (unsigned long value, unsigned short *inst)
{
- /* The size can be either byte or word, check which one it is.
+ /* The size can be either byte or word, check which one it is.
Don't check the highest bit, it's indicating if it's a zero
or sign extend. */
if (cris_get_size (*inst) & INST_WORD_SIZE)
if (cris_is_signed_extend_bit_on (*inst) && (value & SIGNED_WORD_MASK))
{
value |= SIGNED_WORD_EXTEND_MASK;
- }
+ }
}
else
{
/* Handles the register mode for the ADD, SUB, CMP, AND, OR and MOVE
instruction. The MOVE instruction is the move from source to register. */
-static void
+static void
reg_mode_add_sub_cmp_and_or_move_op (unsigned short inst,
inst_env_type *inst_env)
{
unsigned long operand1;
unsigned long operand2;
- /* It's invalid to have a prefix to the instruction. This is a register
+ /* It's invalid to have a prefix to the instruction. This is a register
mode instruction and can't have a prefix. */
if (inst_env->prefix_found)
{
return;
}
/* The instruction has the PC as its target register. */
- operand1 = inst_env->reg[cris_get_operand1 (inst)];
+ operand1 = inst_env->reg[cris_get_operand1 (inst)];
operand2 = inst_env->reg[REG_PC];
/* Check if it's a extend, signed or zero instruction. */
}
/* Calculate the PC value after the instruction, i.e. where the
breakpoint should be. The order of the udw_operands is vital. */
- add_sub_cmp_and_or_move_action (inst, inst_env, operand2, operand1);
+ add_sub_cmp_and_or_move_action (inst, inst_env, operand2, operand1);
}
inst_env->slot_needed = 0;
inst_env->prefix_found = 0;
the size of the operation. If the instruction is a zero or signed
extend instruction, the size field is changed in instruction. */
-static unsigned long
+static unsigned long
get_data_from_address (unsigned short *inst, CORE_ADDR address,
enum bfd_endian byte_order)
{
/* Handles the assign addressing mode for the ADD, SUB, CMP, AND, OR and MOVE
instructions. The MOVE instruction is the move from source to register. */
-static void
-handle_prefix_assign_mode_for_aritm_op (unsigned short inst,
+static void
+handle_prefix_assign_mode_for_aritm_op (unsigned short inst,
inst_env_type *inst_env)
{
unsigned long operand2;
OR instructions. Note that for this to work as expected, the calling
function must have made sure that there is a prefix to this instruction. */
-static void
-three_operand_add_sub_cmp_and_or_op (unsigned short inst,
+static void
+three_operand_add_sub_cmp_and_or_op (unsigned short inst,
inst_env_type *inst_env)
{
unsigned long operand2;
/* Handles the index addressing mode for the ADD, SUB, CMP, AND, OR and MOVE
instructions. The MOVE instruction is the move from source to register. */
-static void
-handle_prefix_index_mode_for_aritm_op (unsigned short inst,
+static void
+handle_prefix_index_mode_for_aritm_op (unsigned short inst,
inst_env_type *inst_env)
{
if (cris_get_operand1 (inst) != cris_get_operand2 (inst))
CMP, AND OR and MOVE instruction. The MOVE instruction is the move from
source to register. */
-static void
-handle_inc_and_index_mode_for_aritm_op (unsigned short inst,
+static void
+handle_inc_and_index_mode_for_aritm_op (unsigned short inst,
inst_env_type *inst_env)
{
unsigned long operand1;
Check if the destination register is the PC. */
if (cris_get_operand2 (inst) == REG_PC)
{
- /* Must be done here, get_data_from_address may change the size
+ /* Must be done here, get_data_from_address may change the size
field. */
size = cris_get_size (inst);
operand2 = inst_env->reg[REG_PC];
/* Calculate the PC value after the instruction, i.e. where the
breakpoint should be. The order of the udw_operands is vital. */
- add_sub_cmp_and_or_move_action (inst, inst_env, operand2, operand3);
+ add_sub_cmp_and_or_move_action (inst, inst_env, operand2, operand3);
}
/* If this is an autoincrement addressing mode, check if the increment
changes the PC. */
size &= ~SIGNED_EXTEND_BIT_MASK;
}
process_autoincrement (size, inst, inst_env);
- }
+ }
inst_env->slot_needed = 0;
inst_env->prefix_found = 0;
inst_env->xflag_found = 0;
/* Handles the two-operand addressing mode, all modes except register, for
the ADD, SUB CMP, AND and OR instruction. */
-static void
-none_reg_mode_add_sub_cmp_and_or_move_op (unsigned short inst,
+static void
+none_reg_mode_add_sub_cmp_and_or_move_op (unsigned short inst,
inst_env_type *inst_env)
{
if (inst_env->prefix_found)
/* Handles the quick addressing mode for the ADD and SUB instruction. */
-static void
+static void
quick_mode_add_sub_op (unsigned short inst, inst_env_type *inst_env)
{
unsigned long operand1;
/* Handles the quick addressing mode for the CMP, AND and OR instruction. */
-static void
+static void
quick_mode_and_cmp_move_or_op (unsigned short inst, inst_env_type *inst_env)
{
unsigned long operand1;
/* Unpack a cris_elf_gregset_t into GDB's register cache. */
-static void
+static void
cris_supply_gregset (const struct regset *regset, struct regcache *regcache,
int regnum, const void *gregs, size_t len)
{
INIT_GDB_FILE (cris_tdep)
{
gdbarch_register (bfd_arch_cris, cris_gdbarch_init, cris_dump_tdep);
-
+
/* CRIS-specific user-commands. */
add_setshow_zuinteger_cmd ("cris-version", class_support,
&usr_cmd_cris_version,
is %s. */
&setlist, &showlist);
- add_setshow_enum_cmd ("cris-mode", class_support,
- cris_modes, &usr_cmd_cris_mode,
+ add_setshow_enum_cmd ("cris-mode", class_support,
+ cris_modes, &usr_cmd_cris_mode,
_("Set the current CRIS mode."),
_("Show the current CRIS mode."),
_("\
set_cris_mode,
NULL, /* FIXME: i18n: Current CRIS version is %s. */
&setlist, &showlist);
-
+
add_setshow_boolean_cmd ("cris-dwarf2-cfi", class_support,
&usr_cmd_cris_dwarf2_cfi,
_("Set the usage of Dwarf-2 CFI for CRIS."),
}
static void
-set_cris_version (const char *ignore_args, int from_tty,
+set_cris_version (const char *ignore_args, int from_tty,
struct cmd_list_element *c)
{
struct gdbarch_info info;
usr_cmd_cris_version_valid = 1;
-
+
/* Update the current architecture, if needed. */
if (!gdbarch_update_p (current_inferior (), info))
internal_error (_("cris_gdbarch_update: failed to update architecture."));
}
static void
-set_cris_mode (const char *ignore_args, int from_tty,
+set_cris_mode (const char *ignore_args, int from_tty,
struct cmd_list_element *c)
{
struct gdbarch_info info;
}
static void
-set_cris_dwarf2_cfi (const char *ignore_args, int from_tty,
+set_cris_dwarf2_cfi (const char *ignore_args, int from_tty,
struct cmd_list_element *c)
{
struct gdbarch_info info;
if (usr_cmd_cris_version_valid)
{
- /* Trust the user's CRIS version setting. */
+ /* Trust the user's CRIS version setting. */
cris_version = usr_cmd_cris_version;
}
else if (info.abfd && bfd_get_mach (info.abfd) == bfd_mach_cris_v32)
/* Make the current settings visible to the user. */
usr_cmd_cris_version = cris_version;
-
+
/* Find a candidate among the list of pre-declared architectures. */
- for (arches = gdbarch_list_lookup_by_info (arches, &info);
+ for (arches = gdbarch_list_lookup_by_info (arches, &info);
arches != NULL;
arches = gdbarch_list_lookup_by_info (arches->next, &info))
{
set_gdbarch_return_value (gdbarch, cris_return_value);
set_gdbarch_sp_regnum (gdbarch, 14);
-
+
/* Length of ordinary registers used in push_word and a few other
places. register_size() is the real way to know how big a
register is. */
return 0;
case 10:
- case 11:
- /* CRIS v10 and v11, a.k.a. ETRAX 100LX. In addition to ETRAX 100,
+ case 11:
+ /* CRIS v10 and v11, a.k.a. ETRAX 100LX. In addition to ETRAX 100,
P7 (32 bits), and P15 (32 bits) have been implemented. */
set_gdbarch_pc_regnum (gdbarch, 15);
set_gdbarch_register_type (gdbarch, cris_register_type);
break;
case 32:
- /* CRIS v32. General registers R0 - R15 (32 bits), special registers
+ /* CRIS v32. General registers R0 - R15 (32 bits), special registers
P0 - P15 (32 bits) except P0, P1, P3 (8 bits) and P4 (16 bits)
and pseudo-register PC (32 bits). */
set_gdbarch_pc_regnum (gdbarch, 32);
set_gdbarch_num_regs (gdbarch, 32 + 1 + 16);
set_gdbarch_register_name (gdbarch, crisv32_register_name);
- set_gdbarch_cannot_store_register
+ set_gdbarch_cannot_store_register
(gdbarch, crisv32_cannot_store_register);
set_gdbarch_cannot_fetch_register
(gdbarch, crisv32_cannot_fetch_register);
set_gdbarch_have_nonsteppable_watchpoint (gdbarch, 1);
- set_gdbarch_single_step_through_delay
+ set_gdbarch_single_step_through_delay
(gdbarch, crisv32_single_step_through_delay);
break;
set_gdbarch_push_dummy_call (gdbarch, cris_push_dummy_call);
set_gdbarch_frame_align (gdbarch, cris_frame_align);
set_gdbarch_skip_prologue (gdbarch, cris_skip_prologue);
-
+
/* The stack grows downward. */
set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
set_gdbarch_breakpoint_kind_from_pc (gdbarch, cris_breakpoint_kind_from_pc);
set_gdbarch_sw_breakpoint_from_kind (gdbarch, cris_sw_breakpoint_from_kind);
set_gdbarch_iterate_over_regset_sections (gdbarch, cris_iterate_over_regset_sections);
-
+
if (tdep->cris_dwarf2_cfi == 1)
{
/* Hook in the Dwarf-2 frame sniffer. */
gdb_printf (_("%u"), ref);
gdb_printf (_(" refs)"));
}
-
+
if (task == task_self ())
{
if (port == task_self())
task = get_task_from_args (args);
if (task == TASK_NULL)
return;
-
+
darwin_debug_regions (task, 0, -1);
}
task = get_task_from_args (args);
if (task == TASK_NULL)
return;
-
+
darwin_debug_regions_recurse (task);
}
if (inferior_ptid == null_ptid)
gdb_printf (_("No inferior running\n"));
inf = current_inferior ();
-
+
darwin_inferior *priv = get_darwin_inferior (inf);
kret = task_get_exception_ports
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* This module provides three functions: dbx_symfile_init,
- which initializes to read a symbol file; dbx_new_init, which
+ which initializes to read a symbol file; dbx_new_init, which
discards existing cached information when all symbols are being
discarded; and dbx_symfile_read, which reads a symbol table
from a file.
#endif
\f
/* Scan and build partial symbols for a symbol file.
- We have been initialized by a call to dbx_symfile_init, which
+ We have been initialized by a call to dbx_symfile_init, which
put all the relevant info into a "struct dbx_symfile_info",
hung off the objfile structure. */
}
/* Using the data cache DCACHE, store in *PTR the contents of the byte at
- address ADDR in the remote machine.
+ address ADDR in the remote machine.
Returns 1 for success, 0 for error. */
gdb_printf (_("No such cache line exists.\n"));
return;
}
-
+
db = (struct dcache_block *) n->value;
gdb_printf (_("Line %d: address %s [%d hits]\n"),
/* The O_BINARY flag is defined in fcntl.h on some non-Posix platforms.
It is used as an access modifier in calls to open(), where it acts
similarly to the "b" character in fopen()'s MODE argument. On Posix
- platforms it should be a no-op, so it is defined as 0 here. This
+ platforms it should be a no-op, so it is defined as 0 here. This
ensures that the symbol may be used freely elsewhere in gdb. */
#ifndef O_BINARY
extern void (*selected_frame_level_changed_hook) (int);
extern int (*deprecated_ui_loop_hook) (int signo);
extern void (*deprecated_show_load_progress) (const char *section,
- unsigned long section_sent,
- unsigned long section_size,
- unsigned long total_sent,
+ unsigned long section_sent,
+ unsigned long section_size,
+ unsigned long total_sent,
unsigned long total_size);
extern void (*deprecated_print_frame_info_listing_hook) (struct symtab * s,
int line,
/* Routines for name->symbol lookups in GDB.
-
+
Copyright (C) 2003-2025 Free Software Foundation, Inc.
Contributed by David Carlton <carlton@bactrian.org> and by Kealia,
is:
* Add a new element DICT_<IMPL> to dict_type.
-
+
* Create a new structure dictionary_<impl>. If your new
implementation is a variant of an existing one, make sure that
their structs have the same initial data members. Define accessor
{
return (DICT_VECTOR (dict))->size (dict);
}
-
+
/* Now come functions (well, one function, currently) that are
implemented generically by means of the vtable. Typically, they're
rarely used. */
struct symbol *next;
next = DICT_ITERATOR_CURRENT (iterator)->hash_next;
-
+
if (next == NULL)
return iterator_hashed_advance (iterator);
else
for (i = DICT_ITERATOR_INDEX (iterator) + 1; i < nbuckets; ++i)
{
struct symbol *sym = DICT_HASHED_BUCKET (dict, i);
-
+
if (sym != NULL)
{
DICT_ITERATOR_INDEX (iterator) = i;
/* Loop through the symbols in the given bucket, breaking when SYM
first matches. If SYM never matches, it will be set to NULL;
either way, we have the right return value. */
-
+
for (sym = DICT_HASHED_BUCKET (dict, hash_index);
sym != NULL;
sym = sym->hash_next)
struct symbol *sym, *next_sym;
sym = old_buckets[i];
- if (sym != NULL)
+ if (sym != NULL)
{
for (next_sym = sym->hash_next;
next_sym != NULL;
are lower-cased identifiers). The <suffix> (which can be empty)
encodes additional information about the denoted entity. This
routine hashes such names to msymbol_hash_iw(Pn). It actually
- does this for a superset of both valid Pi and of <suffix>, but
+ does this for a superset of both valid Pi and of <suffix>, but
in other cases it simply returns msymbol_hash_iw(STRING0). */
const char *string;
}
DICT_ITERATOR_INDEX (iterator) = i;
-
+
return retval;
}
/* Routines for name->symbol lookups in GDB.
-
+
Copyright (C) 2003-2025 Free Software Foundation, Inc.
Contributed by David Carlton <carlton@bactrian.org> and by Kealia,
/* Advance MITERATOR to point at the next symbol in MDICT whose
search_name () is NAME, as tested using COMPARE (see
dict_iter_match_first), or NULL if there are no more such symbols.
- Don't call this if you've previously received NULL from
+ Don't call this if you've previously received NULL from
mdict_iterator_match_first or mdict_iterator_match_next on this
iteration. And don't call it unless MITERATOR was created by a
previous call to mdict_iter_match_first with the same NAME and COMPARE. */
PKGVERSION = @PKGVERSION@
BUGURL_TEXI = @REPORT_BUGS_TEXI@
-# Where is the source dir for the READLINE library doc?
+# Where is the source dir for the READLINE library doc?
# Traditionally readline is in .. or .
READLINE_DIR = ${gdbdir}/../readline/readline/doc
READLINE_TEXI_INCFLAG = @READLINE_TEXI_INCFLAG@
-mkdir -p doxy
$(DOXYGEN) Doxyfile-gdbserver
-Doxyfile-base: $(srcdir)/Doxyfile-base.in
+Doxyfile-base: $(srcdir)/Doxyfile-base.in
$(doxyedit) $(srcdir)/Doxyfile-base.in >Doxyfile-base
-Doxyfile-gdb-api: $(srcdir)/Doxyfile-gdb-api.in
+Doxyfile-gdb-api: $(srcdir)/Doxyfile-gdb-api.in
$(doxyedit) $(srcdir)/Doxyfile-gdb-api.in >Doxyfile-gdb-api
Doxyfile-gdb-xref: $(srcdir)/Doxyfile-gdb-xref.in
# GDB MANUAL: roff translations
# Try to use a recent texi2roff. v2 was put on prep in jan91.
-# If you want an index, see texi2roff doc for postprocessing
+# If you want an index, see texi2roff doc for postprocessing
# and add -i to texi2roff invocations below.
# Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
# corresponding -e lines when later texi2roff's are current)
# + @ (that's at-BLANK) not recognized by texi2roff, turned into blank
# + @alphaenumerate is ridiculously new, turned into @enumerate
-# texi2roff doesn't have a notion of include dirs, so we have to fake
+# texi2roff doesn't have a notion of include dirs, so we have to fake
# it out for gdb manual's include files---but only if not configured
# in main sourcedir.
links2roff: $(GDB_DOC_SOURCE_INCLUDES)
$(srcdir)/gdb.texinfo | \
$(TEXI2ROFF) -me | \
sed -e 's/---/\\(em/g' \
- >gdb.me
+ >gdb.me
# gdb manual suitable for [gtn]roff -ms
gdb.ms: $(GDB_DOC_FILES) links2roff
$(srcdir)/gdb.texinfo | \
$(TEXI2ROFF) -ms | \
sed -e 's/---/\\(em/g' \
- >gdb.ms
+ >gdb.ms
# gdb manual suitable for [tn]roff -mm
-# '@noindent's removed due to texi2roff-2 mm bug; if yours is newer,
+# '@noindent's removed due to texi2roff-2 mm bug; if yours is newer,
# try leaving them in
gdb.mm: $(GDB_DOC_FILES) links2roff
$(ECHO_GEN) sed -e '/\\input texinfo/d' \
$(srcdir)/gdb.texinfo | \
$(TEXI2ROFF) -mm | \
sed -e 's/---/\\(em/g' \
- >gdb.mm
+ >gdb.mm
# GDB MANUAL: HTML file
distclean: clean
rm -f Makefile
-# GDBvn.texi, the dvi files, the info files, and the postscript files,
+# GDBvn.texi, the dvi files, the info files, and the postscript files,
# are all part of the distribution, so it should not be removed by
# "clean" or "distclean". Use maintainer-clean to remove them.
There are no instructions to perform side effects on the running
program, or call the program's functions; we assume that these
expressions are only used for unobtrusive debugging, not for patching
-the running code.
+the running code.
Most bytecode instructions do not distinguish between the various sizes
of values, and operate on full-width values; the upper bits of the
-@c GDB MANUAL configuration file.
+@c GDB MANUAL configuration file.
@c
@c Copyright (C) 1993--2025 Free Software Foundation, Inc.
@c
@c
@c The only automatically-varying variable is the GDB version number,
@c which the Makefile rewrites based on the VERSION variable from
-@c `../Makefile.in'.
-@c
+@c `../Makefile.in'.
+@c
@c GDB version number is recorded in the variable GDBVN
@include GDBvn.texi
@c
@c
@c Name of GDB program. Used also for (gdb) prompt string.
@set GDBP gdb
-@c
+@c
@c Name of GDB product. Used in running text.
@set GDBN @sc{gdb}
@c
@c
@c Name of GCC product
@set NGCC @sc{gcc}
-@c
+@c
@c Name of GCC program
@set GCC gcc
/* Identification bytes (see above). */
uint8_t dofh_ident[16];
/* File attribute flags (if any). */
- uint32_t dofh_flags;
+ uint32_t dofh_flags;
/* Size of file header in bytes. */
- uint32_t dofh_hdrsize;
+ uint32_t dofh_hdrsize;
/* Size of section header in bytes. */
- uint32_t dofh_secsize;
+ uint32_t dofh_secsize;
/* Number of section headers. */
- uint32_t dofh_secnum;
+ uint32_t dofh_secnum;
/* File offset of section headers. */
- uint64_t dofh_secoff;
+ uint64_t dofh_secoff;
/* File size of loadable portion. */
- uint64_t dofh_loadsz;
+ uint64_t dofh_loadsz;
/* File size of entire DOF file. */
- uint64_t dofh_filesz;
+ uint64_t dofh_filesz;
/* Reserved for future use. */
- uint64_t dofh_pad;
+ uint64_t dofh_pad;
};
/* A DOF section, whose contents depend on its type. The several
/* Section type (see the define above). */
uint32_t dofs_type;
/* Section data memory alignment. */
- uint32_t dofs_align;
+ uint32_t dofs_align;
/* Section flags (if any). */
- uint32_t dofs_flags;
+ uint32_t dofs_flags;
/* Size of section entry (if table). */
uint32_t dofs_entsize;
/* DOF + offset points to the section data. */
uint64_t dofs_offset;
/* Size of section data in bytes. */
- uint64_t dofs_size;
+ uint64_t dofs_size;
};
/* A DOF provider, which is the provider of a probe. */
struct dtrace_dof_provider
{
/* Link to a DTRACE_DOF_SECT_TYPE_STRTAB section. */
- uint32_t dofpv_strtab;
+ uint32_t dofpv_strtab;
/* Link to a DTRACE_DOF_SECT_TYPE_PROBES section. */
- uint32_t dofpv_probes;
+ uint32_t dofpv_probes;
/* Link to a DTRACE_DOF_SECT_TYPE_PRARGS section. */
- uint32_t dofpv_prargs;
+ uint32_t dofpv_prargs;
/* Link to a DTRACE_DOF_SECT_TYPE_PROFFS section. */
- uint32_t dofpv_proffs;
+ uint32_t dofpv_proffs;
/* Provider name string. */
- uint32_t dofpv_name;
+ uint32_t dofpv_name;
/* Provider attributes. */
uint32_t dofpv_provattr;
/* Module attributes. */
- uint32_t dofpv_modattr;
+ uint32_t dofpv_modattr;
/* Function attributes. */
uint32_t dofpv_funcattr;
/* Name attributes. */
struct dtrace_dof_probe
{
/* Probe base address or offset. */
- uint64_t dofpr_addr;
+ uint64_t dofpr_addr;
/* Probe function string. */
- uint32_t dofpr_func;
+ uint32_t dofpr_func;
/* Probe name string. */
- uint32_t dofpr_name;
+ uint32_t dofpr_name;
/* Native argument type strings. */
- uint32_t dofpr_nargv;
+ uint32_t dofpr_nargv;
/* Translated argument type strings. */
- uint32_t dofpr_xargv;
+ uint32_t dofpr_xargv;
/* Index of first argument mapping. */
- uint32_t dofpr_argidx;
+ uint32_t dofpr_argidx;
/* Index of first offset entry. */
- uint32_t dofpr_offidx;
+ uint32_t dofpr_offidx;
/* Native argument count. */
- uint8_t dofpr_nargc;
+ uint8_t dofpr_nargc;
/* Translated argument count. */
- uint8_t dofpr_xargc;
+ uint8_t dofpr_xargc;
/* Number of offset entries for probe. */
- uint16_t dofpr_noffs;
+ uint16_t dofpr_noffs;
/* Index of first is-enabled offset. */
uint32_t dofpr_enoffidx;
/* Number of is-enabled offsets. */
uint16_t dofpr_nenoffs;
/* Reserved for future use. */
- uint16_t dofpr_pad1;
+ uint16_t dofpr_pad1;
/* Reserved for future use. */
- uint32_t dofpr_pad2;
+ uint32_t dofpr_pad2;
};
/* DOF supports two different encodings: MSB (big-endian) and LSB
}
return;
-
+
invalid_dof_data:
complaint (_("skipping section '%s' which does not contain valid DOF data."),
sect->name);
entry point, or some random address on the stack. Trying to use
that PC to apply standard frame ID unwind techniques is just
asking for trouble. */
-
+
/* Don't bother unless there is at least one dummy frame. */
if (dummy_frame_stack != NULL)
{
-/* DIE indexing
+/* DIE indexing
Copyright (C) 2022-2025 Free Software Foundation, Inc.
-/* DIE indexing
+/* DIE indexing
Copyright (C) 2022-2025 Free Software Foundation, Inc.
. v / | \
. wait (MAIN_AVAILABLE) finalization
. | \ | /
- . v \ | /
+ . v \ | /
. done state = FINALIZED
. |
. v
result_val = fetch (offset);
in_stack_memory = fetch_in_stack_memory (offset);
break;
-
+
case DW_OP_swap:
{
if (this->m_stack.size () < 2)
result_val = value_cast (address_type, result_val);
}
break;
-
+
case DW_OP_entry_value:
case DW_OP_GNU_entry_value:
{
chain to create. Keep TAILCALL_CACHEP NULL if it did not find any chain,
initialize it otherwise. No tail call chain is created if there are no
unambiguous virtual tail call frames to report.
-
+
ENTRY_CFA_SP_OFFSETP is NULL if no special SP handling is possible,
otherwise *ENTRY_CFA_SP_OFFSETP is the number of bytes to subtract from tail
call frames frame base to get the SP value there - to simulate return
if (cache->tailcall_cache)
{
struct value *val;
-
+
val = dwarf2_tailcall_prev_register_first (this_frame,
&cache->tailcall_cache,
regnum);
way. Several "pointer encodings" are supported. The encoding
that's used for a particular FDE is determined by the 'R'
augmentation in the associated CIE. The argument of this
- augmentation is a single byte.
+ augmentation is a single byte.
The address can be encoded as 2 bytes, 4 bytes, 8 bytes, or as a
LEB128. This is encoded in bits 0, 1 and 2. Bit 3 encodes whether
This becomes a problem when you have some other producer that
creates frame sections that are not as strictly aligned. That
- produces a hole in the frame info that gets filled by the
+ produces a hole in the frame info that gets filled by the
linker with zeros.
The GCC behavior is arguably a bug, but it's effectively now
paddress (call_site_gdbarch, call_site->pc ()),
(msym.minsym == NULL ? "???"
: msym.minsym->print_name ()));
-
+
}
if (caller_frame == NULL)
{
paddress (call_site_gdbarch, call_site->pc ()),
(msym.minsym == NULL ? "???"
: msym.minsym->print_name ()));
-
+
}
caller_arch = get_frame_arch (caller_frame);
caller_core_addr_type = builtin_type (caller_arch)->builtin_func_ptr;
physname, paddress (call_site_gdbarch, call_site->pc ()),
(msym.minsym == NULL ? "???"
: msym.minsym->print_name ()));
-
+
}
CORE_ADDR addr = (gdbarch_convert_from_func_ptr_addr
throw_error (NO_ENTRY_VALUE_ERROR, _("Cannot find matching parameter "
"at DW_TAG_call_site %s at %s"),
paddress (gdbarch, caller_pc),
- msym == NULL ? "???" : msym->print_name ());
+ msym == NULL ? "???" : msym->print_name ());
}
*per_cu_return = call_site->per_cu;
}
/* Compile a DWARF location expression to an agent expression.
-
+
EXPR is the agent expression we are building.
LOC is the agent value we modify.
ARCH is the architecture.
ADDR_SIZE is the size of addresses, in bytes.
OP_PTR is the start of the location expression.
OP_END is one past the last byte of the location expression.
-
+
This will throw an exception for various kinds of errors -- for
example, if the expression cannot be compiled, or if the expression
is invalid. */
if (base_data[0] >= DW_OP_breg0 && base_data[0] <= DW_OP_breg31)
{
const gdb_byte *buf_end;
-
+
frame_reg = base_data[0] - DW_OP_breg0;
buf_end = safe_read_sleb128 (base_data + 1, base_data + base_size,
&base_offset);
offset = extract_unsigned_integer (data + 1, addr_size,
gdbarch_byte_order (gdbarch));
- gdb_printf (stream,
+ gdb_printf (stream,
_("a thread-local variable at offset 0x%s "
"in the thread-local storage for `%s'"),
phex_nz (offset, addr_size), objfile_name (objfile));
data = safe_read_uleb128 (data + 1, end, &offset);
offset = (uint64_t) dwarf2_read_addr_index (per_cu, per_objfile, offset);
- gdb_printf (stream,
+ gdb_printf (stream,
_("a thread-local variable at offset 0x%s "
"in the thread-local storage for `%s'"),
phex_nz (offset, addr_size), objfile_name (objfile));
if (data < end)
{
int empty = data == here;
-
+
if (disassemble)
gdb_printf (stream, " ");
if (data[0] == DW_OP_piece)
-/* DIE indexing
+/* DIE indexing
Copyright (C) 2024-2025 Free Software Foundation, Inc.
const gdb_byte *entry)
{
std::vector<cooked_index_entry *> these_entries;
-
+
while (true)
{
std::optional<ULONGEST> parent;
INFO_PTR should point just after the initial uleb128 of a DIE, and the
abbrev corresponding to that skipped uleb128 should be passed in
ABBREV.
-
+
If DO_SKIP_CHILDREN is true, or if the DIE has no children, this
returns a pointer to this DIE's sibling, skipping any children.
Otherwise, returns a pointer to the DIE's first child. */
struct call_site,
sizeof (*call_site) + sizeof (call_site->parameter[0]) * nparams))
struct call_site (pc, cu->per_cu, per_objfile);
-
+
if (!cu->call_site_htab.emplace (call_site).second)
{
complaint (_("Duplicate PC %s for DW_TAG_call_site "
-/* Work with executable files, for GDB.
+/* Work with executable files, for GDB.
Copyright (C) 1988-2025 Free Software Foundation, Inc.
Note that we have to explicitly ignore additional args, since we can
be called from file_command(), which also calls symbol_file_command()
which can take multiple args.
-
+
If ARGS is NULL, we just want to close the exec file. */
static void
styled_string (file_name_style.style (),
bfd_get_filename (abfd)));
- entry_point = gdbarch_addr_bits_remove (gdbarch,
- bfd_get_start_address (abfd)
+ entry_point = gdbarch_addr_bits_remove (gdbarch,
+ bfd_get_start_address (abfd)
+ displacement);
gdb_printf (_("\tEntry point: %s\n"),
paddress (gdbarch, entry_point));
/* Recursively go all the way down into a possibly multi-dimensional
F77 array and get the bounds. For simple arrays, this is pretty
- easy but when the bounds are dynamic, we must be very careful
- to add up all the lengths correctly. Not doing this right
+ easy but when the bounds are dynamic, we must be very careful
+ to add up all the lengths correctly. Not doing this right
will lead to horrendous-looking arrays in parameter lists.
- This function also works for strings which behave very
+ This function also works for strings which behave very
similarly to arrays. */
if (type->target_type ()->code () == TYPE_CODE_ARRAY
}
}
gdb_printf (stream, " )");
- break;
+ break;
case TYPE_CODE_BOOL:
if (options->format || options->output_format)
sym->print_name ());
else
gdb_printf (_("Contents of blank COMMON block:\n"));
-
+
for (index = 0; index < common->n_entries; index++)
{
struct value *val = NULL;
}
}
-/* This function is used to print out the values in a given COMMON
- block. It will always use the most local common block of the
+/* This function is used to print out the values in a given COMMON
+ block. It will always use the most local common block of the
given name. */
static void
const struct block *block;
int values_printed = 0;
- /* We have been told to display the contents of F77 COMMON
- block supposedly visible in this function. Let us
- first make sure that it is visible and if so, let
+ /* We have been told to display the contents of F77 COMMON
+ block supposedly visible in this function. Let us
+ first make sure that it is visible and if so, let
us display its contents. */
fi = get_selected_frame (_("No frame selected"));
- /* The following is generally ripped off from stack.c's routine
+ /* The following is generally ripped off from stack.c's routine
print_frame_info(). */
block = get_frame_block (fi, 0);
/* For a realtime sigtramp frame, SP + 12 contains a pointer
to a ucontext struct. The ucontext struct contains a
sigcontext struct starting 24 bytes in. (The offset of
- uc_mcontext within struct ucontext is derived as follows:
+ uc_mcontext within struct ucontext is derived as follows:
stack_t is a 12-byte struct and struct sigcontext is
8-byte aligned. This gives an offset of 8 + 12 + 4 (for
padding) = 24.) */
return sc_addr + 48;
case iacc0l_regnum :
return sc_addr + 52;
- default :
+ default :
if (first_gpr_regnum <= regno && regno <= last_gpr_regnum)
return sc_addr + 56 + 4 * (regno - first_gpr_regnum);
else if (first_fpr_regnum <= regno && regno <= last_fpr_regnum)
/* Unpack an frv_elf_gregset_t into GDB's register cache. */
-static void
+static void
frv_linux_supply_gregset (const struct regset *regset,
struct regcache *regcache,
int regnum, const void *gregs, size_t len)
linux_init_abi (info, gdbarch, 0);
/* Set the sigtramp frame sniffer. */
- frame_unwind_append_unwinder (gdbarch, &frv_linux_sigtramp_frame_unwind);
+ frame_unwind_append_unwinder (gdbarch, &frv_linux_sigtramp_frame_unwind);
set_gdbarch_iterate_over_regset_sections
(gdbarch, frv_linux_iterate_over_regset_sections);
/* By default, don't supply any general-purpose or floating-point
register names. */
- var->register_names
+ var->register_names
= (const char **) xmalloc ((frv_num_regs + frv_num_pseudo_regs)
* sizeof (const char *));
for (r = 0; r < frv_num_regs + frv_num_pseudo_regs; r++)
var->register_names[pc_regnum] = "pc";
var->register_names[lr_regnum] = "lr";
var->register_names[lcr_regnum] = "lcr";
-
+
var->register_names[psr_regnum] = "psr";
var->register_names[ccr_regnum] = "ccr";
var->register_names[cccr_regnum] = "cccr";
sthi GRk, @(fp, s)
P KKKKKK 1010001 000010 SSSSSSSSSSSS = 0x01442000
0 000000 1111111 111111 000000000000 = 0x01fff000
- . . . . . . . .
+ . . . . . . . .
And for 8-bit values, we use STB instructions.
stbi GRk, @(fp, s)
P KKKKKK 1010000 000010 SSSSSSSSSSSS = 0x01402000
/* In PIC code, GR15 may be loaded from some offset off of FP prior
to the call instruction.
-
+
Skip over this instruction if present. It won't be present in
non-PIC code, and even in PIC code, it might not be present.
(This is due to the fact that GR15, the FDPIC register, already
is the address of __prolog_$rN.
__prolog_$rN pushes registers from 13 through n inclusive.
So for example CALL __prolog_$r15 is equivalent to:
- PUSH $r13
- PUSH $r14
- PUSH $r15
+ PUSH $r13
+ PUSH $r14
+ PUSH $r15
Note that PROLOGS[0] through PROLOGS[12] are unused. */
CORE_ADDR prologs[32];
return (bfd_vma) 0;
gdbarch = sbrk_objf->arch ();
- target_sbrk_arg = value_from_longest (builtin_type (gdbarch)->builtin_int,
+ target_sbrk_arg = value_from_longest (builtin_type (gdbarch)->builtin_int,
sbrk_arg);
gdb_assert (target_sbrk_arg);
ret = call_function_by_hand (sbrk_fn, NULL, target_sbrk_arg);
If we match, update the current demangling style enum. */
for (dem = libiberty_demanglers, i = 0;
- dem->demangling_style != unknown_demangling;
+ dem->demangling_style != unknown_demangling;
dem++)
{
if (strcmp (current_demangling_style_string,
/* Fill the demangling_style_names[] array, and set the default
demangling style chosen at compilation time. */
for (ndems = 0;
- libiberty_demanglers[ndems].demangling_style != unknown_demangling;
+ libiberty_demanglers[ndems].demangling_style != unknown_demangling;
ndems++)
;
demangling_style_names = XCNEWVEC (const char *, ndems + 1);
for (i = 0;
- libiberty_demanglers[i].demangling_style != unknown_demangling;
+ libiberty_demanglers[i].demangling_style != unknown_demangling;
i++)
{
demangling_style_names[i]
-/* Main function for CLI gdb.
+/* Main function for CLI gdb.
Copyright (C) 2002-2025 Free Software Foundation, Inc.
This file is part of GDB.
# Did the previous configure attempt fail? If it did restart from scratch
if test -d ${dir} -a ! -r ${dir}/Makefile
then
- echo ... removing partially configured
+ echo ... removing partially configured
rm -rf ${dir}
if test -d ${dir}
then
if test "${targexp}" != ""
then
alltarg=`cat gdb_archs | grep ${targexp}`
-else
+else
alltarg=`cat gdb_archs`
fi
rm -f gdb_archs
else
echo " OK"
fi
-
+
# Create a sed script that cleans up the output from GDB.
rm -f mbuild.sed
# Rules to replace <0xNNNN> with the corresponding function's name.
trap "exit 1" 1 2 15
fi
fail "configure failed" ! -r Makefile
-
+
# Build, if not built.
if test ! -x gdb/gdb -a ! -x gdb/gdb.exe
) 2>&1 | log 1 Build.log
fi
fail "compile failed" ! -x gdb/gdb -a ! -x gdb/gdb.exe
-
+
# Check that the built GDB can at least print it's architecture.
echo ... run ${target}
#define GDB_GDB_WCHAR_H
/* We handle three different modes here.
-
+
Capable systems have the full suite: wchar_t support and iconv
(perhaps via GNU libiconv). On these machines, full functionality
is available. Note that full functionality is dependent on us
practice this means we look for __STDC_ISO_10646__ (where we know
the name of the wchar_t encoding) or GNU libiconv, where we can use
"wchar_t".
-
+
DJGPP is known to have libiconv but not wchar_t support. On
systems like this, we use the narrow character functions. The full
functionality is available to the user, but many characters (those
outside the narrow range) will be displayed as escapes.
-
+
Finally, some systems do not have iconv, or are really broken
(e.g., Solaris, which almost has all of this working, but where
just enough is broken to make it too hard to use). Here we provide
/* Multi-process/thread control defs for GDB, the GNU debugger.
Copyright (C) 1987-2025 Free Software Foundation, Inc.
Contributed by Lynx Real-Time Systems, Inc. Los Gatos, CA.
-
+
This file is part of GDB.
void set_running (bool running);
ptid_t ptid; /* "Actual process id";
- In fact, this may be overloaded with
+ In fact, this may be overloaded with
kernel thread id, etc. */
/* Each thread has two GDB IDs.
/* Add a thread to the thread list, print a message
that a new thread is found, and return the pointer to
- the new thread. Caller my use this pointer to
+ the new thread. Caller my use this pointer to
initialize the private thread data. */
extern struct thread_info *add_thread (process_stratum_target *targ,
ptid_t ptid);
static void
show_opaque_type_resolution (struct ui_file *file, int from_tty,
- struct cmd_list_element *c,
+ struct cmd_list_element *c,
const char *value)
{
gdb_printf (file, _("Resolution of opaque struct/class/union types "
show_overload_debug (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
{
- gdb_printf (file, _("Debugging of C++ overloading is %s.\n"),
+ gdb_printf (file, _("Debugging of C++ overloading is %s.\n"),
value);
}
if (ntype)
{
if (typeptr == 0)
- return ntype; /* Don't care about alloc,
+ return ntype; /* Don't care about alloc,
and have new type. */
else if (*typeptr == 0)
{
if (ntype)
{
if (typeptr == 0)
- return ntype; /* Don't care about alloc,
+ return ntype; /* Don't care about alloc,
and have new type. */
else if (*typeptr == 0)
{
new type we construct. */
struct type *
-make_cv_type (int cnst, int voltl,
- struct type *type,
+make_cv_type (int cnst, int voltl,
+ struct type *type,
struct type **typeptr)
{
struct type *ntype; /* New type */
name each time you encounter them. */
gdb_assert ((*typeptr)->objfile_owner () == type->objfile_owner ());
}
-
- ntype = make_qualified_type (type, new_flags,
+
+ ntype = make_qualified_type (type, new_flags,
typeptr ? *typeptr : NULL);
if (typeptr != NULL)
return t;
/* If we get here, it's not a union. */
- error (_("This context has class, struct or enum %s, not a union."),
+ error (_("This context has class, struct or enum %s, not a union."),
name);
}
}
if (sym->type ()->code () != TYPE_CODE_ENUM)
{
- error (_("This context has class, struct or union %s, not an enum."),
+ error (_("This context has class, struct or union %s, not an enum."),
name);
}
return (sym->type ());
visible in lexical block BLOCK. */
struct type *
-lookup_template_type (const char *name, struct type *type,
+lookup_template_type (const char *name, struct type *type,
const struct block *block)
{
std::string nam;
for (const auto &variant : part.variants)
compute_variant_fields_recurse (type, addr_stack, variant,
flags, applied_variant == &variant);
-}
+}
/* Determine which variant fields are available in TYPE. The enabled
fields are stored in RESOLVED_TYPE. ADDR_STACK holds information
types, instead of identifying them as stub types in the first
place. */
- if (TYPE_IS_OPAQUE (type)
- && opaque_type_resolution
+ if (TYPE_IS_OPAQUE (type)
+ && opaque_type_resolution
&& !currently_reading_symtab)
{
const char *name = type->name ();
p = NULL;
if (demangled_name == NULL || p == NULL)
- error (_("Internal: Cannot demangle mangled name `%s'."),
+ error (_("Internal: Cannot demangle mangled name `%s'."),
mangled_name);
/* Now, read in the parameters that define this type. */
if (a->num_fields () != b->num_fields ())
return false;
-
+
if (!types_equal (a->target_type (), b->target_type ()))
return false;
struct type **first_dont_print
= (struct type **) obstack_base (&dont_print_type_obstack);
- int i = (struct type **)
+ int i = (struct type **)
obstack_next_free (&dont_print_type_obstack) - first_dont_print;
while (--i >= 0)
host_address_to_string (TYPE_REFERENCE_TYPE (type)));
gdb_printf ("%*stype_chain %s\n", spaces, "",
host_address_to_string (TYPE_CHAIN (type)));
- gdb_printf ("%*sinstance_flags 0x%x", spaces, "",
+ gdb_printf ("%*sinstance_flags 0x%x", spaces, "",
(unsigned) type->instance_flags ());
if (TYPE_CONST (type))
{
because we can allocate the space for a type before
we know what to put in it. */
- union
+ union
{
struct field *fields;
struct type
{
- /* Get the type code of this type.
+ /* Get the type code of this type.
Note that the code can be TYPE_CODE_TYPEDEF, so if you want the real
type, you need to do `check_typedef (type)->code ()`. */
const char *physname;
/* * The function type for the method.
-
+
(This comment used to say "The return value of the method", but
that's wrong. The function type is expected here, i.e. something
with TYPE_CODE_METHOD, and *not* the return-value type). */
/* * Return the type table for the specified objfile. */
extern const struct builtin_type *builtin_type (struct objfile *objfile);
-
+
/* Explicit floating-point formats. See "floatformat.h". */
extern const struct floatformat *floatformats_ieee_half[BFD_ENDIAN_UNKNOWN];
extern const struct floatformat *floatformats_ieee_single[BFD_ENDIAN_UNKNOWN];
/* See the comments for SKIP_SOLIB_RESOLVER at the top of infrun.c.
This function:
1) decides whether a PLT has sent us into the linker to resolve
- a function reference, and
+ a function reference, and
2) if so, tells us where to set a temporary breakpoint that will
trigger when the dynamic linker is done. */
the same objfile. If we are at the entry point of `fixup', then
we set a breakpoint at the return address (at the top of the
stack), and continue.
-
+
It's kind of gross to do all these checks every time we're
called, since they don't change once the executable has gotten
started. But this is only a temporary hack --- upcoming versions
}
return 0;
-}
+}
mpz_swap (m_val, from.m_val);
}
-
+
gdb_mpz &operator= (const gdb_mpz &from)
{
mpz_set (m_val, from.m_val);
return proc;
}
-/* Frees PROC and any resources it uses, and returns the value of PROC's
+/* Frees PROC and any resources it uses, and returns the value of PROC's
next field. */
struct proc *
gnu_nat_target::_proc_free (struct proc *proc)
{
if (on == inf->traced)
return;
-
+
if (inf->task && !inf->task->dead)
/* Make it take effect immediately. */
{
add_cmd ("pause", no_class, show_thread_default_pause_cmd, _("\
Show whether new threads are suspended while gdb has control."),
&show_thread_default_cmd_list);
-
+
add_cmd ("run", class_run, set_thread_default_run_cmd, _("\
Set whether new threads are allowed to run (once gdb has noticed them)."),
&set_thread_default_cmd_list);
add_cmd ("run", no_class, show_thread_default_run_cmd, _("\
Show whether new threads are allowed to run (once gdb has noticed them)."),
&show_thread_default_cmd_list);
-
+
add_cmd ("detach-suspend-count", class_run, set_thread_default_detach_sc_cmd,
_("Set the default detach-suspend-count value for new threads."),
&set_thread_default_cmd_list);
+ vtable->embedded_offset ()).minsym;
if (! vtable_symbol)
return NULL;
-
+
/* The symbol's demangled name should be something like "vtable for
CLASS", where CLASS is the name of the run-time type of VALUE.
If we didn't like this approach, we could instead look in the
/* Determine if we are currently in a C++ thunk. If so, get the address
of the routine we are thunking to and continue to there instead. */
-static CORE_ADDR
+static CORE_ADDR
gnuv3_skip_trampoline (const frame_info_ptr &frame, CORE_ADDR stop_pc)
{
CORE_ADDR real_stop_pc, method_stop_pc, func_addr;
struct gdbarch *gdbarch = get_frame_arch (frame);
struct obj_section *section;
const char *thunk_name, *fn_name;
-
+
real_stop_pc = gdbarch_skip_trampoline_code (gdbarch, frame, stop_pc);
if (real_stop_pc == 0)
real_stop_pc = stop_pc;
const gdb_fpregset_t *fpregs);
/* Copy register values from GDB's register cache into
- the native target gregset/fpregset. If regno is -1,
+ the native target gregset/fpregset. If regno is -1,
copy all the registers. */
extern void fill_gregset (const struct regcache *regcache,
{
struct compunit_symtab *cust;
- gdbscm_printf (port, " %s",
+ gdbscm_printf (port, " %s",
i_smob->iter.which == GLOBAL_BLOCK
? "global" : "static");
if (i_smob->iter.idx != -1)
obj_arg_pos, func_name,
&except_scm, gdbarch);
}
- else if (gdbscm_is_bool (obj))
+ else if (gdbscm_is_bool (obj))
{
if (type != NULL
&& !is_integral_type (type))
/* A procedure called to look up the printer for the given value.
The procedure is called as (lookup gdb:pretty-printer value).
The result should either be a gdb:pretty-printer object that will print
- the value, or #f if the value is not recognized. */
+ the value, or #f if the value is not recognized. */
SCM lookup;
/* Note: Attaching subprinters to this smob is left to Scheme. */
/* Return the display hint for PRINTER as a Scheme object.
The caller is responsible for ensuring PRINTER is a
<gdb:pretty-printer-worker> object. */
-
+
static SCM
ppscm_get_display_hint_scm (SCM printer)
{
if (hint == HINT_STRING)
{
struct type *type = builtin_type (gdbarch)->builtin_char;
-
+
language->printstr (stream, type, (gdb_byte *) string.get (),
length, NULL, 0, options);
}
if (frame_info == NULL)
error (_("Invalid frame"));
}
-
+
if (symbol_read_needs_frame (symbol) && frame_info == NULL)
error (_("Symbol requires a frame to compute its value"));
st_smob = (symtab_smob *) SCM_SMOB_DATA (st_scm);
st_smob->symtab = symtab;
gdbscm_fill_eqable_gsmob_ptr_slot (slot, &st_smob->base);
-
+
return st_scm;
}
from the register in which it was passed to the stack slot in which
it really lives. It is a byte, word, or longword move from an
argument register to a negative offset from the frame pointer.
-
+
CV, 2003-06-16: Or, in optimized code or when the `register' qualifier
is used, it could be a byte, word or long move to registers r3-r5. */
So, for example, on the h8/300s, if a function expects a three-byte
structure and an int, the structure will go on the stack, and the
int will go in r2, not r0.
-
+
If the function returns an aggregate type (struct, union, or class)
by value, the caller must allocate space to hold the return value,
and pass the callee a pointer to this space as an invisible first
/* Frame unwinder. */
frame_base_set_default (gdbarch, &h8300_frame_base);
- /*
+ /*
* Miscellany
*/
/* Stack grows up. */
errno = 0;
val = ptrace (PTRACE_PEEKUSER, tid, hppa_linux_register_addr (regno, 0), 0);
if (errno != 0)
- error (_("Couldn't read register %s (#%d): %s."),
+ error (_("Couldn't read register %s (#%d): %s."),
gdbarch_register_name (gdbarch, regno),
regno, safe_strerror (errno));
regno++)
fetch_register (regcache, regno);
}
- else
+ else
{
fetch_register (regcache, regno);
}
/* Signal frames. */
/* (This is derived from MD_FALLBACK_FRAME_STATE_FOR in gcc.)
-
+
Unfortunately, because of various bugs and changes to the kernel,
we have several cases to deal with.
- In 2.4, the signal trampoline is 4 bytes, and pc should point directly at
+ In 2.4, the signal trampoline is 4 bytes, and pc should point directly at
the beginning of the trampoline and struct rt_sigframe.
In <= 2.6.5-rc2-pa3, the signal trampoline is 9 bytes, and pc points at
- the 4th word in the trampoline structure. This is wrong, it should point
+ the 4th word in the trampoline structure. This is wrong, it should point
at the 5th word. This is fixed in 2.6.5-rc2-pa4.
To detect these cases, we first take pc, align it to 64-bytes
/* rt_sigreturn trampoline:
3419000x ldi 0, %r25 or ldi 1, %r25 (x = 0 or 2)
- 3414015a ldi __NR_rt_sigreturn, %r20
+ 3414015a ldi __NR_rt_sigreturn, %r20
e4008200 be,l 0x100(%sr2, %r0), %sr0, %r31
08000240 nop */
{
if (insns_match_pattern (gdbarch, pc, hppa_sigtramp, dummy))
{
- /* sigaltstack case: we have no way of knowing which offset to
+ /* sigaltstack case: we have no way of knowing which offset to
use in this case; default to new kernel handling. If this is
wrong the unwinding will fail. */
attempt = 2;
/* 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
+ 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. */
scptr = hppa_linux_sigtramp_find_sigcontext (gdbarch, pc);
/* structure of struct sigcontext:
-
+
struct sigcontext {
unsigned long sc_flags;
- unsigned long sc_gr[32];
+ unsigned long sc_gr[32];
unsigned long long sc_fr[32];
unsigned long sc_iasq[2];
unsigned long sc_iaoq[2];
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
struct obj_section *faddr_sect;
CORE_ADDR faddr;
-
+
faddr = value_as_address (function);
/* Is this a plabel? If so, dereference it to get the gp value. */
return extract_unsigned_integer (buf, sizeof (buf), byte_order);
}
- /* If the address is in the plt section, then the real function hasn't
- yet been fixed up by the linker so we cannot determine the gp of
+ /* If the address is in the plt section, then the real function hasn't
+ yet been fixed up by the linker so we cannot determine the gp of
that function. */
if (in_plt_section (faddr))
return 0;
/* r0 ... r31 */
-1, 1 * 4, 2 * 4, 3 * 4,
4 * 4, 5 * 4, 6 * 4, 7 * 4,
- 8 * 4, 9 * 4, 10 * 4, 11 * 4,
+ 8 * 4, 9 * 4, 10 * 4, 11 * 4,
12 * 4, 13 * 4, 14 * 4, 15 * 4,
16 * 4, 17 * 4, 18 * 4, 19 * 4,
20 * 4, 21 * 4, 22 * 4, 23 * 4,
/* r0 ... r31 */
-1, 1 * 4, 2 * 4, 3 * 4,
4 * 4, 5 * 4, 6 * 4, 7 * 4,
- 8 * 4, 9 * 4, 10 * 4, 11 * 4,
+ 8 * 4, 9 * 4, 10 * 4, 11 * 4,
12 * 4, 13 * 4, 14 * 4, 15 * 4,
16 * 4, 17 * 4, 18 * 4, 19 * 4,
20 * 4, 21 * 4, 22 * 4, 23 * 4,
regcache->raw_supply (HPPA_SR7_REGNUM, regs + 44 * 4);
regcache->raw_supply (HPPA_CR26_REGNUM, regs + 45 * 4);
regcache->raw_supply (HPPA_CR27_REGNUM, regs + 46 * 4);
- }
+ }
else
{
regcache->raw_supply (HPPA_SAR_REGNUM, regs);
};
/* hppa-specific object data -- unwind and solib info.
- TODO/maybe: think about splitting this into two parts; the unwind data is
- common to all hppa targets, but is only used in this file; we can register
+ TODO/maybe: think about splitting this into two parts; the unwind data is
+ common to all hppa targets, but is only used in this file; we can register
that separately and make this static. The solib data is probably hpux-
specific, so we can create a separate extern objfile_data that is registered
by hppa-hpux-tdep.c and shared with pa64solib.c and somsolib.c. */
#define UNWIND_ENTRY_SIZE 16
#define STUB_UNWIND_ENTRY_SIZE 8
-/* Routines to extract various sized constants out of hppa
+/* Routines to extract various sized constants out of hppa
instructions. */
-/* This assumes that no garbage lies outside of the lower bits of
+/* This assumes that no garbage lies outside of the lower bits of
value. */
static int
(word & 0x1) << 16, 17) << 2;
}
-CORE_ADDR
+CORE_ADDR
hppa_symbol_address(const char *sym)
{
bound_minimal_symbol minsym
\f
-/* Compare the start address for two unwind entries returning 1 if
+/* Compare the start address for two unwind entries returning 1 if
the first address is larger than the second, -1 if the second is
larger than the first, and zero if they are equal. */
low_text_segment_address = -1;
bfd_map_over_sections (objfile->obfd.get (),
- record_text_segment_lowaddr,
+ record_text_segment_lowaddr,
&low_text_segment_address);
text_offset = low_text_segment_address;
/* Implement the stack_frame_destroyed_p gdbarch method.
- The epilogue is defined here as the area either on the `bv' instruction
+ The epilogue is defined here as the area either on the `bv' instruction
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. */
inst = extract_unsigned_integer (buf, 4, byte_order);
- /* The most common way to perform a stack adjustment ldo X(sp),sp
+ /* The most common way to perform a stack adjustment ldo X(sp),sp
We are destroying a stack frame if the offset is negative. */
if ((inst & 0xffffc000) == 0x37de0000
&& hppa_extract_14 (inst) < 0)
return 1;
/* ldw,mb D(sp),X or ldd,mb D(sp),X */
- if (((inst & 0x0fc010e0) == 0x0fc010e0
+ if (((inst & 0x0fc010e0) == 0x0fc010e0
|| (inst & 0x0fc010e0) == 0x0fc010e0)
&& hppa_extract_14 (inst) < 0)
return 1;
We simply allocate the appropriate amount of stack space and put
arguments into their proper slots. */
-
+
static CORE_ADDR
hppa32_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
struct regcache *regcache, CORE_ADDR bp_addr,
write_memory (param_end - param_ptr, param_val, param_len);
/* There are some cases when we don't know the type
- expected by the callee (e.g. for variadic functions), so
+ expected by the callee (e.g. for variadic functions), so
pass the parameters in both general and fp regs. */
if (param_ptr <= 48)
{
/* Bump the PC. */
pc += 4;
- /* !stop_before_branch, so also look at the insn in the delay slot
+ /* !stop_before_branch, so also look at the insn in the delay slot
of the branch. */
if (final_iteration)
break;
/* 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.
-
+
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
we might not want to skip all the insns because a prologue insn may
/* Frame pointer gets saved into a special location. */
if (u->Save_SP && i == HPPA_FP_REGNUM)
continue;
-
+
saved_gr_mask |= (1 << i);
}
int looking_for_rp = u->Save_RP;
int fp_loc = -1;
- /* We have to use skip_prologue_hard_way instead of just
+ /* We have to use skip_prologue_hard_way instead of just
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.
-
+
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,
and the program is compiled with debug information, the "easy" way
/* Note the interesting effects of this instruction. */
frame_size += prologue_inst_adjust_sp (inst);
-
+
/* There are limited ways to store the return pointer into the
stack. */
if (inst == 0x6bc23fd9) /* stw rp,-0x14(sr0,sp) */
looking_for_rp = 0;
cache->saved_regs[HPPA_RP_REGNUM].set_addr (-24);
}
- else if (inst == 0x0fc212c1
+ else if (inst == 0x0fc212c1
|| inst == 0x73c23fe1) /* std rp,-0x10(sr0,sp) */
{
looking_for_rp = 0;
cache->saved_regs[HPPA_RP_REGNUM].set_addr (-16);
}
-
+
/* Check to see if we saved SP into the stack. This also
happens to indicate the location of the saved frame
pointer. */
{
fp_in_r1 = 1;
}
-
+
/* Account for general and floating-point register saves. */
reg = inst_saves_gr (inst);
if (reg >= 3 && reg <= 18
else
{
CORE_ADDR offset;
-
+
if ((inst >> 26) == 0x1c)
offset = (inst & 0x1 ? -(1 << 13) : 0)
| (((inst >> 4) & 0x3ff) << 3);
offset = hppa_low_hppa_sign_extend (inst & 0x1f, 5);
else
offset = hppa_extract_14 (inst);
-
+
/* Handle code with and without frame pointers. */
if (u->Save_SP)
cache->saved_regs[reg].set_addr (offset);
}
}
- /* GCC handles callee saved FP regs a little differently.
-
+ /* GCC handles callee saved FP regs a little differently.
+
It emits an instruction to put the value of the start of
the FP store area into %r1. It then uses fstds,ma with a
basereg of %r1 for the stores.
HP CC emits them at the current stack pointer modifying the
stack pointer as it stores each register. */
-
+
/* ldo X(%r3),%r1 or ldo X(%r30),%r1. */
if ((inst & 0xffffc000) == 0x34610000
|| (inst & 0xffffc000) == 0x37c10000)
fp_loc = hppa_extract_14 (inst);
-
+
reg = inst_saves_fr (inst);
if (reg >= 12 && reg <= 21)
{
fp_loc += 8;
}
}
-
+
/* Quit if we hit any kind of branch the previous iteration. */
if (final_iteration)
break;
/* Check to see if a frame pointer is available, and use it for
frame unwinding if it is.
-
+
There are some situations where we need to rely on the frame
pointer to do stack unwinding. For example, if a function calls
alloca (), the stack pointer can get adjusted inside the body of
the function. In this case, the ABI requires that the compiler
maintain a frame pointer for the function.
-
+
The unwind record has a flag (alloca_frame) that indicates that
- a function has a variable frame; unfortunately, gcc/binutils
+ a function has a variable frame; unfortunately, gcc/binutils
does not set this flag. Instead, whenever a frame pointer is used
and saved on the stack, the Save_SP flag is set. We use this to
decide whether to use the frame pointer for unwinding.
-
- TODO: For the HP compiler, maybe we should use the alloca_frame flag
+
+ TODO: For the HP compiler, maybe we should use the alloca_frame flag
instead of Save_SP. */
-
+
fp = get_frame_register_unsigned (this_frame, HPPA_FP_REGNUM);
if (u->alloca_frame)
fp -= u->Total_frame_size << 3;
-
+
if (get_frame_pc (this_frame) >= prologue_end
&& (u->Save_SP || u->alloca_frame) && fp != 0)
{
cache->base = fp;
-
+
if (hppa_debug)
gdb_printf (gdb_stdlog, " (base=%s) [frame pointer]",
paddress (gdbarch, cache->base));
}
- else if (u->Save_SP
+ else if (u->Save_SP
&& cache->saved_regs[HPPA_SP_REGNUM].is_addr ())
{
/* Both we're expecting the SP to be saved and the SP has been
{
if (cache->saved_regs[HPPA_RP_REGNUM].is_addr ())
{
- cache->saved_regs[HPPA_PCOQ_HEAD_REGNUM] =
+ cache->saved_regs[HPPA_PCOQ_HEAD_REGNUM] =
cache->saved_regs[HPPA_RP_REGNUM];
if (hppa_debug)
gdb_printf (gdb_stdlog, " (pc=rp) [stack] } ");
So if we are at offset c, the r3 value that we want is not yet saved
on the stack, but it's been overwritten. The prologue analyzer will
- set fp_in_r1 when it sees the copy insn so we know to get the value
+ set fp_in_r1 when it sees the copy insn so we know to get the value
from r1 instead. */
if (u->Save_SP && !cache->saved_regs[HPPA_FP_REGNUM].is_addr ()
&& fp_in_r1)
{
cache->saved_regs[HPPA_RP_REGNUM].set_addr (cache->saved_regs[HPPA_RP_REGNUM].addr ()
+ cache->base);
- cache->saved_regs[HPPA_PCOQ_HEAD_REGNUM] =
+ cache->saved_regs[HPPA_PCOQ_HEAD_REGNUM] =
cache->saved_regs[HPPA_RP_REGNUM];
}
else
hppa_fallback_frame_this_id (const frame_info_ptr &this_frame, void **this_cache,
struct frame_id *this_id)
{
- struct hppa_frame_cache *info =
+ struct hppa_frame_cache *info =
hppa_fallback_frame_cache (this_frame, this_cache);
(*this_id) = frame_id_build (info->base, get_frame_func (this_frame));
/* ldil LR'xxx,%r1 */
{ 0x20200000, 0xffe00000 },
/* be,n RR'xxx(%sr4,%r1) */
- { 0xe0202002, 0xffe02002 },
+ { 0xe0202002, 0xffe02002 },
{ 0, 0 }
};
/* addil LR'xxx - ($PIC_pcrel$0 - 4), %r1 */
{ 0x28200000, 0xffe00000 },
/* be,n RR'xxxx - ($PIC_pcrel$0 - 8)(%sr4, %r1) */
- { 0xe0202002, 0xffe02002 },
+ { 0xe0202002, 0xffe02002 },
{ 0, 0 }
};
default:
internal_error (_("bad switch"));
}
-
+
/* Struct return methods. */
switch (tdep->bytes_per_address)
{
default:
internal_error (_("bad switch"));
}
-
+
set_gdbarch_breakpoint_kind_from_pc (gdbarch, hppa_breakpoint::kind_from_pc);
set_gdbarch_sw_breakpoint_from_kind (gdbarch, hppa_breakpoint::bp_from_kind);
set_gdbarch_pseudo_register_read (gdbarch, hppa_pseudo_register_read);
{
hppa_gdbarch_tdep *tdep = gdbarch_tdep<hppa_gdbarch_tdep> (gdbarch);
- gdb_printf (file, "bytes_per_address = %d\n",
+ gdb_printf (file, "bytes_per_address = %d\n",
tdep->bytes_per_address);
gdb_printf (file, "elf = %s\n", tdep->is_elf ? "yes" : "no");
}
system. */
int is_elf = 0;
- /* Given a function address, try to find the global pointer for the
+ /* Given a function address, try to find the global pointer for the
corresponding shared object. */
CORE_ADDR (*find_global_pointer) (struct gdbarch *, struct value *) = nullptr;
};
/* HP linkers also generate unwinds for various linker-generated stubs.
- GDB reads in the stubs from the $UNWIND_END$ subspace, then
+ GDB reads in the stubs from the $UNWIND_END$ subspace, then
"converts" them into normal unwind entries using some of the reserved
fields to store the stub type. */
{
warning (_("\
offsetof (struct sigcontext, sc_pc) yields %d instead of %d.\n\
-Please report this to <bug-gdb@gnu.org>."),
+Please report this to <bug-gdb@gnu.org>."),
offset, SC_PC_OFFSET);
}
15 * 4 /* GS */
};
-const int i386_darwin_thread_state_num_regs =
+const int i386_darwin_thread_state_num_regs =
ARRAY_SIZE (i386_darwin_thread_state_reg_offset);
/* Assuming THIS_FRAME is a Darwin sigtramp routine, return the
arg_type->length ());
/* The System V ABI says that:
-
+
"An argument's size is increased, if necessary, to make it a
multiple of [32-bit] words. This may require tail padding,
depending on the size of the argument."
-
+
This makes sure the stack stays word-aligned. */
args_space += align_up (arg_type->length (), 4);
}
{
if (!bfd_check_format (abfd, bfd_object))
return GDB_OSABI_UNKNOWN;
-
+
if (bfd_get_arch (abfd) == bfd_arch_i386)
return GDB_OSABI_DARWIN;
val = ptrace (PTRACE_PEEKUSER, tid,
i386_linux_gregset_reg_offset[regno], 0);
if (errno != 0)
- error (_("Couldn't read register %s (#%d): %s."),
+ error (_("Couldn't read register %s (#%d): %s."),
gdbarch_register_name (regcache->arch (), regno),
regno, safe_strerror (errno));
perror_with_name (_("Couldn't get registers"));
fill_gregset (regcache, ®s, regno);
-
+
if (ptrace (PTRACE_SETREGS, tid, 0, (int) ®s) < 0)
perror_with_name (_("Couldn't write registers"));
}
/* Fill GDB's register array with the floating-point register values in
*FPREGSETP. */
-void
+void
supply_fpregset (struct regcache *regcache, const elf_fpregset_t *fpregsetp)
{
i387_supply_fsave (regcache, -1, fpregsetp);
if (have_ptrace_getfpxregs == TRIBOOL_FALSE)
return 0;
-
+
if (ptrace (PTRACE_GETFPXREGS, tid, 0, &fpxregs) == -1)
{
if (errno == EIO)
{
gdb_printf (gdb_stderr,
_("Process record and replay target doesn't "
- "support syscall number %s\n"),
+ "support syscall number %s\n"),
plongest (syscall_native));
return -1;
}
/* Linux kernel shows PC value after the 'int $0x80' instruction even if
inferior is still inside the syscall. On next PTRACE_SINGLESTEP it will
finish the syscall but PC will not change.
-
+
Some vDSOs contain 'int $0x80; ret' and during stepping out of the syscall
i386_displaced_step_fixup would keep PC at the displaced pad location.
As PC is pointing to the 'ret' instruction before the step
and PC should not be adjusted. In reality it finished syscall instead and
PC should get relocated back to its vDSO address. Hide the 'ret'
instruction by 'nop' so that i386_displaced_step_fixup is not confused.
-
+
It is not fully correct as the bytes in struct
displaced_step_copy_insn_closure will not match the inferior code. But we
would need some new flag in displaced_step_copy_insn_closure otherwise to
}
\f
-static void
+static void
i386nbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
{
struct trad_frame_cache *cache =
i386obsd_trapframe_cache (this_frame, this_cache);
-
+
trad_frame_get_id (cache, this_id);
}
);
\f
-static void
+static void
i386obsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
{
/* Denormal or zero. */
print_i387_value (gdbarch, raw, file);
-
+
if (integer)
/* Pseudo-denormal. */
gdb_puts (" Pseudo-denormal", file);
gdb_puts ("Extended Precision (64-bits)\n", file);
break;
}
-
+
gdb_puts (" RC: ", file);
switch ((control >> 10) & 3)
{
if (val[0] & (1 << fpreg))
{
- int thisreg = (fpreg + 8 - top) % 8
+ int thisreg = (fpreg + 8 - top) % 8
+ I387_ST0_REGNUM (tdep);
tag = i387_tag (FXSAVE_ADDR (tdep, regs, thisreg));
}
if (val[0] & (1 << fpreg))
{
- int thisreg = (fpreg + 8 - top) % 8
+ int thisreg = (fpreg + 8 - top) % 8
+ I387_ST0_REGNUM (tdep);
tag = i387_tag (FXSAVE_ADDR (tdep, regs, thisreg));
}
cache->func_addr = get_frame_pc (this_frame);
/* Get a libunwind cursor to the previous frame.
-
+
We do this by initializing a cursor. Libunwind treats a new cursor
as the top of stack and will get the current register set via the
libunwind register accessor. Now, we provide the platform-specific
return 0;
}
-
- /* Check to see if we have libunwind info by checking if we are in a
+
+ /* Check to see if we have libunwind info by checking if we are in a
signal frame. If it doesn't return an error, we have libunwind info
and can use libunwind. */
ret = unw_is_signal_frame_p (&cursor);
if (cache == NULL)
return frame_unwind_got_constant (this_frame, regnum, 0);
-
+
/* Convert from gdb register number to libunwind register number. */
descr = libunwind_descr (get_frame_arch (this_frame));
uw_regnum = descr->gdb2uw (regnum);
}
return val;
-}
+}
/* The following is a glue routine to call the libunwind unwind table
- search function to get unwind information for a specified ip address. */
+ search function to get unwind information for a specified ip address. */
int
libunwind_search_unwind_table (void *as, long ip, void *di,
void *pi, int need_unwind_info, void *args)
return 0;
}
-
+
static int
libunwind_load (void)
{
= (unw_find_dyn_list_p_ftype *) dlsym (handle, find_dyn_list_name);
if (unw_find_dyn_list_p == NULL)
return 0;
-
+
return 1;
}
int libunwind_frame_sniffer (const struct frame_unwind *self,
const frame_info_ptr &this_frame,
void **this_cache);
-
+
int libunwind_sigtramp_frame_sniffer (const struct frame_unwind *self,
const frame_info_ptr &this_frame,
void **this_cache);
ia64_cannot_store_register (struct gdbarch *gdbarch, int regno)
{
/* Rationale behind not permitting stores to bspstore...
-
+
The IA-64 architecture provides bspstore and bsp which refer
memory locations in the RSE's backing store. bspstore is the
next location which will be written when the RSE needs to write
/* Note: KERNEL_START is supposed to be an address which is not going
to ever contain any valid unwind info. For ia64 linux, the choice
of 0xc000000000000000 is fairly safe since that's uncached space.
-
+
We use KERNEL_START as follows: after obtaining the kernel's
unwind table via getunwind(), we project its unwind data into
address-range KERNEL_START-(KERNEL_START+ktab_size) and then
multiplies its slot numbers (for exceptions) by one while the
disassembler multiplies its slot numbers by 6. In addition, I've
heard it said that the simulator uses 1 as the multiplier.
-
+
I've fixed the disassembler so that the bytes_per_line field will
be the slot multiplier. If bytes_per_line comes in as zero, it
is set to six (which is how it was set up initially). -- objdump
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,
+ 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 };
"nat120","nat121","nat122","nat123","nat124","nat125","nat126","nat127",
"bof",
-
- "r32", "r33", "r34", "r35", "r36", "r37", "r38", "r39",
+
+ "r32", "r33", "r34", "r35", "r36", "r37", "r38", "r39",
"r40", "r41", "r42", "r43", "r44", "r45", "r46", "r47",
"r48", "r49", "r50", "r51", "r52", "r53", "r54", "r55",
"r56", "r57", "r58", "r59", "r60", "r61", "r62", "r63",
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. */
-
+
/* Saved registers. */
CORE_ADDR saved_regs[NUM_IA64_RAW_REGS];
if (group == general_reggroup)
return (!vector_p && !float_p);
if (group == save_reggroup || group == restore_reggroup)
- return raw_p;
+ return raw_p;
return 0;
}
break.m, break.f, and break.x), but they all have the same
encoding. (The five bit template in the low five bits of the
instruction bundle distinguishes one from another.)
-
+
The runtime architecture manual specifies that break instructions
used for debugging purposes must have the upper two bits of the 21
bit immediate set to a 0 and a 1 respectively. A breakpoint
instruction encodes the most significant bit of its 21 bit
immediate at bit 36 of the 41 bit instruction. The penultimate msb
- is at bit 25 which leads to the pattern below.
-
+ is at bit 25 which leads to the pattern below.
+
Originally, I had this set up to do, e.g, a "break.i 0x80000" But
it turns out that 0x80000 was used as the syscall break in the early
simulators. So I changed the pattern slightly to do "break.i 0x080001"
does save byte 15 of our instruction bundle (this is the tail
end of slot 2, which wouldn't be saved if we were to insert
the breakpoint in slot 1).
-
+
ia64 16-byte bundle layout:
| 5 bits | slot 0 with 41 bits | slot 1 with 41 bits | slot 2 with 41 bits |
-
+
The current addressing used by the code below:
original PC placed_address placed_size required covered
== bp_tgt->shadow_len reqd \subset covered
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)
+
+ if ((cfm & 0x7f) > regnum - V32_REGNUM)
{
ULONGEST reg_addr = rse_address_add (bsp, (regnum - V32_REGNUM));
reg = read_memory_integer ((CORE_ADDR)reg_addr, 8, byte_order);
/* 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. */
bsp = rse_address_add (bsp, -(cfm & 0x7f));
-
- if ((cfm & 0x7f) > regnum - V32_REGNUM)
+
+ if ((cfm & 0x7f) > regnum - V32_REGNUM)
gr_addr = rse_address_add (bsp, (regnum - V32_REGNUM));
-
+
if (gr_addr != 0)
{
/* Compute address of nat collection bits. */
nat_bit = (gr_addr >> 3) & 0x3f;
natN_val = (nat_collection >> nat_bit) & 1;
}
-
+
store_unsigned_integer (buf, register_size (gdbarch, regnum),
byte_order, natN_val);
}
int rrb_pr = (cfm >> 32) & 0x3f;
/* Adjust the register number to account for register rotation. */
- regnum = VP16_REGNUM
+ regnum = VP16_REGNUM
+ ((regnum - VP16_REGNUM) + rrb_pr) % 48;
}
prN_val = (pr & (1LL << (regnum - VP0_REGNUM))) != 0;
regcache_cooked_read_unsigned (regcache, IA64_CFM_REGNUM, &cfm);
bsp = rse_address_add (bsp, -(cfm & 0x7f));
-
- if ((cfm & 0x7f) > regnum - V32_REGNUM)
+
+ if ((cfm & 0x7f) > regnum - V32_REGNUM)
{
ULONGEST reg_addr = rse_address_add (bsp, (regnum - V32_REGNUM));
write_memory (reg_addr, buf, 8);
/* 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. */
bsp = rse_address_add (bsp, -(cfm & 0x7f));
-
- if ((cfm & 0x7f) > regnum - V32_REGNUM)
+
+ 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),
byte_order);
int rrb_pr = (cfm >> 32) & 0x3f;
/* Adjust the register number to account for register rotation. */
- regnum = VP16_REGNUM
+ regnum = VP16_REGNUM
+ ((regnum - VP16_REGNUM) + rrb_pr) % 48;
}
prN_val = extract_unsigned_integer (buf, register_size (gdbarch, regnum),
found for the function. (It can be less than when the
scheduler puts a body instruction before the first prologue
instruction.) */
- for (i = 2 * max_skip_non_prologue_insns;
+ for (i = 2 * max_skip_non_prologue_insns;
i > 0 && (lim_pc == 0 || addr < lim_pc);
i--)
{
sal = find_sal_for_pc (addr, 0);
if (sal.line == 0)
break;
- if (sal.line <= prologue_sal.line
+ if (sal.line <= prologue_sal.line
&& sal.symtab == prologue_sal.symtab)
{
prologue_sal = sal;
/* We want to check if we have a recognizable function start before we
look ahead for a prologue. */
- if (pc < lim_pc && next_pc
+ if (pc < lim_pc && next_pc
&& it == M && ((instr & 0x1ee0000003fLL) == 0x02c00000000LL))
{
/* alloc - start of a regular function. */
{
/* Look for a leaf routine. */
if (pc < lim_pc && next_pc
- && (it == I || it == M)
+ && (it == I || it == M)
&& ((instr & 0x1ee00000000LL) == 0x10800000000LL))
{
/* adds rN = imm14, rM (or mov rN, rM when imm14 is 0) */
- int imm = (int) ((((instr & 0x01000000000LL) ? -1 : 0) << 13)
+ int imm = (int) ((((instr & 0x01000000000LL) ? -1 : 0) << 13)
| ((instr & 0x001f8000000LL) >> 20)
| ((instr & 0x000000fe000LL) >> 13));
int rM = (int) ((instr & 0x00007f00000LL) >> 20);
fp_reg = rN;
last_prologue_pc = next_pc;
}
- }
+ }
/* If we don't recognize a regular function or leaf routine, we are
done. */
if (!fp_reg)
{
- pc = lim_pc;
+ pc = lim_pc;
if (trust_limit)
last_prologue_pc = lim_pc;
}
if (it == B && ((instr & 0x1e1f800003fLL) != 0x04000000000LL))
{
- /* Exit loop upon hitting a non-nop branch instruction. */
+ /* Exit loop upon hitting a non-nop branch instruction. */
if (trust_limit)
lim_pc = pc;
break;
}
- else if (((instr & 0x3fLL) != 0LL) &&
+ else if (((instr & 0x3fLL) != 0LL) &&
(frameless || ret_reg != 0))
{
/* Exit loop upon hitting a predicated instruction if
- we already have the return register or if we are frameless. */
+ we already have the return register or if we are frameless. */
if (trust_limit)
lim_pc = pc;
break;
last_prologue_pc = next_pc;
}
}
- else if ((it == I || it == M)
+ else if ((it == I || it == M)
&& ((instr & 0x1ee00000000LL) == 0x10800000000LL))
{
/* adds rN = imm14, rM (or mov rN, rM when imm14 is 0) */
- int imm = (int) ((((instr & 0x01000000000LL) ? -1 : 0) << 13)
+ int imm = (int) ((((instr & 0x01000000000LL) ? -1 : 0) << 13)
| ((instr & 0x001f8000000LL) >> 20)
| ((instr & 0x000000fe000LL) >> 13));
int rM = (int) ((instr & 0x00007f00000LL) >> 20);
mem_stack_frame_size -= imm;
last_prologue_pc = next_pc;
}
- else if (qp == 0 && rN == 2
+ else if (qp == 0 && rN == 2
&& ((rM == fp_reg && fp_reg != 0) || rM == 12))
{
CORE_ADDR saved_sp = 0;
- /* adds r2, spilloffset, rFramePointer
+ /* adds r2, spilloffset, rFramePointer
or
adds r2, spilloffset, r12
saved_sp = get_frame_register_unsigned (this_frame,
sp_regnum);
spill_addr = saved_sp
- + (rM == 12 ? 0 : mem_stack_frame_size)
+ + (rM == 12 ? 0 : mem_stack_frame_size)
+ imm;
spill_reg = rN;
last_prologue_pc = next_pc;
}
- else if (qp == 0 && rM >= 32 && rM < 40 && !instores[rM-32] &&
+ else if (qp == 0 && rM >= 32 && rM < 40 && !instores[rM-32] &&
rN < 256 && imm == 0)
{
/* mov rN, rM where rM is an input register. */
reg_contents[rN] = rM;
last_prologue_pc = next_pc;
}
- else if (frameless && qp == 0 && rN == fp_reg && imm == 0 &&
+ else if (frameless && qp == 0 && rN == fp_reg && imm == 0 &&
rM == 2)
{
/* mov r12, r2 */
break;
}
}
- else if (it == M
+ else if (it == M
&& ( ((instr & 0x1efc0000000LL) == 0x0eec0000000LL)
|| ((instr & 0x1ffc8000000LL) == 0x0cec0000000LL) ))
{
else if ((it == M && ((instr & 0x1eff8000000LL) == 0x02110000000LL))
|| (it == I && ((instr & 0x1eff8000000LL) == 0x00050000000LL)) )
{
- /* mov.m rN = arM
- or
+ /* mov.m rN = arM
+ or
mov.i rN = arM */
int arM = (int) ((instr & 0x00007f00000LL) >> 20);
last_prologue_pc = next_pc;
}
}
- else if (it == M
+ else if (it == M
&& ( ((instr & 0x1ffc8000000LL) == 0x08cc0000000LL)
|| ((instr & 0x1efc0000000LL) == 0x0acc0000000LL)))
{
- /* st8 [rN] = rM
+ /* st8 [rN] = rM
or
st8 [rN] = rM, imm9 */
int rN = (int) ((instr & 0x00007f00000LL) >> 20);
instores[rM-32] = 1;
last_prologue_pc = next_pc;
}
- else if (qp == 0 && 32 <= indirect && indirect < 40 &&
+ else if (qp == 0 && 32 <= indirect && indirect < 40 &&
!instores[indirect-32])
{
/* Allow an indirect store of an input register. */
st4 [rN] = rM
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. */
int rM = (int) ((instr & 0x000000fe000LL) >> 13);
instores[rM-32] = 1;
last_prologue_pc = next_pc;
}
- else if (qp == 0 && 32 <= indirect && indirect < 40 &&
+ else if (qp == 0 && 32 <= indirect && indirect < 40 &&
!instores[indirect-32])
{
/* Allow an indirect store of an input register. */
/* Find the bof (beginning of frame). */
bof = rse_address_add (cache->bsp, -sof);
-
+
for (i = 0, addr = bof;
i < sof;
i++, addr += 8)
cfm = extract_unsigned_integer (buf, 8, byte_order);
}
cache->prev_cfm = cfm;
-
+
if (cfm != 0)
{
sor = ((cfm >> 14) & 0xf) * 8;
locals) due to the overlap between output and input of
subsequent frames. */
bof = rse_address_add (bof, -sol);
-
+
for (i = 0, addr = bof;
i < sof;
i++, addr += 8)
}
if (i < sor)
cache->saved_regs[IA64_GR32_REGNUM
- + ((i + (sor - rrb_gr)) % sor)]
+ + ((i + (sor - rrb_gr)) % sor)]
= addr;
else
cache->saved_regs[IA64_GR32_REGNUM + i] = addr;
}
-
+
}
}
-
+
/* Try and trust the lim_pc value whenever possible. */
if (trust_limit && lim_pc >= last_prologue_pc)
last_prologue_pc = lim_pc;
by subtracting frame size. */
get_frame_register (this_frame, IA64_BSP_REGNUM, buf);
cache->bsp = extract_unsigned_integer (buf, 8, byte_order);
-
+
get_frame_register (this_frame, IA64_PSR_REGNUM, buf);
get_frame_register (this_frame, IA64_CFM_REGNUM, buf);
if (cache->pc != 0)
examine_prologue (cache->pc, get_frame_pc (this_frame), this_frame, cache);
-
+
cache->base = cache->saved_sp + cache->mem_stack_frame_size;
return cache;
else if (regnum == IA64_CFM_REGNUM)
{
CORE_ADDR addr = cache->saved_regs[IA64_CFM_REGNUM];
-
+
if (addr != 0)
return frame_unwind_got_memory (this_frame, regnum, addr);
{
struct value *pr_val;
ULONGEST prN;
-
+
pr_val = ia64_frame_prev_register (this_frame, this_cache,
IA64_PR_REGNUM);
if (VP16_REGNUM <= regnum && regnum <= VP63_REGNUM)
addr = rse_address_add (prev_bof, (regnum - IA64_GR32_REGNUM));
return frame_unwind_got_memory (this_frame, regnum, addr);
}
-
+
return frame_unwind_got_constant (this_frame, regnum, 0);
}
if (addr != 0)
return frame_unwind_got_memory (this_frame, regnum, addr);
/* Otherwise, punt and get the current value of the register. */
- else
+ else
return frame_unwind_got_register (this_frame, regnum, regnum);
}
}
-
+
static const struct frame_unwind_legacy ia64_frame_unwind (
"ia64 prologue",
NORMAL_FRAME,
delta -= 0x3e;
return addr + ((num_regs + delta/0x3f) << 3);
}
-
+
/* Gdb ia64-libunwind-tdep callback function to convert from an ia64 gdb
register number to a libunwind register number. */
static int
else
return -1;
}
-
+
/* Gdb ia64-libunwind-tdep callback function to convert from a libunwind
register number to a ia64 gdb register number. */
static int
/* Libunwind callback accessor function for general registers. */
static int
-ia64_access_reg (unw_addr_space_t as, unw_regnum_t uw_regnum, unw_word_t *val,
+ia64_access_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);
struct frame_info *this_frame = (frame_info *) arg;
struct gdbarch *gdbarch = get_frame_arch (this_frame);
ia64_gdbarch_tdep *tdep = gdbarch_tdep<ia64_gdbarch_tdep> (gdbarch);
-
+
/* We never call any libunwind routines that need to write registers. */
gdb_assert (!write);
psr = get_frame_register_unsigned (this_frame, IA64_PSR_REGNUM);
*val = ip | ((psr >> 41) & 0x3);
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
*val = get_frame_register_unsigned (this_frame, regnum);
break;
}
-
+
if (gdbarch_debug >= 1)
- gdb_printf (gdb_stdlog,
+ gdb_printf (gdb_stdlog,
" access_reg: from cache: %4s=%s\n",
(((unsigned) regnum <= IA64_NAT127_REGNUM)
- ? ia64_register_names[regnum] : "r??"),
+ ? ia64_register_names[regnum] : "r??"),
paddress (gdbarch, *val));
return 0;
}
{
int regnum = ia64_uw2gdb_regnum (uw_regnum);
frame_info_ptr this_frame = (const frame_info_ptr &) arg;
-
+
/* We never call any libunwind routines that need to write registers. */
gdb_assert (!write);
unw_word_t bsp, sof, cfm, psr, ip;
struct regcache *regcache = (struct regcache *) arg;
struct gdbarch *gdbarch = regcache->arch ();
-
+
/* We never call any libunwind routines that need to write registers. */
gdb_assert (!write);
regcache_cooked_read_unsigned (regcache, IA64_PSR_REGNUM, &psr);
*val = ip | ((psr >> 41) & 0x3);
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
sof = (cfm & 0x7f);
*val = ia64_rse_skip_regs (bsp, -sof);
break;
-
+
case UNW_IA64_AR_BSPSTORE:
/* Libunwind wants bspstore to be after the current register frame.
This is what ptrace() and gdb treats as the regular bsp value. */
regcache_cooked_read_unsigned (regcache, regnum, val);
break;
}
-
+
if (gdbarch_debug >= 1)
- gdb_printf (gdb_stdlog,
+ gdb_printf (gdb_stdlog,
" access_rse_reg: from cache: %4s=%s\n",
(((unsigned) regnum <= IA64_NAT127_REGNUM)
- ? ia64_register_names[regnum] : "r??"),
+ ? ia64_register_names[regnum] : "r??"),
paddress (gdbarch, *val));
return 0;
{
int regnum = ia64_uw2gdb_regnum (uw_regnum);
struct regcache *regcache = (struct regcache *) arg;
-
+
/* We never call any libunwind routines that need to write registers. */
gdb_assert (!write);
{
unw_word_t *laddr = (unw_word_t*) ((char *) ktab
+ (addr - KERNEL_START));
-
+
if (write)
- *laddr = *val;
- else
+ *laddr = *val;
+ else
*val = *laddr;
return 0;
}
TARGET_OBJECT_UNWIND_TABLE, NULL);
}
-/* Get the kernel unwind table. */
+/* Get the kernel unwind table. */
static int
get_kernel_table (unw_word_t ip, unw_dyn_info_t *di)
{
static struct ia64_table_entry *etab;
- if (!ktab)
+ if (!ktab)
{
ktab_buf = getunwind_table ();
if (!ktab_buf)
for (etab = ktab; etab->start_offset; ++etab)
etab->info_offset += KERNEL_START;
}
-
+
if (ip < ktab[0].start_offset || ip >= etab[-1].end_offset)
return -UNW_ENOINFO;
-
+
di->format = UNW_INFO_FORMAT_TABLE;
di->gp = 0;
di->start_ip = ktab[0].start_offset;
di->u.ti.segbase = 0;
di->u.ti.table_len = ((char *) etab - (char *) ktab) / sizeof (unw_word_t);
di->u.ti.table_data = (unw_word_t *) ktab;
-
+
if (gdbarch_debug >= 1)
gdb_printf (gdb_stdlog, "get_kernel_table: found table `%s': "
"segbase=%s, length=%s, gp=%s\n",
- (char *) di->u.ti.name_ptr,
+ (char *) di->u.ti.name_ptr,
hex_string (di->u.ti.segbase),
- pulongest (di->u.ti.table_len),
+ pulongest (di->u.ti.table_len),
hex_string (di->gp));
return 0;
}
int i;
bfd = objfile->obfd;
-
+
ehdr = elf_tdata (bfd)->elf_header;
phdr = elf_tdata (bfd)->phdr;
/* 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.
- Otherwise, we are dealing with runtime-generated code, for which we
+ Otherwise, we are dealing with runtime-generated code, for which we
have no info here. */
segbase = p_text->p_vaddr + load_base;
hex_string (di.u.ti.segbase),
hex_string (di.start_ip), hex_string (di.end_ip),
hex_string (di.gp),
- pulongest (di.u.ti.table_len),
+ pulongest (di.u.ti.table_len),
hex_string ((CORE_ADDR)di.u.ti.table_data));
}
else
hex_string (di.u.rti.segbase),
hex_string (di.start_ip), hex_string (di.end_ip),
hex_string (di.gp),
- pulongest (di.u.rti.table_len),
+ pulongest (di.u.rti.table_len),
hex_string (di.u.rti.table_data));
}
/* Nothing required for now. */
}
-/* Libunwind callback accessor function to get head of the dynamic
- unwind-info registration list. */
+/* Libunwind callback accessor function to get head of the dynamic
+ unwind-info registration list. */
static int
ia64_get_dyn_info_list (unw_addr_space_t as,
unw_word_t *dilap, void *arg)
return;
}
- /* We must add the bsp as the special address for frame comparison
+ /* We must add the bsp as the special address for frame comparison
purposes. */
get_frame_register (this_frame, IA64_BSP_REGNUM, buf);
bsp = extract_unsigned_integer (buf, 8, byte_order);
marker for this frame. */
cfm = get_frame_register_unsigned (this_frame, IA64_CFM_REGNUM);
rrb_pr = (cfm >> 32) & 0x3f;
-
+
/* Adjust the register number to account for register rotation. */
regnum = VP16_REGNUM + ((regnum - VP16_REGNUM) + rrb_pr) % 48;
}
return;
}
- /* We must add the bsp as the special address for frame comparison
+ /* We must add the bsp as the special address for frame comparison
purposes. */
get_frame_register (this_frame, IA64_BSP_REGNUM, buf);
bsp = extract_unsigned_integer (buf, 8, byte_order);
ia64-libunwind-tdep code to use. */
struct libunwind_descr ia64_libunwind_descr =
{
- ia64_gdb2uw_regnum,
- ia64_uw2gdb_regnum,
- ia64_is_fpreg,
+ ia64_gdb2uw_regnum,
+ ia64_uw2gdb_regnum,
+ ia64_is_fpreg,
&ia64_unw_accessors,
&ia64_unw_rse_accessors,
};
}
static void
-ia64_store_return_value (struct type *type, struct regcache *regcache,
+ia64_store_return_value (struct type *type, struct regcache *regcache,
const gdb_byte *valbuf)
{
struct gdbarch *gdbarch = regcache->arch ();
}
}
}
-
+
static enum return_value_convention
ia64_return_value (struct gdbarch *gdbarch, struct value *function,
struct type *valtype, struct regcache *regcache,
{
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
struct obj_section *faddr_sect;
-
+
faddr_sect = find_pc_section (faddr);
if (faddr_sect != NULL)
{
write_memory (fdesc, buf, 16);
}
- return fdesc;
+ return fdesc;
}
/* Use the following routine when printing out function pointers
/* Allocate a new RSE frame. */
regcache_cooked_read_unsigned (regcache, IA64_BSP_REGNUM, &bsp);
tdep->infcall_ops.allocate_new_rse_frame (regcache, bsp, rseslots);
-
+
/* We will attempt to find function descriptors in the .opd segment,
but if we can't we'll construct them ourselves. That being the
case, we'll need to reserve space on the stack for them. */
return frame_id_build_special (sp, get_frame_pc (this_frame), bsp);
}
-static CORE_ADDR
+static CORE_ADDR
ia64_unwind_pc (struct gdbarch *gdbarch, const frame_info_ptr &next_frame)
{
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
ip = extract_unsigned_integer (buf, 8, byte_order);
frame_unwind_register (next_frame, IA64_PSR_REGNUM, buf);
psr = extract_unsigned_integer (buf, 8, byte_order);
-
+
pc = (ip & ~0xf) | ((psr >> 41) & 3);
return pc;
}
/* Still aligned? */
gdb_assert (sp == gdbarch_frame_align (gdbarch, sp));
/* NOTE: cagney/2002-09-18:
-
+
On a RISC architecture, a void parameterless generic dummy
frame (i.e., no parameters, no result) typically does not
need to push anything the stack and hence can leave SP and
type, and *RETVAL_TYPE to the target function's return type.
Calls error() if the function is not valid for calling. */
-extern CORE_ADDR find_function_addr (struct value *function,
+extern CORE_ADDR find_function_addr (struct value *function,
struct type **retval_type,
struct type **function_type = NULL);
void
post_create_inferior (int from_tty, bool set_pspace_solib_ops)
{
- /* Be sure we own the terminal in case write operations are performed. */
+ /* Be sure we own the terminal in case write operations are performed. */
target_terminal::ours_for_output ();
infrun_debug_show_threads ("threads in the newly created inferior",
starti_command (const char *args, int from_tty)
{
run_command_1 (args, from_tty, RUN_STOP_AT_FIRST_INSN);
-}
+}
static bool
proceed_thread_callback (struct thread_info *thread)
if (p != 0 && val != 0)
{
/* 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
+ equals, walk forward over the spaces til we see a nonspace
(possibly the equals). */
if (p > val)
while (*val == ' ')
warning (_("Can not remove current inferior %d."), num);
continue;
}
-
+
if (inf->pid != 0)
{
warning (_("Can not remove active inferior %d."), num);
generates these signals at breakpoints (the code has been in GDB since at
least 1992) so I can not guess how to handle them here.
- In earlier versions of GDB, a target with
+ In earlier versions of GDB, a target with
gdbarch_have_nonsteppable_watchpoint would have the PC after hitting a
watchpoint affected by gdbarch_decr_pc_after_break. I haven't found any
target with both of these set in GDB history, and it seems unlikely to be
differentiate between the two, as the latter needs adjusting
but the former does not.
- The SIGTRAP can be due to a completed hardware single-step only if
+ The SIGTRAP can be due to a completed hardware single-step only if
- we didn't insert software single-step breakpoints
- this thread is currently being stepped
/* The user issued a step when stopped at a breakpoint.
Maybe we should stop, maybe we should not - the delay
slot *might* correspond to a line of source. In any
- case, don't decide that here, just set
- ecs->stepping_over_breakpoint, making sure we
+ case, don't decide that here, just set
+ ecs->stepping_over_breakpoint, making sure we
single-step again before breakpoints are re-inserted. */
ecs->event_thread->stepping_over_breakpoint = 1;
}
{
/* Any solib trampoline code can be handled in reverse
by simply continuing to single-step. We have already
- executed the solib function (backwards), and a few
+ executed the solib function (backwards), and a few
steps will take us back through the trampoline to the
caller. */
keep_going (ecs);
{
/* Any solib trampoline code can be handled in reverse
by simply continuing to single-step. We have already
- executed the solib function (backwards), and a few
+ executed the solib function (backwards), and a few
steps will take us back through the trampoline to the
caller. */
keep_going (ecs);
symtab_and_line sr_sal;
sr_sal.pc = ecs->stop_func_start;
sr_sal.pspace = get_frame_program_space (frame);
- insert_step_resume_breakpoint_at_sal (gdbarch,
+ insert_step_resume_breakpoint_at_sal (gdbarch,
sr_sal, null_frame_id);
keep_going (ecs);
return;
stop_pc_sal = find_sal_for_pc (ecs->event_thread->stop_pc (), 0);
/* NOTE: tausq/2004-05-24: This if block used to be done before all
- the trampoline processing logic, however, there are some trampolines
+ the trampoline processing logic, however, there are some trampolines
that have no names, so we should do trampoline handling first. */
if (ecs->event_thread->control.step_over_calls == STEP_OVER_UNDEBUGGABLE
&& ecs->stop_func_name == nullptr
/* The exception breakpoint is a thread-specific breakpoint on
the unwinder's debug hook, declared as:
-
+
void _Unwind_DebugHook (void *cfa, void *handler);
-
+
The CFA argument indicates the frame to which control is
about to be transferred. HANDLER is the destination PC.
-
+
We ignore the CFA and set a temporary breakpoint at HANDLER.
This is not extremely efficient but it avoids issues in gdb
with computing the DWARF CFA, and it also works even in weird
show_follow_exec_mode_string,
&setlist, &showlist);
- add_setshow_enum_cmd ("scheduler-locking", class_run,
+ add_setshow_enum_cmd ("scheduler-locking", class_run,
scheduler_enums, &scheduler_mode, _("\
Set mode for locking scheduler during execution."), _("\
Show mode for locking scheduler during execution."), _("\
return current_ui->current_interpreter;
}
-/* interp_exec - This executes COMMAND_STR in the current
+/* interp_exec - This executes COMMAND_STR in the current
interpreter. */
void
extern void interps_notify_tsv_created (const trace_state_variable *tsv);
/* Notify all interpreters that trace state variable TSV was deleted.
-
+
If TSV is nullptr, it means that all trace state variables were deleted. */
extern void interps_notify_tsv_deleted (const trace_state_variable *tsv);
enum gdb_regnum
{
- E_R0_REGNUM, E_R1_REGNUM, E_R2_REGNUM, E_R3_REGNUM,
- E_R4_REGNUM, E_R5_REGNUM, E_R6_REGNUM, E_R7_REGNUM,
- E_R8_REGNUM, E_R9_REGNUM, E_R10_REGNUM, E_R11_REGNUM,
- E_R12_REGNUM, E_R13_REGNUM, E_R14_REGNUM, E_R15_REGNUM,
- E_R16_REGNUM, E_R17_REGNUM, E_R18_REGNUM, E_R19_REGNUM,
- E_R20_REGNUM, E_R21_REGNUM, E_R22_REGNUM, E_R23_REGNUM,
- E_R24_REGNUM, E_R25_REGNUM, E_R26_REGNUM, E_R27_REGNUM,
- E_R28_REGNUM, E_R29_REGNUM, E_R30_REGNUM, E_R31_REGNUM,
- E_PC_REGNUM,
+ E_R0_REGNUM, E_R1_REGNUM, E_R2_REGNUM, E_R3_REGNUM,
+ E_R4_REGNUM, E_R5_REGNUM, E_R6_REGNUM, E_R7_REGNUM,
+ E_R8_REGNUM, E_R9_REGNUM, E_R10_REGNUM, E_R11_REGNUM,
+ E_R12_REGNUM, E_R13_REGNUM, E_R14_REGNUM, E_R15_REGNUM,
+ E_R16_REGNUM, E_R17_REGNUM, E_R18_REGNUM, E_R19_REGNUM,
+ E_R20_REGNUM, E_R21_REGNUM, E_R22_REGNUM, E_R23_REGNUM,
+ E_R24_REGNUM, E_R25_REGNUM, E_R26_REGNUM, E_R27_REGNUM,
+ E_R28_REGNUM, E_R29_REGNUM, E_R30_REGNUM, E_R31_REGNUM,
+ E_PC_REGNUM,
E_LR_REGNUM = E_R31_REGNUM, /* Link register. */
E_SP_REGNUM = E_R29_REGNUM, /* Stack pointer. */
E_FP_REGNUM = E_R27_REGNUM, /* Frame pointer. */
/* Prologue analysis methods: */
/* ADDIU insn (001001 rs(5) rt(5) imm(16)). */
-#define INSN_IS_ADDIU(X) (((X) & 0xfc000000) == 0x24000000)
+#define INSN_IS_ADDIU(X) (((X) & 0xfc000000) == 0x24000000)
#define ADDIU_REG_SRC(X) (((X) & 0x03e00000) >> 21)
#define ADDIU_REG_TGT(X) (((X) & 0x001f0000) >> 16)
#define ADDIU_IMMEDIATE(X) ((signed short) ((X) & 0x0000ffff))
/* Function: find_last_line_symbol
Given an address range, first find a line symbol corresponding to
- the starting address. Then find the last line symbol within the
+ the starting address. Then find the last line symbol within the
range that has a line number less than or equal to the first line.
For optimized code with code motion, this finds the last address
}
/* Saved registers:
- We first have to save the saved register's offset, and
+ We first have to save the saved register's offset, and
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
+ 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). */
for (srcreg = 0; srcreg < E_NUM_REGS; srcreg ++)
cache->saved_regs[srcreg] = -1;
}
/* Function: iq2000_skip_prologue
- If the input address is in a function prologue,
+ If the input address is in a function prologue,
returns the address of the end of the prologue;
else returns the input address.
- Note: the input address is likely to be the function start,
+ Note: the input address is likely to be the function start,
since this function is mainly used for advancing a breakpoint
to the first line, or stepping to the first line when we have
stepped into a function call. */
this_cache);
/* This marks the outermost frame. */
- if (cache->base == 0)
+ if (cache->base == 0)
return;
*this_id = frame_id_build (cache->saved_sp, cache->pc);
return cache->base;
}
-
+
static const struct frame_base iq2000_frame_base = {
&iq2000_frame_unwind,
iq2000_frame_base_address,
- iq2000_frame_base_address,
+ iq2000_frame_base_address,
iq2000_frame_base_address
};
/* Target function return value methods: */
/* Function: store_return_value
- Copy the function return value from VALBUF into the
+ Copy the function return value from VALBUF into the
proper location for a function return. */
static void
}
}
-/* Function: use_struct_convention
+/* Function: use_struct_convention
Returns non-zero if the given struct type will be returned using
a special convention, rather than the normal function return method. */
}
/* Function: extract_return_value
- Copy the function's return value into VALBUF.
+ Copy the function's return value into VALBUF.
This function is called only in the context of "target function calls",
ie. when the debugger forces a function to be called in the child, and
when the debugger forces a function to return prematurely via the
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
/* If the function's return value is 8 bytes or less, it is
- returned in a register, and if larger than 8 bytes, it is
+ returned in a register, and if larger than 8 bytes, it is
returned in a stack location which is pointed to by the same
register. */
int len = type->length ();
{
int regno = E_FN_RETURN_REGNUM;
- /* Return values of <= 8 bytes are returned in
+ /* Return values of <= 8 bytes are returned in
FN_RETURN_REGNUM. */
while (len > 0)
{
typelen = type->length ();
if (typelen <= 4)
{
- /* Scalars of up to 4 bytes,
+ /* Scalars of up to 4 bytes,
structs of up to 4 bytes, and
pointers. */
if (argreg <= E_LAST_ARGREG)
}
else if (typelen == 8 && !iq2000_pass_8bytetype_by_address (type))
{
- /* long long,
+ /* long long,
double, and possibly
structs with a single field of long long or double. */
if (argreg <= E_LAST_ARGREG - 1)
}
else if (typelen == 8 && !iq2000_pass_8bytetype_by_address (type))
{
- /* (long long), (double), or struct consisting of
+ /* (long long), (double), or struct consisting of
a single (long long) or (double). */
if (argreg <= E_LAST_ARGREG - 1)
{
any non-NULL struct language_defn.skip_trampoline() functions.
Return the result from the first that returns non-zero, or 0 if all
`fail'. */
-CORE_ADDR
+CORE_ADDR
skip_language_trampoline (const frame_info_ptr &frame, CORE_ADDR pc)
{
for (const auto &lang : language_defn::languages)
extern enum array_ordering
{
array_row_major, array_column_major
- }
+ }
array_ordering;
extern bool warn_frame_lang_mismatch;
-/* language_mode ==
+/* language_mode ==
language_mode_auto: current_language automatically set upon selection
of scope (e.g. stack frame)
language_mode_manual: current_language set only by user. */
const char *name);
\f
-/* These macros define the behavior of the expression
+/* These macros define the behavior of the expression
evaluator. */
/* Should we range check values against the domain of their type? */
if (select_mode == multiple_symbols_cancel && items.size () > 1)
error (_("canceled because the command is ambiguous\n"
"See set/show multiple-symbol."));
-
+
if (select_mode == multiple_symbols_all || items.size () == 1)
{
convert_results_to_lsals (self, result);
}
}
-/* Throw an appropriate error when an unexpected token is encountered
+/* Throw an appropriate error when an unexpected token is encountered
in the input. */
[[noreturn]] static void
kills the entire thread group.
A delivered SIGSTOP would stop the entire thread group, not just the thread we
-tkill'd. But we never let the SIGSTOP be delivered; we always intercept and
+tkill'd. But we never let the SIGSTOP be delivered; we always intercept and
cancel it (by PTRACE_CONT without passing SIGSTOP).
We could use a real-time signal instead. This would solve those problems; we
{
/* This flag should be checked in the common target.c code. */
gdb_assert (target_async_permitted);
-
+
/* Otherwise, this targets is always able to support async mode. */
return true;
}
/* Record a linux syscall. */
-extern int record_linux_system_call (enum gdb_syscall num,
+extern int record_linux_system_call (enum gdb_syscall num,
struct regcache *regcache,
struct linux_record_tdep *tdep);
be anonymous. Otherwise, GDB considers this mapping to be a
file-backed mapping (because there will be a file associated with
it).
-
+
It is worth mentioning that, from all those checks described
above, the most fragile is the one to see if the file name ends
with " (deleted)". This does not necessarily mean that the
that if the file name ends with " (deleted)", then the mapping is
indeed anonymous. FWIW, this is something the Linux kernel could
do better: expose this information in a more direct way.
-
+
- If we see the flag "sh" in the "VmFlags:" field (in
/proc/PID/smaps), then certainly the memory mapping is shared
(VM_SHARED). If we have access to the VmFlags, and we don't see
/* Implementation of `gdbarch_read_core_file_mappings', as defined in
gdbarch.h.
-
+
This function reads the NT_FILE note (which BFD turns into the
section ".note.linuxcore.file"). The format of this note / section
is described as follows in the Linux kernel sources in
fs/binfmt_elf.c:
-
+
long count -- how many files are mapped
long page_size -- units for file_ofs
array of [COUNT] elements of
long end
long file_ofs
followed by COUNT filenames in ASCII: "FILE1" NUL "FILE2" NUL...
-
+
CBFD is the BFD of the core file.
PRE_LOOP_CB is the callback function to invoke prior to starting
the loop which processes individual entries. This callback will
only be executed after the note has been examined in enough
detail to verify that it's not malformed in some way.
-
+
LOOP_CB is the callback function that will be executed once
for each mapping. */
pack_long (buf, long_type, 1);
obstack_grow (&data_obstack, buf, long_type->length ());
- linux_find_memory_regions_full (gdbarch,
+ linux_find_memory_regions_full (gdbarch,
dump_note_entry_p,
linux_make_mappings_callback,
&mapping_data);
where calls to td_thr_get_info fail with TD_ERR for statically linked
executables if td_thr_get_info is called before glibc has initialized
itself.
-
+
If the nptl bug is NOT present in the inferior and still thread_db
reports an error return 1. It means the inferior has corrupted thread
list and GDB should fall back only to LWPs.
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
unsigned long instruction;
- /* Keep reading though instructions, until we come across an instruction
+ /* Keep reading though instructions, until we come across an instruction
that isn't likely to be part of the prologue. */
info->size = 0;
for (; pc < limit; pc += 4)
&& (LM32_REG0 (instruction) == SIM_LM32_SP_REGNUM))
{
/* Any stack displaced store is likely part of the prologue.
- Record that the register is being saved, and the offset
+ Record that the register is being saved, and the offset
into the stack. */
info->saved_regs[LM32_REG1 (instruction)].set_addr (LM32_IMM16 (instruction));
}
&& (LM32_REG1 (instruction) == SIM_LM32_FP_REGNUM)
&& (LM32_REG0 (instruction) == SIM_LM32_R0_REGNUM)))
{
- /* Likely to be in the prologue for functions that require
+ /* Likely to be in the prologue for functions that require
a frame pointer. */
}
else
return pc;
}
-/* Return PC of first non prologue instruction, for the function at the
+/* Return PC of first non prologue instruction, for the function at the
specified address. */
static CORE_ADDR
typedef BP_MANIPULATION (lm32_break_insn) lm32_breakpoint;
-/* Setup registers and stack for faking a call to a function in the
+/* Setup registers and stack for faking a call to a function in the
inferior. */
static CORE_ADDR
val = extract_unsigned_integer (contents, arg_type->length (),
byte_order);
- /* First num_arg_regs parameters are passed by registers,
+ /* First num_arg_regs parameters are passed by registers,
and the rest are passed on the stack. */
if (i < num_arg_regs)
regcache_cooked_write_unsigned (regcache, first_arg_reg + i, val);
arg1 = value_struct_elt (&temp, {}, "_m2_contents", NULL,
_("unbounded structure "
"missing _m2_contents field"));
-
+
if (arg1->type () != type)
arg1 = value_cast (type, arg1);
}
gdb_printf (stream, ";\n");
}
-
+
gdb_printf (stream, "%*sEND ", level, "");
}
}
addr);
len = unpack_field_as_long (type, valaddr, 1);
- gdb_printf (stream, "{");
+ gdb_printf (stream, "{");
m2_print_array_contents (val, stream, recurse, options, len);
gdb_printf (stream, ", HIGH = %d}", (int) len);
}
return val_print_string (type->target_type (), NULL, addr, -1,
stream, options);
}
-
+
return 0;
}
gdb_printf (stream, "[");
gdb_puts (paddress (gdbarch, addr), stream);
gdb_printf (stream, "] : ");
-
+
if (elttype->code () != TYPE_CODE_UNDEF)
{
struct value *deref_val =
relative to the original value of the SP). */
static int
-m32c_is_arg_spill (struct m32c_pv_state *st,
- struct srcdest loc,
+m32c_is_arg_spill (struct m32c_pv_state *st,
+ struct srcdest loc,
pv_t value)
{
gdbarch *arch = st->arch;
&& ! st->stack->find_reg (st->arch, value.reg, 0));
}
-/* Return non-zero if a store of VALUE to LOC is probably
+/* Return non-zero if a store of VALUE to LOC is probably
copying the struct return address into an address register
for immediate use. This is basically a "spill" into the
- address register, instead of onto the stack.
+ address register, instead of onto the stack.
The prerequisites are:
- value being stored is original value of the FIRST arg register;
static int
m32c_is_struct_return (struct m32c_pv_state *st,
- struct srcdest loc,
+ struct srcdest loc,
pv_t value)
{
gdbarch *arch = st->arch;
below, this value might be useful if converted back into
an address by GDB, but will otherwise, almost certainly,
be garbage.
-
+
Using this masked result does seem to be useful
in gdb.cp/cplusfuncs.exp in which ~40 FAILs turn into
PASSes. These results appear to be correct as well.
-
+
We print a warning here so that the user can make a
determination about whether the result is useful or not. */
ptrval = addr & 0xffff;
for (aspace = 1; aspace <= 15; aspace++)
{
ptr_msym = lookup_minimal_symbol_by_pc ((aspace << 16) | ptr);
-
+
if (ptr_msym.minsym)
ptr |= aspace << 16;
}
regcache *regcache = get_thread_regcache (inferior_thread ());
m32c_gdbarch_tdep *tdep = gdbarch_tdep<m32c_gdbarch_tdep> (gdbarch);
-
+
if (!find_pc_partial_function (pc, &name, &func_addr, &func_end))
internal_error (_("No virtual frame pointer available"));
#if 0
/* I'm dropping the dwarf2 sniffer because it has a few problems.
They may be in the dwarf2 cfi code in GDB, or they may be in
- the debug info emitted by the upstream toolchain. I don't
+ the debug info emitted by the upstream toolchain. I don't
know which, but I do know that the prologue analyzer works better.
MVS 04/13/06 */
dwarf2_append_sniffers (gdbarch);
/* Breakpoints
-
+
The little endian mode of M32R is unique. In most of architectures,
two 16-bit instructions, A and B, are placed as the following:
-
+
Big endian:
A0 A1 B0 B1
-
+
Little endian:
A1 A0 B1 B0
-
+
In M32R, they are placed like this:
-
+
Big endian:
A0 A1 B0 B1
-
+
Little endian:
B1 B0 A1 A0
-
+
This is because M32R always fetches instructions in 32-bit.
-
+
The following functions take care of this behavior. */
static int
}
-/* Given a return value in `regbuf' with a type `valtype',
+/* Given a return value in `regbuf' with a type `valtype',
extract and copy its value into `valbuf'. */
static void
/* Target-dependent code for Renesas M32R, for GDB.
-
+
Copyright (C) 2004-2025 Free Software Foundation, Inc.
This file is part of GDB.
#include "gdbcore.h"
#include "value.h"
#include "inferior.h"
-#include "dis-asm.h"
+#include "dis-asm.h"
#include "symfile.h"
#include "objfiles.h"
#include "arch-utils.h"
For 68HC11/68HC12 we have two flags that tell which return
type the function is using. This is used for prologue and frame
analysis to compute correct stack frame layout.
-
+
The MSB of the minimal symbol's "info" field is used for this purpose.
MSYMBOL_SET_RTC Actually sets the "RTC" bit.
RETURN_RTI
};
-
+
/* Register numbers of various important registers. */
#define HARD_X_REGNUM 0
"d29", "d30", "d31", "d32"
};
-struct m68hc11_soft_reg
+struct m68hc11_soft_reg
{
const char *name;
CORE_ADDR addr;
if (soft_reg_initialized)
return;
-
+
soft_min_addr = INT_MAX;
soft_max_addr = 0;
for (i = 0; i < M68HC11_ALL_REGS; i++)
{
soft_regs[i].name = 0;
}
-
+
m68hc11_get_register_info (&soft_regs[SOFT_FP_REGNUM], "_.frame");
m68hc11_get_register_info (&soft_regs[SOFT_TMP_REGNUM], "_.tmp");
m68hc11_get_register_info (&soft_regs[SOFT_ZS_REGNUM], "_.z");
m68hc11_which_soft_register (CORE_ADDR addr)
{
int i;
-
+
if (addr < soft_min_addr || addr > soft_max_addr)
return -1;
-
+
for (i = SOFT_FP_REGNUM; i < M68HC11_ALL_REGS; i++)
{
if (soft_regs[i].name && soft_regs[i].addr == addr)
}
m68hc11_initialize_register_info ();
-
+
/* Fetch a soft register: translate into a memory read. */
if (soft_regs[regno].name)
{
regcache_cooked_write_unsigned (regcache, HARD_PC_REGNUM, pc);
return;
}
-
+
m68hc11_initialize_register_info ();
/* Store a soft register: translate into a memory write. */
/* Sequence of instructions in the 68HC12 function prologue. */
-static struct insn_sequence m6812_prologue[] = {
+static struct insn_sequence m6812_prologue[] = {
{ P_SAVE_REG, 5, { M6812_OP_PAGE2, M6812_OP_MOVW, M6812_PB_PSHW,
OP_IMM_HIGH, OP_IMM_LOW } },
{ P_SET_FRAME, 2, { M6812_OP_STS, OP_DIRECT } },
/* Continue while we match the opcode. */
if (seq->code[j] == buffer[j])
continue;
-
+
if ((seq->code[j] & 0xf00) == 0)
break;
-
+
/* Extract a sequence parameter (address or constant). */
switch (seq->code[j])
{
m68gc11_gdbarch_tdep *tdep = gdbarch_tdep<m68gc11_gdbarch_tdep> (gdbarch);
seq_table = tdep->prologue;
-
+
/* The 68hc11 stack is as follows:
of locals in this function. An alternative to this is to use
DWARF2 info. This would be better but I don't know how to
access dwarf2 debug from this function.
-
+
Walk from the function entry point to the point where we save
the frame. While walking instructions, compute the size of bytes
which are pushed. This gives us the index to access the previous
gdb_printf (file, "\nCCR=");
m68hc11_print_register (gdbarch, file, frame, HARD_CCR_REGNUM);
-
+
gdb_printf (file, "\nD=");
m68hc11_print_register (gdbarch, file, frame, HARD_D_REGNUM);
gdb_printf (file, " Y=");
m68hc11_print_register (gdbarch, file, frame, HARD_Y_REGNUM);
-
+
m68gc11_gdbarch_tdep *tdep = gdbarch_tdep<m68gc11_gdbarch_tdep> (gdbarch);
if (tdep->use_page_register)
/* Skip registers which are not defined in the symbol table. */
if (soft_regs[i].name == 0)
continue;
-
+
gdb_printf (file, "D%d=", i - SOFT_D1_REGNUM + 1);
m68hc11_print_register (gdbarch, file, frame, i);
nr++;
struct type *type;
const gdb_byte *val;
gdb_byte buf[2];
-
+
first_stack_argnum = 0;
if (return_method == return_method_struct)
regcache_cooked_write_unsigned (regcache, HARD_D_REGNUM, struct_addr);
}
-/* Given a return value in `regcache' with a type `type',
+/* Given a return value in `regcache' with a type `type',
extract and copy its value into `valbuf'. */
static void
/* Test whether the ELF symbol corresponds to a function using rtc or
rti to return. */
-
+
static void
m68hc11_elf_make_msymbol_special (const asymbol *sym,
struct minimal_symbol *msym)
frame_unwind_append_unwinder (gdbarch, &m68hc11_frame_unwind);
frame_base_set_default (gdbarch, &m68hc11_frame_base);
-
+
/* Methods for saving / extracting a dummy frame's ID. The ID's
stack address must match the SP value returned by
PUSH_DUMMY_CALL, and saved by generic_save_dummy_frame_tos. */
gdbarch_register (bfd_arch_m68hc11, m68hc11_gdbarch_init);
gdbarch_register (bfd_arch_m68hc12, m68hc11_gdbarch_init);
m68hc11_init_reggroups ();
-}
+}
m68kbsd_fpreg_offset (struct gdbarch *gdbarch, int regnum)
{
int fp_len = gdbarch_register_type (gdbarch, regnum)->length ();
-
+
if (regnum >= M68K_FPC_REGNUM)
return 8 * fp_len + (regnum - M68K_FPC_REGNUM) * 4;
memcpy (&buf[i], &val, sizeof (long));
regaddr += sizeof (long);
if (errno != 0)
- error (_("Couldn't read register %s (#%d): %s."),
+ error (_("Couldn't read register %s (#%d): %s."),
gdbarch_register_name (gdbarch, regno),
regno, safe_strerror (errno));
}
/* Fetch the thread-local storage pointer for libthread_db. */
ps_err_e
-ps_get_thread_area (struct ps_prochandle *ph,
+ps_get_thread_area (struct ps_prochandle *ph,
lwpid_t lwpid, int idx, void **base)
{
if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) < 0)
if (info.bfd_arch_info && info.bfd_arch_info->mach != 0)
{
- const bfd_arch_info_type *coldfire_arch =
+ const bfd_arch_info_type *coldfire_arch =
bfd_lookup_arch (bfd_arch_m68k, bfd_mach_mcf_isa_a_nodiv);
if (coldfire_arch
- && ((*info.bfd_arch_info->compatible)
+ && ((*info.bfd_arch_info->compatible)
(info.bfd_arch_info, coldfire_arch)))
flavour = m68k_coldfire_flavour;
}
-
+
/* Try to figure out if the arch uses floating registers to return
floating point values from functions. On ColdFire, floating
point values are returned in D0. */
/* The number of characters in the string. */
int len;
- /* For detecting token splicing.
+ /* For detecting token splicing.
This is the index in TEXT of the first character of the token
that abuts the end of TEXT. If TEXT contains no tokens, then we
know the nature of TEXT. */
int last_token = -1;
- /* If this buffer is holding the result from get_token, then this
+ /* If this buffer is holding the result from get_token, then this
is non-zero if it is an identifier token, zero otherwise. */
int is_identifier = 0;
get_character_constant (shared_macro_buffer *tok,
const char *p, const char *end)
{
- /* ISO/IEC 9899:1999 (E) Section 6.4.4.4 paragraph 1
+ /* ISO/IEC 9899:1999 (E) Section 6.4.4.4 paragraph 1
But of course, what really matters is that we handle it the same
way GDB's C/C++ lexer does. So we call parse_escape in utils.c
to handle escape sequences. */
/* From the ISO C standard, ISO/IEC 9899:1999 (E), section 6.4:
- preprocessing-token:
+ preprocessing-token:
header-name
identifier
pp-number
src->len -= consumed;
return 1;
}
- else
+ else
{
/* We have found a "non-whitespace character that cannot be
one of the above." Make a token out of it. */
gdb_assert (src->last_token != -1);
gdb_assert (dest->last_token != -1);
-
+
/* First, just try appending the two, and call get_token to see if
we got a splice. */
dest->appendmem (src->text, src->len);
/* Expanding macros! */
-/* A singly-linked list of the names of the macros we are currently
+/* A singly-linked list of the names of the macros we are currently
expanding --- for detecting expansion loops. */
struct macro_name_list {
const char *name;
const macro_scope &scope);
/* A helper function for substitute_args.
-
+
ARGV is a vector of all the arguments; ARGC is the number of
arguments. IS_VARARGS is true if the macro being substituted is a
varargs macro; in this case VA_ARG_NAME is the name of the
return -1;
for (i = 0; i < argc; ++i)
- if (tok->len == strlen (argv[i])
+ if (tok->len == strlen (argv[i])
&& !memcmp (tok->text, argv[i], tok->len))
return i;
return -1;
}
-
+
/* Helper function for substitute_args that gets the next token and
updates the passed-in state variables. */
sources, where all the #included files have been substituted into
their places. */
static int
-compare_locations (struct macro_source_file *file1, int line1,
+compare_locations (struct macro_source_file *file1, int line1,
struct macro_source_file *file2, int line2)
{
/* We want to treat positions in an #included file as coming *after*
macro_bcache_free (t, (char *) d->argv[i]);
macro_bcache_free (t, (char **) d->argv);
}
-
+
macro_bcache_free (t, (char *) d->replacement);
macro_free (d, t);
}
use that. */
splay_tree_node pred = splay_tree_predecessor (t->definitions,
(splay_tree_key) &query);
-
+
if (pred)
{
/* Make sure this predecessor actually has the right name.
((splay_tree_allocate_fn) macro_alloc),
((splay_tree_deallocate_fn) macro_free),
t));
-
+
return t;
}
/* There will always be an interpreter. Either the one passed into
this captured main, or one specified by the user at start up, or
- the console. Initialize the interpreter to the one requested by
+ the console. Initialize the interpreter to the one requested by
the application. */
interpreter_p = context->interpreter_p;
#include <algorithm>
/* Provide a way to test if we have both ECOFF and ELF symbol tables.
- We use this define in order to know whether we should override a
- symbol's ECOFF section with its ELF section. This is necessary in
+ We use this define in order to know whether we should override a
+ symbol's ECOFF section with its ELF section. This is necessary in
case the symbol's ELF section could not be represented in ECOFF. */
#define ECOFF_IN_ELF(bfd) (bfd_get_flavour (bfd) == bfd_target_elf_flavour \
&& bfd_get_section_by_name (bfd, ".mdebug") != NULL)
stabsread_new_init ();
free_header_files ();
init_header_files ();
-
+
/* Make sure all the FDR information is swapped in. */
if (info->fdr == NULL)
{
(in particular constructor method names are different
from the class name). There is therefore no risk that
this check stops the count on the StEnd of a method.
-
+
Also, assume that we're really at the end when tsym.iss
is 0 (issNull). */
if (tsym.iss == issNull
if (i)
{
struct mdebug_extra_func_info *e;
-
+
e = (struct mdebug_extra_func_info *) i->value_bytes ();
e->pdr = *pr;
/* ECOFF in ELF:
For ECOFF in ELF, we skip the creation of the minimal symbols.
- The ECOFF symbols should be a subset of the Elf symbols, and the
+ The ECOFF symbols should be a subset of the Elf symbols, and the
section information of the elf symbols will be more accurate.
FIXME! What about Irix 5's native linker?
- By default, Elf sections which don't exist in ECOFF
+ By default, Elf sections which don't exist in ECOFF
get put in ECOFF's absolute section by the gnu linker.
- Since absolute sections don't get relocated, we
- end up calculating an address different from that of
+ Since absolute sections don't get relocated, we
+ end up calculating an address different from that of
the symbol's minimal symbol (created earlier from the
Elf symtab).
1) don't create the duplicate symbol
(assumes ECOFF symtab is a subset of the ELF symtab;
assumes no side-effects result from ignoring ECOFF symbol)
- 2) create it, only if lookup for existing symbol in ELF's minimal
+ 2) create it, only if lookup for existing symbol in ELF's minimal
symbols fails
- (inefficient;
+ (inefficient;
assumes no side-effects result from ignoring ECOFF symbol)
3) create it, but lookup ELF's minimal symbol and use it's section
during relocation, then modify "uniquify" phase to merge and
(highly inefficient)
I've implemented #1 here...
- Skip the creation of the minimal symbols based on the ECOFF
+ Skip the creation of the minimal symbols based on the ECOFF
symbol table. */
/* Pass 2 over external syms: fill in external symbols. */
which storage class is scData... Since these symbols are
usually useless for the debugger user anyway, we just
discard these symbols. */
-
+
if (SC_IS_TEXT (ext_in->asym.sc))
{
if (objfile->sect_index_text == -1)
continue;
-
+
ms_type = mst_file_text;
}
else if (SC_IS_DATA (ext_in->asym.sc))
break;
default:
- /* FIXME! Shouldn't this use cases for bss,
+ /* FIXME! Shouldn't this use cases for bss,
then have the default be abs? */
namestring = debug_info->ss + fh->issBase + sh.iss;
record_minimal_symbol (reader, namestring,
"be treated as inaccessible.\n"));
else
gdb_printf (file, _("Unknown memory addresses "
- "will be treated as RAM.\n"));
+ "will be treated as RAM.\n"));
}
/* This function should be called before any command which would
/* Either find memory range containing ADDR, or set LO and HI
to the nearest boundaries of an existing memory range.
-
+
If we ever want to support a huge list of memory regions, this
check should be replaced with a binary search (probably using
VEC_lower_bound). */
region.lo = lo;
region.hi = hi;
- /* When no memory map is defined at all, we always return
- 'default_mem_attrib', so that we do not make all memory
+ /* When no memory map is defined at all, we always return
+ 'default_mem_attrib', so that we do not make all memory
inaccessible for targets that don't provide a memory map. */
if (inaccessible_by_default && !mem_region_list->empty ())
region.attrib = mem_attrib::unknown ();
tmp = hex_string_custom (m.lo, 8);
else
tmp = hex_string_custom (m.lo, 16);
-
+
gdb_printf ("%s ", tmp);
if (gdbarch_addr_bit (current_inferior ()->arch ()) <= 32)
};
/* The set of all attributes that can be set for a memory region.
-
+
This structure was created so that memory attributes can be passed
to target_ functions without exposing the details of memory region
list, which would be necessary if these fields were simply added to
FIXME: It would be useful if there was a mechanism for targets to
add their own attributes. For example, the number of wait states. */
-
-struct mem_attrib
+
+struct mem_attrib
{
static mem_attrib unknown ()
{
/* enables hardware breakpoints */
int hwbreak = 0;
-
+
/* enables host-side caching of memory region data */
int cache = 0;
-
+
/* Enables memory verification. After a write, memory is re-read
to verify that the write was successful. */
int verify = 0;
int blocksize = -1;
};
-struct mem_region
+struct mem_region
{
/* Create a mem_region with default attributes. */
/* Lowest address in the region. */
CORE_ADDR lo;
- /* Address past the highest address of the region.
+ /* Address past the highest address of the region.
If 0, upper bound is "infinity". */
CORE_ADDR hi;
return "";
}
-
+
/* Masks for option bits in the OPT special-purpose register. */
enum {
MEP_OPT_DIV = 1 << 25, /* 32-bit divide instruction option */
/* The MeP spec defines the following registers:
- 16 general purpose registers (r0-r15)
+ 16 general purpose registers (r0-r15)
32 control/special registers (csr0-csr31)
32 coprocessor general-purpose registers (c0 -- c31)
64 coprocessor control registers (ccr0 -- ccr63)
/* Special-purpose registers. */
static const char *csr_names[] = {
- "pc", "lp", "sar", "", /* 0 csr3: reserved */
+ "pc", "lp", "sar", "", /* 0 csr3: reserved */
"rpb", "rpe", "rpc", "hi", /* 4 */
"lo", "", "", "", /* 8 csr9-csr11: reserved */
"mb0", "me0", "mb1", "me1", /* 12 */
ULONGEST old_bits;
ULONGEST new_bits;
ULONGEST mixed_bits;
-
+
regcache_raw_read_unsigned (regcache, r->raw, &old_bits);
new_bits = extract_unsigned_integer (buf, size, byte_order);
mixed_bits = ((r->writeable_bits & new_bits)
regcache_raw_write_unsigned (regcache, r->raw, mixed_bits);
}
}
-
+
static void
mep_pseudo_cr32_write (struct gdbarch *gdbarch,
the pseudoregister. */
int rawnum = mep_pseudo_to_raw[cookednum];
gdb_byte buf64[8];
-
+
gdb_assert (register_type (gdbarch, rawnum)->length () == sizeof (buf64));
gdb_assert (register_type (gdbarch, cookednum)->length () == 4);
/* Slow, but legible. */
So, the *INSN values for the instruction sequence above would be
the following, in either endianness:
- 0xd1561234 movu $1,0x123456
+ 0xd1561234 movu $1,0x123456
0xc1285678 sb $1,22136($2)
0xf1011098 clip $1,0x13
0x70020000 ret
significant to prologue analysis --- for the time being,
anyway. */
-static CORE_ADDR
+static CORE_ADDR
mep_get_insn (struct gdbarch *gdbarch, CORE_ADDR pc, unsigned long *insn)
{
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
else
gdb_assert_not_reached ("unexpected vliw mode");
}
-
+
/* Otherwise, the top two bits of the major opcode are (again) what
we need to check. */
else if ((*insn & 0xc0000000) == 0xc0000000)
accuracy, it would be better to just quit now. */
if (stack.store_would_trash (reg[rm]))
break;
-
+
if (is_arg_spill (gdbarch, reg[rn], reg[rm], &stack))
after_last_frame_setup_insn = next_pc;
to this branch target and also stop the prologue scan.
The instructions at and beyond the branch target should
no longer be associated with the prologue.
-
+
Note that we only consider forward branches here. We
presume that a forward branch is being used to skip over
a loop body.
-
+
A backwards branch is covered by the default case below.
If we were to encounter a backwards branch, that would
most likely mean that we've scanned through a loop body.
- If the instruction just changed the FP back to its original
value, then that's probably a restore instruction. The
- prologue should definitely end before that.
+ prologue should definitely end before that.
- If the instruction increased the value of the SP (that is,
shrunk the frame), then it's probably part of a frame
{
CORE_ADDR func_start, stop_addr;
- *this_prologue_cache
+ *this_prologue_cache
= FRAME_OBSTACK_ZALLOC (struct mep_prologue);
func_start = get_frame_func (this_frame);
/* The address of the end of the stack area for arguments. This is
just for error checking. */
CORE_ADDR arg_stack_end;
-
+
sp = push_large_arguments (sp, argc, argv, copy);
/* Reserve space for the stack arguments, if any. */
/* Update the stack pointer. */
regcache_cooked_write_unsigned (regcache, MEP_SP_REGNUM, sp);
-
+
return sp;
}
const char *file_name = bfd_get_filename (info.abfd);
const char *file_endianness
= bfd_big_endian (info.abfd) ? "big" : "little";
-
+
gdb_putc ('\n', gdb_stderr);
if (module_name)
warning (_("the MeP module '%s' is %s-endian, but the executable\n"
already. info->bfd_arch_info needs to match, but we also want
the right me_module: the ELF header's e_flags field needs to
match as well. */
- for (arches = gdbarch_list_lookup_by_info (arches, &info);
+ for (arches = gdbarch_list_lookup_by_info (arches, &info);
arches != NULL;
arches = gdbarch_list_lookup_by_info (arches->next, &info))
{
reggroup_add (gdbarch, mep_ccr_reggroup);
/* Disassembly. */
- set_gdbarch_print_insn (gdbarch, mep_gdb_print_insn);
+ set_gdbarch_print_insn (gdbarch, mep_gdb_print_insn);
/* Breakpoints. */
set_gdbarch_breakpoint_kind_from_pc (gdbarch, mep_breakpoint::kind_from_pc);
/* Return values. */
set_gdbarch_return_value (gdbarch, mep_return_value);
-
+
/* Inferior function calls. */
set_gdbarch_frame_align (gdbarch, mep_frame_align);
set_gdbarch_push_dummy_call (gdbarch, mep_push_dummy_call);
INIT_GDB_FILE (mep_tdep)
{
mep_csr_reggroup = reggroup_new ("csr", USER_REGGROUP);
- mep_cr_reggroup = reggroup_new ("cr", USER_REGGROUP);
+ mep_cr_reggroup = reggroup_new ("cr", USER_REGGROUP);
mep_ccr_reggroup = reggroup_new ("ccr", USER_REGGROUP);
gdbarch_register (bfd_arch_mep, mep_gdbarch_init);
}
/* Insert a watchpoint. The type of watchpoint is specified by the
- first argument:
- -break-watch <expr> --> insert a regular wp.
+ first argument:
+ -break-watch <expr> --> insert a regular wp.
-break-watch -r <expr> --> insert a read watchpoint.
-break-watch -a <expr> --> insert an access wp. */
disassemble the function that contains that line.
HOW_MANY: Number of disassembly lines to display. With source, it
is the number of disassembly lines only, not counting the source
- lines.
+ lines.
always required:
if (argc > 0)
error (_("-environment-pwd: No arguments allowed"));
-
+
gdb::unique_xmalloc_ptr<char> cwd (getcwd (NULL, 0));
if (cwd == NULL)
error (_("-environment-pwd: error finding name of working directory: %s"),
{
if (argc == 0 || argc > 1)
error (_("-environment-cd: Usage DIRECTORY"));
-
+
env_execute_cli_command ("cd", argv[0]);
}
if (dirname == 0 || dirname[0] == '\0')
return;
- /* Call add_path with last arg 0 to indicate not to parse for
+ /* Call add_path with last arg 0 to indicate not to parse for
separator characters. */
add_path (dirname, which_path, 0);
}
#include "source.h"
#include "solib.h"
-/* Return to the client the absolute path and line number of the
+/* Return to the client the absolute path and line number of the
current file being executed. */
void
const char *const *argv, int argc)
{
struct ui_out *uiout = current_uiout;
-
+
if (!mi_valid_noargs ("-file-list-exec-source-file", argc, argv))
error (_("-file-list-exec-source-file: Usage: No args"));
}
}
-/* Print a list of the local variables (including arguments) for the
+/* Print a list of the local variables (including arguments) for the
current frame. ARGC must be 1 and ARGV[0] specify if only the names,
- or both names and values of the variables must be printed. See
+ or both names and values of the variables must be printed. See
parse_print_value for possible values. */
void
if the value should be printed. The PRINT_EXPRESSION parameter
controls if the expression should be printed. */
-static void
+static void
print_varobj (struct varobj *var, enum print_values print_values,
int print_expression)
{
uiout->field_string ("exp", exp);
}
uiout->field_signed ("numchild", varobj_get_num_children (var));
-
+
if (mi_print_value_p (var, print_values))
{
std::string val = varobj_get_value (var);
if (strcmp (frame, "*") == 0)
var_type = USE_CURRENT_FRAME;
else if (strcmp (frame, "@") == 0)
- var_type = USE_SELECTED_FRAME;
+ var_type = USE_SELECTED_FRAME;
else
{
var_type = USE_SPECIFIED_FRAME;
var = varobj_get_handle (argv[0]);
format = mi_parse_format (argv[1]);
-
+
/* Set the format of VAR to the given format. */
varobj_set_display_format (var, format);
/* Report the new current format. */
uiout->field_string ("format", varobj_format_string[(int) format]);
-
+
/* Report the value in the new format. */
std::string val = varobj_get_value (var);
uiout->field_string ("value", val);
int argc)
{
struct ui_out *uiout = current_uiout;
- struct varobj *var;
+ struct varobj *var;
enum print_values print_values;
int from, to;
/* Get varobj handle, if a valid var obj name was specified. */
var = varobj_get_handle (argv[0]);
-
+
const char *path_expr = varobj_get_path_expr (var);
uiout->field_string ("path_expr", path_expr);
int formatFound;
int oind;
const char *oarg;
-
+
enum opt
{
OP_FORMAT
case OP_FORMAT:
if (formatFound)
error (_("Cannot specify format more than once"));
-
+
format = mi_parse_format (oarg);
formatFound = 1;
break;
if (oind >= argc)
error (_("Usage: [-f FORMAT] NAME"));
-
+
if (oind < argc - 1)
error (_("Garbage at end of command"));
-
+
/* Get varobj handle, if a valid var obj name was specified. */
var = varobj_get_handle (argv[oind]);
-
+
if (formatFound)
{
std::string val = varobj_get_formatted_value (var, format);
struct ui_out *uiout = current_uiout;
std::vector<varobj_update_result> changes = varobj_update (&var, is_explicit);
-
+
for (const varobj_update_result &r : changes)
{
int from, to;
if (argc != 3)
error (_("-var-set-update-range: Usage: VAROBJ FROM TO"));
-
+
var = varobj_get_handle (argv[0]);
from = atoi (argv[1]);
to = atoi (argv[2]);
return mi_getopt_1 (prefix, argc, argv, opts, oind, oarg, 0);
}
-int
+int
mi_valid_noargs (const char *prefix, int argc, const char *const *argv)
{
int oind = 0;
/* mi_valid_noargs determines if ARGC/ARGV are a valid set of
parameters to satisfy an MI function that is not supposed to
receive any arguments.
-
- An MI function that should not receive arguments can still be
+
+ An MI function that should not receive arguments can still be
passed parameters after the special option '--' such as below.
Example: The MI function -exec-run takes no args.
See PR-783
PREFIX is passed to mi_getopt for an error message.
-
+
This function Returns 1 if the parameter pair ARGC/ARGV are valid
for an MI function that takes no arguments. Otherwise, it returns 0
and the appropriate error message is displayed by mi_getopt. */
#include "solib-svr4-linux.h"
static int
-microblaze_linux_memory_remove_breakpoint (struct gdbarch *gdbarch,
+microblaze_linux_memory_remove_breakpoint (struct gdbarch *gdbarch,
struct bp_target_info *bp_tgt)
{
CORE_ADDR addr = bp_tgt->reqstd_address;
/* Registers saved on stack. */
for (regnum = 0; regnum < MICROBLAZE_BTR_REGNUM; regnum++)
- trad_frame_set_reg_addr (this_cache, regnum,
+ trad_frame_set_reg_addr (this_cache, regnum,
gpregs + regnum * MICROBLAZE_REGISTER_SIZE);
trad_frame_set_id (this_cache, frame_id_build (base, func));
}
0);
}
-static struct tramp_frame microblaze_linux_sighandler_tramp_frame =
+static struct tramp_frame microblaze_linux_sighandler_tramp_frame =
{
SIGTRAMP_FRAME,
4,
INIT_GDB_FILE (microblaze_linux_tdep)
{
- gdbarch_register_osabi (bfd_arch_microblaze, 0, GDB_OSABI_LINUX,
+ gdbarch_register_osabi (bfd_arch_microblaze, 0, GDB_OSABI_LINUX,
microblaze_linux_init_abi);
}
of "real" code (i.e., the end of the prologue). */
static CORE_ADDR
-microblaze_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc,
+microblaze_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc,
CORE_ADDR current_pc,
struct microblaze_frame_cache *cache)
{
current pc, or the end of the function, whichever is first. */
stop = (current_pc < func_end ? current_pc : func_end);
- microblaze_debug ("Scanning prologue: name=%s, func_addr=%s, stop=%s\n",
- name, paddress (gdbarch, func_addr),
+ microblaze_debug ("Scanning prologue: name=%s, func_addr=%s, stop=%s\n",
+ name, paddress (gdbarch, func_addr),
paddress (gdbarch, stop));
for (addr = func_addr; addr < stop; addr += INST_WORD_SIZE)
microblaze_debug ("%s %08lx\n", paddress (gdbarch, pc), insn);
/* This code is very sensitive to what functions are present in the
- prologue. It assumes that the (addi, addik, swi, sw) can be the
+ prologue. It assumes that the (addi, addik, swi, sw) can be the
only instructions in the prologue. */
if (IS_UPDATE_SP(op, rd, ra))
{
}
else if (IS_SETUP_FP(op, ra, rb))
{
- /* We have a frame pointer. Note the register which is
+ /* We have a frame pointer. Note the register which is
acting as the frame pointer. */
cache->fp_regnum = rd;
microblaze_debug ("Found a frame pointer: r%d\n", cache->fp_regnum);
start_pc = sal.end;
}
- ostart_pc = microblaze_analyze_prologue (gdbarch, func_start, 0xffffffffUL,
+ ostart_pc = microblaze_analyze_prologue (gdbarch, func_start, 0xffffffffUL,
&cache);
if (ostart_pc > start_pc)
set_gdbarch_register_type (gdbarch, microblaze_register_type);
/* Register numbers of various important registers. */
- set_gdbarch_sp_regnum (gdbarch, MICROBLAZE_SP_REGNUM);
- set_gdbarch_pc_regnum (gdbarch, MICROBLAZE_PC_REGNUM);
+ set_gdbarch_sp_regnum (gdbarch, MICROBLAZE_SP_REGNUM);
+ set_gdbarch_pc_regnum (gdbarch, MICROBLAZE_PC_REGNUM);
/* Map Dwarf2 registers to GDB registers. */
set_gdbarch_dwarf2_reg_to_regnum (gdbarch, microblaze_dwarf2_reg_to_regnum);
/* Build (or rebuild) the minimal symbol hash tables. This is necessary
after compacting or sorting the table since the entries move around
thus causing the internal minimal_symbol pointers to become jumbled. */
-
+
static void
build_minimal_symbol_hash_tables
(struct objfile *objfile,
/* Record a new minimal symbol. This is the "full" entry point;
simpler convenience entry points are also provided below.
-
+
This returns a new minimal symbol. It is ok to modify the returned
minimal symbol (though generally not necessary). It is not ok,
though, to stash the pointer anywhere; as minimal symbols may be
moved after creation. The memory for the returned minimal symbol
is still owned by the minsyms.c code, and should not be freed.
-
+
Arguments are:
NAME - the symbol's name
lookup_msym_prefer prefer = lookup_msym_prefer::TEXT,
bound_minimal_symbol *previous = nullptr);
-/* Backward compatibility: search through the minimal symbol table
+/* Backward compatibility: search through the minimal symbol table
for a matching PC (no section given).
-
+
This is a wrapper that calls lookup_minimal_symbol_by_pc_section
with a NULL section argument. */
static int have_ptrace_regsets = 1;
/* Map gdb internal register number to ptrace ``address''.
- These ``addresses'' are normally defined in <asm/ptrace.h>.
+ These ``addresses'' are normally defined in <asm/ptrace.h>.
ptrace does not provide a way to read (or set) MIPS_PS_REGNUM,
and there's no point in reading or setting MIPS_ZERO_REGNUM.
default:
return 0;
}
-
+
for (i = 0;
i < mips_linux_watch_get_num_valid (&watch_readback) && cnt;
i++)
if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1)
perror_with_name (_("Couldn't get registers"));
-
+
mipsnbsd_supply_reg (regcache, (char *) ®s, regno);
if (regno != -1)
return;
if (regno == -1
|| regno >= gdbarch_fp0_regnum (regcache->arch ()))
{
- struct fpreg fpregs;
+ struct fpreg fpregs;
if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
perror_with_name (_("Couldn't get floating point status"));
for (i = gdbarch_fp0_regnum (gdbarch);
i <= mips_regnum (gdbarch)->fp_control_status;
i++)
- if ((regno == i || regno == -1)
+ if ((regno == i || regno == -1)
&& ! gdbarch_cannot_store_register (gdbarch, i))
regcache->raw_collect
(i, (fpregs + ((i - gdbarch_fp0_regnum (gdbarch))
addu a0, sp, 16
li v0, 295 # __sigreturn14
syscall
-
+
Each instruction has a unique encoding, so we simply attempt to match
the instruction the PC is pointing to with any of the above instructions.
If there is a hit, we know the offset to the start of the designated
static struct link_map_offsets lmo;
static struct link_map_offsets *lmp = NULL;
- if (lmp == NULL)
+ if (lmp == NULL)
{
lmp = &lmo;
/* Everything we need is in the first 40 bytes. */
lmo.link_map_size = 48;
lmo.l_addr_offset = 0;
- lmo.l_name_offset = 16;
+ lmo.l_name_offset = 16;
lmo.l_ld_offset = 24;
lmo.l_next_offset = 32;
lmo.l_prev_offset = 40;
If REGNUM is -1, do this for all gp registers in regset. */
static void
-am33_supply_gregset_method (const struct regset *regset,
- struct regcache *regcache,
+am33_supply_gregset_method (const struct regset *regset,
+ struct regcache *regcache,
int regnum, const void *gregs, size_t len)
{
const mn10300_elf_greg_t *regp = (const mn10300_elf_greg_t *) gregs;
switch (regnum) {
case E_D0_REGNUM:
- regcache->raw_supply (E_D0_REGNUM,
+ regcache->raw_supply (E_D0_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_D0));
break;
case E_D1_REGNUM:
- regcache->raw_supply (E_D1_REGNUM,
+ regcache->raw_supply (E_D1_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_D1));
break;
case E_D2_REGNUM:
- regcache->raw_supply (E_D2_REGNUM,
+ regcache->raw_supply (E_D2_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_D2));
break;
case E_D3_REGNUM:
- regcache->raw_supply (E_D3_REGNUM,
+ regcache->raw_supply (E_D3_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_D3));
break;
case E_A0_REGNUM:
- regcache->raw_supply (E_A0_REGNUM,
+ regcache->raw_supply (E_A0_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_A0));
break;
case E_A1_REGNUM:
- regcache->raw_supply (E_A1_REGNUM,
+ regcache->raw_supply (E_A1_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_A1));
break;
case E_A2_REGNUM:
- regcache->raw_supply (E_A2_REGNUM,
+ regcache->raw_supply (E_A2_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_A2));
break;
case E_A3_REGNUM:
- regcache->raw_supply (E_A3_REGNUM,
+ regcache->raw_supply (E_A3_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_A3));
break;
case E_SP_REGNUM:
- regcache->raw_supply (E_SP_REGNUM,
+ regcache->raw_supply (E_SP_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_SP));
break;
case E_PC_REGNUM:
- regcache->raw_supply (E_PC_REGNUM,
+ regcache->raw_supply (E_PC_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_PC));
break;
case E_MDR_REGNUM:
- regcache->raw_supply (E_MDR_REGNUM,
+ regcache->raw_supply (E_MDR_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_MDR));
break;
case E_PSW_REGNUM:
- regcache->raw_supply (E_PSW_REGNUM,
+ regcache->raw_supply (E_PSW_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_EPSW));
break;
case E_LIR_REGNUM:
- regcache->raw_supply (E_LIR_REGNUM,
+ regcache->raw_supply (E_LIR_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_LIR));
break;
case E_LAR_REGNUM:
- regcache->raw_supply (E_LAR_REGNUM,
+ regcache->raw_supply (E_LAR_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_LAR));
break;
case E_MDRQ_REGNUM:
- regcache->raw_supply (E_MDRQ_REGNUM,
+ regcache->raw_supply (E_MDRQ_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_MDRQ));
break;
case E_E0_REGNUM:
- regcache->raw_supply (E_E0_REGNUM,
+ regcache->raw_supply (E_E0_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_E0));
break;
case E_E1_REGNUM:
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_E1));
break;
case E_E2_REGNUM:
- regcache->raw_supply (E_E2_REGNUM,
+ regcache->raw_supply (E_E2_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_E2));
break;
case E_E3_REGNUM:
- regcache->raw_supply (E_E3_REGNUM,
+ regcache->raw_supply (E_E3_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_E3));
break;
case E_E4_REGNUM:
- regcache->raw_supply (E_E4_REGNUM,
+ regcache->raw_supply (E_E4_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_E4));
break;
case E_E5_REGNUM:
- regcache->raw_supply (E_E5_REGNUM,
+ regcache->raw_supply (E_E5_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_E5));
break;
case E_E6_REGNUM:
- regcache->raw_supply (E_E6_REGNUM,
+ regcache->raw_supply (E_E6_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_E6));
break;
case E_E7_REGNUM:
- regcache->raw_supply (E_E7_REGNUM,
+ regcache->raw_supply (E_E7_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_E7));
break;
regcache->raw_supply_zeroed (E_E10_REGNUM);
break;
case E_MCRH_REGNUM:
- regcache->raw_supply (E_MCRH_REGNUM,
+ regcache->raw_supply (E_MCRH_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_MCRH));
break;
case E_MCRL_REGNUM:
- regcache->raw_supply (E_MCRL_REGNUM,
+ regcache->raw_supply (E_MCRL_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_MCRL));
break;
case E_MCVF_REGNUM:
- regcache->raw_supply (E_MCVF_REGNUM,
+ regcache->raw_supply (E_MCVF_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_MCVF));
break;
case E_FPCR_REGNUM:
If REGNUM is -1, do this for all fp registers in regset. */
static void
-am33_supply_fpregset_method (const struct regset *regset,
- struct regcache *regcache,
+am33_supply_fpregset_method (const struct regset *regset,
+ struct regcache *regcache,
int regnum, const void *fpregs, size_t len)
{
const mn10300_elf_fpregset_t *fpregset
for (i = 0; i < MN10300_ELF_NFPREG; i++)
am33_supply_fpregset_method (regset, regcache,
E_FS0_REGNUM + i, fpregs, len);
- am33_supply_fpregset_method (regset, regcache,
+ am33_supply_fpregset_method (regset, regcache,
E_FPCR_REGNUM, fpregs, len);
}
else if (regnum == E_FPCR_REGNUM)
/* Copy register values from regcache to regset. */
static void
-am33_collect_gregset_method (const struct regset *regset,
- const struct regcache *regcache,
+am33_collect_gregset_method (const struct regset *regset,
+ const struct regcache *regcache,
int regnum, void *gregs, size_t len)
{
mn10300_elf_gregset_t *regp = (gdb_byte (*)[28][4]) gregs;
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_D0));
break;
case E_D1_REGNUM:
- regcache->raw_collect (E_D1_REGNUM,
+ regcache->raw_collect (E_D1_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_D1));
break;
case E_D2_REGNUM:
- regcache->raw_collect (E_D2_REGNUM,
+ regcache->raw_collect (E_D2_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_D2));
break;
case E_D3_REGNUM:
- regcache->raw_collect (E_D3_REGNUM,
+ regcache->raw_collect (E_D3_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_D3));
break;
case E_A0_REGNUM:
- regcache->raw_collect (E_A0_REGNUM,
+ regcache->raw_collect (E_A0_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_A0));
break;
case E_A1_REGNUM:
- regcache->raw_collect (E_A1_REGNUM,
+ regcache->raw_collect (E_A1_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_A1));
break;
case E_A2_REGNUM:
- regcache->raw_collect (E_A2_REGNUM,
+ regcache->raw_collect (E_A2_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_A2));
break;
case E_A3_REGNUM:
- regcache->raw_collect (E_A3_REGNUM,
+ regcache->raw_collect (E_A3_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_A3));
break;
case E_SP_REGNUM:
- regcache->raw_collect (E_SP_REGNUM,
+ regcache->raw_collect (E_SP_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_SP));
break;
case E_PC_REGNUM:
- regcache->raw_collect (E_PC_REGNUM,
+ regcache->raw_collect (E_PC_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_PC));
break;
case E_MDR_REGNUM:
- regcache->raw_collect (E_MDR_REGNUM,
+ regcache->raw_collect (E_MDR_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_MDR));
break;
case E_PSW_REGNUM:
- regcache->raw_collect (E_PSW_REGNUM,
+ regcache->raw_collect (E_PSW_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_EPSW));
break;
case E_LIR_REGNUM:
- regcache->raw_collect (E_LIR_REGNUM,
+ regcache->raw_collect (E_LIR_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_LIR));
break;
case E_LAR_REGNUM:
- regcache->raw_collect (E_LAR_REGNUM,
+ regcache->raw_collect (E_LAR_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_LAR));
break;
case E_MDRQ_REGNUM:
- regcache->raw_collect (E_MDRQ_REGNUM,
+ regcache->raw_collect (E_MDRQ_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_MDRQ));
break;
case E_E0_REGNUM:
- regcache->raw_collect (E_E0_REGNUM,
+ regcache->raw_collect (E_E0_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_E0));
break;
case E_E1_REGNUM:
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_E1));
break;
case E_E2_REGNUM:
- regcache->raw_collect (E_E2_REGNUM,
+ regcache->raw_collect (E_E2_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_E2));
break;
case E_E3_REGNUM:
- regcache->raw_collect (E_E3_REGNUM,
+ regcache->raw_collect (E_E3_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_E3));
break;
case E_E4_REGNUM:
- regcache->raw_collect (E_E4_REGNUM,
+ regcache->raw_collect (E_E4_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_E4));
break;
case E_E5_REGNUM:
- regcache->raw_collect (E_E5_REGNUM,
+ regcache->raw_collect (E_E5_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_E5));
break;
case E_E6_REGNUM:
- regcache->raw_collect (E_E6_REGNUM,
+ regcache->raw_collect (E_E6_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_E6));
break;
case E_E7_REGNUM:
- regcache->raw_collect (E_E7_REGNUM,
+ regcache->raw_collect (E_E7_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_E7));
break;
/* The gregset struct has noplace to put this: do nothing. */
break;
case E_MCRH_REGNUM:
- regcache->raw_collect (E_MCRH_REGNUM,
+ regcache->raw_collect (E_MCRH_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_MCRH));
break;
case E_MCRL_REGNUM:
- regcache->raw_collect (E_MCRL_REGNUM,
+ regcache->raw_collect (E_MCRL_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_MCRL));
break;
case E_MCVF_REGNUM:
- regcache->raw_collect (E_MCVF_REGNUM,
+ regcache->raw_collect (E_MCVF_REGNUM,
(regp + MN10300_ELF_GREGSET_T_REG_INDEX_MCVF));
break;
case E_FPCR_REGNUM:
/* Copy fp register values from regcache to regset. */
static void
-am33_collect_fpregset_method (const struct regset *regset,
- const struct regcache *regcache,
+am33_collect_fpregset_method (const struct regset *regset,
+ const struct regcache *regcache,
int regnum, void *fpregs, size_t len)
{
mn10300_elf_fpregset_t *fpregset = (mn10300_elf_fpregset_t *) fpregs;
for (i = 0; i < MN10300_ELF_NFPREG; i++)
am33_collect_fpregset_method (regset, regcache, E_FS0_REGNUM + i,
fpregs, len);
- am33_collect_fpregset_method (regset, regcache,
+ am33_collect_fpregset_method (regset, regcache,
E_FPCR_REGNUM, fpregs, len);
}
else if (regnum == E_FPCR_REGNUM)
{
int len = type->length ();
int reg, regsz;
-
+
if (type->code () == TYPE_CODE_PTR)
reg = 4;
else
NORMAL_FRAME,
FRAME_UNWIND_ARCH,
default_frame_unwind_stop_reason,
- mn10300_frame_this_id,
+ mn10300_frame_this_id,
mn10300_frame_prev_register,
NULL,
default_frame_sniffer
*/
static CORE_ADDR
-mn10300_push_dummy_call (struct gdbarch *gdbarch,
+mn10300_push_dummy_call (struct gdbarch *gdbarch,
struct value *target_func,
struct regcache *regcache,
- CORE_ADDR bp_addr,
+ CORE_ADDR bp_addr,
int nargs, struct value **args,
- CORE_ADDR sp,
+ CORE_ADDR sp,
function_call_return_method return_method,
CORE_ADDR struct_addr)
{
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
const int push_size = register_size (gdbarch, E_PC_REGNUM);
int regs_used;
- int len, arg_len;
+ int len, arg_len;
int stack_offset = 0;
int argnum;
const gdb_byte *val;
while (regs_used < 2 && arg_len > 0)
{
- regcache_cooked_write_unsigned (regcache, regs_used,
+ regcache_cooked_write_unsigned (regcache, regs_used,
extract_unsigned_integer (val, push_size, byte_order));
val += push_size;
arg_len -= push_size;
expected to allocate any additional stack. On the other hand, if
the SP values are different, the difference determines the
additional stack that must be allocated.
-
+
Note that we don't update the return value though because that's
the value of the stack just after pushing the arguments, but prior
to performing the call. This value is needed in order to
construct the frame ID of the dummy call. */
{
CORE_ADDR func_addr = find_function_addr (target_func, NULL);
- CORE_ADDR unwound_sp
+ CORE_ADDR unwound_sp
= gdbarch_unwind_sp (gdbarch, create_new_frame (sp, func_addr));
if (sp != unwound_sp)
regcache_cooked_write_unsigned (regcache, E_SP_REGNUM,
/* Stage 2 */
set_gdbarch_return_value (gdbarch, mn10300_return_value);
-
+
/* Stage 3 -- get target calls working. */
set_gdbarch_push_dummy_call (gdbarch, mn10300_push_dummy_call);
/* set_gdbarch_return_value (store, extract) */
return gdbarch;
}
-
+
/* Dump out the mn10300 specific architecture information. */
static void
{
offset = read_memory_integer (next_addr + 2, 4, byte_order);
inst2 = read_memory_unsigned_integer (next_addr + 6, 2, byte_order);
-
+
if (inst2 == 0x291e) /* sub.l $sp, $r12 */
{
cache->framesize += offset;
}
-
+
return (next_addr + 8);
}
else if ((inst & 0xff00) == 0x9100) /* dec $sp, X */
struct symbol *sym;
struct moxie_frame_cache cache;
CORE_ADDR plg_end;
-
+
memset (&cache, 0, sizeof cache);
-
- plg_end = moxie_analyze_prologue (func_addr,
+
+ plg_end = moxie_analyze_prologue (func_addr,
func_end, &cache, gdbarch);
/* Found a function. */
sym = lookup_symbol (func_name, nullptr,
return next_pcs;
}
-/* Given a return value in `regbuf' with a type `valtype',
+/* Given a return value in `regbuf' with a type `valtype',
extract and copy its value into `valbuf'. */
static void
{
/* This is a Form 3 instruction. */
int opcode = (inst >> 10 & 0xf);
-
+
switch (opcode)
{
case 0x00: /* beq */
{
regcache->raw_read (
MOXIE_SP_REGNUM, (gdb_byte *) & tmpu32);
- tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32,
+ tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32,
4, byte_order);
if (record_full_arch_list_add_reg (regcache, MOXIE_FP_REGNUM)
|| (record_full_arch_list_add_reg (regcache,
{
int reg = (inst >> 4) & 0xf;
regcache->raw_read (reg, (gdb_byte *) & tmpu32);
- tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32,
+ tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32,
4, byte_order);
if (record_full_arch_list_add_reg (regcache, reg)
|| record_full_arch_list_add_mem (tmpu32 - 4, 4))
break;
case 0x09: /* sta.l */
{
- tmpu32 = (uint32_t) moxie_process_readu (addr+2, buf,
+ tmpu32 = (uint32_t) moxie_process_readu (addr+2, buf,
4, byte_order);
if (record_full_arch_list_add_mem (tmpu32, 4))
return -1;
{
int reg = (inst >> 4) & 0xf;
regcache->raw_read (reg, (gdb_byte *) & tmpu32);
- tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32,
+ tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32,
4, byte_order);
if (record_full_arch_list_add_mem (tmpu32, 4))
return -1;
uint32_t offset = (((int16_t) moxie_process_readu (addr+2, buf, 2,
byte_order)) << 16 ) >> 16;
regcache->raw_read (reg, (gdb_byte *) & tmpu32);
- tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32,
+ tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32,
4, byte_order);
tmpu32 += offset;
if (record_full_arch_list_add_mem (tmpu32, 4))
{
regcache->raw_read (
MOXIE_SP_REGNUM, (gdb_byte *) & tmpu32);
- tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32,
+ tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32,
4, byte_order);
if (record_full_arch_list_add_reg (regcache, MOXIE_FP_REGNUM)
|| (record_full_arch_list_add_reg (regcache,
{
int reg = (inst >> 4) & 0xf;
regcache->raw_read (reg, (gdb_byte *) & tmpu32);
- tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32,
+ tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32,
4, byte_order);
if (record_full_arch_list_add_mem (tmpu32, 1))
return -1;
{
int reg = (inst >> 4) & 0xf;
regcache->raw_read (reg, (gdb_byte *) & tmpu32);
- tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32,
+ tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32,
4, byte_order);
if (record_full_arch_list_add_mem (tmpu32, 2))
return -1;
break;
case 0x30: /* swi */
{
- /* We currently implement support for libgloss'
+ /* We currently implement support for libgloss'
system calls. */
int inum = moxie_process_readu (addr+2, buf, 4, byte_order);
/* Read buffer pointer is in $r1. */
regcache->raw_read (3, (gdb_byte *) & ptr);
- ptr = extract_unsigned_integer ((gdb_byte *) & ptr,
+ ptr = extract_unsigned_integer ((gdb_byte *) & ptr,
4, byte_order);
/* String length is at 0x12($fp). */
regcache->raw_read (
MOXIE_FP_REGNUM, (gdb_byte *) & tmpu32);
- tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32,
+ tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32,
4, byte_order);
length = moxie_process_readu (tmpu32+20, buf, 4, byte_order);
uint32_t offset = (((int16_t) moxie_process_readu (addr+2, buf, 2,
byte_order)) << 16 ) >> 16;
regcache->raw_read (reg, (gdb_byte *) & tmpu32);
- tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32,
+ tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32,
4, byte_order);
tmpu32 += offset;
if (record_full_arch_list_add_mem (tmpu32, 1))
uint32_t offset = (((int16_t) moxie_process_readu (addr+2, buf, 2,
byte_order)) << 16 ) >> 16;
regcache->raw_read (reg, (gdb_byte *) & tmpu32);
- tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32,
+ tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32,
4, byte_order);
tmpu32 += offset;
if (record_full_arch_list_add_mem (tmpu32, 2))
/* Target-dependent code for Moxie
-
+
Copyright (C) 2009-2025 Free Software Foundation, Inc.
This file is part of GDB.
/* Linux-specific functions to retrieve OS data.
-
+
Copyright (C) 2009-2025 Free Software Foundation, Inc.
This file is part of GDB.
size.Y = 12;
return size;
}
-
+
/* See windows-nat.h. */
bool
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 3, or (at your option) any
* later version.
- *
+ *
* This file is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
- *
+ *
* Under Section 7 of GPL version 3, you are granted additional
* permissions described in the GCC Runtime Library Exception, version
* 3.1, as published by the Free Software Foundation.
- *
+ *
* You should have received a copy of the GNU General Public License and
* a copy of the GCC Runtime Library Exception along with this program;
* see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
Copyright (C) 2002-2025 Free Software Foundation, Inc.
Contributed by Wasabi Systems, Inc.
-
+
This file is part of GDB.
-
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
};
struct objc_class {
- CORE_ADDR isa;
- CORE_ADDR super_class;
- CORE_ADDR name;
+ CORE_ADDR isa;
+ CORE_ADDR super_class;
+ CORE_ADDR name;
long version;
long info;
long instance_size;
{
if (noerr)
return 0;
- else
+ else
error (_("No struct type named %s."), name);
}
if (sym->type ()->code () != TYPE_CODE_STRUCT)
if (noerr)
return 0;
else
- error (_("This context has class, union or enum %s, not a struct."),
+ error (_("This context has class, union or enum %s, not a struct."),
name);
}
return sym;
}
-CORE_ADDR
+CORE_ADDR
lookup_objc_class (struct gdbarch *gdbarch, const char *classname)
{
struct type *char_type = builtin_type (gdbarch)->builtin_char;
return 0;
}
- selstring = value_coerce_array (value_string (selname,
+ selstring = value_coerce_array (value_string (selname,
strlen (selname) + 1,
char_type));
return value_as_long (call_function_by_hand (function, NULL, selstring));
}
-struct value *
+struct value *
value_nsstring (struct gdbarch *gdbarch, const char *ptr, int len)
{
struct type *char_type = builtin_type (gdbarch)->builtin_char;
= find_function_in_inferior("+[NSString stringWithCString:]", NULL);
type = builtin_type (gdbarch)->builtin_long;
- stringValue[0] = value_from_longest
+ stringValue[0] = value_from_longest
(type, lookup_objc_class (gdbarch, "NSString"));
- stringValue[1] = value_from_longest
+ stringValue[1] = value_from_longest
(type, lookup_child_selector (gdbarch, "stringWithCString:"));
nsstringValue = call_function_by_hand(function, NULL, stringValue);
}
* Implements the "Info selectors" command. Takes an optional regexp
* arg. Lists all objective c selectors that match the regexp. Works
* by grepping through all symbols for objective c methods. Output list
- * is sorted and uniqued.
+ * is sorted and uniqued.
*/
static void
continue;
}
if (regexp == NULL || re_exec(++name) != 0)
- {
+ {
const char *mystart = name;
const char *myend = strchr (mystart, ']');
-
+
if (myend && (myend - mystart > maxlen))
maxlen = myend - mystart; /* Get longest selector. */
matches++;
}
if (matches)
{
- gdb_printf (_("Selectors matching \"%s\":\n\n"),
+ gdb_printf (_("Selectors matching \"%s\":\n\n"),
regexp ? regexp : "*");
sym_arr = XALLOCAVEC (struct symbol *, matches);
}
}
- qsort (sym_arr, matches, sizeof (struct minimal_symbol *),
+ qsort (sym_arr, matches, sizeof (struct minimal_symbol *),
compare_selectors);
/* Prevent compare on first iteration. */
asel[0] = 0;
* Function: compare_classes (const void *, const void *)
*
* Comparison function for use with qsort. Arguments are symbols or
- * msymbols Compares class part of objc method name alphabetically.
+ * msymbols Compares class part of objc method name alphabetically.
*/
static int
* Lists all objective c classes that match the optional regexp.
* Works by grepping through the list of objective c methods. List will
* be sorted and uniqued (since one class may have many methods).
- * BUGS: will not list a class that has no methods.
+ * BUGS: will not list a class that has no methods.
*/
static void
(name[0] == '-' || name[0] == '+') &&
name[1] == '[') /* Got a method name. */
if (regexp == NULL || re_exec(name+2) != 0)
- {
+ {
/* Compute length of classname part. */
const char *mystart = name + 2;
const char *myend = strchr (mystart, ' ');
-
+
if (myend && (myend - mystart > maxlen))
maxlen = myend - mystart;
matches++;
}
if (matches)
{
- gdb_printf (_("Classes matching \"%s\":\n\n"),
+ gdb_printf (_("Classes matching \"%s\":\n\n"),
regexp ? regexp : "*");
sym_arr = XALLOCAVEC (struct symbol *, matches);
matches = 0;
}
}
- qsort (sym_arr, matches, sizeof (struct minimal_symbol *),
+ qsort (sym_arr, matches, sizeof (struct minimal_symbol *),
compare_classes);
/* Prevent compare on first iteration. */
aclass[0] = 0;
gdb_printf (_("No classes matching \"%s\"\n"), regexp ? regexp : "*");
}
-static char *
+static char *
parse_selector (char *method, char **selector)
{
char *s1 = NULL;
s1 = method;
s1 = skip_spaces (s1);
- if (*s1 == '\'')
+ if (*s1 == '\'')
{
found_quote = 1;
s1++;
}
s1 = skip_spaces (s1);
-
+
nselector = s1;
s2 = s1;
s2 = skip_spaces (s2);
if (found_quote)
{
- if (*s2 == '\'')
+ if (*s2 == '\'')
s2++;
s2 = skip_spaces (s2);
}
return s2;
}
-static char *
+static char *
parse_method (char *method, char *type, char **theclass,
char **category, char **selector)
{
gdb_assert (theclass != NULL);
gdb_assert (category != NULL);
gdb_assert (selector != NULL);
-
+
s1 = method;
s1 = skip_spaces (s1);
- if (*s1 == '\'')
+ if (*s1 == '\'')
{
found_quote = 1;
s1++;
}
s1 = skip_spaces (s1);
-
+
if ((s1[0] == '+') || (s1[0] == '-'))
ntype = *s1++;
nclass = s1;
while (c_isalnum (*s1) || (*s1 == '_'))
s1++;
-
+
s2 = s1;
s2 = skip_spaces (s2);
-
+
if (*s2 == '(')
{
s2++;
s2 = skip_spaces (s2);
if (found_quote)
{
- if (*s2 != '\'')
+ if (*s2 != '\'')
return NULL;
s2++;
s2 = skip_spaces (s2);
}
static void
-find_methods (char type, const char *theclass, const char *category,
+find_methods (char type, const char *theclass, const char *category,
const char *selector,
std::vector<const char *> *symbol_names)
{
&& ((nclass == NULL) || (strcmp (theclass, nclass) != 0)))
continue;
- if ((category != NULL) &&
+ if ((category != NULL) &&
((ncategory == NULL) || (strcmp (category, ncategory) != 0)))
continue;
- if ((selector != NULL) &&
+ if ((selector != NULL) &&
((nselector == NULL) || (strcmp (selector, nselector) != 0)))
continue;
strings->end ());
}
-/*
+/*
* Function: find_imps (const char *selector, struct symbol **sym_arr)
*
* Input: a string representing a selector
struct symbol *sym = lookup_symbol (selector, NULL, SEARCH_VFT,
0).symbol;
- if (sym != NULL)
+ if (sym != NULL)
symbol_names->push_back (sym->natural_name ());
else
{
bound_minimal_symbol msym
= lookup_minimal_symbol (current_program_space, selector);
- if (msym.minsym != NULL)
+ if (msym.minsym != NULL)
symbol_names->push_back (msym.minsym->natural_name ());
}
}
return method + (tmp - buf);
}
-static void
+static void
print_object_command (const char *args, int from_tty)
{
struct value *object, *function, *description;
* case the functions have moved for some reason.
*/
-static void
+static void
find_objc_msgsend (void)
{
unsigned int i;
methcalls[i].name + 1);
}
if (func.minsym == NULL)
- {
+ {
methcalls[i].begin = 0;
methcalls[i].end = 0;
- continue;
+ continue;
}
methcalls[i].begin = func.value_address ();
* dependent modules.
*/
-static int
+static int
find_objc_msgcall_submethod (int (*f) (CORE_ADDR, CORE_ADDR *),
- CORE_ADDR pc,
+ CORE_ADDR pc,
CORE_ADDR *new_pc)
{
try
return 0;
}
-int
+int
find_objc_msgcall (CORE_ADDR pc, CORE_ADDR *new_pc)
{
unsigned int i;
*new_pc = 0;
}
- for (i = 0; i < nmethcalls; i++)
- if ((pc >= methcalls[i].begin) && (pc < methcalls[i].end))
+ for (i = 0; i < nmethcalls; i++)
+ if ((pc >= methcalls[i].begin) && (pc < methcalls[i].end))
{
- if (methcalls[i].stop_at != NULL)
- return find_objc_msgcall_submethod (methcalls[i].stop_at,
+ if (methcalls[i].stop_at != NULL)
+ return find_objc_msgcall_submethod (methcalls[i].stop_at,
pc, new_pc);
- else
+ else
return 0;
}
add_com_alias ("po", print_object_cmd, class_vars, 1);
}
-static void
+static void
read_objc_method (struct gdbarch *gdbarch, CORE_ADDR addr,
struct objc_method *method)
{
return read_memory_unsigned_integer (addr + 4, 4, byte_order);
}
-static void
+static void
read_objc_methlist_method (struct gdbarch *gdbarch, CORE_ADDR addr,
unsigned long num, struct objc_method *method)
{
gdb_assert (num < read_objc_methlist_nmethods (gdbarch, addr));
read_objc_method (gdbarch, addr + 8 + (12 * num), method);
}
-
-static void
+
+static void
read_objc_object (struct gdbarch *gdbarch, CORE_ADDR addr,
struct objc_object *object)
{
object->isa = read_memory_unsigned_integer (addr, 4, byte_order);
}
-static void
+static void
read_objc_super (struct gdbarch *gdbarch, CORE_ADDR addr,
struct objc_super *super)
{
super->theclass = read_memory_unsigned_integer (addr + 4, 4, byte_order);
};
-static void
+static void
read_objc_class (struct gdbarch *gdbarch, CORE_ADDR addr,
struct objc_class *theclass)
{
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
CORE_ADDR subclass = theclass;
- while (subclass != 0)
+ while (subclass != 0)
{
struct objc_class class_str;
read_objc_class (gdbarch, subclass, &class_str);
- for (;;)
+ for (;;)
{
CORE_ADDR mlist;
unsigned long nmethods;
unsigned long i;
-
- mlist = read_memory_unsigned_integer (class_str.methods +
+
+ mlist = read_memory_unsigned_integer (class_str.methods +
(4 * mlistnum),
4, byte_order);
- if (mlist == 0)
+ if (mlist == 0)
break;
nmethods = read_objc_methlist_nmethods (gdbarch, mlist);
- for (i = 0; i < nmethods; i++)
+ for (i = 0; i < nmethods; i++)
{
struct objc_method meth_str;
read_objc_methlist_method (gdbarch, mlist, i, &meth_str);
- if (meth_str.name == sel)
+ if (meth_str.name == sel)
/* FIXME: hppa arch was doing a pointer dereference
here. There needs to be a better way to do that. */
return meth_str.imp;
read_objc_super (gdbarch, super, &sstr);
if (sstr.theclass == 0)
return 0;
-
+
res = find_implementation_from_class (gdbarch, sstr.theclass, sel);
if (new_pc != 0)
*new_pc = res;
read_objc_super (gdbarch, super, &sstr);
if (sstr.theclass == 0)
return 0;
-
+
res = find_implementation_from_class (gdbarch, sstr.theclass, sel);
if (new_pc != 0)
*new_pc = res;
Return non-zero iff any change happened. */
static int
-objfile_relocate1 (struct objfile *objfile,
+objfile_relocate1 (struct objfile *objfile,
const section_offsets &new_offsets)
{
section_offsets delta (objfile->section_offsets.size ());
/* OS ABI variant handling for GDB.
Copyright (C) 2001-2025 Free Software Foundation, Inc.
-
+
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
if (*type == '\0' && nrows == 0)
error (_("Available types of OS data not reported."));
-
+
if (!osdata->items.empty ())
{
last = &osdata->items.back ();
return n < max;
}
\f
-/* This function avoids direct calls to fprintf
+/* This function avoids direct calls to fprintf
in the parser generated debug code. */
void
parser_fprintf (FILE *x, const char *y, ...)
-{
+{
va_list args;
va_start (args, y);
if (x == stderr)
- gdb_vprintf (gdb_stderr, y, args);
+ gdb_vprintf (gdb_stderr, y, args);
else
{
gdb_printf (gdb_stderr, " Unknown FILE used.\n");
watchpoints and hardware-accelerated condition evaluation. */
#ifndef PPC_PTRACE_GETHWDBGINFO
-/* Not having PPC_PTRACE_GETHWDBGINFO defined means that the PowerPC HWDEBUG
+/* Not having PPC_PTRACE_GETHWDBGINFO defined means that the PowerPC HWDEBUG
ptrace interface is not present in ptrace.h, so we'll have to pretty much
include it all here so that the code at least compiles on older systems. */
#define PPC_PTRACE_GETHWDBGINFO 0x89
int wordsize = sizeof (long);
/* General purpose registers occupy 1 slot each in the buffer. */
- if (regno >= tdep->ppc_gp0_regnum
+ if (regno >= tdep->ppc_gp0_regnum
&& regno < tdep->ppc_gp0_regnum + ppc_num_gprs)
u_addr = ((regno - tdep->ppc_gp0_regnum + PT_R0) * wordsize);
size_t padding = (bytes_transferred - register_size (gdbarch, regno));
regcache->raw_supply (regno, buf + padding);
}
- else
+ else
internal_error (_("fetch_register: unexpected byte order: %d"),
gdbarch_byte_order (gdbarch));
}
/* This function actually issues the request to ptrace, telling
it to get all general-purpose registers and put them into the
specified regset.
-
+
If the ptrace request does not exist, this function returns 0
and properly sets the have_ptrace_* flag. If the request fails,
this function calls perror_with_name. Otherwise, if the request
/* This function actually issues the request to ptrace, telling
it to get all floating-point registers and put them into the
specified regset.
-
+
If the ptrace request does not exist, this function returns 0
and properly sets the have_ptrace_* flag. If the request fails,
this function calls perror_with_name. Otherwise, if the request
if (have_ptrace_getsetfpregs)
if (fetch_all_fp_regs (regcache, tid))
return;
-
+
/* If we've hit this point, it doesn't really matter which
architecture we are using. We just need to read the
registers in the "old-fashioned way". */
fetch_register (regcache, tid, tdep->ppc_fp0_regnum + i);
}
-static void
+static void
fetch_ppc_registers (struct regcache *regcache, int tid)
{
struct gdbarch *gdbarch = regcache->arch ();
if (regno == -1)
fetch_ppc_registers (regcache, tid);
- else
+ else
fetch_register (regcache, tid, regno);
}
ptrace (PTRACE_POKEUSER, tid, (PTRACE_TYPE_ARG3) regaddr, l);
regaddr += sizeof (long);
- if (errno == EIO
+ if (errno == EIO
&& (regno == tdep->ppc_fpscr_regnum
|| regno == PPC_ORIG_R3_REGNUM
|| regno == PPC_TRAP_REGNUM))
/* This function actually issues the request to ptrace, telling
it to store all general-purpose registers present in the specified
regset.
-
+
If the ptrace request does not exist, this function returns 0
and properly sets the have_ptrace_* flag. If the request fails,
this function calls perror_with_name. Otherwise, if the request
/* This function actually issues the request to ptrace, telling
it to store all floating-point registers present in the specified
regset.
-
+
If the ptrace request does not exist, this function returns 0
and properly sets the have_ptrace_* flag. If the request fails,
this function calls perror_with_name. Otherwise, if the request
{
struct gdbarch *gdbarch = regcache->arch ();
ppc_gdbarch_tdep *tdep = gdbarch_tdep<ppc_gdbarch_tdep> (gdbarch);
-
+
store_gp_regs (regcache, tid, -1);
if (tdep->ppc_fp0_regnum >= 0)
store_fp_regs (regcache, tid, -1);
return 0;
}
/* addr+len must fall in the 8 byte watchable region for DABR-based
- processors (i.e., server processors). Without the new PowerPC HWDEBUG
+ processors (i.e., server processors). Without the new PowerPC HWDEBUG
ptrace interface, DAC-based processors (i.e., embedded processors) will
use addresses aligned to 4-bytes due to the way the read/write flags are
passed in the old ptrace interface. */
actually called, the code in the PLT is hit and the function is
resolved. In order to better illustrate this, an example is in
order; the following example is from the gdb testsuite.
-
+
We start the program shmain.
[kev@arroyo testsuite]$ ../gdb gdb.base/shmain
Now run 'til main.
(gdb) r
- Starting program: gdb.base/shmain
+ Starting program: gdb.base/shmain
Breakpoint 1 at 0xffaf790: file gdb.base/shr1.c, line 19.
Breakpoint 2, main ()
ppc_linux_return_value (struct gdbarch *gdbarch, struct value *function,
struct type *valtype, struct regcache *regcache,
struct value **read_value, const gdb_byte *writebuf)
-{
+{
gdb_byte *readbuf = nullptr;
if (read_value != nullptr)
{
static struct tramp_frame ppc32_linux_sigaction_tramp_frame = {
SIGTRAMP_FRAME,
4,
- {
+ {
{ 0x380000ac, ULONGEST_MAX }, /* li r0, 172 */
{ 0x44000002, ULONGEST_MAX }, /* sc */
{ TRAMP_SENTINEL_INSN },
static struct tramp_frame ppc32_linux_sighandler_tramp_frame = {
SIGTRAMP_FRAME,
4,
- {
+ {
{ 0x38000077, ULONGEST_MAX }, /* li r0,119 */
{ 0x44000002, ULONGEST_MAX }, /* sc */
{ TRAMP_SENTINEL_INSN },
static struct tramp_frame ppc64_linux_sighandler_tramp_frame = {
SIGTRAMP_FRAME,
4,
- {
+ {
{ 0x38210080, ULONGEST_MAX }, /* addi r1,r1,128 */
{ 0x38000077, ULONGEST_MAX }, /* li r0,119 */
{ 0x44000002, ULONGEST_MAX }, /* sc */
set_gdbarch_skip_solib_resolver (gdbarch, glibc_skip_solib_resolver);
}
-
+
if (tdep->wordsize == 8)
{
if (tdep->elf_abi == POWERPC_ELF_V1)
10000388: 7d 69 03 a6 mtctr r11
1000038c: e8 42 80 80 ld r2,-32640(r2)
10000390: 28 22 00 00 cmpldi r2,0
- 10000394: 4c e2 04 20 bnectr+
+ 10000394: 4c e2 04 20 bnectr+
10000398: 48 00 03 a0 b 10000738 <printf@plt>
- But since this is the first time that PLT entry has been used, it
/* Check if ADDR points to a function descriptor. */
if (s && strcmp (s->the_bfd_section->name, ".opd") == 0)
{
- /* There may be relocations that need to be applied to the .opd
+ /* There may be relocations that need to be applied to the .opd
section. Unfortunately, this function may be called at a time
where these relocations have not yet been performed -- this can
happen for example shortly after a library has been loaded with
CORE_ADDR name_location = 0;
struct obj_section *section = NULL;
const char *name_temp = "";
-
+
/* Let's say it is mapped (not unmapped). */
*unmapped = 0;
}
}
- /* Try to find the address in both the symbol table and the minsyms.
+ /* Try to find the address in both the symbol table and the minsyms.
In most cases, we'll prefer to use the symbol instead of the
minsym. However, there are cases (see below) where we'll choose
to use the minsym instead. */
if (msymbol.minsym != NULL)
{
/* Use the minsym if no symbol is found.
-
+
Additionally, use the minsym instead of a (found) symbol if
the following conditions all hold:
1) The prefer_sym_over_minsym flag is false.
dont_repeat ();
}
-/* Display a single auto-display.
+/* Display a single auto-display.
Do nothing if the display cannot be printed in the current context,
or if the display is disabled. */
if (*s++ != '"')
error (_("Bad format string, non-terminated '\"'."));
-
+
s = skip_spaces (s);
if (*s != ',' && *s != 0)
break;
if (info_verbose)
- fprintf (procfs_file ? procfs_file : stdout,
+ fprintf (procfs_file ? procfs_file : stdout,
"%s:%d -- ", file, line);
switch (opcode) {
case PCSET:
- fprintf (procfs_file ? procfs_file : stdout,
- "write (PCSET, %s) %s\n",
+ fprintf (procfs_file ? procfs_file : stdout,
+ "write (PCSET, %s) %s\n",
arg[1] == PR_FORK ? "PR_FORK" :
arg[1] == PR_RLC ? "PR_RLC" :
arg[1] == PR_ASYNC ? "PR_ASYNC" :
info_verbose ? rw_table[i].desc : "");
break;
case PCUNSET:
- fprintf (procfs_file ? procfs_file : stdout,
- "write (PCRESET, %s) %s\n",
+ fprintf (procfs_file ? procfs_file : stdout,
+ "write (PCRESET, %s) %s\n",
arg[1] == PR_FORK ? "PR_FORK" :
arg[1] == PR_RLC ? "PR_RLC" :
arg[1] == PR_ASYNC ? "PR_ASYNC" :
info_verbose ? rw_table[i].desc : "");
break;
case PCSTRACE:
- fprintf (procfs_file ? procfs_file : stdout,
+ fprintf (procfs_file ? procfs_file : stdout,
"write (PCSTRACE) ");
proc_prettyfprint_signalset (procfs_file ? procfs_file : stdout,
(sigset_t *) &arg[1], 0);
break;
case PCSFAULT:
- fprintf (procfs_file ? procfs_file : stdout,
+ fprintf (procfs_file ? procfs_file : stdout,
"write (PCSFAULT) ");
proc_prettyfprint_faultset (procfs_file ? procfs_file : stdout,
(fltset_t *) &arg[1], 0);
break;
case PCSENTRY:
- fprintf (procfs_file ? procfs_file : stdout,
+ fprintf (procfs_file ? procfs_file : stdout,
"write (PCSENTRY) ");
proc_prettyfprint_syscalls (procfs_file ? procfs_file : stdout,
(sysset_t *) &arg[1], 0);
break;
case PCSEXIT:
- fprintf (procfs_file ? procfs_file : stdout,
+ fprintf (procfs_file ? procfs_file : stdout,
"write (PCSEXIT) ");
proc_prettyfprint_syscalls (procfs_file ? procfs_file : stdout,
(sysset_t *) &arg[1], 0);
break;
case PCSHOLD:
- fprintf (procfs_file ? procfs_file : stdout,
+ fprintf (procfs_file ? procfs_file : stdout,
"write (PCSHOLD) ");
proc_prettyfprint_signalset (procfs_file ? procfs_file : stdout,
(sigset_t *) &arg[1], 0);
break;
case PCSSIG:
- fprintf (procfs_file ? procfs_file : stdout,
+ fprintf (procfs_file ? procfs_file : stdout,
"write (PCSSIG) ");
proc_prettyfprint_signal (procfs_file ? procfs_file : stdout,
- arg[1] ? ((siginfo_t *) &arg[1])->si_signo
- : 0,
+ arg[1] ? ((siginfo_t *) &arg[1])->si_signo
+ : 0,
0);
fprintf (procfs_file ? procfs_file : stdout, "\n");
break;
case PCRUN:
- fprintf (procfs_file ? procfs_file : stdout,
+ fprintf (procfs_file ? procfs_file : stdout,
"write (PCRUN) ");
if (arg[1] & PRCSIG)
fprintf (procfs_file ? procfs_file : stdout, "clearSig ");
fprintf (procfs_file ? procfs_file : stdout, "syscallAbort ");
if (arg[1] & PRSTOP)
fprintf (procfs_file ? procfs_file : stdout, "stopReq ");
-
+
fprintf (procfs_file ? procfs_file : stdout, "\n");
break;
case PCKILL:
- fprintf (procfs_file ? procfs_file : stdout,
+ fprintf (procfs_file ? procfs_file : stdout,
"write (PCKILL) ");
proc_prettyfprint_signal (procfs_file ? procfs_file : stdout,
arg[1], 0);
default:
{
if (rw_table[i].name)
- fprintf (procfs_file ? procfs_file : stdout,
- "write (%s) %s\n",
- rw_table[i].name,
+ fprintf (procfs_file ? procfs_file : stdout,
+ "write (%s) %s\n",
+ rw_table[i].name,
info_verbose ? rw_table[i].desc : "");
else
{
if (lseek_offset != -1)
- fprintf (procfs_file ? procfs_file : stdout,
- "write (<unknown>, %lud bytes at 0x%08lx) \n",
+ fprintf (procfs_file ? procfs_file : stdout,
+ "write (<unknown>, %lud bytes at 0x%08lx) \n",
(unsigned long) len, (unsigned long) lseek_offset);
else
- fprintf (procfs_file ? procfs_file : stdout,
- "write (<unknown>, %lud bytes) \n",
+ fprintf (procfs_file ? procfs_file : stdout,
+ "write (<unknown>, %lud bytes) \n",
(unsigned long) len);
}
break;
ret = write (fd, (void *) arg, len);
if (procfs_trace && ret != len)
{
- fprintf (procfs_file ? procfs_file : stdout,
+ fprintf (procfs_file ? procfs_file : stdout,
"[write (%s) FAILED! (%s)]\n",
- rw_table[i].name != NULL ?
- rw_table[i].name : "<unknown>",
+ rw_table[i].name != NULL ?
+ rw_table[i].name : "<unknown>",
safe_strerror (errno));
if (procfs_file)
fflush (procfs_file);
lseek_offset = ret;
if (procfs_trace && (ret == -1 || errno != 0))
{
- fprintf (procfs_file ? procfs_file : stdout,
- "[lseek (0x%08lx) FAILED! (%s)]\n",
+ fprintf (procfs_file ? procfs_file : stdout,
+ "[lseek (0x%08lx) FAILED! (%s)]\n",
(unsigned long) offset, safe_strerror (errno));
if (procfs_file)
fflush (procfs_file);
if (procfs_trace)
{
if (info_verbose)
- fprintf (procfs_file ? procfs_file : stdout,
+ fprintf (procfs_file ? procfs_file : stdout,
"%s:%d -- ", file, line);
if (errno)
{
- fprintf (procfs_file ? procfs_file : stdout,
- "[open FAILED! (%s) line %d]\\n",
+ fprintf (procfs_file ? procfs_file : stdout,
+ "[open FAILED! (%s) line %d]\\n",
safe_strerror (errno), line);
}
else
{
- fprintf (procfs_file ? procfs_file : stdout,
+ fprintf (procfs_file ? procfs_file : stdout,
"%d = open (%s, ", ret, filename);
if (mode == O_RDONLY)
fprintf (procfs_file ? procfs_file : stdout, "O_RDONLY) %d\n",
if (procfs_trace)
{
if (info_verbose)
- fprintf (procfs_file ? procfs_file : stdout,
+ fprintf (procfs_file ? procfs_file : stdout,
"%s:%d -- ", file, line);
if (errno)
- fprintf (procfs_file ? procfs_file : stdout,
+ fprintf (procfs_file ? procfs_file : stdout,
"[close FAILED! (%s)]\n", safe_strerror (errno));
else
- fprintf (procfs_file ? procfs_file : stdout,
+ fprintf (procfs_file ? procfs_file : stdout,
"%d = close (%d)\n", ret, fd);
if (procfs_file)
fflush (procfs_file);
if (procfs_trace)
{
if (info_verbose)
- fprintf (procfs_file ? procfs_file : stdout,
+ fprintf (procfs_file ? procfs_file : stdout,
"%s:%d -- ", file, line);
- fprintf (procfs_file ? procfs_file : stdout,
+ fprintf (procfs_file ? procfs_file : stdout,
"wait (line %d) ", line);
if (procfs_file)
fflush (procfs_file);
if (procfs_trace)
{
if (errno)
- fprintf (procfs_file ? procfs_file : stdout,
+ fprintf (procfs_file ? procfs_file : stdout,
"[wait FAILED! (%s)]\n", safe_strerror (errno));
else
- fprintf (procfs_file ? procfs_file : stdout,
+ fprintf (procfs_file ? procfs_file : stdout,
"returned pid %d, status 0x%x\n", ret, lstat);
if (procfs_file)
fflush (procfs_file);
if (procfs_trace)
{
if (info_verbose)
- fprintf (procfs_file ? procfs_file : stdout,
+ fprintf (procfs_file ? procfs_file : stdout,
"%s:%d -- ", file, line);
fprintf (procfs_file ? procfs_file : stdout, "%s", msg);
if (procfs_file)
fprintf (procfs_file ? procfs_file : stdout,
"Thread %d: ", thread);
- proc_prettyfprint_flags (procfs_file ? procfs_file : stdout,
+ proc_prettyfprint_flags (procfs_file ? procfs_file : stdout,
flags, 0);
if (flags & (PR_STOPPED | PR_ISTOP))
- proc_prettyfprint_why (procfs_file ? procfs_file : stdout,
+ proc_prettyfprint_why (procfs_file ? procfs_file : stdout,
why, what, 0);
if (procfs_file)
fflush (procfs_file);
other signals second, with signals in each block ordered by their
numerical values on a typical POSIX platform. */
-static struct trans signal_table[] =
+static struct trans signal_table[] =
{
- { 0, "<no signal>", "no signal" },
+ { 0, "<no signal>", "no signal" },
/* SIGINT, SIGILL, SIGABRT, SIGFPE, SIGSEGV and SIGTERM
are ANSI-standard signals and are always available. */
return;
}
- fprintf (file, "Unknown hardware fault %d%c",
+ fprintf (file, "Unknown hardware fault %d%c",
faultno, verbose ? '\n' : ' ');
}
/*
* Pretty-print the prstatus flags.
- *
+ *
* Arguments: unsigned long flags, int verbose
*
*/
/* From proc-why.c */
/*
- * Pretty-print functions for /proc data
+ * Pretty-print functions for /proc data
*/
extern void proc_prettyprint_why (unsigned long why, unsigned long what,
extern void proc_prettyfprint_flags (FILE *file, unsigned long flags,
int verbose);
-extern void proc_prettyfprint_why (FILE *file, unsigned long why,
+extern void proc_prettyfprint_why (FILE *file, unsigned long why,
unsigned long what, int verbose);
extern void proc_prettyfprint_fault (FILE *file, int faultno, int verbose);
static struct trans pr_why_table[] =
{
- { PR_REQUESTED, "PR_REQUESTED",
+ { PR_REQUESTED, "PR_REQUESTED",
"Directed to stop by debugger via P(IO)CSTOP or P(IO)CWSTOP" },
{ PR_SIGNALLED, "PR_SIGNALLED", "Receipt of a traced signal" },
{ PR_SYSENTRY, "PR_SYSENTRY", "Entry to a traced system call" },
{
cmp = PyObject_IsTrue (value);
if (cmp < 0 )
- return -1;
+ return -1;
if (cmp == 1)
self->value.autoboolval = AUTO_BOOLEAN_TRUE;
else
print_stack_unless_memory_error (stream);
/* Set a flag so we can know whether we printed all the
available elements. */
- else
+ else
done_flag = 1;
break;
}
Py_buffer_up buffer_up;
Py_buffer py_buf;
- if (PyObject_CheckBuffer (obj)
+ if (PyObject_CheckBuffer (obj)
&& PyObject_GetBuffer (obj, &py_buf, PyBUF_SIMPLE) == 0)
{
/* Got a buffer, py_buf, out of obj. Cause it to be released
# define PyType_Ready POISONED_PyType_Ready
#endif
-/* A class to manage lifecycle of Python objects for objects that are "owned"
+/* A class to manage lifecycle of Python objects for objects that are "owned"
by an objfile or a gdbarch. It keeps track of Python objects and when
the "owning" object (objfile or gdbarch) is about to be freed, ensures that
all Python objects "owned" by that object are properly invalidated.
on demand and it is deleted when owning object is about to be freed.
The storage class must provide two member types:
-
- * obj_type - the type of Python object whose lifecycle is managed.
- * val_type - the type of GDB structure the Python objects are
+
+ * obj_type - the type of Python object whose lifecycle is managed.
+ * val_type - the type of GDB structure the Python objects are
representing.
It must also provide following methods:
};
/* A "storage" implementation suitable for temporary (on-demand) objects. */
-template <typename P,
- typename V,
- V* P::*val_slot,
+template <typename P,
+ typename V,
+ V* P::*val_slot,
typename Invalidator = gdbpy_default_invalidator<P, V, val_slot>>
class gdbpy_tracking_registry_storage
{
{
gdb_assert (obj != nullptr && obj->*val_slot != nullptr);
- m_objects.insert (obj);
+ m_objects.insert (obj);
}
void remove (obj_type *obj)
gdb_assert (obj != nullptr && obj->*val_slot != nullptr);
gdb_assert (m_objects.contains (obj));
- m_objects.erase (obj);
+ m_objects.erase (obj);
}
~gdbpy_tracking_registry_storage ()
drops all their references the Python object is deallocated and removed
from storage.
*/
-template <typename P,
- typename V,
- V* P::*val_slot,
+template <typename P,
+ typename V,
+ V* P::*val_slot,
typename Invalidator = gdbpy_default_invalidator<P, V, val_slot>>
class gdbpy_memoizing_registry_storage
{
/* Call FUN for every file defined in OBJFILE whose symtab is
not already read in.
-
+
FUN is passed the file's FILENAME and the file's FULLNAME (if need_fullname
is true). */
virtual void map_symbol_filenames (objfile *objfile,
{
unsigned short num;
unsigned short len;
- union
+ union
{
gdb_byte *ptr;
gdb_byte buf[2 * sizeof (gdb_byte *)];
Each instruction that is added to the execution log is represented
by a variable number of list elements ('entries'). The instruction
- will have one "reg" entry for each register that is changed by
- executing the instruction (including the PC in every case). It
+ will have one "reg" entry for each register that is changed by
+ executing the instruction (including the PC in every case). It
will also have one "mem" entry for each memory change. Finally,
each instruction will have an "end" entry that separates it from
the changes associated with the next instruction. */
entry->u.mem.mem_entry_not_accessible = 1;
else
{
- if (target_write_memory (entry->u.mem.addr,
+ if (target_write_memory (entry->u.mem.addr,
record_full_get_loc (entry),
entry->u.mem.len))
{
to know about, so the wait method just records them and keeps
singlestepping.
- In replay mode, this function emulates the recorded execution log,
- one instruction at a time (forward or backward), and determines
+ In replay mode, this function emulates the recorded execution log,
+ one instruction at a time (forward or backward), and determines
where to stop. */
static ptid_t
registers_changed ();
reinit_frame_cache ();
-
+
thread_info *thr = inferior_thread ();
thr->set_stop_pc (regcache_read_pc (get_thread_regcache (thr)));
print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC, 1);
{
uint64_t ret;
- store_unsigned_integer ((gdb_byte *) &ret, sizeof (ret),
+ store_unsigned_integer ((gdb_byte *) &ret, sizeof (ret),
BFD_ENDIAN_BIG, input);
return ret;
}
{
uint32_t ret;
- store_unsigned_integer ((gdb_byte *) &ret, sizeof (ret),
+ store_unsigned_integer ((gdb_byte *) &ret, sizeof (ret),
BFD_ENDIAN_BIG, input);
return ret;
}
/* "record_full_restore" can only be called when record list is empty. */
gdb_assert (record_full_first.next == NULL);
-
+
if (record_debug)
gdb_printf (gdb_stdlog, "Restoring recording from core file.\n");
/* Write memaddr. */
addr = netorder64 (record_full_list->u.mem.addr);
- bfdcore_write (obfd.get (), osec, &addr,
+ bfdcore_write (obfd.get (), osec, &addr,
sizeof (addr), &bfd_offset);
/* Write memval. */
if (record_debug)
gdb_printf (gdb_stdlog,
" Writing record_full_end (1 + "
- "%lu + %lu bytes)\n",
+ "%lu + %lu bytes)\n",
(unsigned long) sizeof (signal),
(unsigned long) sizeof (count));
/* Write signal value. */
/* Return the size of register REGNUM. All registers should have only
one size. */
-
+
extern int register_size (struct gdbarch *gdbarch, int regnum);
using register_read_ftype
typedef void (supply_regset_ftype) (const struct regset *, struct regcache *,
int, const void *, size_t);
-typedef void (collect_regset_ftype) (const struct regset *,
+typedef void (collect_regset_ftype) (const struct regset *,
const struct regcache *,
int, void *, size_t);
return;
}
length = (size_t) num;
-
+
buffer = (gdb_byte *) xmalloc (length);
if (target_read_memory (ptrval, buffer, length) != 0)
{
remote_fileio_reply (remote, -1, FILEIO_EINVAL);
return;
}
-
+
ret = lseek (fd, offset, flag);
if (ret == (off_t) -1)
remote_fileio_ioerror (remote);
return;
}
-
+
/* 2. Parameter: Ptr to newpath / length incl. trailing zero */
if (remote_fileio_extract_ptr_w_len (&buf, &new_ptr, &new_len))
{
remote_fileio_ioerror (remote);
return;
}
-
+
/* Request oldpath using 'm' packet */
oldpath = (char *) alloca (old_len);
if (target_read_memory (old_ptr, (gdb_byte *) oldpath, old_len) != 0)
remote_fileio_ioerror (remote);
return;
}
-
+
/* Request newpath using 'm' packet */
newpath = (char *) alloca (new_len);
if (target_read_memory (new_ptr, (gdb_byte *) newpath, new_len) != 0)
remote_fileio_ioerror (remote);
return;
}
-
+
/* Only operate on regular files and directories. */
of = stat (oldpath, &ost);
nf = stat (newpath, &nst);
return;
}
statptr = (CORE_ADDR) lnum;
-
+
/* Request pathname using 'm' packet */
pathname = (char *) alloca (namelength);
if (target_read_memory (nameptr, (gdb_byte *) pathname, namelength) != 0)
return;
}
}
-
+
/* Check if system(3) has been explicitly allowed using the
`set remote system-call-allowed 1' command. If length is 0,
indicating a NULL parameter to the system call, return zero to
# The first args type checking statement; we need to insert our chunk of
# code that bypasses all the type checks if this is an error return, after
# which we're done until we get to the next function. Handily, the size
- # of mig's Reply structure is also the size of the alternate Request
+ # of mig's Reply structure is also the size of the alternate Request
# structure that we want to check for.
print "\tif (In0P->Head.msgh_size == sizeof (Reply)";
print "\t && ! (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)";
/* User interface:
reverse-step, reverse-next etc. */
-/* exec_reverse_once -- accepts an arbitrary gdb command (string),
+/* exec_reverse_once -- accepts an arbitrary gdb command (string),
and executes it with exec-direction set to 'reverse'.
Used to implement reverse-next etc. commands. */
RL78_NUM_PSEUDO_REGS = RL78_NUM_TOTAL_REGS - RL78_NUM_REGS
};
-#define RL78_SP_ADDR 0xffff8
+#define RL78_SP_ADDR 0xffff8
/* Architecture specific data. */
&& reg_nr <= RL78_BANK3_R7_REGNUM))
return tdep->rl78_int8;
else if (reg_nr == RL78_SP_REGNUM
- || (RL78_BANK0_RP0_PTR_REGNUM <= reg_nr
+ || (RL78_BANK0_RP0_PTR_REGNUM <= reg_nr
&& reg_nr <= RL78_BANK3_RP3_PTR_REGNUM))
return tdep->rl78_data_pointer;
else
&& opc.op[0].reg == RL78_Reg_SP
&& opc.op[1].type == RL78_Operand_Register)
{
- int rsrc = (bank * RL78_REGS_PER_BANK)
+ int rsrc = (bank * RL78_REGS_PER_BANK)
+ 2 * (opc.op[1].reg - RL78_Reg_AX);
reg[RL78_SP_REGNUM] = pv_add_constant (reg[RL78_SP_REGNUM], -1);
{
int i, offset = 0;
- for (i = tdep->ppc_vsr0_upper_regnum; i < tdep->ppc_vsr0_upper_regnum
+ for (i = tdep->ppc_vsr0_upper_regnum; i < tdep->ppc_vsr0_upper_regnum
+ 32; i++, offset += 8)
ppc_supply_reg (regcache, i, (const gdb_byte *) vsxregs, offset, 8);
return_val example( float, int);
- eabi:
+ eabi:
float in fp0, int in r3
offset of stack on overflow 8/16
for varargs, must go by type.
power open:
float in r3&r4, int in r5
- offset of stack on overflow different
- both:
+ offset of stack on overflow different
+ both:
return in r3 or f0. If no float, must study how gcc emulates floats;
pay attention to arg promotion.
- User may have to cast\args to handle promotion correctly
+ User may have to cast\args to handle promotion correctly
since gdb won't know if prototype supplied or not. */
for (argno = 0, argbytes = 0; argno < nargs && ii < 8; ++ii)
/* Stack pointer must be quadword aligned. */
sp &= -16;
- /* If there are more arguments, allocate space for them in
+ /* If there are more arguments, allocate space for them in
the stack, then push them starting from the ninth one. */
if ((argno < nargs) || argbytes)
regcache_raw_write_signed (regcache,
gdbarch_sp_regnum (gdbarch), sp);
- /* If the last argument copied into the registers didn't fit there
+ /* If the last argument copied into the registers didn't fit there
completely, push the rest of it into stack. */
if (argbytes)
std::vector<CORE_ADDR> next_pcs = ppc_deal_with_atomic_sequence (regcache);
if (!next_pcs.empty ())
return next_pcs;
-
+
/* Here 0xfc000000 is the opcode mask to detect a P10 prefix instruction. */
if ((insn & 0xfc000000) == 1 << 26)
breaks[0] = loc + 2 * PPC_INSN_SIZE;
spe_register_p (struct gdbarch *gdbarch, int regno)
{
ppc_gdbarch_tdep *tdep = gdbarch_tdep<ppc_gdbarch_tdep> (gdbarch);
-
+
/* Is it a reference to EV0 -- EV31, and do we have those? */
if (IS_SPE_PSEUDOREG (tdep, regno))
return 1;
/* General-purpose registers. */
for (i = 0; i < ppc_num_gprs; i++)
set_sim_regno (sim_regno, tdep->ppc_gp0_regnum + i, sim_ppc_r0_regnum + i);
-
+
/* Floating-point registers. */
if (tdep->ppc_fp0_regnum >= 0)
for (i = 0; i < ppc_num_fprs; i++)
Write the register to REGCACHE. */
void
-ppc_supply_reg (struct regcache *regcache, int regnum,
+ppc_supply_reg (struct regcache *regcache, int regnum,
const gdb_byte *regs, size_t offset, int regsize)
{
if (regnum != -1 && offset != -1)
regcache->raw_collect (regnum, regs + offset);
}
}
-
+
static int
ppc_greg_offset (struct gdbarch *gdbarch,
ppc_gdbarch_tdep *tdep,
int insn = read_memory_integer (loc, PPC_INSN_SIZE, byte_order);
int insn_count;
int index;
- int last_breakpoint = 0; /* Defaults to 0 (no breakpoints placed). */
+ int last_breakpoint = 0; /* Defaults to 0 (no breakpoints placed). */
const int atomic_sequence_length = 16; /* Instruction sequence length. */
int bc_insn_count = 0; /* Conditional branch instruction count. */
if (!IS_LOAD_AND_RESERVE_INSN (insn))
return {};
- /* Assume that no atomic sequence is longer than "atomic_sequence_length"
+ /* Assume that no atomic sequence is longer than "atomic_sequence_length"
instructions. */
for (insn_count = 0; insn_count < atomic_sequence_length; ++insn_count)
{
insn = read_memory_integer (loc, PPC_INSN_SIZE, byte_order);
/* Assume that there is at most one conditional branch in the atomic
- sequence. If a conditional branch is found, put a breakpoint in
+ sequence. If a conditional branch is found, put a breakpoint in
its destination address. */
if ((insn & OP_MASK) == BC_INSN)
{
if (bc_insn_count >= 1)
return {}; /* More than one conditional branch found, fallback
to the standard single-step code. */
-
+
if (absolute)
breaks[1] = immediate;
else
return (rx_regno >= 3 && rx_regno <= 10);
}
-
+
/* Save a General Purpose Register on stack via the Frame Pointer. */
if (framep &&
/* Assuming that INSN is a "bl" instruction located at PC, return
nonzero if the destination of the branch is a "blrl" instruction.
-
+
This sequence is sometimes found in certain function prologues.
It allows the function to load the LR register with a value that
they can use to access PIC data using PC-relative offsets. */
The former is anded with the opcode in question; if the result of
this masking operation is equal to BL_INSTRUCTION, then the opcode in
question is a ``bl'' instruction.
-
+
BL_DISPLACEMENT_MASK is anded with the opcode in order to extract
the branch displacement. */
of each function prologue when compiling with -fstack-check. If one of
such sequences starts at START_PC, then return the address of the
instruction immediately past this sequence. Otherwise, return START_PC. */
-
+
static CORE_ADDR
rs6000_skip_stack_check (struct gdbarch *gdbarch, const CORE_ADDR start_pc)
{
/* First possible sequence: A small number of probes.
stw 0, -<some immediate>(1)
[repeat this instruction any (small) number of times]. */
-
+
if ((op & 0xffff0000) == 0x90010000)
{
while ((op & 0xffff0000) == 0x90010000)
op = rs6000_fetch_instruction (gdbarch, pc);
if ((op & 0xffff0000) != 0x3d800000)
break;
-
+
/* lwz 12,<some immediate>(12) */
pc = pc + 4;
op = rs6000_fetch_instruction (gdbarch, pc);
continue;
}
else if (op == 0x48000005)
- { /* bl .+4 used in
+ { /* bl .+4 used in
-mrelocatable */
fdata->used_bl = 1;
continue;
}
else if ((op & 0xfc000001) == 0x48000001)
- { /* bl foo,
+ { /* bl foo,
to save fprs??? */
fdata->frameless = 0;
was part of the function prologue. */
if (op == 0x4def7b82 || op == 0) /* crorc 15, 15, 15 */
- break; /* Don't skip over
+ break; /* Don't skip over
this branch. */
fdata->used_bl = 1;
record this insn as part of the prologue yet. */
prev_insn_was_prologue_insn = 0;
}
- /* Store vector register S at (r31+r0) aligned to 16 bytes. */
+ /* Store vector register S at (r31+r0) aligned to 16 bytes. */
/* 011111 sssss 11111 00000 00111001110 */
else if ((op & 0xfc1fffff) == 0x7c1f01ce) /* stvx Vs, R31, R0 */
{
{
struct gdbarch *gdbarch = get_frame_arch (frame);
gdb_byte from[PPC_MAX_REGISTER_SIZE];
-
+
gdb_assert (type->code () == TYPE_CODE_FLT);
/* We have an IEEE 128-bit float -- need to change regnum mapping from
else
switch (num)
{
- case 64:
+ case 64:
return tdep->ppc_mq_regnum;
case 65:
return tdep->ppc_lr_regnum;
- case 66:
+ case 66:
return tdep->ppc_ctr_regnum;
- case 76:
+ case 76:
return tdep->ppc_xer_regnum;
case 109:
return tdep->ppc_vrsave_regnum;
return tdep->ppc_acc_regnum;
case 112:
return tdep->ppc_spefscr_regnum;
- default:
+ default:
return num;
}
}
/* Handles single stepping of atomic sequences. */
set_gdbarch_get_next_pcs (gdbarch, ppc_deal_with_atomic_sequence);
-
+
/* Not sure on this. FIXMEmgo */
set_gdbarch_frame_args_skip (gdbarch, 8);
case TYPE_CODE_PTR:
{
LONGEST low_bound, high_bound;
-
+
if (type->target_type ()->code () == TYPE_CODE_ARRAY
&& rust_u8_type_p (type->target_type ()->target_type ())
&& get_array_bounds (type->target_type (), &low_bound,
struct type *type = rust_lookup_type (path.c_str ());
if (type == nullptr)
error (_("Could not find type '%s'"), path.c_str ());
-
+
return parse_struct_expr (type);
}
else if (current_token == '(')
/* No cached value; scan the function. The frame type is cached in
rx_analyze_prologue / rx_analyze_frame_prologue. */
-
+
pc = get_frame_pc (this_frame);
-
+
/* Attempt to find the last address in the function. If it cannot
be determined, set the limit to be a short ways past the frame's
pc. */
void *
sentinel_frame_cache (struct regcache *regcache)
{
- struct frame_unwind_cache *cache =
+ struct frame_unwind_cache *cache =
FRAME_OBSTACK_ZALLOC (struct frame_unwind_cache);
cache->regcache = regcache;
if (timeout > 0)
timeout -= delta;
- /* If we got a character or an error back from wait_for, then we can
+ /* If we got a character or an error back from wait_for, then we can
break from the loop before the timeout is completed. */
if (status != SERIAL_TIMEOUT)
break;
return SERIAL_EOF;
else
/* Got an error from read. */
- return SERIAL_ERROR;
+ return SERIAL_ERROR;
}
scb->bufcnt = status;
}
void
-ser_base_print_tty_state (struct serial *scb,
+ser_base_print_tty_state (struct serial *scb,
serial_ttystate ttystate,
struct ui_file *stream)
{
the started state, or that we exit this thread. */
wait_events[0] = state->start_select;
wait_events[1] = state->exit_select;
- if (WaitForMultipleObjects (2, wait_events, FALSE, INFINITE)
+ if (WaitForMultipleObjects (2, wait_events, FALSE, INFINITE)
!= WAIT_OBJECT_0)
/* Either the EXIT_SELECT event was signaled (requesting that the
thread exit) or an error has occurred. In either case, we exit
the thread. */
ExitThread (0);
-
+
/* We are now in the started state. */
SetEvent (state->have_started);
}
struct net_windows_state
{
struct ser_console_state base;
-
+
HANDLE sock_event;
};
fork() due to the fact that autoconf will ``#define vfork fork''
on certain platforms. */
pid = vfork ();
-
+
/* Error. */
if (pid == -1)
{
struct timeval t;
int n;
- /* While we wait for the connect to complete,
- poll the UI so it can update or the user can
+ /* While we wait for the connect to complete,
+ poll the UI so it can update or the user can
interrupt. */
if (deprecated_ui_loop_hook && deprecated_ui_loop_hook (0))
{
#define GDB_SER_UNIX_H
extern int ser_unix_read_prim (struct serial *scb, size_t count);
-extern int ser_unix_write_prim (struct serial *scb, const void *buf,
+extern int ser_unix_write_prim (struct serial *scb, const void *buf,
size_t count);
#endif /* GDB_SER_UNIX_H */
/* Write a printf style string onto the serial port. */
-extern void serial_printf (struct serial *desc,
+extern void serial_printf (struct serial *desc,
const char *,...) ATTRIBUTE_PRINTF (2, 3);
/* Allow pending output to drain. */
immediately forwarded to gdb_stderr. This may be -1.
If != -1, this descriptor should be non-blocking or
ops->avail should be non-NULL. */
- int error_fd;
+ int error_fd;
const struct serial_ops *ops; /* Function vector */
void *state; /* Local context info for open FD */
serial_ttystate ttystate; /* Not used (yet) */
/* Instruction patterns. */
#define SH_MOVW 0x9305
#define SH_TRAP 0xc300
-#define SH_OR_R0_R0 0x200b
+#define SH_OR_R0_R0 0x200b
/* SH sigreturn syscall numbers. */
#define SH_NR_SIGRETURN 0x0077
static const char sh_cc_renesas[] = "renesas";
static const char *const sh_cc_enum[] = {
sh_cc_gcc,
- sh_cc_renesas,
+ sh_cc_renesas,
NULL
};
the return value from foo() will be in memory, not
in R0, because there is no 3-byte integer type.
- Similarly, in
+ Similarly, in
struct s { char c[2]; } wibble;
struct s foo(void) { return wibble; }
manner, but using FP registers instead of GP registers.
Arguments that are smaller than 4 bytes will still take up a whole
- register or a whole 32-bit word on the stack, and will be
+ register or a whole 32-bit word on the stack, and will be
right-justified in the register or the stack word. This includes
chars, shorts, and small aggregate types.
- Arguments that are larger than 4 bytes may be split between two or
+ Arguments that are larger than 4 bytes may be split between two or
more registers. If there are not enough registers free, an argument
may be passed partly in a register (or registers), and partly on the
stack. This includes doubles, long longs, and larger aggregates.
- As far as I know, there is no upper limit to the size of aggregates
- that will be passed in this way; in other words, the convention of
+ As far as I know, there is no upper limit to the size of aggregates
+ that will be passed in this way; in other words, the convention of
passing a pointer to a large aggregate instead of a copy is not used.
MVS: The above appears to be true for the SH variants that do not
if it is larger than 16 bytes (four GP registers).
An exceptional case exists for struct arguments (and possibly other
- aggregates such as arrays) if the size is larger than 4 bytes but
- not a multiple of 4 bytes. In this case the argument is never split
+ aggregates such as arrays) if the size is larger than 4 bytes but
+ not a multiple of 4 bytes. In this case the argument is never split
between the registers and the stack, but instead is copied in its
- entirety onto the stack, AND also copied into as many registers as
- there is room for. In other words, space in registers permitting,
+ entirety onto the stack, AND also copied into as many registers as
+ there is room for. In other words, space in registers permitting,
two copies of the same argument are passed in. As far as I can tell,
- only the one on the stack is used, although that may be a function
+ only the one on the stack is used, although that may be a function
of the level of compiler optimization. I suspect this is a compiler
- bug. Arguments of these odd sizes are left-justified within the
- word (as opposed to arguments smaller than 4 bytes, which are
+ bug. Arguments of these odd sizes are left-justified within the
+ word (as opposed to arguments smaller than 4 bytes, which are
right-justified).
- If the function is to return an aggregate type such as a struct, it
- is either returned in the normal return value register R0 (if its
+ If the function is to return an aggregate type such as a struct, it
+ is either returned in the normal return value register R0 (if its
size is no greater than one byte), or else the caller must allocate
space into which the callee will copy the return value (if the size
- is greater than one byte). In this case, a pointer to the return
- value location is passed into the callee in register R2, which does
+ is greater than one byte). In this case, a pointer to the return
+ value location is passed into the callee in register R2, which does
not displace any of the other arguments passed in via registers R4
to R7. */
/* This function returns the next register to use for float arg passing.
It returns either a valid value between FLOAT_ARG0_REGNUM and
- FLOAT_ARGLAST_REGNUM if a register is available, otherwise it returns
+ FLOAT_ARGLAST_REGNUM if a register is available, otherwise it returns
FLOAT_ARGLAST_REGNUM + 1 to indicate that no register is available.
Note that register number 0 in flt_argreg_array corresponds with the
/* On the sh4, the DRi pseudo registers are problematic if the target
is little endian. When the user writes one of those registers, for
instance with 'set var $dr0=1', we want the double to be stored
- like this:
- fr0 = 0x00 0x00 0xf0 0x3f
- fr1 = 0x00 0x00 0x00 0x00
+ like this:
+ fr0 = 0x00 0x00 0xf0 0x3f
+ fr1 = 0x00 0x00 0x00 0x00
This corresponds to little endian byte order & big endian word
order. However if we let gdb write the register w/o conversion, it
fr0 = 0x00 0x00 0x00 0x00
fr1 = 0x00 0x00 0xf0 0x3f
because it will consider fr0 and fr1 as a single LE stretch of memory.
-
+
To achieve what we want we must force gdb to store things in
floatformat_ieee_double_littlebyte_bigword (which is defined in
include/floatformat.h and libiberty/floatformat.c.
_("SH specific commands."),
&setshcmdlist, &showshcmdlist,
&setlist, &showlist);
-
+
add_setshow_enum_cmd ("calling-convention", class_vars, sh_cc_enum,
&sh_active_calling_convention,
_("Set calling convention used when calling target "
lm->dyn_relocs = (arelent **) xmalloc (storage_needed);
/* Fetch the dynamic relocs. */
- lm->dyn_reloc_count
+ lm->dyn_reloc_count
= bfd_canonicalize_dynamic_reloc (abfd, lm->dyn_relocs, lm->dyn_syms);
}
{
reload_shared_libraries_1 (from_tty);
- /* Creating inferior hooks here has two purposes. First, if we reload
+ /* Creating inferior hooks here has two purposes. First, if we reload
shared libraries then the address of solib breakpoint we've computed
previously might be no longer valid. For example, if we forgot to set
solib-absolute-prefix and are setting it right now, then the previous
breakpoint address is plain wrong. Second, installing solib hooks
also implicitly figures were ld.so is and loads symbols for it.
- Absent this call, if we've just connected to a target and set
+ Absent this call, if we've just connected to a target and set
solib-absolute-prefix or solib-search-path, we'll lose all information
about ld.so. */
if (target_has_execution ())
}
/* See source.h. */
-
+
symtab_and_line
get_current_source_symtab_and_line (program_space *pspace)
{
cursal.line = loc->line ();
cursal.pc = 0;
cursal.end = 0;
-
+
return cursal;
}
process of determining a new default may call the caller!
Use get_current_source_symtab_and_line only to get whatever
we have without erroring out or trying to get a default. */
-
+
void
set_default_source_symtab_and_line (void)
{
(the returned sal pc and end fields are not valid.)
and set the current default to whatever is in SAL.
NOTE: The returned sal pc and end fields are not valid. */
-
+
struct symtab_and_line
set_current_source_symtab_and_line (const symtab_and_line &sal)
{
/* Open a source file given a symtab S. Returns a file descriptor or
negative errno for error.
-
+
This function is a convenience function to find_and_open_source. */
scoped_fd
if (s->fullname () == nullptr)
s->set_fullname (std::move (fullname));
}
- }
+ }
return s->fullname ();
}
show_substitute_path_command (const char *args, int from_tty)
{
char *from = NULL;
-
+
gdb_argv argv (args);
/* We expect zero or one argument. */
#ifdef HAVE_STRUCT_REG
typedef struct reg gregset_t;
typedef struct fpreg fpregset_t;
-#else
+#else
typedef struct regs gregset_t;
typedef struct fp_status fpregset_t;
#endif
sparc_is_unimp_insn (CORE_ADDR pc)
{
const unsigned long insn = sparc_fetch_instruction (pc);
-
+
return ((insn & 0xc1c00000) == 0);
}
of each function prologue when compiling with -fstack-check. If one of
such sequences starts at START_PC, then return the address of the
instruction immediately past this sequence. Otherwise, return START_PC. */
-
+
static CORE_ADDR
sparc_skip_stack_check (const CORE_ADDR start_pc)
{
/* We found a valid stack-check sequence, return the new PC. */
return pc;
}
-
+
/* Third sequence: A probing loop.
[first three instructions above]
sub %g1, %g4, %g4
/* If the program counter is zero, this is probably a core dump, and
we can get %pc from the stack. */
if (pcb->pcb_pc == 0)
- read_memory(pcb->pcb_sp + BIAS - 176 + (11 * 8),
+ read_memory(pcb->pcb_sp + BIAS - 176 + (11 * 8),
(gdb_byte *)&pcb->pcb_pc, sizeof pcb->pcb_pc);
regcache->raw_supply (SPARC_SP_REGNUM, &pcb->pcb_sp);
/* If the program counter is zero, this is probably a core dump, and
we can get %pc from the stack. */
if (pcb->pcb_pc == 0)
- read_memory(pcb->pcb_sp + BIAS - 176 + (11 * 8),
+ read_memory(pcb->pcb_sp + BIAS - 176 + (11 * 8),
(gdb_byte *)&pcb->pcb_pc, sizeof pcb->pcb_pc);
regcache->raw_supply (SPARC_SP_REGNUM, &pcb->pcb_sp);
code can handle both. */
\f
/* The M7 processor supports an Application Data Integrity (ADI) feature
- that detects invalid data accesses. When software allocates memory and
- enables ADI on the allocated memory, it chooses a 4-bit version number,
- sets the version in the upper 4 bits of the 64-bit pointer to that data,
- and stores the 4-bit version in every cacheline of the object. Hardware
- saves the latter in spare bits in the cache and memory hierarchy. On each
- load and store, the processor compares the upper 4 VA (virtual address) bits
+ that detects invalid data accesses. When software allocates memory and
+ enables ADI on the allocated memory, it chooses a 4-bit version number,
+ sets the version in the upper 4 bits of the 64-bit pointer to that data,
+ and stores the 4-bit version in every cacheline of the object. Hardware
+ saves the latter in spare bits in the cache and memory hierarchy. On each
+ load and store, the processor compares the upper 4 VA (virtual address) bits
to the cacheline's version. If there is a mismatch, the processor generates
a version mismatch trap which can be either precise or disrupting.
The trap is an error condition which the kernel delivers to the process
/* Get ADI info for process PID, creating one if it doesn't exist. */
-static sparc64_adi_info *
+static sparc64_adi_info *
get_adi_info_proc (pid_t pid)
{
auto found = std::find_if (adi_proc_list.begin (), adi_proc_list.end (),
}
}
-static adi_stat_t
+static adi_stat_t
get_adi_info (pid_t pid)
{
sparc64_adi_info *proc;
{
if ((*it).pid == pid)
{
- if ((*it).stat.tag_fd > 0)
+ if ((*it).stat.tag_fd > 0)
target_fileio_close ((*it).stat.tag_fd, &target_errno);
adi_proc_list.erase_after (pit);
break;
return addr;
}
-/* Align a normalized address - a VA with bit 59 sign extended into
+/* Align a normalized address - a VA with bit 59 sign extended into
ADI bits. */
static CORE_ADDR
char cl_name[MAX_PROC_NAME_SIZE];
snprintf (cl_name, sizeof(cl_name), "/proc/%ld/adi/tags", (long) pid);
fileio_error target_errno;
- proc->stat.tag_fd = target_fileio_open (NULL, cl_name, O_RDWR|O_EXCL,
+ proc->stat.tag_fd = target_fileio_open (NULL, cl_name, O_RDWR|O_EXCL,
false, 0, &target_errno);
return proc->stat.tag_fd;
}
struct fn_fieldlist fn_fieldlist;
};
-/* The routines that read and process a complete stabs for a C struct or
+/* The routines that read and process a complete stabs for a C struct or
C++ class pass lists of data member fields and lists of member function
fields in an instance of a field_info structure, as defined below.
This is part of some reorganization of low level C++ support and is
return type;
}
-/* for all the stabs in a given stab vector, build appropriate types
+/* for all the stabs in a given stab vector, build appropriate types
and fix their symbols in given symbol vector. */
static void
if (stabs)
{
- /* for all the stab entries, find their corresponding symbols and
+ /* for all the stab entries, find their corresponding symbols and
patch their types! */
for (ii = 0; ii < stabs->count; ++ii)
return pst;
}
-/* Set namestring based on nlist. If the string table index is invalid,
+/* Set namestring based on nlist. If the string table index is invalid,
give a fake name, and print a single error message per symbol file read,
rather than abort the symbol reading or flood the user with messages. */
complaint (_("bad string table offset in symbol %d"),
symnum);
namestring = "<bad string table offset>";
- }
+ }
else
namestring = (nlist->n_strx + key->ctx.file_string_table_offset
+ DBX_STRINGTAB (objfile));
case N_DATA:
ms_type = mst_file_data;
- /* Check for __DYNAMIC, which is used by Sun shared libraries.
+ /* Check for __DYNAMIC, which is used by Sun shared libraries.
Record it as global even if it's local, not global, so
lookup_minimal_symbol can find it. We don't check symbol_leading_char
because for SunOS4 it always is '_'. */
/* Save the directory name SOs locally, then save it into
the psymtab when it's created below. */
dirname_nso = namestring;
- continue;
+ continue;
}
/* Some other compilers (C++ ones in particular) emit useless
}
/* Scan and build partial symbols for a symbol file.
- We have been initialized by a call to dbx_symfile_init, which
+ We have been initialized by a call to dbx_symfile_init, which
put all the relevant info into a "struct dbx_symfile_info",
hung off the objfile structure. */
#define VISIBILITY_PUBLIC '2' /* Stabs character for public field */
#define VISIBILITY_IGNORE '9' /* Optimized out or zero length */
-/* Structure for storing pointers to reference definitions for fast lookup
+/* Structure for storing pointers to reference definitions for fast lookup
during "process_later". */
struct ref_map
}
/* Create array of pointers mapping refids to symbols and stab strings.
- Add pointers to reference definition symbols and/or their values as we
+ Add pointers to reference definition symbols and/or their values as we
find them, using their reference numbers as our index.
These will be used later when we resolve references. */
void
ref_map = (struct ref_map *)
xrealloc (ref_map, REF_MAP_SIZE (ref_chunk + new_chunks));
- memset (ref_map + ref_chunk * MAX_CHUNK_REFS, 0,
+ memset (ref_map + ref_chunk * MAX_CHUNK_REFS, 0,
new_chunks * REF_CHUNK_SIZE);
ref_chunk += new_chunks;
}
return refnum;
}
-/* If STRING defines a reference, store away a pointer to the reference
+/* If STRING defines a reference, store away a pointer to the reference
definition for later use. Return the reference number. */
int
ind++;
p += 2;
}
- else if (*p)
+ else if (*p)
{
string_local[ind] = (gdb_byte) (*p);
ind++;
will be stored in the VAR_DOMAIN). If the symbol was indeed
defined as 'Tt' then the STRUCT_DOMAIN symbol will be created
elsewhere, so we don't need to take care of that.
-
+
This is important to do, because of forward references:
The cleanup of undefined types stored in undef_types only uses
STRUCT_DOMAIN symbols to perform the replacement. */
p++;
sym->set_type (read_type (&p, objfile));
-
+
/* For a nameless type, we don't want a create a symbol, thus we
did not use `sym'. Return without further processing. */
if (nameless)
tmp_sublist = tmp_sublist->next;
continue;
}
-
+
destr_fnlist->fn_fieldlist.fn_fields[i++]
= tmp_sublist->fn_field;
if (last_sublist)
/* Complain that the compiler has emitted more than one definition for the
structure type TYPE. */
-static void
+static void
complain_about_struct_wipeout (struct type *type)
{
const char *name = "";
/* Set the length for all variants of a same main_type, which are
connected in the closed chain.
-
+
This is something that needs to be done when a type is defined *after*
some cross references to this type have already been read. Consider
for instance the following scenario where we have the following two
OBJFILE points to the current objfile from which the stabs information is
being read. (Note that it is redundant in that TYPE also contains a pointer
- to this same objfile, so it might be a good idea to eliminate it. FIXME).
+ to this same objfile, so it might be a good idea to eliminate it. FIXME).
*/
static struct type *
scope? */
/* Add a type to the list of undefined types to be checked through
once this file has been read in.
-
+
In practice, we actually maintain two such lists: The first list
(UNDEF_TYPES) is used for types whose name has been provided, and
concerns forward references (eg 'xs' or 'xu' forward references);
1. It is a typedef in the STRUCT domain;
2. It has the same name, and same type code;
3. The instance flags are identical.
-
+
It is important to check the instance flags, because we have seen
examples where the debug info contained definitions such as:
just want to print their addresses. Print ??? for args whose
address we do not know. We pass 2 as "recurse" to val_print
because our standard indentation here is 4 spaces, and
- val_print indents 2 for each recurse. */
+ val_print indents 2 for each recurse. */
annotate_arg_value (arg->val->type ());
}
else
numargs = -1;
-
+
{
ui_out_emit_list list_emitter (uiout, "args");
try
if (print_what != SHORT_LOCATION && sal.symtab)
{
const char *filename_display;
-
+
filename_display = symtab_to_filename_for_display (sal.symtab);
annotate_frame_source_begin ();
uiout->wrap_hint (3);
RS = register suffix
RIP = register indirection prefix
RIS = register indirection suffix
-
+
Then a register operand can be:
-
+
[RIP] [RP] REGISTER [RS] [RIS]
This function takes care of a register's indirection, displacement and
*ptr++ = hexchars[sigval >> 4];
*ptr++ = hexchars[sigval & 0xf];
- *ptr++ = hexchars[ESP];
+ *ptr++ = hexchars[ESP];
*ptr++ = ':';
ptr = mem2hex((char *)®isters[ESP], ptr, 4, 0); /* SP */
*ptr++ = ';';
- *ptr++ = hexchars[EBP];
+ *ptr++ = hexchars[EBP];
*ptr++ = ':';
ptr = mem2hex((char *)®isters[EBP], ptr, 4, 0); /* FP */
*ptr++ = ';';
- *ptr++ = hexchars[PC];
+ *ptr++ = hexchars[PC];
*ptr++ = ':';
ptr = mem2hex((char *)®isters[PC], ptr, 4, 0); /* PC */
*ptr++ = ';';
term_flush ();
}
}
-
+
va_end (vargs);
}
}
static int
-output_callback (pthreadDebugClient_t context,
+output_callback (pthreadDebugClient_t context,
pthreadDebugConstString_t line)
{
term_puts (line);
}
static int
-error_callback (pthreadDebugClient_t context,
+error_callback (pthreadDebugClient_t context,
pthreadDebugConstString_t line)
{
term_puts (line);
(int *) &dbgext_func);
if (!(status & STS$M_SUCCESS))
LIB$SIGNAL (status);
-
+
status = lib$find_image_symbol
((void *) &pthread_rtl_desc, (void *) &dbgsymtable_desc,
(int *) &dbg_symtable);
unsigned int pos = QSUPPORTED_LEN;
pthreadDebugThreadInfo_t info;
int res;
-
+
/* Ignore gdb features. */
gdb_buf[0] = '$';
gdb_blen = 1;
int res;
unsigned __int64 val;
pthreadDebugThreadInfo_t info;
-
+
pos++;
val = pkt2val (pkt, &pos);
if (pos != len)
int res;
unsigned __int64 val;
unsigned int fthr, thr;
-
+
val = pkt2val (pkt, &pos);
/* Default is error (but only after parsing is complete). */
packet_error (0);
sub_desc.dsc$w_length = i - start;
for (j = 0; j < NBR_DEBUG_FLAGS; j++)
- if (str$case_blind_compare (&sub_desc,
+ if (str$case_blind_compare (&sub_desc,
(void *)&debug_flags[j].name) == 0)
{
debug_flags[j].val++;
imcb->imcb$t_log_image_name + 1,
imcb->imcb$t_log_image_name[0]))
has_threads = 1;
-
+
if (trace_images)
{
unsigned int j;
term_puts (flags & 0x08000000 ? " Shrd" : " ");
TERM_FAO (" !XA-!XA!/",
ldrisd[j].ldrisd$p_base,
- (unsigned __int64) ldrisd[j].ldrisd$p_base
+ (unsigned __int64) ldrisd[j].ldrisd$p_base
+ ldrisd[j].ldrisd$i_len - 1);
}
ldrisd = ldrimg->ldrimg$l_dyn_seg;
if (ldrisd)
TERM_FAO (" dynamic !XA-!XA!/",
ldrisd->ldrisd$p_base,
- (unsigned __int64) ldrisd->ldrisd$p_base
+ (unsigned __int64) ldrisd->ldrisd$p_base
+ ldrisd->ldrisd$i_len - 1);
}
}
0x00, 0x00, 0x04, 0x00 };
unsigned int entry_prot;
unsigned int status;
-
+
status = page_set_rw (entry_pc, 16, &entry_prot);
if (!(status & STS$M_SUCCESS))
else
LIB$SIGNAL (status);
}
-
+
if (entry_pc != 0)
{
ots$move (entry_saved, 16, (void *)entry_pc);
/*****************************************************************************
* BUFMAX defines the maximum number of characters in inbound/outbound buffers
- * at least NUMREGBYTES*2 are needed for register packets
+ * at least NUMREGBYTES*2 are needed for register packets
*/
#define BUFMAX 400
}
else /* continuing, not single-stepping */
{
- /* OK, about to do a "continue". First check to see if the
- target pc is on an odd boundary (second instruction in the
- word). If so, we must do a single-step first, because
+ /* OK, about to do a "continue". First check to see if the
+ target pc is on an odd boundary (second instruction in the
+ word). If so, we must do a single-step first, because
ya can't jump or return back to an odd boundary! */
if ((registers[PC] & 2) != 0)
prepare_to_step (1);
case 'D': /* Detach */
#if 0
- /* I am interpreting this to mean, release the board from control
+ /* I am interpreting this to mean, release the board from control
by the remote stub. To do this, I am restoring the original
(or at least previous) exception vectors.
*/
/*
Table of branch instructions:
-
+
10B6 RTE return from trap or exception
1FCr JMP jump
1ECr JL jump and link
return 0;
}
-/* if address is NOT on a 4-byte boundary, or high-bit of instr is zero,
+/* if address is NOT on a 4-byte boundary, or high-bit of instr is zero,
then it's a 2-byte instruction, else it's a 4-byte instruction. */
#define INSTRUCTION_SIZE(addr) \
/* Function: prepare_to_step
Called from handle_exception to prepare the user program to single-step.
- Places a trap instruction after the target instruction, with special
- extra handling for branch instructions and for instructions in the
- second half-word of a word.
+ Places a trap instruction after the target instruction, with special
+ extra handling for branch instructions and for instructions in the
+ second half-word of a word.
- Returns: True if we should actually execute the instruction;
+ Returns: True if we should actually execute the instruction;
False if we are going to emulate executing the instruction,
- in which case we simply report to GDB that the instruction
+ in which case we simply report to GDB that the instruction
has already been executed. */
#define TRAP1 0x10f1; /* trap #1 instruction */
int branchCode = isBranch ((unsigned char *) pc);
unsigned char *p;
- /* zero out the stepping context
+ /* zero out the stepping context
(paranoia -- it should already be zeroed) */
for (p = (unsigned char *) &stepping;
p < ((unsigned char *) &stepping) + sizeof (stepping); p++)
stepping.trap1_save = *(unsigned short *) stepping.trap1_addr;
*(unsigned short *) stepping.trap1_addr = trap1;
}
- /* "continue_p" means that we are actually doing a continue, and not
+ /* "continue_p" means that we are actually doing a continue, and not
being requested to single-step by GDB. Sometimes we have to do
one single-step before continuing, because the PC is on a half-word
boundary. There's no way to simply resume at such an address. */
}
/* Function: finish_from_step
- Called from handle_exception to finish up when the user program
+ Called from handle_exception to finish up when the user program
returns from a single-step. Replaces the instructions that had
- been overwritten by traps or no-ops,
+ been overwritten by traps or no-ops,
Returns: True if we should notify GDB that the target stopped.
False if we only single-stepped because we had to before we
- could continue (ie. we were trying to continue at a
+ could continue (ie. we were trying to continue at a
half-word boundary). In that case don't notify GDB:
just "continue continuing". */
/****************************************************************************
- THIS SOFTWARE IS NOT COPYRIGHTED
-
+ THIS SOFTWARE IS NOT COPYRIGHTED
+
HP offers the following for use in the public domain. HP makes no
- warranty with regard to the software or it's performance and the
+ warranty with regard to the software or it's performance and the
user accepts the software "AS IS" with all faults.
HP DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD
****************************************************************************/
/****************************************************************************
- * Header: remcom.c,v 1.34 91/03/09 12:29:49 glenne Exp $
+ * Header: remcom.c,v 1.34 91/03/09 12:29:49 glenne Exp $
*
- * Module name: remcom.c $
+ * Module name: remcom.c $
* Revision: 1.34 $
* Date: 91/03/09 12:29:49 $
* Contributor: Lake Stevens Instrument Division$
- *
+ *
* Description: low level support for gdb debugger. $
*
* Considerations: only works on target hardware $
*
* Written by: Glenn Engel $
- * ModuleState: Experimental $
+ * ModuleState: Experimental $
*
* NOTES: See Below $
- *
+ *
* To enable debugger support, two things need to happen. One, a
* call to set_debug_traps() is necessary in order to allow any breakpoints
* or error conditions to be properly intercepted and reported to gdb.
* there either should be a standard breakpoint instruction, or the protocol
* should be extended to provide some means to communicate which breakpoint
* instruction is in use (or have the stub insert the breakpoint).
- *
+ *
* Some explanation is probably necessary to explain how exceptions are
* handled. When an exception is encountered the 68000 pushes the current
* program counter and status register onto the supervisor stack and then
* The handlers for the exception vectors are hardwired to jmp to an address
* given by the relation: (exception - 256) * 6. These are descending
* addresses starting from -6, -12, -18, ... By allowing 6 bytes for
- * each entry, a jsr, jmp, bsr, ... can be used to enter the exception
+ * each entry, a jsr, jmp, bsr, ... can be used to enter the exception
* handler. Using a jsr to handle an exception has an added benefit of
* allowing a single handler to service several exceptions and use the
* return address as the key differentiation. The vector number can be
* For 68020 machines, the ability to have a return address around just
* so the vector can be determined is not necessary because the '020 pushes an
* extra word onto the stack containing the vector offset
- *
+ *
* Because gdb will sometimes write to the stack area to execute function
* calls, this program cannot rely on using the supervisor stack so it
* uses its own stack area reserved in the int array remcomStack.
- *
+ *
*************
*
* The following gdb commands are supported:
- *
+ *
* command function Return value
- *
+ *
* g return the value of the CPU registers hex data or ENN
* G set the value of the CPU registers OK or ENN
- *
+ *
* mAA..AA,LLLL Read LLLL bytes at address AA..AA hex data or ENN
* MAA..AA,LLLL: Write LLLL bytes at address AA.AA OK or ENN
- *
+ *
* c Resume at current address SNN ( signal NN)
* cAA..AA Continue at address AA..AA SNN
- *
+ *
* s Step one instruction SNN
* sAA..AA Step one instruction from AA..AA SNN
- *
+ *
* k kill
*
* ? What was the last sigval ? SNN (signal NN)
- *
- * All commands and responses are sent with a packet which includes a
- * checksum. A packet consists of
- *
+ *
+ * All commands and responses are sent with a packet which includes a
+ * checksum. A packet consists of
+ *
* $<packet info>#<checksum>.
- *
+ *
* where
* <packet info> :: <characters representing the command or response>
* <checksum> :: < two hex digits computed as modulo 256 sum of <packetinfo>>
- *
+ *
* When a packet is received, it is first acknowledged with either '+' or '-'.
* '+' indicates a successful transfer. '-' indicates a failed transfer.
- *
+ *
* Example:
- *
+ *
* Host: Reply:
* $m0,10#2a +$00010203040506070809101112131415#42
- *
+ *
****************************************************************************/
#include <stdio.h>
/************************************************************************
*
- * external low-level support routines
+ * external low-level support routines
*/
typedef void (*ExceptionHook)(int); /* pointer to function with int parm */
typedef void (*Function)(); /* pointer to a function */
static char initialized; /* boolean flag. != 0 means we've been initialized */
int remote_debug;
-/* debug > 0 prints ill-formed commands in valid packets & checksum errors */
+/* debug > 0 prints ill-formed commands in valid packets & checksum errors */
static const char hexchars[]="0123456789abcdef";
/* there are 180 bytes of registers on a 68020 w/68881 */
/* many of the fpa registers are 12 byte (96 bit) registers */
#define NUMREGBYTES 180
-enum regnames {D0,D1,D2,D3,D4,D5,D6,D7,
- A0,A1,A2,A3,A4,A5,A6,A7,
+enum regnames {D0,D1,D2,D3,D4,D5,D6,D7,
+ A0,A1,A2,A3,A4,A5,A6,A7,
PS,PC,
FP0,FP1,FP2,FP3,FP4,FP5,FP6,FP7,
FPCONTROL,FPSTATUS,FPIADDR
/*
* In many cases, the system will want to continue exception processing
- * when a continue command is given.
+ * when a continue command is given.
* oldExceptionHook is a function to invoke in this case.
*/
/* do an fsave, then remember the address to begin a restore from */
#define SAVE_FP_REGS() asm(" fsave a0@-"); \
asm(" fmovemx fp0-fp7,_registers+72"); \
- asm(" fmoveml fpcr/fpsr/fpi,_registers+168");
+ asm(" fmoveml fpcr/fpsr/fpi,_registers+168");
#define RESTORE_FP_REGS() \
asm(" \n\
fmoveml _registers+168,fpcr/fpsr/fpi \n\
.text
.globl _return_to_super
_return_to_super:
- movel _registers+60,sp /* get new stack pointer */
- movel _lastFrame,a0 /* get last frame info */
+ movel _registers+60,sp /* get new stack pointer */
+ movel _lastFrame,a0 /* get last frame info */
bra return_to_any
.globl _return_to_user
_return_to_user:
- movel _registers+60,a0 /* get usp */
- movel a0,usp /* set usp */
- movel _superStack,sp /* get original stack pointer */
+ movel _registers+60,a0 /* get usp */
+ movel a0,usp /* set usp */
+ movel _superStack,sp /* get original stack pointer */
return_to_any:
- movel _lastFrame,a0 /* get last frame info */
- movel a0@+,_lastFrame /* link in previous frame */
- addql #8,a0 /* skip over pc, vector#*/
- movew a0@+,d0 /* get # of words in cpu frame */
- addw d0,a0 /* point to end of data */
- addw d0,a0 /* point to end of data */
- movel a0,a1
-#
-# copy the stack frame
- subql #1,d0
-copyUserLoop:
- movew a1@-,sp@-
- dbf d0,copyUserLoop
-");
- RESTORE_FP_REGS()
- asm(" moveml _registers,d0-d7/a0-a6");
- asm(" rte"); /* pop and go! */
+ movel _lastFrame,a0 /* get last frame info */
+ movel a0@+,_lastFrame /* link in previous frame */
+ addql #8,a0 /* skip over pc, vector#*/
+ movew a0@+,d0 /* get # of words in cpu frame */
+ addw d0,a0 /* point to end of data */
+ addw d0,a0 /* point to end of data */
+ movel a0,a1
+#
+# copy the stack frame
+ subql #1,d0
+copyUserLoop:
+ movew a1@-,sp@-
+ dbf d0,copyUserLoop
+");
+ RESTORE_FP_REGS()
+ asm(" moveml _registers,d0-d7/a0-a6");
+ asm(" rte"); /* pop and go! */
#define DISABLE_INTERRUPTS() asm(" oriw #0x0700,sr");
#define BREAKPOINT() asm(" trap #1");
asm(" andiw #0x700,d0
cmpiw #0x700,d0
beq _already7
- movew sp@+,d0
+ movew sp@+,d0
bra __catchException
_already7:
movew sp@+,d0");
* stack on entry: stack on exit:
* N bytes of junk exception # MSWord
* Exception Format Word exception # MSWord
- * Program counter LSWord
- * Program counter MSWord
- * Status Register
- *
- *
+ * Program counter LSWord
+ * Program counter MSWord
+ * Status Register
+ *
+ *
*/
-asm("
+asm("
.text
.globl __catchException
__catchException:");
moveml d0-d7/a0-a6,_registers /* save registers */
movel _lastFrame,a0 /* last frame pointer */
");
-SAVE_FP_REGS();
+SAVE_FP_REGS();
asm("
lea _registers,a5 /* get address of registers */
movew sp@,d1 /* get status register */
- movew d1,a5@(66) /* save sr */
+ movew d1,a5@(66) /* save sr */
movel sp@(2),a4 /* save pc in a4 for later use */
movel a4,a5@(68) /* save pc in _regisers[] */
movew d0,d2 /* make a copy of format word */
andiw #0xf000,d0 /* mask off format type */
rolw #5,d0 /* rotate into the low byte *2 */
- lea _exceptionSize,a1
+ lea _exceptionSize,a1
addw d0,a1 /* index into the table */
movew a1@,d0 /* get number of words in frame */
movew d0,d3 /* save it */
# save the a7 in use at time of exception
movel sp,_superStack /* save supervisor sp */
andiw #0x2000,d1 /* were we in supervisor mode ? */
- beq userMode
+ beq userMode
movel a7,a5@(60) /* save a7 */
bra a7saveDone
-userMode:
- movel usp,a1
+userMode:
+ movel usp,a1
movel a1,a5@(60) /* save user stack pointer */
a7saveDone:
/* This function is called when an exception occurs. It translates the
* return address found on the stack into an exception vector # which
* is then handled by either handle_exception or a system handler.
- * _catchException provides a front end for both.
+ * _catchException provides a front end for both.
*
* stack on entry: stack on exit:
- * Program counter MSWord exception # MSWord
+ * Program counter MSWord exception # MSWord
* Program counter LSWord exception # MSWord
- * Status Register
- * Return Address MSWord
- * Return Address LSWord
+ * Status Register
+ * Return Address MSWord
+ * Return Address LSWord
*/
asm("
.text
moveml d0-d7/a0-a6,_registers /* save registers */
movel _lastFrame,a0 /* last frame pointer */
");
-SAVE_FP_REGS();
+SAVE_FP_REGS();
asm("
lea _registers,a5 /* get address of registers */
movel sp@+,d2 /* pop return address */
addl #1530,d2 /* convert return addr to */
divs #6,d2 /* exception number */
- extl d2
+ extl d2
moveql #3,d3 /* assume a three word frame */
movel sp@+,a0@- /* copy error info to frame buff*/
movel sp@+,a0@- /* these are never used */
moveql #7,d3 /* this is a 7 word frame */
-
-normal:
+
+normal:
movew sp@+,d1 /* pop status register */
movel sp@+,a4 /* pop program counter */
- movew d1,a5@(66) /* save sr */
+ movew d1,a5@(66) /* save sr */
movel a4,a5@(68) /* save pc in _regisers[] */
movel a4,a0@- /* copy pc to frame buffer */
movew d1,a0@- /* copy sr to frame buffer */
movel sp,_superStack /* save supervisor sp */
andiw #0x2000,d1 /* were we in supervisor mode ? */
- beq userMode
+ beq userMode
movel a7,a5@(60) /* save a7 */
- bra saveDone
+ bra saveDone
userMode:
movel usp,a1 /* save user stack pointer */
movel a1,a5@(60) /* save user stack pointer */
longjmp (remcomEnv, 1);
}
-/* this function takes the 68000 exception number and attempts to
+/* this function takes the 68000 exception number and attempts to
translate this number into a unix compatible signal value */
int
computeSignal (exceptionVector)
lastFrame->previous = lastFrame;
}
-/* this function is used to set up exception handlers for tracing and
+/* this function is used to set up exception handlers for tracing and
breakpoints */
void
set_debug_traps ()
/* sh-stub.c -- debugging stub for the Renesas-SH.
- NOTE!! This code has to be compiled with optimization, otherwise the
+ NOTE!! This code has to be compiled with optimization, otherwise the
function inlining which generates the exception handlers won't work.
*/
/* This is originally based on an m68k software stub written by Glenn
- Engel at HP, but has changed quite a bit.
+ Engel at HP, but has changed quite a bit.
Modifications for the SH by Ben Lee and Steve Chamberlain
'$' or '#'. If <data> starts with two characters followed by
':', then the existing stubs interpret this as a sequence number.
- CSUM1 and CSUM2 are ascii hex representation of an 8-bit
+ CSUM1 and CSUM2 are ascii hex representation of an 8-bit
checksum of <data>, the most significant nibble is sent first.
the hex digits 0-9,a-f are used.
Responses can be run-length encoded to save space. A '*' means that
the next character is an ASCII encoding giving a repeat count which
stands for that many repetitions of the character preceding the '*'.
- The encoding is n+29, yielding a printable character where n >=3
- (which is where rle starts to win). Don't use an n > 126.
+ The encoding is n+29, yielding a printable character where n >=3
+ (which is where rle starts to win). Don't use an n > 126.
- So
+ So
"0* " means the same as "0000". */
#include <string.h>
int runlen;
/* Do run length encoding */
- for (runlen = 0; runlen < 100; runlen ++)
+ for (runlen = 0; runlen < 100; runlen ++)
{
- if (src[0] != src[runlen])
+ if (src[0] != src[runlen])
{
- if (runlen > 3)
+ if (runlen > 3)
{
int encode;
/* Got a useful amount */
{
case INVALID_INSN_VEC:
sigval = 4;
- break;
+ break;
case INVALID_SLOT_VEC:
sigval = 4;
- break;
+ break;
case CPU_BUS_ERROR_VEC:
sigval = 10;
- break;
+ break;
case DMA_BUS_ERROR_VEC:
sigval = 10;
- break;
+ break;
case NMI_VEC:
sigval = 2;
- break;
+ break;
case TRAP_VEC:
case USER_VEC:
}
-#define GDBCOOKIE 0x5ac
+#define GDBCOOKIE 0x5ac
static int ingdbmode;
/* We've had an exception - choose to go into the monitor or
the gdb stub */
#ifdef MONITOR
if (ingdbmode != GDBCOOKIE)
monitor_handle_exception (exceptionVector);
- else
+ else
#endif
gdb_handle_exception (exceptionVector);
or wherever your vbr points. */
const vec_type vectable =
-{
+{
&BINIT, /* 0: Power-on reset PC */
init_stack + init_stack_size, /* 1: Power-on reset SP */
&BINIT, /* 2: Manual reset PC */
mov.l @(L_reg, pc), r1
bra restoreRegisters
mov.l r15, @r0 ! save __stub_stack
-
+
.align 2
L_reg:
.long _registers
static void rr()
{
asm("
- .align 2
+ .align 2
.global _resume
_resume:
mov r4,r1
mov.l @r1+, r14 ! restore R14
mov.l @r1+, r15 ! restore programs stack
mov.l @r1+, r0
- add #-8, r15 ! uncover PC/SR on stack
+ add #-8, r15 ! uncover PC/SR on stack
mov.l r0, @r15 ! restore PC onto stack
lds.l @r1+, pr ! restore PR
- ldc.l @r1+, gbr ! restore GBR
+ ldc.l @r1+, gbr ! restore GBR
ldc.l @r1+, vbr ! restore VBR
lds.l @r1+, mach ! restore MACH
lds.l @r1+, macl ! restore MACL
- mov.l @r1, r0
+ mov.l @r1, r0
add #-88, r1 ! readjust reg pointer to R1
mov.l r0, @(4, r15) ! restore SR onto stack+4
mov.l r2, @-r15
}
-static __inline__ void code_for_catch_exception(int n)
+static __inline__ void code_for_catch_exception(int n)
{
- asm(" .globl _catch_exception_%O0" : : "i" (n) );
+ asm(" .globl _catch_exception_%O0" : : "i" (n) );
asm(" _catch_exception_%O0:" :: "i" (n) );
asm(" add #-4, r15 ! reserve spot on stack ");
asm(" mov.l r1, @-r15 ! push R1 ");
- if (n == NMI_VEC)
+ if (n == NMI_VEC)
{
/* Special case for NMI - make sure that they don't nest */
asm(" mov.l r0, @-r15 ! push R0");
#define PB1MD0 0x0004
#define PB0MD1 0x0002
#define PB0MD0 0x0001
-
+
#define PB7MD PB7MD1|PB7MD0
#define PB6MD PB6MD1|PB6MD0
#define PB5MD PB5MD1|PB5MD0
{
}
-void
+void
init_serial (void)
{
int i;
return SSR1 & SCI_RDRF ;
}
-char
+char
getDebugChar (void)
{
char ch;
return ch;
}
-int
+int
putDebugCharReady (void)
{
return (SSR1 & SCI_TDRE);
SSR1 &= ~SCI_TDRE;
}
-void
+void
handleError (char theSSR)
{
SSR1 &= ~(SCI_ORER | SCI_PER | SCI_FER);
error (_("Error reading inferior's overlay table: couldn't "
"find `_ovly_table' array\n"
"in inferior. Use `overlay manual' mode."));
-
+
if (cache_ovly_table_base == minsym.value_address ())
/* Then go ahead and try to look up this single section in
the cache. */
is_full_physname_constructor = is_constructor_name (physname);
- is_constructor = is_full_physname_constructor
+ is_constructor = is_full_physname_constructor
|| (newname && strcmp (field_name, newname) == 0);
if (!is_destructor)
return {};
const char *scope = block->scope ();
-
+
while (!block->is_global_block () && !block->is_static_block ())
{
struct symbol *sym = lookup_symbol_in_block (name, match_type,
&& range >= best_cust_range)
/* Cust doesn't have a smaller range than best_cust, skip it. */
continue;
-
+
/* For an objfile that has its functions reordered,
find_pc_psymtab will find the proper partial symbol table
and we simply return its corresponding symtab. */
continue;
if (FILENAME_CMP (symtab_to_fullname (sym_tab),
symtab_to_fullname (s)) != 0)
- continue;
+ continue;
l = s->linetable ();
ind = find_line_common (l, line, &exact, 0);
if (ind >= 0)
}
/* A wrapper for ::split_name (see split-name.h) that splits this
- name, and that handles any language-specific peculiarities. */
+ name, and that handles any language-specific peculiarities. */
std::vector<std::string_view> split_name (language lang) const
{
if (lang == language_ada)
extern std::string domain_name (domain_search_flags);
/* Convert a symbol domain to search flags. */
-static inline domain_search_flags
+static inline domain_search_flags
to_search_flags (domain_enum domain)
{
return domain_search_flags (domain_search_flag (1 << domain));
The linker might even remove the minimal symbol if the global
symbol is never referenced, in which case the symbol remains
unresolved.
-
+
GDB would normally find the symbol in the minimal symbol table if it will
not find it in the full symbol table. But a reference to an external
symbol in a local block shadowing other definition requires full symbol
\f
/* The virtual function table is now an array of structures which have the
- form { int16 offset, delta; void *pfn; }.
+ form { int16 offset, delta; void *pfn; }.
In normal virtual function tables, OFFSET is unused.
DELTA is the amount which is added to the apparent object's base
function (exclusive). If the optional parameter BLOCK is non-null,
then set *BLOCK to the address of the block corresponding to the
function symbol, if such a symbol could be found during the lookup;
- nullptr is used as a return value for *BLOCK if no block is found.
+ nullptr is used as a return value for *BLOCK if no block is found.
This function either succeeds or fails (not halfway succeeds). If
it succeeds, it sets *NAME, *ADDRESS, and *ENDADDR to real
information and returns true. If it fails, it sets *NAME, *ADDRESS
and *ENDADDR to zero and returns false.
-
+
If the function in question occupies non-contiguous ranges,
*ADDRESS and *ENDADDR are (subject to the conditions noted above) set
to the start and end of the range in which PC is found. Thus
*ADDRESS <= PC < *ENDADDR with no intervening gaps (in which ranges
from other functions might be found).
-
+
This property allows find_pc_partial_function to be used (as it had
been prior to the introduction of non-contiguous range support) by
various tdep files for finding a start address and limit address
argument can be made that prologue analysis ought to be performed
starting from the entry pc even when PC is within some other range.
This might suggest that *ADDRESS and *ENDADDR ought to be set to the
- limits of the entry pc range, but that will cause the
+ limits of the entry pc range, but that will cause the
*ADDRESS <= PC < *ENDADDR condition to be violated; many of the
- callers of find_pc_partial_function expect this condition to hold.
+ callers of find_pc_partial_function expect this condition to hold.
Callers which require the start and/or end addresses for the range
containing the entry pc should instead call
try
{
CORE_ADDR lm_addr;
-
+
/* Fetch the load module address for this objfile. */
lm_addr = gdbarch_fetch_tls_load_module_address (gdbarch,
objfile);
/* See target.h. */
-gdb::unique_xmalloc_ptr<char>
+gdb::unique_xmalloc_ptr<char>
target_fileio_read_stralloc (struct inferior *inf, const char *filename)
{
gdb_byte *buffer;
/* The structure below stores information about a system call.
It is basically used in the "catch syscall" command, and in
every function that gives information about a system call.
-
+
It's also good to mention that its fields represent everything
that we currently know about a syscall in GDB. */
struct syscall
/* These defines are used to mark target_ops methods. The script
make-target-delegates scans these and auto-generates the base
method implementations. There are four macros that can be used:
-
+
1. TARGET_DEFAULT_IGNORE. There is no argument. The base method
does nothing. This is only valid if the method return type is
'void'.
-
+
2. TARGET_DEFAULT_NORETURN. The argument is a function call, like
'tcomplain ()'. The base method simply makes this call, which is
assumed not to return.
-
+
3. TARGET_DEFAULT_RETURN. The argument is a C expression. The
base method returns this expression's value.
-
+
4. TARGET_DEFAULT_FUNC. The argument is the name of a function.
make-target-delegates does not generate a base method in this case,
but instead uses the argument function as the base method. */
value.related_pid. I.e., if the child forks, value.related_pid
is the parent's ID. */
TARGET_WAITKIND_FORKED,
-
+
/* The program has vforked. A "related" process's PTID is in
value.related_pid. */
TARGET_WAITKIND_VFORKED,
-
+
/* The program has exec'ed a new executable file. The new file's
pathname is pointed to by value.execd_pathname. */
TARGET_WAITKIND_EXECD,
-
+
/* The program had previously vforked, and now the child is done
with the shared memory region, because it exec'ed or exited.
Note that the event is reported to the vfork parent. This is
function. This way the event loop is responsive to other events,
like for instance the user typing. */
TARGET_WAITKIND_IGNORE,
-
+
/* The target has run out of history information,
and cannot run backward any further. */
TARGET_WAITKIND_NO_HISTORY,
-
+
/* There are no resumed children left in the program. */
TARGET_WAITKIND_NO_RESUMED,
# a different host.
#
-# This module to be used for testing gdb with a "gdbserver"
-# built either from libremote or from gdb/gdbserver.
+# This module to be used for testing gdb with a "gdbserver"
+# built either from libremote or from gdb/gdbserver.
#
#
# 'O' packet. This means that tests involving printf will
# fail unles you set this varibale in your baseboard
# configuration file.
-#
+#
# set_board_info gdb,no_hardware_watchpoints 1
# Unles you have a gdbserver that supports hardware watchpoints.
# FIXME: gdb should detect if the target doesn't support them,
#
# set_board_info sockethost
# The name of the host computer whose socket is being used.
-# Defaults to "localhost". Note: old gdbserver requires
+# Defaults to "localhost". Note: old gdbserver requires
# that you define this, but libremote/gdbserver does not.
#
# set_board_info gdb,socketport
verbose "Set target to $targetname"
return 0
}
- -re "Connected to.*$gdb_prompt" {
+ -re "Connected to.*$gdb_prompt" {
verbose "Set target to $targetname"
return 0
}
proc gdb_target_exec { } {
gdb_test "target exec" "No executable file now." "" ".*Kill it.*y or n.*" "y"
-
+
}
#
# gdb_load -- load a file into the debugger.
case [target_info multilib_flags] in {
{ *big-endian* *-EB* *-meb* } { set sidendian "-EB" }
{ *little-endian* *-EL* *-mel* } { set sidendian "-EL" }
- default {
+ default {
if {[target_info exists sim,defaultendian]} {
- set sidendian [target_info sim,defaultendian]
- } else {
+ set sidendian [target_info sim,defaultendian]
+ } else {
# rely on endianness settings in sid configuration defaults
set sidendian ""
}
# Don't do the following any more; it breaks with "runtest ... < /dev/null"
# expect_background {
-# -re \[^\n\]*\n {
+# -re \[^\n\]*\n {
# regsub "\n" $expect_out(buffer) {} msg
# verbose "SID: $msg" 2
# }
-re "Remote debugging using.*$gdb_prompt" {
verbose "Set target to sid"
}
- timeout {
+ timeout {
perror "Couldn't set target for remote simulator."
gdb_exit
}
#
proc gdb_target_sim { } {
global gdb_prompt
-
+
set target_sim_options "[board_info target gdb,target_sim_options]"
send_gdb "target sim $target_sim_options\n"
-re "Connected to the simulator.*$gdb_prompt $" {
verbose "Set target to sim"
}
- timeout {
+ timeout {
perror "Couldn't set target for simulator."
return -1
}
set gdb_prompt "\\(gdb\\)"
#
-# gdb_load -- load a file into the GDB.
+# gdb_load -- load a file into the GDB.
# Returns a 0 if there was an error,
# 1 if it load successfully.
#
send_user "Set target to $targetname\n"
}
}
- timeout {
+ timeout {
perror "Couldn't set SLITE target."
set timeout 10
verbose "Timeout is now $timeout seconds" 2
return -1
}
}
-
+
if [target_info exists gdb_load_offset] {
set offset "[target_info gdb_load_offset]"
} else {
Another_Value : Another_Range;
Color : Colors;
end record;
-
+
for Rec use record
Value at 0 range 0..6;
Another_Value at 0 range 7..10;
0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f};
long val;
void *addr;
-
+
addr = &buf0[0];
__asm __volatile ("ldr %x0, [%1]\n\t"
"ldr q0, [%x0]"
: "=r" (val)
: "r" (&addr)
: "q1" );
-
+
return 1;
}
vector char vchar_d = {'z','z','z','z','z','z','z','z','z','z','z','z','z','z','z','z'};
vector unsigned char vuchar_d = {'Z','Z','Z','Z','Z','Z','Z','Z','Z','Z','Z','Z','Z','Z','Z','Z'};
vector float vfloat_d = {1.0, 1.0, 1.0, 1.0};
-
+
struct test_vec_struct
{
vector signed short vshort1;
matrix[0] = vec_add (matrix[0], matrix[1]);
matrix[2] = vec_add (matrix[2], matrix[3]);
}
-
+
vector int
vec_func (vector short vshort_f, /* goes in v2 */
vector unsigned short vushort_f, /* goes in v3 */
int
main (void)
-{
+{
vector int result = {-1,-1,-1,-1};
vector short x = {1,2,3,4,5,6,7,8};
vector int y = {12, 22, 32, 42};
vector char a_d = {'q','q','q','q','q','q','q','q','q','q','q','q','q','q','q','q'};
vector float b_d = {5.0, 5.0, 5.0, 5.0};
vector float c_d = {3.0, 3.0, 3.0, 3.0};
-
+
int var_int = 44;
short var_short = 3;
struct test_vec_struct vect_struct;
-
+
vect_struct.vshort1 = (vector signed short){1, 2, 3, 4, 5, 6, 7, 8};
vect_struct.vshort2 = (vector signed short){11, 12, 13, 14, 15, 16, 17, 18};
vect_struct.vshort3 = (vector signed short){21, 22, 23, 24, 25, 26, 27, 28};
c = vec_add (a, b);
return c;
}
-
+
int
main ()
{
- vector unsigned int y;
- vector unsigned int x;
- vector unsigned int z;
+ vector unsigned int y;
+ vector unsigned int x;
+ vector unsigned int z;
int a = 0;
#ifdef _AIX
a = 9; /* start here */
x = ((vector unsigned int) vec_splat_u8 (-2));
y = ((vector unsigned int) vec_splat_u8 (1));
-
+
z = vector_fun (x, y);
x = vec_sld (x,y,2);
movl v(%rip), %eax
addl $1, %eax
movl %eax, v(%rip)
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.cfi_endproc
.LFE0:
popq %rbx
.cfi_def_cfa_offset 8
.LVL7:
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.cfi_endproc
.LFE2:
# gdb.arch/amd64-entry-value-inline.c:50
.loc 1 50 0
xorl %eax, %eax
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.cfi_endproc
.LFE3:
# gdb.arch/amd64-entry-value-paramref.cc:25
.loc 1 25 0
movl (%rdi), %eax
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
# gdb.arch/amd64-entry-value-paramref.cc:26
.loc 1 26 0
ret
.loc 1 33 0
addq $16, %rsp
.cfi_def_cfa_offset 8
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.cfi_endproc
.LFE1:
# gdb.arch/amd64-entry-value.cc:23
.loc 1 23 0
movl $0, _ZL1v(%rip)
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
# gdb.arch/amd64-entry-value.cc:24
.loc 1 24 0
ret
# 41 "gdb.arch/amd64-entry-value.cc" 1
breakhere_locexpr:
# 0 "" 2
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
# gdb.arch/amd64-entry-value.cc:42
.loc 1 42 0
#NO_APP
# gdb.arch/amd64-entry-value.cc:164
.loc 1 164 0
movl $_ZZL5datapvE3two, %eax
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.cfi_endproc
.LFE16:
# gdb.arch/amd64-entry-value.cc:169
.loc 1 169 0
addl $1, (%rdi)
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
# gdb.arch/amd64-entry-value.cc:170
.loc 1 170 0
ret
# gdb.arch/amd64-entry-value.cc:176
.loc 1 176 0
movl $10, %eax
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.cfi_endproc
.LFE18:
# gdb.arch/amd64-entry-value.cc:182
.loc 1 182 0
movl $20, %eax
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.cfi_endproc
.LFE19:
.LCFI5:
.cfi_def_cfa_offset 8
.LVL63:
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.cfi_endproc
.LFE20:
.LCFI7:
.cfi_def_cfa_offset 8
.LVL66:
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.cfi_endproc
.LFE21:
# 206 "gdb.arch/amd64-entry-value.cc" 1
breakhere_invalid:
# 0 "" 2
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
# gdb.arch/amd64-entry-value.cc:207
.loc 1 207 0
#NO_APP
# SUCC: 4 [100.0%] (fallthru,can_fallthru)
.LVL86:
# BLOCK 4 freq:10000 seq:2
-# PRED: 3 [100.0%] (fallthru,can_fallthru) 5 [100.0%]
+# PRED: 3 [100.0%] (fallthru,can_fallthru) 5 [100.0%]
.L31:
# gdb.arch/amd64-entry-value.cc:230
.loc 1 230 0
.LCFI11:
.cfi_def_cfa_offset 8
.LVL89:
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.LVL90:
# BLOCK 5 freq:3900 seq:3
movl $1, %edi
call _ZL1aid
.LVL91:
-# SUCC: 4 [100.0%]
+# SUCC: 4 [100.0%]
jmp .L31
.LBE6:
.cfi_endproc
/* This file is compiled from gdb.arch/amd64-invalid-stack-middle.c
using: 'gcc -g -O0 -S -dA' and gcc version '4.7.2'.
Changes were then made to the CFI entry for func2. */
-
+
.file "amd64-invalid-stack-middle.c"
.text
.Ltext0:
.loc 1 27 0
popq %rbp
.LCFI2:
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.LFE0:
.size breakpt, .-breakpt
.loc 1 33 0
popq %rbp
.LCFI5:
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.LFE1:
.size func5, .-func5
.loc 1 39 0
popq %rbp
.LCFI8:
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.LFE2:
.size func4, .-func4
.loc 1 45 0
popq %rbp
.LCFI11:
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.LFE3:
.size func3, .-func3
.loc 1 51 0
leave
.LCFI14:
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.LFE4:
.size func2, .-func2
.loc 1 57 0
leave
.LCFI17:
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.LFE5:
.size func1, .-func1
.loc 1 78 0
leave
.LCFI20:
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.LFE6:
.size make_invalid_ptr, .-make_invalid_ptr
.loc 1 89 0
leave
.LCFI23:
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.LFE7:
.size main, .-main
{
int page_size, ans;
void *ptr;
-
+
page_size = getpagesize ();
ptr = mmap (0, page_size, PROT_NONE,
MAP_PRIVATE | MAP_ANONYMOUS,
return ptr;
}
-int
+int
main (void)
{
void *invalid_ptr;
invalid_ptr = make_invalid_ptr ();
func1 (invalid_ptr);
-
+
return 0;
}
{
int page_size, ans;
void *ptr;
-
+
page_size = getpagesize ();
ptr = mmap (0, page_size, PROT_NONE,
MAP_PRIVATE | MAP_ANONYMOUS,
return ptr;
}
-int
+int
main (void)
{
void *invalid_ptr;
invalid_ptr = make_invalid_ptr ();
func1 (invalid_ptr);
-
+
return 0;
}
# gdb.arch/amd64-optimout-repeat.c:29
.loc 1 29 0
xorl %eax, %eax
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.cfi_endproc
.LFE0:
/* This testcase is part of GDB, the GNU debugger.
-
+
Copyright 2011-2025 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
+
/* This file is compiled from gdb.arch/amd64-prologue-xmm.c
using -g -dA -S. */
"mov 16(%0), %%esi\n\t"
"mov 20(%0), %%edi\n\t"
: /* no output operands */
- : "r" (data)
+ : "r" (data)
: "eax", "ebx", "ecx", "edx", "esi", "edi");
asm ("nop"); /* first breakpoint here */
"mov 48(%0), %%r14d\n\t"
"mov 52(%0), %%r15d\n\t"
: /* no output operands */
- : "r" (data)
+ : "r" (data)
: "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15");
asm ("nop" /* second breakpoint here */
#NO_APP
popq %rbp
.cfi_def_cfa 7, 8
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.cfi_endproc
.LFE0:
movl $0, %eax
popq %rbp
.cfi_def_cfa 7, 8
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.cfi_endproc
.LFE0:
# gdb.arch/amd64-tailcall-cxx1.cc:23
.loc 1 23 0
movl %edi, v(%rip)
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.cfi_endproc
.LFE0:
xorl %eax, %eax
addq $8, %rsp
.cfi_def_cfa_offset 8
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.cfi_endproc
.LFE1:
jne .L8
# BLOCK 3 freq:9996 seq:1
# PRED: 2 [100.0%] (fallthru,can_fallthru)
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
rep
ret
# BLOCK 4 freq:4 seq:2
addq $8, %rsp
.LCFI3:
.cfi_def_cfa_offset 8
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.cfi_endproc
.LFE12:
# gdb.arch/amd64-tailcall-ret.c:23
.loc 1 23 0
movl $2, v(%rip)
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.cfi_endproc
.LFE0:
# gdb.arch/amd64-tailcall-ret.c:39
.loc 1 39 0
xorl %eax, %eax
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.cfi_endproc
.LFE2:
# PRED: ENTRY [100.0%] (FALLTHRU)
# amd64-tailcall-self.c:2
.loc 1 2 0
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.cfi_endproc
.LFE0:
# amd64-tailcall-self.c:8
.loc 1 8 0
leal 1(%rdi), %eax
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
# amd64-tailcall-self.c:9
.loc 1 9 0
ret
# BLOCK 6 freq:721 seq:4
# PRED: 4 [80.1%] (CAN_FALLTHRU)
.L3:
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.cfi_endproc
.LFE2:
# amd64-tailcall-self.c:23
.loc 1 23 0
xorl %eax, %eax
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.cfi_endproc
.LFE3:
add sp, sp, #4
mov r7, sp
-
- /* Test call and return */
+
+ /* Test call and return */
.global test_call
test_call:
bl test_call_subr
.global test_ret_end
test_ret_end:
nop @ Location test_ret_end
-
+
/* Test branch */
bl test_branch
#endif
bl test_pop_pc
-
+
/* Test str in ARM mode and Thumb-2 */
#if !defined(__thumb__)
bl test_str_pc
movs r0, #0
pop {r7, pc}
.size main, .-main
-
+
.global test_call_subr
#if defined (__thumb__)
.code 16
bx lr
.size test_call_subr, .-test_call_subr
-
+
.global test_branch
#if defined (__thumb__)
.code 16
.word test_ldm_stm_pc_ret
.size test_ldm_stm_pc, .-test_ldm_stm_pc
#endif
-
+
#if !defined (__thumb__) || defined(__thumb2__)
.global test_ldr_literal
.type test_ldr_literal, %function
push {r1} /* Push the right address so that PC will get it. */
/* Push the wrong address so r0-r7 will get the wrong a ddress. If PC
is set from any of them, we can get a FAIL. */
- push {r2}
+ push {r2}
push {r2}
push {r2}
push {r2}
.global test_pop_pc_3_wrong
test_pop_pc_3_wrong:
b test_pop_pc_ret /* wrong */
-
+
.align 2
.L1_right:
.word test_pop_pc_1_right
vector float h_vec_f,
vector float i_vec_f,
vector unsigned int l_vec_f,
- vector int m_vec_f)
+ vector int m_vec_f)
{
vector int n_vec;
int x,y,z;
x = 2;
y = 3;
-
+
z = x + y;
z++;
n_vec = __ev_and(a_vec_f, b_vec_f);
c = __ev_and (a, b);
return c;
}
-
+
int
main ()
{
- vector int y;
- vector int x;
- vector int z;
+ vector int y;
+ vector int x;
+ vector int z;
int a;
/* This line may look unnecessary but we do need it, because we want to
a = 9;
x = (vector int) __ev_create_s32 (-2, -2);
y = (vector int) __ev_create_s32 (1, 1);
-
+
z = vector_fun (x, y);
return 0;
! source file:
!
! #include <stdio.h>
-!
+!
! main()
! {
! printf("hello world\n");
! sub1()
! {
! int buf[64];
-!
+!
! }
-!
+!
! sub2()
! {
! int buf[65];
-!
+!
! }
!
! We use a pregenerated assembly file as the test input to avoid possible
mov r14,r15
lds.l @r15+,pr
mov.l @r15+,r14
- rts
+ rts
nop
.L6:
.align 2
mov r14,r15
lds.l @r15+,pr
mov.l @r15+,r14
- rts
+ rts
nop
.align 1
.L8:
mov r14,r15
lds.l @r15+,pr
mov.l @r15+,r14
- rts
+ rts
nop
.align 1
.L11:
! source file:
!
! #include <stdio.h>
-!
+!
! main()
! {
! printf("hello world\n");
! sub1()
! {
! int buf[64];
-!
+!
! }
-!
+!
! sub2()
! {
! int buf[65];
-!
+!
! }
!
! We use a pregenerated assembly file as the test input to avoid possible
mov r14,r15
lds.l @r15+,pr
mov.l @r15+,r14
- rts
+ rts
nop
.L6:
.align 2
mov r14,r15
lds.l @r15+,pr
mov.l @r15+,r14
- rts
+ rts
nop
.align 1
.L8:
mov r14,r15
lds.l @r15+,pr
mov.l @r15+,r14
- rts
+ rts
nop
.align 1
.L11:
/* Copyright 2004-2025 Free Software Foundation, Inc.
-
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-
+
Please email any bugs, comments, and/or additions to this file to:
bug-gdb@gnu.org
-
+
This file is part of the gdb testsuite. */
#include <stdio.h>
{
printf ("In sub1\n");
}
-
+
sub2 ()
{
printf ("In sub2\n");
}
-
+
main ()
{
sub1 ();
It was generated using
"gcc -g -O9 -S -o gate.s gate.c -fasynchronous-unwind-tables",
using the following source file:
-
-
+
+
void *gate (void *(*gate) (void *data), void *data)
{
return 1 + (*gate) (data);
}
-
+
Changes are marked as `CHANGE' below. */
.file "gate.c"
"mov 8(%0), %%ecx\n\t"
"mov 12(%0), %%edx\n\t"
: /* no output operands */
- : "r" (data)
+ : "r" (data)
: "eax", "ebx", "ecx", "edx");
asm ("nop" /* first breakpoint here */
"movaps 96(%0), %%xmm6\n\t"
"movaps 112(%0), %%xmm7\n\t"
: /* no output operands */
- : "r" (data)
+ : "r" (data)
: "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7");
#ifdef __x86_64__
asm ("movaps 128(%0), %%xmm8\n\t"
"movaps 224(%0), %%xmm14\n\t"
"movaps 240(%0), %%xmm15\n\t"
: /* no output operands */
- : "r" (data)
+ : "r" (data)
: "xmm8", "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15");
#endif
"movaps %%xmm6, 96(%0)\n\t"
"movaps %%xmm7, 112(%0)\n\t"
: /* no output operands */
- : "r" (data)
+ : "r" (data)
: "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7");
#ifdef __x86_64__
asm (
"movaps %%xmm14, 224(%0)\n\t"
"movaps %%xmm15, 240(%0)\n\t"
: /* no output operands */
- : "r" (data)
+ : "r" (data)
: "xmm8", "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15");
#endif
int a = 40;
STAP_PROBE1 (foo, bar, a);
- return 0;
+ return 0;
}
volatile uint64_t taken_##BRANCH_IF##_##BIT = \
BASE & (~(1ull << BIT)) | ((uint64_t) BRANCH_IF << BIT); \
volatile uint64_t not_taken_##BRANCH_IF##_##BIT = \
- BASE & (~(1ull << BIT)) | (((uint64_t) !BRANCH_IF) << BIT);
+ BASE & (~(1ull << BIT)) | (((uint64_t) !BRANCH_IF) << BIT);
DEF_BBIT_TAKEN (0, 10);
DEF_BBIT_TAKEN (0, 36);
{
long *aligned_addr = (long *) addr;
long i;
- for (i = 0; i < size / sizeof (long); i += ONEKB)
- {
- *aligned_addr = pattern;
+ for (i = 0; i < size / sizeof (long); i += ONEKB)
+ {
+ *aligned_addr = pattern;
aligned_addr = aligned_addr + ONEKB;
}
return (0);
/* Test ISM. */
int shmid = shmget (IPC_PRIVATE, SHMSIZE, IPC_CREAT | 0666);
- if (shmid == -1)
+ if (shmid == -1)
exit(1);
char *shmaddr = (char *)shmat (shmid, NULL, 0x666 | SHM_RND);
- if (shmaddr == (char *)-1)
- {
- shmctl (shmid, IPC_RMID, NULL);
+ if (shmaddr == (char *)-1)
+ {
+ shmctl (shmid, IPC_RMID, NULL);
exit(1);
}
/* Enable ADI on ISM segment. */
- if (mprotect (shmaddr, SHMSIZE, PROT_READ|PROT_WRITE|PROT_ADI))
- {
- perror ("mprotect failed");
- goto err_out;
+ if (mprotect (shmaddr, SHMSIZE, PROT_READ|PROT_WRITE|PROT_ADI))
+ {
+ perror ("mprotect failed");
+ goto err_out;
}
if (memory_fill (shmaddr, SHMSIZE, PAT) != 0) /* line breakpoint here */
{
- exit(1);
+ exit(1);
}
adi_clr_version (shmaddr, SHMSIZE);
caddr_t vshmaddr = adi_set_version (shmaddr, SHMSIZE, 0x8);
- if (vshmaddr == 0)
+ if (vshmaddr == 0)
exit(1);
- /* Test mmap. */
+ /* Test mmap. */
int fd = open ("/dev/zero", O_RDWR);
if (fd < 0)
exit(1);
- char *maddr = (char *)mmap (NULL, MAPSIZE, PROT_READ|PROT_WRITE,
+ char *maddr = (char *)mmap (NULL, MAPSIZE, PROT_READ|PROT_WRITE,
MAP_PRIVATE, fd, 0);
- if (maddr == (char *)-1)
- exit(1);
+ if (maddr == (char *)-1)
+ exit(1);
/* Enable ADI. */
- if (mprotect (shmaddr, MAPSIZE, PROT_READ|PROT_WRITE|PROT_ADI))
- {
- perror ("mprotect failed");
+ if (mprotect (shmaddr, MAPSIZE, PROT_READ|PROT_WRITE|PROT_ADI))
+ {
+ perror ("mprotect failed");
goto err_out;
-
+
}
- if (memory_fill (maddr, MAPSIZE, PAT) != 0)
- exit(1);
+ if (memory_fill (maddr, MAPSIZE, PAT) != 0)
+ exit(1);
caddr_t vmaddr = adi_set_version (maddr, MAPSIZE, 0x8);
/* Test heap. */
haddr = (char*) memalign (MAPSIZE, MAPSIZE);
/* Enable ADI. */
- if (mprotect (shmaddr, MAPSIZE, PROT_READ|PROT_WRITE|PROT_ADI))
- {
- perror ("mprotect failed");
+ if (mprotect (shmaddr, MAPSIZE, PROT_READ|PROT_WRITE|PROT_ADI))
+ {
+ perror ("mprotect failed");
goto err_out;
}
- if (memory_fill (haddr, MAPSIZE, PAT) != 0)
+ if (memory_fill (haddr, MAPSIZE, PAT) != 0)
exit(1);
adi_clr_version (haddr, MAPSIZE);
/* Set some ADP version number. */
vaddr2 = adi_clr_version (haddr+64*4, 64*2);
vaddr3 = adi_set_version (haddr+64*6, 64*2, 0xa);
vaddr4 = adi_set_version (haddr+64*8, 64*10, 0x3);
- if (vaddr == 0)
+ if (vaddr == 0)
exit(1);
char *versioned_p = vaddr;
*versioned_p = 'a';
*uvp = 'b'; // version mismatch trap
return (0);
-err_out:
- if (shmdt ((const void *)shmaddr) != 0)
+err_out:
+ if (shmdt ((const void *)shmaddr) != 0)
perror ("Detach failure");
shmctl (shmid, IPC_RMID, NULL);
exit (1);
comment "Be careful about changing this file without also changing"
comment "asm-source.exp."
-
+
comment "This file is not linked with crt0."
comment "Provide very simplistic equivalent."
-
+
.global _start
gdbasm_declare _start
gdbasm_startup
int b, c;
c = 5;
b = 3; /* advance this location */
-
+
func (c); /* stop here after leaving current frame */
marker1 (); /* stop here after leaving current frame */
func3 (); /* break here */
extern void dummy();
dummy();
return 0;
-
+
}
void dummy()
v_short = 3;
v_signed_short = 4;
- v_unsigned_short = 5;
+ v_unsigned_short = 5;
v_int = 6;
v_signed_int = 7;
- v_unsigned_int = 8;
+ v_unsigned_int = 8;
v_long = 9;
v_signed_long = 10;
- v_unsigned_long = 11;
-
+ v_unsigned_long = 11;
+
v_float = 100.343434;
v_double = 200.565656;
}
main (void)
{
int my_array[3] = { 1, 2, 3 }; /* break main */
-
+
value = 7;
-
+
#ifdef SIGUSR1
signal (SIGUSR1, handle_USR1);
#endif
printf ("value is %d\n", value);
printf ("my_array[2] is %d\n", my_array[2]);
-
+
{
int i;
for (i = 0; i < 5; i++)
main (void)
{
int my_array[3] = { 1, 2, 3 }; /* break main */
-
+
value = 7;
-
+
#ifdef SIGUSR1
signal (SIGUSR1, handle_USR1);
#endif
printf ("value is %d\n", value);
printf ("my_array[2] is %d\n", my_array[2]);
-
+
{
int i;
for (i = 0; i < 5; i++)
main (void)
{
int y, z;
-
+
y = 2;
z = 9;
y = foo ();
static int my_list[num] = {3,4,2,0,2,1,8,3,6,7};
-void print_average(int *list, int low, int high)
+void print_average(int *list, int low, int high)
{
int total = 0, num_elements = 0, average = 0;
total = sum(list, low, high);
b32 = 1.5f;
b64 = 2.25;
b128 = 3.375l;
-
+
return 0;
}
}
close (fd);
}
-
+
/* Compute an initial chunk size. The math is dodgy but it works
for the moment. Perhaps there's a constant around somewhere.
Limit this to max_core_size bytes - no point in trying to
break5 ();
}
-int main ()
+int main ()
{
int i;
simply as places to try setting breakpoints at. They are
explicitly "one-line functions" to verify that this case works
(some versions of gcc have or have had problems with this).
-
+
These functions are in a separate source file to prevent an
optimizing compiler from inlining them and optimizing them away. */
main (void)
{
volatile int i;
-
+
i = 1; /* break-first */
i = 2; /* break-second */
/**************************************************************************
* TESTS :
* -- function arguments that are enumerated types
- * -- small structure arguments ( <= 64 bits )
+ * -- small structure arguments ( <= 64 bits )
* -- stored in registers
* -- stored on the stack
* -- large structure arguments ( > 64 bits )
*/
typedef int id_int;
-typedef enum {
+typedef enum {
BLACK,
BLUE,
BROWN,
*/
struct array_rep_info_t {
- int next_index[10];
+ int next_index[10];
int values[10];
int head;
};
/*****************************************************************************
- * Small structures ( <= 64 bits). These are used to test passing small
+ * Small structures ( <= 64 bits). These are used to test passing small
* structures as parameters and test argument size promotion.
*****************************************************************************/
};
/*****************************************************************
- * PRINT_STUDENT_ID_SHIRT_COLOR :
+ * PRINT_STUDENT_ID_SHIRT_COLOR :
* IN id_int student -- enumerated type
* IN colors shirt -- enumerated type
*****************************************************************/
printf("student id : %d\t", student);
printf("shirt color : ");
switch (shirt) {
- case BLACK : printf("BLACK\n");
+ case BLACK : printf("BLACK\n");
break;
case BLUE : printf("BLUE\n");
break;
}
/*****************************************************************
- * PRINT_CHAR_ARRAY :
- * IN char array_c[] -- character array
+ * PRINT_CHAR_ARRAY :
+ * IN char array_c[] -- character array
*****************************************************************/
void print_char_array (char array_c[])
{
printf("array_c :\n");
printf("=========\n\n");
for (index = 0; index < 120; index++) {
- printf("%1c", array_c[index]);
+ printf("%1c", array_c[index]);
if ((index%50) == 0) printf("\n");
}
printf("\n\n");
}
/*****************************************************************
- * PRINT_DOUBLE_ARRAY :
+ * PRINT_DOUBLE_ARRAY :
* IN double array_d[] -- array of doubles
*****************************************************************/
void print_double_array (double array_d[])
printf("array_d :\n");
printf("=========\n\n");
for (index = 0; index < 9; index++) {
- printf("%f ", array_d[index]);
+ printf("%f ", array_d[index]);
if ((index%8) == 0) printf("\n");
}
printf("\n\n");
}
/*****************************************************************
- * PRINT_FLOAT_ARRAY:
- * IN float array_f[] -- array of floats
+ * PRINT_FLOAT_ARRAY:
+ * IN float array_f[] -- array of floats
*****************************************************************/
void print_float_array (float array_f[])
{
printf("array_f :\n");
printf("=========\n\n");
for (index = 0; index < 15; index++) {
- printf("%f ", array_f[index]);
+ printf("%f ", array_f[index]);
if ((index%8) == 0) printf("\n");
}
}
/*****************************************************************
- * PRINT_INT_ARRAY:
- * IN int array_i[] -- array of integers
+ * PRINT_INT_ARRAY:
+ * IN int array_i[] -- array of integers
*****************************************************************/
void print_int_array (int array_i[])
{
printf("array_i :\n");
printf("=========\n\n");
for (index = 0; index < 50; index++) {
- printf("%d ", array_i[index]);
+ printf("%d ", array_i[index]);
if ((index%8) == 0) printf("\n");
}
printf("\n\n");
}
/*****************************************************************
- * PRINT_ALL_ARRAYS:
- * IN int array_i[] -- array of integers
- * IN char array_c[] -- array of characters
- * IN float array_f[] -- array of floats
- * IN double array_d[] -- array of doubles
+ * PRINT_ALL_ARRAYS:
+ * IN int array_i[] -- array of integers
+ * IN char array_c[] -- array of characters
+ * IN float array_f[] -- array of floats
+ * IN double array_d[] -- array of doubles
*****************************************************************/
void print_all_arrays(int array_i[], char array_c[], float array_f[], double array_d[])
{
}
/*****************************************************************
- * LOOP_COUNT :
- * A do nothing function. Used to provide a point at which calls can be made.
+ * LOOP_COUNT :
+ * A do nothing function. Used to provide a point at which calls can be made.
*****************************************************************/
void loop_count () {
}
/*****************************************************************
- * COMPUTE_WITH_SMALL_STRUCTS :
- * A do nothing function. Used to provide a point at which calls can be made.
+ * COMPUTE_WITH_SMALL_STRUCTS :
+ * A do nothing function. Used to provide a point at which calls can be made.
* IN int seed
*****************************************************************/
void compute_with_small_structs (int seed)
* the call command behavior when integer arguments do not fit into
* registers and must be placed on the stack.
* OUT struct bit_flags_t *bit_flags -- structure to be filled
- * IN unsigned a -- 0 or 1
- * IN unsigned b -- 0 or 1
- * IN unsigned g -- 0 or 1
- * IN unsigned d -- 0 or 1
- * IN unsigned e -- 0 or 1
- * IN unsigned o -- 0 or 1
+ * IN unsigned a -- 0 or 1
+ * IN unsigned b -- 0 or 1
+ * IN unsigned g -- 0 or 1
+ * IN unsigned d -- 0 or 1
+ * IN unsigned e -- 0 or 1
+ * IN unsigned o -- 0 or 1
*****************************************************************/
void init_bit_flags (struct bit_flags_t *bit_flags, unsigned a, unsigned b, unsigned g, unsigned d, unsigned e, unsigned o)
{
* to see the call command behavior when integer and character arguments
* do not fit into registers and must be placed on the stack.
* OUT struct bit_flags_combo_t *bit_flags_combo -- structure to fill
- * IN unsigned a -- 0 or 1
- * IN unsigned b -- 0 or 1
+ * IN unsigned a -- 0 or 1
+ * IN unsigned b -- 0 or 1
* IN char ch1
- * IN unsigned g -- 0 or 1
- * IN unsigned d -- 0 or 1
+ * IN unsigned g -- 0 or 1
+ * IN unsigned d -- 0 or 1
* IN char ch2
- * IN unsigned e -- 0 or 1
- * IN unsigned o -- 0 or 1
+ * IN unsigned e -- 0 or 1
+ * IN unsigned o -- 0 or 1
*****************************************************************/
void init_bit_flags_combo (struct bit_flags_combo_t *bit_flags_combo, unsigned a, unsigned b, char ch1, unsigned g, unsigned d, char ch2, unsigned e, unsigned o)
{
/*****************************************************************
- * INIT_ONE_DOUBLE :
- * OUT struct one_double_t *one_double -- structure to fill
+ * INIT_ONE_DOUBLE :
+ * OUT struct one_double_t *one_double -- structure to fill
* IN double init_val
*****************************************************************/
void init_one_double (struct one_double_t *one_double, double init_val)
}
/*****************************************************************
- * INIT_TWO_FLOATS :
+ * INIT_TWO_FLOATS :
* OUT struct two_floats_t *two_floats -- structure to be filled
- * IN float init_val1
- * IN float init_val2
+ * IN float init_val1
+ * IN float init_val2
*****************************************************************/
void init_two_floats (struct two_floats_t *two_floats, float init_val1, float init_val2)
{
}
/*****************************************************************
- * INIT_TWO_CHARS :
+ * INIT_TWO_CHARS :
* OUT struct two_char_t *two_char -- structure to be filled
- * IN char init_val1
- * IN char init_val2
+ * IN char init_val1
+ * IN char init_val2
*****************************************************************/
void init_two_chars (struct two_char_t *two_char, char init_val1, char init_val2)
{
}
/*****************************************************************
- * INIT_THREE_CHARS :
+ * INIT_THREE_CHARS :
* OUT struct three_char_t *three_char -- structure to be filled
- * IN char init_val1
- * IN char init_val2
- * IN char init_val3
+ * IN char init_val1
+ * IN char init_val2
+ * IN char init_val3
*****************************************************************/
void init_three_chars (struct three_char_t *three_char, char init_val1, char init_val2, char init_val3)
{
}
/*****************************************************************
- * INIT_FIVE_CHARS :
+ * INIT_FIVE_CHARS :
* OUT struct five_char_t *five_char -- structure to be filled
- * IN char init_val1
- * IN char init_val2
- * IN char init_val3
- * IN char init_val4
- * IN char init_val5
+ * IN char init_val1
+ * IN char init_val2
+ * IN char init_val3
+ * IN char init_val4
+ * IN char init_val5
*****************************************************************/
void init_five_chars (struct five_char_t *five_char, char init_val1, char init_val2, char init_val3, char init_val4, char init_val5)
{
}
/*****************************************************************
- * INIT_INT_CHAR_COMBO :
+ * INIT_INT_CHAR_COMBO :
* OUT struct int_char_combo_t *combo -- structure to be filled
- * IN int init_val1
- * IN char init_val2
+ * IN int init_val1
+ * IN char init_val2
*****************************************************************/
void init_int_char_combo (struct int_char_combo_t *combo, int init_val1, char init_val2)
{
}
/*****************************************************************
- * INIT_STRUCT_REP :
+ * INIT_STRUCT_REP :
* OUT struct small_rep_into_t *small_struct -- structure to be filled
- * IN int seed
+ * IN int seed
*****************************************************************/
void init_struct_rep(struct small_rep_info_t *small_struct, int seed)
{
- small_struct->value = 2 + (seed*2);
- small_struct->head = 0;
+ small_struct->value = 2 + (seed*2);
+ small_struct->head = 0;
}
/*****************************************************************
- * INIT_SMALL_STRUCTS :
+ * INIT_SMALL_STRUCTS :
* Takes all the small structures as input and calls the appropriate
* initialization routine for each structure
*****************************************************************/
struct two_floats_t *f3)
{
- init_bit_flags(flags, (unsigned)1, (unsigned)0, (unsigned)1,
- (unsigned)0, (unsigned)1, (unsigned)0 );
+ init_bit_flags(flags, (unsigned)1, (unsigned)0, (unsigned)1,
+ (unsigned)0, (unsigned)1, (unsigned)0 );
init_bit_flags_combo(flags_combo, (unsigned)1, (unsigned)0, 'y',
(unsigned)1, (unsigned)0, 'n',
- (unsigned)1, (unsigned)0 );
+ (unsigned)1, (unsigned)0 );
init_three_chars(three_char, 'a', 'b', 'c');
init_five_chars(five_char, 'l', 'm', 'n', 'o', 'p');
init_int_char_combo(int_char_combo, 123, 'z');
init_struct_rep(struct2, 4);
init_struct_rep(struct3, 5);
init_struct_rep(struct4, 6);
- init_one_double ( d1, 10.5);
- init_one_double ( d2, -3.375);
- init_one_double ( d3, 675.09375);
- init_two_floats ( f1, 45.234, 43.6);
- init_two_floats ( f2, 78.01, 122.10);
- init_two_floats ( f3, -1232.345, -199.21);
+ init_one_double ( d1, 10.5);
+ init_one_double ( d2, -3.375);
+ init_one_double ( d3, 675.09375);
+ init_two_floats ( f1, 45.234, 43.6);
+ init_two_floats ( f2, 78.01, 122.10);
+ init_two_floats ( f3, -1232.345, -199.21);
}
/*****************************************************************
- * PRINT_TEN_DOUBLES :
+ * PRINT_TEN_DOUBLES :
* ?????????????????????????????
****************************************************************/
void print_ten_doubles (
}
/*****************************************************************
- * PRINT_BIT_FLAGS :
- * IN struct bit_flags_t bit_flags
+ * PRINT_BIT_FLAGS :
+ * IN struct bit_flags_t bit_flags
****************************************************************/
void print_bit_flags (struct bit_flags_t bit_flags)
{
}
/*****************************************************************
- * PRINT_BIT_FLAGS_COMBO :
- * IN struct bit_flags_combo_t bit_flags_combo
+ * PRINT_BIT_FLAGS_COMBO :
+ * IN struct bit_flags_combo_t bit_flags_combo
****************************************************************/
void print_bit_flags_combo (struct bit_flags_combo_t bit_flags_combo)
{
}
/*****************************************************************
- * PRINT_ONE_DOUBLE :
- * IN struct one_double_t one_double
+ * PRINT_ONE_DOUBLE :
+ * IN struct one_double_t one_double
****************************************************************/
void print_one_double (struct one_double_t one_double)
{
}
/*****************************************************************
- * PRINT_TWO_FLOATS :
- * IN struct two_floats_t two_floats
+ * PRINT_TWO_FLOATS :
+ * IN struct two_floats_t two_floats
****************************************************************/
void print_two_floats (struct two_floats_t two_floats)
{
}
/*****************************************************************
- * PRINT_TWO_CHARS :
+ * PRINT_TWO_CHARS :
* IN struct two_char_t two_char
****************************************************************/
void print_two_chars (struct two_char_t two_char)
}
/*****************************************************************
- * PRINT_THREE_CHARS :
+ * PRINT_THREE_CHARS :
* IN struct three_char_t three_char
****************************************************************/
void print_three_chars (struct three_char_t three_char)
}
/*****************************************************************
- * PRINT_FIVE_CHARS :
+ * PRINT_FIVE_CHARS :
* IN struct five_char_t five_char
****************************************************************/
void print_five_chars (struct five_char_t five_char)
{
printf("Contents of five_char_t: \n\n");
- printf("%c\t%c\t%c\t%c\t%c\n", five_char.ch1, five_char.ch2,
- five_char.ch3, five_char.ch4,
+ printf("%c\t%c\t%c\t%c\t%c\n", five_char.ch1, five_char.ch2,
+ five_char.ch3, five_char.ch4,
five_char.ch5);
}
/*****************************************************************
- * PRINT_INT_CHAR_COMBO :
+ * PRINT_INT_CHAR_COMBO :
* IN struct int_char_combo_t int_char_combo
****************************************************************/
void print_int_char_combo (struct int_char_combo_t int_char_combo)
printf("Contents of int_char_combo_t: \n\n");
printf("%d\t%c\n", int_char_combo.int1, int_char_combo.ch1);
-}
+}
/*****************************************************************
- * PRINT_STRUCT_REP :
+ * PRINT_STRUCT_REP :
* The last parameter must go onto the stack rather than into a register.
* This is a good function to call to test small structures.
* IN struct small_rep_info_t struct1
printf("Contents of struct1: \n\n");
- printf("%10d%10d\n", struct1.value, struct1.head);
+ printf("%10d%10d\n", struct1.value, struct1.head);
printf("Contents of struct2: \n\n");
- printf("%10d%10d\n", struct2.value, struct2.head);
+ printf("%10d%10d\n", struct2.value, struct2.head);
printf("Contents of struct3: \n\n");
- printf("%10d%10d\n", struct3.value, struct3.head);
+ printf("%10d%10d\n", struct3.value, struct3.head);
}
/*****************************************************************
- * SUM_STRUCT_PRINT :
+ * SUM_STRUCT_PRINT :
* The last two parameters must go onto the stack rather than into a register.
* This is a good function to call to test small structures.
* IN struct small_rep_info_t struct1
void sum_struct_print (
int seed,
struct small_rep_info_t struct1,
- struct small_rep_info_t struct2,
+ struct small_rep_info_t struct2,
struct small_rep_info_t struct3,
struct small_rep_info_t struct4)
{
}
/*****************************************************************
- * PRINT_SMALL_STRUCTS :
+ * PRINT_SMALL_STRUCTS :
* This is a good function to call to test small structures.
* All of the small structures of odd sizes (40 bits, 8bits, etc.)
* are pushed onto the stack.
}
/*****************************************************************
- * PRINT_LONG_ARG_LIST :
+ * PRINT_LONG_ARG_LIST :
* This is a good function to call to test small structures.
* The first two parameters ( the doubles ) go into registers. The
* remaining arguments are pushed onto the stack. Depending on where
- * print_long_arg_list is called from, the size of the argument list
+ * print_long_arg_list is called from, the size of the argument list
* may force more space to be pushed onto the stack as part of the callers
* frame.
****************************************************************/
printf("int : %d\n", e);
printf("int : %d\n", f);
print_small_structs( struct1, struct2, struct3, struct4, flags, flags_combo,
- three_char, five_char, int_char_combo, d1, d2, d3,
+ three_char, five_char, int_char_combo, d1, d2, d3,
f1, f2, f3);
}
printf(" | \n");*/
/*for (index = 0; index < 10; index++) {*/
- printf("%10d%10d\n", linked_list1.values[0],
- linked_list1.next_index[0]);
+ printf("%10d%10d\n", linked_list1.values[0],
+ linked_list1.next_index[0]);
/*}*/
}
/*****************************************************************
- * PRINT_ARRAY_REP :
- * The three structure parameters should fit into registers.
+ * PRINT_ARRAY_REP :
+ * The three structure parameters should fit into registers.
* IN struct array_rep_info_t linked_list1
* IN struct array_rep_info_t linked_list2
* IN struct array_rep_info_t linked_list3
printf(" | \n");
for (index = 0; index < 10; index++) {
- printf("%10d%10d\n", linked_list1.values[index],
- linked_list1.next_index[index]);
+ printf("%10d%10d\n", linked_list1.values[index],
+ linked_list1.next_index[index]);
}
printf("Contents of linked list2: \n\n");
printf(" | \n");
for (index = 0; index < 10; index++) {
- printf("%10d%10d\n", linked_list2.values[index],
- linked_list2.next_index[index]);
+ printf("%10d%10d\n", linked_list2.values[index],
+ linked_list2.next_index[index]);
}
printf("Contents of linked list3: \n\n");
printf(" | \n");
for (index = 0; index < 10; index++) {
- printf("%10d%10d\n", linked_list3.values[index],
- linked_list3.next_index[index]);
+ printf("%10d%10d\n", linked_list3.values[index],
+ linked_list3.next_index[index]);
}
}
/*****************************************************************
- * SUM_ARRAY_PRINT :
- * The last structure parameter must be pushed onto the stack
+ * SUM_ARRAY_PRINT :
+ * The last structure parameter must be pushed onto the stack
* IN int seed
* IN struct array_rep_info_t linked_list1
* IN struct array_rep_info_t linked_list2
}
/*****************************************************************
- * INIT_ARRAY_REP :
+ * INIT_ARRAY_REP :
* IN struct array_rep_info_t *linked_list
* IN int seed
****************************************************************/
for (index = 0; index < 10; index++) {
- linked_list->values[index] = (2*index) + (seed*2);
+ linked_list->values[index] = (2*index) + (seed*2);
linked_list->next_index[index] = index + 1;
}
- linked_list->head = 0;
+ linked_list->head = 0;
}
static char char_array[121];
static double double_array[9];
static float float_array[15];
- static int integer_array[50];
+ static int integer_array[50];
static int index;
static id_int student_id = 23;
static colors my_shirt = YELLOW;
-
+
/* variables for large structure testing
*/
static int number = 10;
print_char_array(char_array);
print_double_array(double_array); /* -tbreak2- */
print_float_array(float_array);
- print_student_id_shirt_color(student_id, my_shirt);
+ print_student_id_shirt_color(student_id, my_shirt);
print_int_array(integer_array);
print_all_arrays(integer_array, char_array, float_array, double_array); /* -tbreak3- */
- /* Allocate space for large structures
+ /* Allocate space for large structures
*/
list1 = (struct array_rep_info_t *)malloc(sizeof(struct array_rep_info_t));
list2 = (struct array_rep_info_t *)malloc(sizeof(struct array_rep_info_t));
list3 = (struct array_rep_info_t *)malloc(sizeof(struct array_rep_info_t));
list4 = (struct array_rep_info_t *)malloc(sizeof(struct array_rep_info_t));
- /* Initialize large structures
+ /* Initialize large structures
*/
init_array_rep(list1, 2);
init_array_rep(list2, 4);
printf("BYE BYE FOR NOW\n"); /* -tbreak4- */
printf("VERY GREEN GRASS\n"); /* -next2- */
- /* Print large structures
+ /* Print large structures
*/
sum_array_print(10, *list1, *list2, *list3, *list4); /* -tbreak5- */
print_array_rep(*list1, *list2, *list3);
print_one_large_struct(*list1);
- /* Allocate space for small structures
+ /* Allocate space for small structures
*/
struct1 = (struct small_rep_info_t *)malloc(sizeof(struct small_rep_info_t));
struct2 = (struct small_rep_info_t *)malloc(sizeof(struct small_rep_info_t));
f2 = (struct two_floats_t *)malloc(sizeof(struct two_floats_t));
f3 = (struct two_floats_t *)malloc(sizeof(struct two_floats_t));
- /* Initialize small structures
+ /* Initialize small structures
*/
- init_small_structs ( struct1, struct2, struct3, struct4, flags,
+ init_small_structs ( struct1, struct2, struct3, struct4, flags,
flags_combo, three_char, five_char, int_char_combo,
d1, d2, d3, f1, f2, f3);
- /* Print small structures
+ /* Print small structures
*/
- print_small_structs ( *struct1, *struct2, *struct3, *struct4, *flags,
+ print_small_structs ( *struct1, *struct2, *struct3, *struct4, *flags,
*flags_combo, *three_char, *five_char, *int_char_combo,
*d1, *d2, *d3, *f1, *f2, *f3);
- /* Print a very long arg list
+ /* Print a very long arg list
*/
a = 22.25;
b = 33.375;
*flags, *flags_combo, *three_char, *five_char, *int_char_combo,
*d1, *d2, *d3, *f1, *f2, *f3);
- /* Initialize small structures
+ /* Initialize small structures
*/
- init_one_double ( d1, 1.11111);
- init_one_double ( d2, -345.34);
- init_one_double ( d3, 546464.2);
- init_two_floats ( f1, 0.234, 453.1);
- init_two_floats ( f2, 78.345, 23.09);
- init_two_floats ( f3, -2.345, 1.0);
- init_bit_flags(flags, (unsigned)1, (unsigned)0, (unsigned)1,
- (unsigned)0, (unsigned)1, (unsigned)0 );
+ init_one_double ( d1, 1.11111);
+ init_one_double ( d2, -345.34);
+ init_one_double ( d3, 546464.2);
+ init_two_floats ( f1, 0.234, 453.1);
+ init_two_floats ( f2, 78.345, 23.09);
+ init_two_floats ( f3, -2.345, 1.0);
+ init_bit_flags(flags, (unsigned)1, (unsigned)0, (unsigned)1,
+ (unsigned)0, (unsigned)1, (unsigned)0 );
init_bit_flags_combo(flags_combo, (unsigned)1, (unsigned)0, 'y', /* -tbreak8- */
(unsigned)1, (unsigned)0, 'n',
- (unsigned)1, (unsigned)0 );
+ (unsigned)1, (unsigned)0 );
init_three_chars(three_char, 'x', 'y', 'z');
init_five_chars(five_char, 'h', 'e', 'l', 'l', 'o');
init_int_char_combo(int_char_combo, 13, '!'); /* -tbreak9- */
printf("BYE BYE FOR NOW\n");
printf("VERY GREEN GRASS\n");
- /* Print small structures
+ /* Print small structures
*/
print_one_double(*d1);
print_one_double(*d2);
*/
struct array_rep_info_t {
- int next_index[10];
+ int next_index[10];
int values[10];
int head;
};
/*****************************************************************************
- * Small structures ( <= 64 bits). These are used to test passing small
+ * Small structures ( <= 64 bits). These are used to test passing small
* structures as parameters and test argument size promotion.
*****************************************************************************/
/*****************************************************************
- * LOOP_COUNT :
- * A do nothing function. Used to provide a point at which calls can be made.
+ * LOOP_COUNT :
+ * A do nothing function. Used to provide a point at which calls can be made.
*****************************************************************/
void loop_count () {
* the call command behavior when integer arguments do not fit into
* registers and must be placed on the stack.
* OUT struct bit_flags_char_t *bit_flags -- structure to be filled
- * IN unsigned a -- 0 or 1
- * IN unsigned b -- 0 or 1
- * IN unsigned g -- 0 or 1
- * IN unsigned d -- 0 or 1
- * IN unsigned e -- 0 or 1
- * IN unsigned o -- 0 or 1
+ * IN unsigned a -- 0 or 1
+ * IN unsigned b -- 0 or 1
+ * IN unsigned g -- 0 or 1
+ * IN unsigned d -- 0 or 1
+ * IN unsigned e -- 0 or 1
+ * IN unsigned o -- 0 or 1
*****************************************************************/
void init_bit_flags_char (
struct bit_flags_char_t *bit_flags,
* the call command behavior when integer arguments do not fit into
* registers and must be placed on the stack.
* OUT struct bit_flags_short_t *bit_flags -- structure to be filled
- * IN unsigned a -- 0 or 1
- * IN unsigned b -- 0 or 1
- * IN unsigned g -- 0 or 1
- * IN unsigned d -- 0 or 1
- * IN unsigned e -- 0 or 1
- * IN unsigned o -- 0 or 1
+ * IN unsigned a -- 0 or 1
+ * IN unsigned b -- 0 or 1
+ * IN unsigned g -- 0 or 1
+ * IN unsigned d -- 0 or 1
+ * IN unsigned e -- 0 or 1
+ * IN unsigned o -- 0 or 1
*****************************************************************/
void init_bit_flags_short (
struct bit_flags_short_t *bit_flags,
* the call command behavior when integer arguments do not fit into
* registers and must be placed on the stack.
* OUT struct bit_flags_t *bit_flags -- structure to be filled
- * IN unsigned a -- 0 or 1
- * IN unsigned b -- 0 or 1
- * IN unsigned g -- 0 or 1
- * IN unsigned d -- 0 or 1
- * IN unsigned e -- 0 or 1
- * IN unsigned o -- 0 or 1
+ * IN unsigned a -- 0 or 1
+ * IN unsigned b -- 0 or 1
+ * IN unsigned g -- 0 or 1
+ * IN unsigned d -- 0 or 1
+ * IN unsigned e -- 0 or 1
+ * IN unsigned o -- 0 or 1
*****************************************************************/
void init_bit_flags (
struct bit_flags_t *bit_flags,
* to see the call command behavior when integer and character arguments
* do not fit into registers and must be placed on the stack.
* OUT struct bit_flags_combo_t *bit_flags_combo -- structure to fill
- * IN unsigned a -- 0 or 1
- * IN unsigned b -- 0 or 1
+ * IN unsigned a -- 0 or 1
+ * IN unsigned b -- 0 or 1
* IN char ch1
- * IN unsigned g -- 0 or 1
- * IN unsigned d -- 0 or 1
+ * IN unsigned g -- 0 or 1
+ * IN unsigned d -- 0 or 1
* IN char ch2
- * IN unsigned e -- 0 or 1
- * IN unsigned o -- 0 or 1
+ * IN unsigned e -- 0 or 1
+ * IN unsigned o -- 0 or 1
*****************************************************************/
void init_bit_flags_combo (
struct bit_flags_combo_t *bit_flags_combo,
/*****************************************************************
- * INIT_ONE_DOUBLE :
- * OUT struct one_double_t *one_double -- structure to fill
+ * INIT_ONE_DOUBLE :
+ * OUT struct one_double_t *one_double -- structure to fill
* IN double init_val
*****************************************************************/
void init_one_double ( struct one_double_t *one_double, double init_val)
}
/*****************************************************************
- * INIT_TWO_FLOATS :
+ * INIT_TWO_FLOATS :
* OUT struct two_floats_t *two_floats -- structure to be filled
- * IN float init_val1
- * IN float init_val2
+ * IN float init_val1
+ * IN float init_val2
*****************************************************************/
void init_two_floats (
struct two_floats_t *two_floats,
}
/*****************************************************************
- * INIT_THREE_CHARS :
+ * INIT_THREE_CHARS :
* OUT struct three_char_t *three_char -- structure to be filled
- * IN char init_val1
- * IN char init_val2
- * IN char init_val3
+ * IN char init_val1
+ * IN char init_val2
+ * IN char init_val3
*****************************************************************/
void init_three_chars (
struct three_char_t *three_char,
}
/*****************************************************************
- * INIT_FIVE_CHARS :
+ * INIT_FIVE_CHARS :
* OUT struct five_char_t *five_char -- structure to be filled
- * IN char init_val1
- * IN char init_val2
- * IN char init_val3
- * IN char init_val4
- * IN char init_val5
+ * IN char init_val1
+ * IN char init_val2
+ * IN char init_val3
+ * IN char init_val4
+ * IN char init_val5
*****************************************************************/
void init_five_chars (
struct five_char_t *five_char,
}
/*****************************************************************
- * INIT_INT_CHAR_COMBO :
+ * INIT_INT_CHAR_COMBO :
* OUT struct int_char_combo_t *combo -- structure to be filled
- * IN int init_val1
- * IN char init_val2
+ * IN int init_val1
+ * IN char init_val2
*****************************************************************/
void init_int_char_combo (
struct int_char_combo_t *combo,
}
/*****************************************************************
- * INIT_STRUCT_REP :
+ * INIT_STRUCT_REP :
* OUT struct small_rep_into_t *small_struct -- structure to be filled
- * IN int seed
+ * IN int seed
*****************************************************************/
void init_struct_rep(
struct small_rep_info_t *small_struct,
int seed)
{
- small_struct->value = 2 + (seed*2);
- small_struct->head = 0;
+ small_struct->value = 2 + (seed*2);
+ small_struct->head = 0;
}
/*****************************************************************
- * PRINT_BIT_FLAGS_CHAR :
- * IN struct bit_flags_char_t bit_flags
+ * PRINT_BIT_FLAGS_CHAR :
+ * IN struct bit_flags_char_t bit_flags
****************************************************************/
struct bit_flags_char_t print_bit_flags_char (struct bit_flags_char_t bit_flags)
{
if (bit_flags.epsilon) printf("epsilon\n");
if (bit_flags.omega) printf("omega\n");
return bit_flags;
-
+
}
/*****************************************************************
- * PRINT_BIT_FLAGS_SHORT :
- * IN struct bit_flags_short_t bit_flags
+ * PRINT_BIT_FLAGS_SHORT :
+ * IN struct bit_flags_short_t bit_flags
****************************************************************/
struct bit_flags_short_t print_bit_flags_short (struct bit_flags_short_t bit_flags)
{
if (bit_flags.epsilon) printf("epsilon\n");
if (bit_flags.omega) printf("omega\n");
return bit_flags;
-
+
}
/*****************************************************************
- * PRINT_BIT_FLAGS :
- * IN struct bit_flags_t bit_flags
+ * PRINT_BIT_FLAGS :
+ * IN struct bit_flags_t bit_flags
****************************************************************/
struct bit_flags_t print_bit_flags (struct bit_flags_t bit_flags)
{
if (bit_flags.epsilon) printf("epsilon\n");
if (bit_flags.omega) printf("omega\n");
return bit_flags;
-
+
}
/*****************************************************************
- * PRINT_BIT_FLAGS_COMBO :
- * IN struct bit_flags_combo_t bit_flags_combo
+ * PRINT_BIT_FLAGS_COMBO :
+ * IN struct bit_flags_combo_t bit_flags_combo
****************************************************************/
struct bit_flags_combo_t print_bit_flags_combo (struct bit_flags_combo_t bit_flags_combo)
{
if (bit_flags_combo.omega) printf("omega\n");
printf("ch1: %c\tch2: %c\n", bit_flags_combo.ch1, bit_flags_combo.ch2);
return bit_flags_combo;
-
+
}
/*****************************************************************
- * PRINT_ONE_DOUBLE :
- * IN struct one_double_t one_double
+ * PRINT_ONE_DOUBLE :
+ * IN struct one_double_t one_double
****************************************************************/
struct one_double_t print_one_double (struct one_double_t one_double)
{
printf("Contents of one_double_t: \n\n");
printf("%f\n", one_double.double1);
return one_double;
-
+
}
/*****************************************************************
- * PRINT_TWO_FLOATS :
- * IN struct two_floats_t two_floats
+ * PRINT_TWO_FLOATS :
+ * IN struct two_floats_t two_floats
****************************************************************/
struct two_floats_t print_two_floats (struct two_floats_t two_floats)
{
printf("Contents of two_floats_t: \n\n");
printf("%f\t%f\n", two_floats.float1, two_floats.float2);
return two_floats;
-
+
}
/*****************************************************************
- * PRINT_THREE_CHARS :
+ * PRINT_THREE_CHARS :
* IN struct three_char_t three_char
****************************************************************/
struct three_char_t print_three_chars (struct three_char_t three_char)
printf("Contents of three_char_t: \n\n");
printf("%c\t%c\t%c\n", three_char.ch1, three_char.ch2, three_char.ch3);
return three_char;
-
+
}
/*****************************************************************
- * PRINT_FIVE_CHARS :
+ * PRINT_FIVE_CHARS :
* IN struct five_char_t five_char
****************************************************************/
struct five_char_t print_five_chars (struct five_char_t five_char)
{
printf("Contents of five_char_t: \n\n");
- printf("%c\t%c\t%c\t%c\t%c\n", five_char.ch1, five_char.ch2,
- five_char.ch3, five_char.ch4,
+ printf("%c\t%c\t%c\t%c\t%c\n", five_char.ch1, five_char.ch2,
+ five_char.ch3, five_char.ch4,
five_char.ch5);
return five_char;
-
+
}
/*****************************************************************
- * PRINT_INT_CHAR_COMBO :
+ * PRINT_INT_CHAR_COMBO :
* IN struct int_char_combo_t int_char_combo
****************************************************************/
struct int_char_combo_t print_int_char_combo (struct int_char_combo_t int_char_combo)
printf("Contents of int_char_combo_t: \n\n");
printf("%d\t%c\n", int_char_combo.int1, int_char_combo.ch1);
return int_char_combo;
-
-}
+
+}
/*****************************************************************
- * PRINT_STRUCT_REP :
+ * PRINT_STRUCT_REP :
****************************************************************/
struct small_rep_info_t print_struct_rep(struct small_rep_info_t struct1)
{
printf("Contents of struct1: \n\n");
- printf("%10d%10d\n", struct1.value, struct1.head);
+ printf("%10d%10d\n", struct1.value, struct1.head);
struct1.value =+5;
-
+
return struct1;
-
+
}
{
- printf("%10d%10d\n", linked_list1.values[0],
- linked_list1.next_index[0]);
-
+ printf("%10d%10d\n", linked_list1.values[0],
+ linked_list1.next_index[0]);
+
return linked_list1;
-
+
}
/*****************************************************************
int main () {
-
+
/* variables for large structure testing
*/
int number = 10;
gdb_unbuffer_output ();
- /* Allocate space for large structures
+ /* Allocate space for large structures
*/
list1 = (struct array_rep_info_t *)malloc(sizeof(struct array_rep_info_t));
- /* Initialize large structures
+ /* Initialize large structures
*/
init_array_rep(list1, 2);
- /* Print large structures
+ /* Print large structures
*/
print_one_large_struct(*list1);
- /* Allocate space for small structures
+ /* Allocate space for small structures
*/
struct1 = (struct small_rep_info_t *)malloc(sizeof(struct small_rep_info_t));
cflags = (struct bit_flags_char_t *)malloc(sizeof(struct bit_flags_char_t));
d1 = (struct one_double_t *)malloc(sizeof(struct one_double_t));
f3 = (struct two_floats_t *)malloc(sizeof(struct two_floats_t));
- /* Initialize small structures
+ /* Initialize small structures
*/
- init_one_double ( d1, 1.11111);
- init_two_floats ( f3, -2.345, 1.0);
- init_bit_flags_char(cflags, (unsigned)1, (unsigned)0, (unsigned)1,
- (unsigned)0, (unsigned)1, (unsigned)0 );
- init_bit_flags_short(sflags, (unsigned)1, (unsigned)0, (unsigned)1,
- (unsigned)0, (unsigned)1, (unsigned)0 );
- init_bit_flags(flags, (unsigned)1, (unsigned)0, (unsigned)1,
- (unsigned)0, (unsigned)1, (unsigned)0 );
+ init_one_double ( d1, 1.11111);
+ init_two_floats ( f3, -2.345, 1.0);
+ init_bit_flags_char(cflags, (unsigned)1, (unsigned)0, (unsigned)1,
+ (unsigned)0, (unsigned)1, (unsigned)0 );
+ init_bit_flags_short(sflags, (unsigned)1, (unsigned)0, (unsigned)1,
+ (unsigned)0, (unsigned)1, (unsigned)0 );
+ init_bit_flags(flags, (unsigned)1, (unsigned)0, (unsigned)1,
+ (unsigned)0, (unsigned)1, (unsigned)0 );
init_bit_flags_combo(flags_combo, (unsigned)1, (unsigned)0, 'y',
(unsigned)1, (unsigned)0, 'n',
- (unsigned)1, (unsigned)0 );
+ (unsigned)1, (unsigned)0 );
init_three_chars(three_char, 'x', 'y', 'z');
init_five_chars(five_char, 'h', 'e', 'l', 'l', 'o');
init_int_char_combo(int_char_combo, 13, '!');
init_struct_rep(struct1, 10);
-
-
- /* Print small structures
+
+
+ /* Print small structures
*/
print_one_double(*d1);
print_two_floats(*f3);
T fun()
{
- return foo;
+ return foo;
}
void Fun(T foo)
zed ();
while (1)
{
- L = fun ();
+ L = fun ();
zed ();
}
}
char * str_func(
-char * s1,
+char * s1,
char * s2,
char * s3,
char * s4,
(i5 == 5) && (i6 == 6) && (i7 == 7) && (i8 == 8) && (i9 == 9);
}
-/* Functions that expect specific values to be passed and return
+/* Functions that expect specific values to be passed and return
either 0 or 1, depending upon whether the values were
passed incorrectly or correctly, respectively. */
There must be one version of "t_float_values" (this one)
that is not prototyped, and one (if supported) that is (following).
That way GDB can be tested against both cases. */
-
+
int t_float_values (float_arg1, float_arg2)
float float_arg1, float_arg2;
{
/* This file is used to test the 'catch syscall' feature on GDB.
-
+
Please, if you are going to edit this file DO NOT change the syscalls
being called (nor the order of them). If you really must do this, then
take a look at catch-syscall.exp and modify there too.
/*
- * Test that GDB cleans up properly after errors that result when a
- * breakpoint is reset.
+ * Test that GDB cleans up properly after errors that result when a
+ * breakpoint is reset.
*/
/* VARIABLE is a macro defined on the compiler command line. */
-/*
+/*
Purpose of this test: to test breakpoints on consecutive instructions.
*/
volatile unsigned long valve = 2000;
volatile float vacuity = 3.0;
volatile double vertigo = 10.3;
-
+
/* pointers to volatile variables */
volatile char * vampire = &vox;
const char * const volatile cove = &laconic;
const unsigned char * const volatile cavity = &laggard;
-
+
/* const volatile pointers to volatile vars */
volatile char * const volatile vagus = &vox;
volatile unsigned char * const volatile vagrancy = &victuals;
-
+
/* const volatile pointers to const volatile */
const volatile char * const volatile vagary = &victor;
const volatile unsigned char * const volatile vendor = &vicar;
-
+
/* const volatile arrays */
const volatile char vindictive[2] = {victor, victor};
const volatile unsigned char vegetation[2] = {vicar, vicar};
volatile signed char & remuneration = lemonade;
*/
marker1 ();
-
+
return 0;
}
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-/* This test has two large memory areas buf_rw and buf_ro.
+/* This test has two large memory areas buf_rw and buf_ro.
buf_rw is written to by the program while buf_ro is initialized at
compile / load time. Thus, when a core file is created, buf_rw's
const char * const volatile cove;
const unsigned char * const volatile cavity;
-
+
/* const volatile pointers to volatile vars */
volatile char * const volatile vagus;
volatile unsigned char * const volatile vagrancy;
-
+
/* const volatile pointers to const volatile */
const volatile char * const volatile vagary;
/**** Enumerations *******/
-enum
+enum
/* Work around the bug for compilers which don't put out the right stabs. */
#if __GNUC__ < 2 && !defined (_AIX)
primary1_tag
sum++; f++; force_mem (&k);
}
}
- }
+ }
return i; /* set breakpoint 2 here */
}
for( j = 0; j < LOOP; j++ ) {
if( p_c[j] == c ) { /* set breakpoint 3 here */
j++;
- }
+ }
else {
i++;
}
main()
{
do_loops();
- do_vars();
+ do_vars();
return 0;
}
char *name = "application";
TEST_TWO_LOCATIONS ();
-
+
int i = 0;
while (i < 10)
{
else
TEST_TWO_LOCATIONS ();
}
-
+
return 0; /* last break here */
}
extern void dummy();
dummy();
return 0;
-
+
}
/* We put main() right up front so its line number doesn't keep changing. */
v_short = 3;
v_signed_short = 4;
- v_unsigned_short = 5;
+ v_unsigned_short = 5;
v_int = 6;
v_signed_int = 7;
- v_unsigned_int = 8;
+ v_unsigned_int = 8;
v_long = 9;
v_signed_long = 10;
- v_unsigned_long = 11;
-
+ v_unsigned_long = 11;
+
v_float = 100.0;
v_double = 200.0;
v_char_array[0] = v_char;
1) Attempt to create file that already exists - EEXIST
2) Attempt to open a directory for writing - EISDIR
3) Pathname does not exist - ENOENT
-4) Open for write but no write permission - EACCES
+4) Open for write but no write permission - EACCES
read(int fd, void *buf, size_t count);
1) Read using invalid file descriptor - EBADF
ret = open (OUTDIR FILENAME, O_CREAT | O_TRUNC | O_RDWR, S_IWUSR | S_IRUSR);
printf ("open 1: ret = %d, errno = %d %s\n", ret, errno,
ret >= 0 ? "OK" : "");
-
+
if (ret >= 0)
close (ret);
stop ();
short s;
int i;
long l;
-} SVAL;
+} SVAL;
void hitbottom ()
{
call6a (c, s, i, l, f, d, uc, us, ui, ul);
call7a (c, i, s, l, f, uc, d, us, ul, ui);
-
+
/* Test passing structures recursively. */
test_struct_args ();
static int un_initialized_array[4];
static char *heap_string;
-void
+void
terminal_func ()
{
return;
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-
+
This file was written by Michael Elizabeth Chastain (mec@shout.net). */
struct s_2_by_4
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-
+
This file was written by Michael Elizabeth Chastain (mec@shout.net). */
#include <stdlib.h>
int i;
gnu_ifunc_pre ();
-
+
i = gnu_ifunc (1); /* break-at-call */
assert (i == 2);
/* Lock the mutex to prevent the new thread from finishing immediately. */
pthread_mutex_lock (&mutex);
pthread_create (&thread, NULL, thread_proc, 0);
-
+
sock = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP);
if (sock < 0)
{
printf ("Cannot create socket.\n");
return 1;
}
-
+
sock_addr.sin_family = AF_INET;
sock_addr.sin_port = 0; /* Bind to a free port. */
sock_addr.sin_addr.s_addr = htonl (INADDR_ANY);
int main ()
{
-
+
x = 14;
y = 3;
z = 2;
w = 2;
return 0;
-
+
}
here:
printf("not here\n");
i = 1;
-
+
there:
printf("but here\n");
if (i == 0)
/* A union is used here as, hopefully it has well defined packing
rules. */
struct {
- long long bin, oct, dec, hex;
+ long long bin, oct, dec, hex;
} val;
memset (&val, 0, sizeof val);
pack (ll, sizeof (long long), 2);
known_types();
-
+
return 0;
}
void
marker1 ()
{
-
+
}
int
dbig.d[202] = 9.99999999;
sbig.s[90] = 255;
lbig.l[333] = 999999999;
-
+
marker1 ();
return 0;
}
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include <stdlib.h>
+#include <stdlib.h>
int
main (void)
since libgloss is the one intended to handle low level system issues.
I would suggest something like _flush_cache to avoid the user's namespace
but not be completely obscure as other things may need this facility. */
-
+
static void
FlushCache (void)
{
}
/* _ovly_debug_event:
- * Debuggers may set a breakpoint here, to be notified
+ * Debuggers may set a breakpoint here, to be notified
* when the overlay table has been modified.
*/
static void
else if (_ovly_table[i][VMA] == _ovly_table[ovlyno][VMA])
_ovly_table[i][MAPPED] = 0; /* this one now un-mapped */
- ovly_copy (_ovly_table[ovlyno][VMA],
- _ovly_table[ovlyno][LMA],
+ ovly_copy (_ovly_table[ovlyno][VMA],
+ _ovly_table[ovlyno][LMA],
_ovly_table[ovlyno][SIZE]);
FlushCache ();
* Does NOT mark overlay as "unmapped", therefore may be called
* more than once for the same mapped overlay.
*/
-
+
bool
OverlayUnload (unsigned long ovlyno)
{
if (ovlyno < 0 || ovlyno >= _novlys)
exit (-1); /* fail, bad ovly number */
-
+
if (!_ovly_table[ovlyno][MAPPED])
exit (-1); /* error, can't copy out a segment that's not "in" */
-
- ovly_copy (_ovly_table[ovlyno][LMA],
+
+ ovly_copy (_ovly_table[ovlyno][LMA],
_ovly_table[ovlyno][VMA],
_ovly_table[ovlyno][SIZE]);
{
void dummy();
int more_code();
-
+
dummy();
more_code ();
usevar (&y);
return 0;
-
+
}
void dummy()
{
-
-
+
+
v_char = 0;
v_signed_char = 1;
v_unsigned_char = 2;
v_short = 3;
v_signed_short = 4;
- v_unsigned_short = 5;
+ v_unsigned_short = 5;
v_int = 6;
v_signed_int = 7;
- v_unsigned_int = 8;
+ v_unsigned_int = 8;
v_long = 9;
v_signed_long = 10;
- v_unsigned_long = 11;
-
+ v_unsigned_long = 11;
+
v_float = 100.0;
v_double = 200.0;
v_double_pointer = &v_double;
ptr_to_ptr_to_float = &v_float_pointer;
-
-
+
+
v_char_array[0] = v_char;
v_signed_char_array[0] = v_signed_char;
v_unsigned_char_array[0] = v_unsigned_char;
v_int_array[0] = v_int;
v_int_array[1] = v_int * 3;
-
+
v_signed_int_array[0] = v_signed_int;
v_unsigned_int_array[0] = v_unsigned_int;
pUL = &UL;
pF = &F;
pD = &D;
-
+
marker1();
return 0;
}
/**** Enumerations *******/
-enum
+enum
/* Work around the bug for compilers which don't put out the right stabs. */
#if __GNUC__ < 2 && !defined (_AIX)
primary1_tag
-/* Trivial code used to test watchpoints in recursive code and
+/* Trivial code used to test watchpoints in recursive code and
auto-deletion of watchpoints as they go out of scope. */
static int
#include <stdio.h>
#include <stdlib.h>
-/**************************************************************************
+/**************************************************************************
* TESTS :
* -- downloading of a rather large executable
- ***************************************************************************/
+ ***************************************************************************/
/* A large array in .data. If RLE compression becomes available during
- downloads, this would have to become a bunch of real random data.
+ downloads, this would have to become a bunch of real random data.
Here's a quick way of generating such a bunch:
awk < /dev/null '
};
int
-main()
+main()
{
long size = sizeof (random_data) / sizeof (random_data[0]);
printf ("%d\n", random_data [size - 1]);
in this file. If people modify the functions manually, instead of
changing this expression and re-running it, then evaluating this
expression could wipe out their work, so you probably shouldn't
- re-run it. But I leave it here for reference.
+ re-run it. But I leave it here for reference.
(defun callee (n) (format "callee%d" n))
(defun caller (n) (format "caller%d" n))
(while (<= j n)
(insert " register int " (local j)
" = increment (" previous ");")
- (if first-end
+ (if first-end
(progn
(insert " /" "* " first-end " prologue *" "/")
(setq first-end nil)))
(insert " register int n;\n")
(let ((j 0))
(while (<= j limit)
- (insert " n = " (callee j) " ("
+ (insert " n = " (callee j) " ("
(if (> j 0) "n + " "")
last ");\n")
(setq j (1+ j)))))
double double_resultval;
int i;
- /* A "test load" that will insure that the function really returns
+ /* A "test load" that will insure that the function really returns
a ${type} (as opposed to just a truncated or part of a ${type}). */
for (i = 0; i < sizeof (testval.ffff); i++)
testval.ffff[i] = 0xff;
throughout the value, so we'll still detect truncated values. */
testval.float_testval = 2.7182818284590452354;/* long_long_checkpoint */
- float_resultval = float_func ();
+ float_resultval = float_func ();
testval.double_testval = 3.14159265358979323846; /* float_checkpoint */
- double_resultval = double_func ();
+ double_resultval = double_func ();
main_test = 1; /* double_checkpoint */
return 0;
}
#ifdef FAKEARGV
printf ("%d\n", factorial (1)); /* commands.exp: hw local_var out of scope */
-#else
+#else
if (argc != 2) {
printf ("usage: factorial <number>\n");
return 1;
{
void bar ();
-
+
static int funclocal = 3; /* In Data section */
static int funclocal_bss; /* In BSS section */
static const int funclocal_ro = 203; /* RO Data */
void usestatics1 ()
{
void useit1 (const int *val);
-
+
useit1 (&filelocal);
useit1 (&filelocal_bss);
useit1 (&filelocal_ro);
v_short = 3;
v_signed_short = 4;
- v_unsigned_short = 5;
+ v_unsigned_short = 5;
v_int = 6;
v_signed_int = 7;
- v_unsigned_int = 8;
+ v_unsigned_int = 8;
v_long = 9;
v_signed_long = 10;
- v_unsigned_long = 11;
-
+ v_unsigned_long = 11;
+
v_float = 100.0;
v_double = 200.0;
int eglob;
struct {
- int a;
+ int a;
int b;
} s;
{
kill (getpid (), SIGABRT);
return 0;
-}
+}
int x;
handle_HUP (0);
#endif
return 0;
-}
+}
int
gen_QUIT ()
handle_USR2 (0);
#endif
return 0;
-}
+}
int
gen_PWR ()
{
foo ();
return 0;
-}
+}
/* Test "stepi" */
a[5] = a[3] - a[4];
callee(); /* STEPI */
-
+
/* Test "nexti" */
callee(); /* NEXTI */
wack_struct_2 ();
wack_struct_3 ();
wack_struct_4 ();
-
+
/* These calls are for up frame. */
wack_struct_1 ();
wack_struct_2 ();
wack_struct_3 ();
wack_struct_4 ();
-
+
wack_field_1 ();
wack_field_2 ();
wack_field_3 ();
struct struct1 fun1()
{
- return foo1;
+ return foo1;
}
struct struct2 fun2()
{
}
struct struct10 fun10()
{
- return foo10;
+ return foo10;
}
struct struct11 fun11()
{
- return foo11;
+ return foo11;
}
struct struct12 fun12()
{
- return foo12;
+ return foo12;
}
struct struct13 fun13()
{
- return foo13;
+ return foo13;
}
struct struct14 fun14()
{
- return foo14;
+ return foo14;
}
struct struct15 fun15()
{
- return foo15;
+ return foo15;
}
struct struct16 fun16()
{
- return foo16;
+ return foo16;
}
struct struct17 fun17()
{
- return foo17;
+ return foo17;
}
struct struct18 fun18()
{
- return foo18;
+ return foo18;
}
void Fun1(struct struct1 foo1)
}
void Fun10(struct struct10 foo10)
{
- L10 = foo10;
+ L10 = foo10;
}
void Fun11(struct struct11 foo11)
{
- L11 = foo11;
+ L11 = foo11;
}
void Fun12(struct struct12 foo12)
{
- L12 = foo12;
+ L12 = foo12;
}
void Fun13(struct struct13 foo13)
{
- L13 = foo13;
+ L13 = foo13;
}
void Fun14(struct struct14 foo14)
{
- L14 = foo14;
+ L14 = foo14;
}
void Fun15(struct struct15 foo15)
{
- L15 = foo15;
+ L15 = foo15;
}
void Fun16(struct struct16 foo16)
{
- L16 = foo16;
+ L16 = foo16;
}
void Fun17(struct struct17 foo17)
{
- L17 = foo17;
+ L17 = foo17;
}
void Fun18(struct struct18 foo18)
{
- L18 = foo18;
+ L18 = foo18;
}
void
chartest[i].c = i;
chartest[0].c = 0; /* chartest-done */
- Fun1(foo1);
- Fun2(foo2);
- Fun3(foo3);
- Fun4(foo4);
- Fun5(foo5);
- Fun6(foo6);
- Fun7(foo7);
- Fun8(foo8);
- Fun9(foo9);
+ Fun1(foo1);
+ Fun2(foo2);
+ Fun3(foo3);
+ Fun4(foo4);
+ Fun5(foo5);
+ Fun6(foo6);
+ Fun7(foo7);
+ Fun8(foo8);
+ Fun9(foo9);
Fun10(foo10);
Fun11(foo11);
Fun12(foo12);
for (i = 0; i < 1000000; ++i)
{
zed ();
- L1 = fun1();
- L2 = fun2();
- L3 = fun3();
- L4 = fun4();
- L5 = fun5();
- L6 = fun6();
- L7 = fun7();
- L8 = fun8();
- L9 = fun9();
+ L1 = fun1();
+ L2 = fun2();
+ L3 = fun3();
+ L4 = fun4();
+ L5 = fun5();
+ L6 = fun6();
+ L7 = fun7();
+ L8 = fun8();
+ L9 = fun9();
L10 = fun10();
L11 = fun11();
L12 = fun12();
along with this program. If not, see <http://www.gnu.org/licenses/>. */
struct struct_libtype_opaque
-{
+{
int libfield_opaque;
};
struct struct_libtype_opaque struct_libtype_opaque_use;
struct struct_libtype_empty
-{
+{
int libfield_empty;
};
struct struct_libtype_empty struct_libtype_empty_use;
struct struct_libtype_filled
-{
+{
int libfield_filled;
};
struct struct_libtype_filled struct_libtype_filled_use;
union union_libtype_opaque
-{
+{
int libfield_opaque;
};
union union_libtype_opaque union_libtype_opaque_use;
union union_libtype_empty
-{
+{
int libfield_empty;
};
union union_libtype_empty union_libtype_empty_use;
union union_libtype_filled
-{
+{
int libfield_filled;
};
union union_libtype_filled union_libtype_filled_use;
struct struct_libtype_empty
{
- };
+ };
struct struct_libtype_filled
{
long mainfield_filled;
- };
+ };
union union_libtype_opaque;
union union_libtype_empty
{
- };
+ };
union union_libtype_filled
{
long mainfield_filled;
- };
+ };
int main (void)
{
const char *msg;
handle = dlopen (SHLIB_NAME, RTLD_LAZY);
-
+
if (!handle)
{
fprintf (stderr, "%s\n", dlerror ());
/* The second library should share the same memory address. */
handle = dlopen (SHLIB_NAME2, RTLD_LAZY);
-
+
if (!handle)
{
fprintf (stderr, "%s\n", dlerror ());
nop
popq %rbp
.cfi_def_cfa 7, 8
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.cfi_endproc
.LFE0:
nop
leave
.cfi_def_cfa 7, 8
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.cfi_endproc
.LFE1:
nop
popq %rbp
#.cfi_def_cfa 7, 8
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.cfi_endproc
.LFE0:
nop
leave
#.cfi_def_cfa 7, 8
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.cfi_endproc
.LFE1:
popl %ebp
.cfi_restore 5
# .cfi_def_cfa 4, 4
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.cfi_endproc
.LFE0:
leave
.cfi_restore 5
# .cfi_def_cfa 4, 4
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.cfi_endproc
.LFE1:
-/* varargs.c -
+/* varargs.c -
* (Added as part of fix for bug 15306 - "call" to varargs functions fails)
* This program is intended to let me try out "call" to varargs functions
* with varying numbers of declared args and various argument types.
dd = 2.0;
dmax_val = find_max_double(3, 1.0, 4.0, 2.0);
dmax_val = find_max_double(a, db, dc, dd);
-
+
return 0;
}
void (*foo) (int);
handle = dlopen (SHLIB_NAME, RTLD_LAZY);
-
+
if (!handle)
{
#ifdef __WIN32__
int ival3 = -1;
int ival4 = -1;
-int
+int
main ()
{
for (count = 0; count < 4; count++) {
bar (void)
{
puts ("bar in u1");
-}
+}
void bar (void);
void
foo (void)
-{
+{
bar ();
-}
+}
void
bar (void)
-{
+{
puts ("bar in u2");
-}
+}
v_short = 3;
v_signed_short = 4;
- v_unsigned_short = 5;
+ v_unsigned_short = 5;
v_int = 6;
v_signed_int = 7;
- v_unsigned_int = 8;
+ v_unsigned_int = 8;
v_long = 9;
v_signed_long = 10;
- v_unsigned_long = 11;
+ v_unsigned_long = 11;
#ifndef NO_LONG_LONG
v_long_long = 12;
JVA2 jva2;
JVA1V jva1v;
JE je;
-
+
int i;
i += k.i + m.w + a1.x + a2.x + a3.x + x.z + l.z + n.r + j.j;
/* Code to go along with tests in breakpoint.exp.
-
+
Copyright 2004-2025 Free Software Foundation, Inc.
This file is part of GDB.
C1::Nested c1;
c1.foo ();
-
+
C1 c2 (2), c3 (3);
c2.foo ();
c2.bar ();
g_anon_union.one = 1;
g_anon_union.a = 2;
- inheritance2 ();
+ inheritance2 ();
}
// ======================== static member functions =====================
g_vE.vE::ve = 27;
g_vE.vE::vx = 28;
- inheritance4 ();
+ inheritance4 ();
}
// ======================================================================
compile it:
warning: the address of 'int foo1_7(bool)' will always evaluate as true
-
+
foo1_7 (&foo1_7); // pointer to boolean
*/
-
+
foo1_7 (&A::member_); // pointer to member to boolean
foo1_7 (a); // pointer to boolean
foo1_7 (fp); // float to boolean
bool operator== (const Foo &other) { return foo_value == other.foo_value; }
};
-
+
void Foo::set_foo (int value)
{
foo_value = value;
int operator% (base const& o) const { // base::operator%
return foo_ % o.foo_; }
-
+
base operator%= (base const& o) { // base::operator%=
foo_ %= o.foo_; return *this; }
base operator|= (base const& o) { // base::operator|=
foo_ |= o.foo_; return *this; }
-
+
int operator^ (base const& o) const { // base::operator^
return foo_ ^ o.foo_; }
main (void)
{
foo f;
- return f.baz (foo::bar () + 3);
+ return f.baz (foo::bar () + 3);
}
extern void add1();
extern void subr2();
extern void subr3();
-
+
c = 'a';
i = 2;
f = 4.5;
unsigned char c;
int i;
float f;
-
+
c = 'b';
i = 3;
f = 6.5;
unsigned char c;
int i;
float f;
-
+
c = 'b';
i = 3;
f = 6.5;
unsigned char c;
int i;
float f;
-
+
c = 'b';
i = 3;
f = 6.5;
}
A::value_type bfoo();
A::value_type foo();
-
+
};
}
int cfoo();
int foo();
-
+
};
}
value_type dfoo();
value_type foo();
-
+
};
}
value_type efoo();
value_type foo();
-
+
};
}
value_type ffoo();
value_type foo();
-
+
};
class G : private A, public B, protected C {
a=15;
b=16;
c=17;
-
+
}
int gfoo();
int foo();
-
+
};
class Z : public A
A::value_type A::foo()
{
return 7;
-
+
}
A::value_type B::foo()
{
return 8;
-
+
}
A::value_type C::foo()
{
return 9;
-
+
}
D::value_type D::foo()
{
return 10;
-
+
}
E::value_type E::foo()
{
return 11;
-
+
}
F::value_type F::foo()
{
return 12;
-
+
}
int G::foo()
{
return 13;
-
+
}
ZZ zz_instance;
marker1(); // marker1-returns-here
-
+
a_instance.a = 20; // marker1-returns-here
a_instance.aa = 21;
b_instance.b = 22;
dobj.doit ();
foo2 ();
return 0;
-
+
}
}
extern "C" int bar (int k, unsigned long eharg, int flag);
-
+
int bar (int k, unsigned long eharg, int flag)
{
return 1;
catch (int x) {
catcher (x);
}
-
+
try {
try {
j = foo (20);
catcher (y);
}
- // Not caught
+ // Not caught
foo (20);
}
struct Struct1
{
- int x, y;
+ int x, y;
};
int f1 (Struct1& s, Enum1& e, int& i)
Enum1 e1 = Val11;
-int main(void)
+int main(void)
{
f1 (s1, e1, i1);
/* Code to go along with tests in rtti.exp.
-
+
Copyright 2015-2025 Free Software Foundation, Inc.
This file is part of GDB.
L::A::B::O labo;
foo (labo);
-
+
M::A ma;
foo(ma,'a');
ma.foo('a');
// Tests for local types
void marker1 (void)
-{
+{
}
void marker2 (void)
{
}
-
+
int foobar (int x)
{
class Local {
int main()
{
int c;
-
+
c = foobar (31);
-
+
{ // inner block
class InnerLocal {
public:
{
protected:
antiquities value_derived;
-
+
public:
gnu_obj_2(antiquities b): gnu_obj_1(oriental, 7), value_derived(b) { }
-};
+};
// Test three.
template<typename T>
protected:
typedef region antiquities;
gnu_obj_2<int> data;
-
+
public:
gnu_obj_3(antiquities b): data(etruscan) { }
-};
+};
int shadow = 0;
C theC (1); // breakpoint: first-constructs-done
theC.marker ();
-
+
return shadow;
}
{
public:
static antiquities value_derived;
-
+
public:
gnu_obj_2(antiquities b): gnu_obj_1(oriental, 7) { }
-};
+};
template<typename T>
typename gnu_obj_2<T>::antiquities gnu_obj_2<T>::value_derived = etruscan;
public:
typedef region antiquities;
static gnu_obj_2<int> data;
-
+
public:
gnu_obj_3(antiquities b) { }
-};
+};
template<typename T>
gnu_obj_2<int> gnu_obj_3<T>::data(etruscan);
#include <stdio.h>
-class Base
+class Base
{
public:
Base(int k);
a.j = 121;
a.jj = 1331;
-
+
int k;
a_p = &a;
k = (a.**pmf_p)(5);
k = a.*pmi;
-
+
k = a.bar(2);
B b;
k += b.s;
-
+
return 0;
}
a.x = k * 2;
k = a.foo(13);
-
+
k += a.bar(15);
// Test for CHFts23426 follows
g_anon_union.one = 1;
g_anon_union.a = 2;
- inheritance2 ();
+ inheritance2 ();
}
// ======================== static member functions =====================
g_vE.vE::ve = 27;
g_vE.vE::vx = 28;
- inheritance4 ();
+ inheritance4 ();
}
// ======================================================================
namespace
{
int cX = 6;
-
+
namespace F
{
int cXf = 7;
AAA::SomeEnum var = AAA::ALPHA;
using namespace BBB;
-
+
c1 = xyzq ('x');
c1 = AAA::xyzq ('x');
c1 = BBB::CCC::xyzq ('m');
-
+
inA ina;
ina.xx = 33;
c1 = cl.xyzq('e');
marker1();
-
+
C::D::marker2 ();
C::ensureRefs ();
{
function1 (val);
}
- catch (...)
+ catch (...)
{
cout << "Caught and handled function1 exception" << endl;
}
return x;
}
-int main ()
-{
+int main ()
+{
int testval = -1;
try
const char *ccpfoo;
int overload1arg (void);
-int overload1arg (char);
+int overload1arg (char);
int overload1arg (signed char);
int overload1arg (unsigned char);
int overload1arg (short);
int intintfunc (int x) { return x; }
-int main ()
+int main ()
{
char arg2 = 2;
signed char arg3 =3;
int foo::overloadfnarg (void) { return ifoo * 20; }
int foo::overloadfnarg (int arg) { arg = 0; return 13;}
-int foo::overloadfnarg (int arg, int (*foo) (int)) { return foo(arg); }
+int foo::overloadfnarg (int arg, int (*foo) (int)) { return foo(arg); }
/* Some functions to test overloading by varying argument count. */
-int foo::overloadargs (int a1)
-{ a1 = 0;
+int foo::overloadargs (int a1)
+{ a1 = 0;
return 1;}
-int foo::overloadargs (int a1, int a2)
-{ a1 = a2 = 0;
+int foo::overloadargs (int a1, int a2)
+{ a1 = a2 = 0;
return 2;}
-int foo::overloadargs (int a1, int a2, int a3)
-{ a1 = a2 = a3 = 0;
+int foo::overloadargs (int a1, int a2, int a3)
+{ a1 = a2 = a3 = 0;
return 3;}
int foo::overloadargs (int a1, int a2, int a3, int a4)
-{ a1 = a2 = a3 = a4 = 0;
+{ a1 = a2 = a3 = a4 = 0;
return 4;}
int foo::overloadargs (int a1, int a2, int a3, int a4, int a5)
-{ a1 = a2 = a3 = a4 = a5 = 0;
+{ a1 = a2 = a3 = a4 = a5 = 0;
return 5;}
int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6)
-{ a1 = a2 = a3 = a4 = a5 = a6 = 0;
+{ a1 = a2 = a3 = a4 = a5 = a6 = 0;
return 6;}
int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7)
-{ a1 = a2 = a3 = a4 = a5 = a6 = a7 = 0;
+{ a1 = a2 = a3 = a4 = a5 = a6 = a7 = 0;
return 7;}
int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
int a8)
-{ a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = 0;
+{ a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = 0;
return 8;}
int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
int a8, int a9)
-{
- a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 = 0;
+{
+ a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 = 0;
return 9;
}
const char *ccpfoo;
int overload1arg (void);
-int overload1arg (char);
+int overload1arg (char);
int overload1arg (signed char);
int overload1arg (unsigned char);
int overload1arg (short);
void marker1()
{}
-int main ()
+int main ()
{
char arg2 = 2;
signed char arg3 =3;
foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8, 9);
foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
-
+
marker1();
- return 0;
+ return 0;
}
foo::foo (int i) { ifoo = i;}
/* Some functions to test overloading by varying argument count. */
-int foo::overloadargs (int a1)
-{ a1 = 0;
+int foo::overloadargs (int a1)
+{ a1 = 0;
return 1;}
-int foo::overloadargs (int a1, int a2)
-{ a1 = a2 = 0;
+int foo::overloadargs (int a1, int a2)
+{ a1 = a2 = 0;
return 2;}
-int foo::overloadargs (int a1, int a2, int a3)
-{ a1 = a2 = a3 = 0;
+int foo::overloadargs (int a1, int a2, int a3)
+{ a1 = a2 = a3 = 0;
return 3;}
int foo::overloadargs (int a1, int a2, int a3, int a4)
-{ a1 = a2 = a3 = a4 = 0;
+{ a1 = a2 = a3 = a4 = 0;
return 4;}
int foo::overloadargs (int a1, int a2, int a3, int a4, int a5)
-{ a1 = a2 = a3 = a4 = a5 = 0;
+{ a1 = a2 = a3 = a4 = a5 = 0;
return 5;}
int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6)
-{ a1 = a2 = a3 = a4 = a5 = a6 = 0;
+{ a1 = a2 = a3 = a4 = a5 = a6 = 0;
return 6;}
int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7)
-{ a1 = a2 = a3 = a4 = a5 = a6 = a7 = 0;
+{ a1 = a2 = a3 = a4 = a5 = a6 = a7 = 0;
return 7;}
int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
int a8)
-{ a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = 0;
+{ a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = 0;
return 8;}
int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
int a8, int a9)
-{
- a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 = 0;
+{
+ a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 = 0;
return 9;
}
-class vec2
+class vec2
{
public:
vec2() { _v[0] = _v[1] = 0; }
};
vec2 vec2::axis[2] = { vec2(1,0), vec2(0,1) };
-vec2 vec2::axis6[6] = {
+vec2 vec2::axis6[6] = {
vec2(1,0), vec2(0,1),
vec2(2,0), vec2(0,2),
- vec2(3,0), vec2(0,3)
+ vec2(3,0), vec2(0,3)
};
int main(int argc, char*argv[])
class B : public A<int, B>
{
-
+
};
int main()
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
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/>. */
return mf1(C);
}
-int main(void)
+int main(void)
{
Child Q(42);
Child& QR = Q;
void marker1 (void)
{
-
+
}
I = f();
return 0;
-
+
}
/* Code to go along with tests in rtti.exp.
-
+
Copyright 2003-2025 Free Software Foundation, Inc.
Contributed by David Carlton <carlton@bactrian.org> and by Kealia,
class D2 : public C2{
public:
D2(C2 *, C2 *);
-
+
C2* expr_1_;
C2* expr_2_;
};
/* Code to go along with tests in rtti.exp.
-
+
Copyright 2003-2025 Free Software Foundation, Inc.
Contributed by David Carlton <carlton@bactrian.org> and by Kealia,
class D1 : public C1{
public:
D1(C1 *, C1 *);
-
+
C1* expr_1_;
C1* expr_2_;
};
-
+
D1::D1(C1 *expr_1, C1 *expr_2)
: expr_1_(expr_1), expr_2_(expr_2) { }
/* Code to go along with tests in rtti.exp.
-
+
Copyright 2003-2025 Free Software Foundation, Inc.
Contributed by David Carlton <carlton@bactrian.org> and by Kealia,
#include "rtti.h"
namespace n2 {
-
+
D2::D2(C2 *expr_1, C2 *expr_2)
: expr_1_(expr_1), expr_2_(expr_2) { }
T1& operator~() const;
};
-void*
+void*
T1::operator new(size_t) throw ()
{ return 0; }
static void* operator new(size_t) throw ();
static void operator delete(void *pointer);
int value();
-
+
static T X;
T x;
int val;
T5<int (*)(char, void *)> t5fi1(3);
T5<int (*)(int, double **, void *)> t5fi2(4);
-
+
int (*manage[5])(double,
void *(*malloc)(unsigned size),
void (*free)(void *pointer));
- int (*device[5])(int open(const char *, unsigned mode, unsigned perms, int extra),
+ int (*device[5])(int open(const char *, unsigned mode, unsigned perms, int extra),
int *(*read)(int fd, void *place, unsigned size),
int *(*write)(int fd, void *place, unsigned size),
void (*close)(int fd));
int x = fint.foo(33, 47);
char c = fchar.foo(33, 'x');
volatile char * cp = fvpchar.foo(33, 0);
-
+
int y = dummy<int> (400, 600);
int z = bint.bar(55, 66);
c = bazint2.baz(4, 'y');
c = quxint2.qux(4, 'z');
-
+
y = bazint.baz(4,3);
y = quxint.qux(4, 22);
y += qux11.qux(4, 22);
y *= gf1(y) - gf2(y);
-
+
Spec<int, char> sic;
Spec<int, int *> siip;
Garply<Garply<char> > nf;
nf.x = 31;
-
+
x = f.garply (3, 4);
-
+
fc = nf.garply (3, fc);
y = x + fc.x;
-
+
i=GetMax<int>(x,y);
n=GetMax<long>(l,m);
{
public:
antiquities value_derived;
-
+
gnu_obj_2(antiquities b): gnu_obj_1(oriental, 7), value_derived(b) { }
-};
+};
// Test three.
template<typename T>
public:
typedef region antiquities;
gnu_obj_2<int> data;
-
+
gnu_obj_3(antiquities b): data(etruscan) { }
-};
+};
int main()
{
if (obj.value != egyptian) // marker 1-catch
test &= false;
if (obj.key2 != 4589)
- test &= false;
+ test &= false;
}
catch (...)
{
if (obj.value != egyptian) // marker 2-catch
test &= false;
if (obj.key2 != 4589)
- test &= false;
+ test &= false;
}
}
catch (gnu_obj_1& obj)
if (obj.value != egyptian)
test &= false;
if (obj.key2 != 4589)
- test &= false;
+ test &= false;
}
}
catch (...)
int operator!();
A1 operator++();
A1 operator++(int);
-A1 operator--();
+A1 operator--();
A1 operator--(int);
};
A1 sum(0,0);
sum.x = x + second.x;
sum.y = y + second.y;
-
+
return (sum);
}
A1 product(0,0);
product.x = this->x * second.x;
product.y = this->y * second.y;
-
+
return product;
}
A1 diff(0,0);
diff.x = x - second.x;
diff.y = y - second.y;
-
+
return diff;
}
A1 div(0,0);
div.x = x / second.x;
div.y = y / second.y;
-
+
return div;
}
A1 rem(0,0);
rem.x = x % second.x;
rem.y = y % second.y;
-
+
return rem;
}
{
int a = (x == second.x);
int b = (y == second.y);
-
+
return (a && b);
}
{
int a = (x != second.x);
int b = (y != second.y);
-
+
return (a || b);
}
A1 lshft(0,0);
lshft.x = x << value;
lshft.y = y << value;
-
+
return lshft;
}
A1 rshft(0,0);
rshft.x = x >> value;
rshft.y = y >> value;
-
+
return rshft;
}
A1 abitor(0,0);
abitor.x = x | second.x;
abitor.y = y | second.y;
-
+
return abitor;
}
A1 axor(0,0);
axor.x = x ^ second.x;
axor.y = y ^ second.y;
-
+
return axor;
}
A1 abitand(0,0);
abitand.x = x & second.x;
abitand.y = y & second.y;
-
+
return abitand;
}
A1 A1::operator++() // pre increment
{
x = x +1;
-
+
return (*this);
}
A1 A1::operator++(int) // post increment
{
y = y +1;
-
+
return (*this);
}
A1 A1::operator--() // pre decrement
{
x = x -1;
-
+
return (*this);
}
A1 A1::operator--(int) // post decrement
{
y = y -1;
-
+
return (*this);
}
ostream& operator<<(ostream& outs, A1 one)
{
- return (outs << endl << "x = " << one.x << endl << "y = " << one.y << endl << "-------" << endl);
+ return (outs << endl << "x = " << one.x << endl << "y = " << one.y << endl << "-------" << endl);
}
class A2 {
Member mem1, mem2;
int val;
Member Container::* mptr = &Container::m;
-
+
mem1.z = 5;
mem2.z = 7;
c.m.z = 8;
cout << "< " << val << endl << "-----"<<endl;
val = one > two;
cout << "> " << val << endl << "-----"<<endl;
-
+
three = one << 2;
cout << "lsh " << three;
three = one >> 2;
cout << " = "<< three;
three += 5;
cout << " += "<< three;
-
+
val = (!one);
cout << "! " << val << endl << "-----"<<endl;
three = (+one);
cout << "postinc " << three;
three--;
cout << "postdec " << three;
-
+
--three;
cout << "predec " << three;
++three;
class Base {
protected:
int x;
-
+
public:
Base(void) { x = 2; };
};
class Middle: public virtual mc::Base {
protected:
int y;
-
+
public:
Middle(void): mc::Base() { y = 3; };
class Derived: public virtual Middle {
protected:
int z;
-
+
public:
Derived(void): Middle() { z = 4; };
{
public:
RHA() : mA(0xaaaaaaaa) {}
- virtual void a() = 0;
+ virtual void a() = 0;
int mA;
};
// E : B (V) D C
//
-class VA
+class VA
{
public:
int va;
TEST(pEe->vd(), 282);
TEST(pEe->fvb(), 311);
-
+
TEST(pEe->D::vg(), 102);
printf("Did %d tests, of which %d failed.\n", all_count, failed_count);
}
test_calls();
return 0;
-
+
}
int A::f() {return 1;}
{
virtual int do_print3() { return 111111; }
};
-
+
class Obj : virtual public interface
{
public:
btst 0x7ffefdfc,r2
-
+
dsp_add_tests:
add_add r4,r1,r2,r3
add_add r4,r1,2,r3
bb,>= %r4,5,bb_tests
bb,<,n %r4,5,bb_tests
bb,>=,n %r4,5,bb_tests
-
+
; Computational instructions
add_tests
add %r4,%r5,%r6
proberi (%sr0,%r5),1,%r7
probew (%sr0,%r5),%r6,%r7
probewi (%sr0,%r5),1,%r7
-
+
lpa_tests
lpa %r4(%sr0,%r5),%r6
lpa,m %r4(%sr0,%r5),%r6
frnd,quad %fr5,%fr10
frnd,sgl %fr20,%fr24
frnd,dbl %fr20,%fr24
-
+
fcnvff_tests
fcnvff,sgl,sgl %fr5,%fr10
fcnvff,sgl,dbl %fr5,%fr10
copr,4,5,n
copr,4,115,n
-copr_indexing_load
+copr_indexing_load
cldwx,4 5(0,4),26
cldwx,4,s 5(0,4),26
cldwx,4,m 5(0,4),26
clddx,4,m 5(0,4),26
clddx,4,sm 5(0,4),26
-copr_indexing_store
+copr_indexing_store
cstwx,4 26,5(0,4)
cstwx,4,s 26,5(0,4)
cstwx,4,m 26,5(0,4)
cstdx,4,m 26,5(0,4)
cstdx,4,sm 26,5(0,4)
-copr_short_memory
+copr_short_memory
cldws,4 0(0,4),26
cldws,4,mb 0(0,4),26
cldws,4,ma 0(0,4),26
blt bCC_tests
bhi bCC_tests
bcc bCC_tests
- bls bCC_tests
+ bls bCC_tests
bcs bCC_tests
bvc bCC_tests
bvs bCC_tests
bltx bCCx_tests
bhix bCCx_tests
bccx bCCx_tests
- blsx bCCx_tests
+ blsx bCCx_tests
bcsx bCCx_tests
bvcx bCCx_tests
bvsx bCCx_tests
extxu d3
extxb d2
extxbu d1
-
+
logical_tests:
and d1,d2
and 127,d2
blt bCC_tests
bhi bCC_tests
bcc bCC_tests
- bls bCC_tests
+ bls bCC_tests
bcs bCC_tests
bvc bCC_tests
bvs bCC_tests
cmp 256,a2
cmp 131071,a1
-
+
extend_tests:
ext d1
extb d2
sat16 d2,d3
sat24 d3,d2
bsch d1,d2
-
+
logical_tests:
and d1,d2
and 127,d2
llt
lhi
lcc
- lls
+ lls
lcs
lra
setlb
mov.b @er3,@0x1234:16 ;017803401234
mov.b @er3,@0x12345678:32 ;0178034812345678
- mov.b @(0x1:2,er3),@er1 ;01781301
- mov.b @(0x1:2,er3),@(0x1:2,er1) ;01781311
- mov.b @(0x1:2,er3),@er1+ ;01781381
- mov.b @(0x1:2,er3),@-er1 ;017813b1
- mov.b @(0x1:2,er3),@+er1 ;01781391
- mov.b @(0x1:2,er3),@er1- ;017813a1
+ mov.b @(0x1:2,er3),@er1 ;01781301
+ mov.b @(0x1:2,er3),@(0x1:2,er1) ;01781311
+ mov.b @(0x1:2,er3),@er1+ ;01781381
+ mov.b @(0x1:2,er3),@-er1 ;017813b1
+ mov.b @(0x1:2,er3),@+er1 ;01781391
+ mov.b @(0x1:2,er3),@er1- ;017813a1
mov.b @(0x1:2,er3),@(0x1234:16,er1) ;017813c11234
mov.b @(0x1:2,er3),@(0x12345678:32,er1) ;017813c912345678
mov.b @(0x1:2,er3),@(0x1234:16,r1l.b) ;017813d11234
mov.b @(0x1:2,er3),@0x12345678:32 ;0178134812345678
mov.b @-er3,@er1 ;0178b301
- mov.b @-er3,@(0x1:2,er1) ;0178b311
- mov.b @-er3,@er1+ ;0178b381
- mov.b @-er3,@-er1 ;0178b3b1
- mov.b @-er3,@+er1 ;0178b391
- mov.b @-er3,@er1- ;0178b3a1
+ mov.b @-er3,@(0x1:2,er1) ;0178b311
+ mov.b @-er3,@er1+ ;0178b381
+ mov.b @-er3,@-er1 ;0178b3b1
+ mov.b @-er3,@+er1 ;0178b391
+ mov.b @-er3,@er1- ;0178b3a1
mov.b @-er3,@(0x1234:16,er1) ;0178b3c11234
mov.b @-er3,@(0x12345678:32,er1) ;0178b3c912345678
mov.b @-er3,@(0x1234:16,r1l.b) ;0178b3d11234
mov.b @-er3,@0x12345678:32 ;0178b34812345678
mov.b @er3+,@er1 ;01788301
- mov.b @er3+,@(0x1:2,er1) ;01788311
- mov.b @er3+,@er1+ ;01788381
- mov.b @er3+,@-er1 ;017883b1
- mov.b @er3+,@+er1 ;01788391
- mov.b @er3+,@er1- ;017883a1
+ mov.b @er3+,@(0x1:2,er1) ;01788311
+ mov.b @er3+,@er1+ ;01788381
+ mov.b @er3+,@-er1 ;017883b1
+ mov.b @er3+,@+er1 ;01788391
+ mov.b @er3+,@er1- ;017883a1
mov.b @er3+,@(0x1234:16,er1) ;017883c11234
mov.b @er3+,@(0x12345678:32,er1) ;017883c912345678
mov.b @er3+,@(0x1234:16,r1l.b) ;017883d11234
mov.b @er3+,@0x12345678:32 ;0178834812345678
mov.b @er3-,@er1 ;0178a301
- mov.b @er3-,@(0x1:2,er1) ;0178a311
- mov.b @er3-,@er1+ ;0178a381
- mov.b @er3-,@-er1 ;0178a3b1
- mov.b @er3-,@+er1 ;0178a391
- mov.b @er3-,@er1- ;0178a3a1
+ mov.b @er3-,@(0x1:2,er1) ;0178a311
+ mov.b @er3-,@er1+ ;0178a381
+ mov.b @er3-,@-er1 ;0178a3b1
+ mov.b @er3-,@+er1 ;0178a391
+ mov.b @er3-,@er1- ;0178a3a1
mov.b @er3-,@(0x1234:16,er1) ;0178a3c11234
mov.b @er3-,@(0x12345678:32,er1) ;0178a3c912345678
mov.b @er3-,@(0x1234:16,r1l.b) ;0178a3d11234
mov.b @er3-,@0x12345678:32 ;0178a34812345678
mov.b @+er3,@er1 ;01789301
- mov.b @+er3,@(0x1:2,er1) ;01789311
- mov.b @+er3,@er1+ ;01789381
- mov.b @+er3,@-er1 ;017893b1
- mov.b @+er3,@+er1 ;01789391
- mov.b @+er3,@er1- ;017893a1
+ mov.b @+er3,@(0x1:2,er1) ;01789311
+ mov.b @+er3,@er1+ ;01789381
+ mov.b @+er3,@-er1 ;017893b1
+ mov.b @+er3,@+er1 ;01789391
+ mov.b @+er3,@er1- ;017893a1
mov.b @+er3,@(0x1234:16,er1) ;017893c11234
mov.b @+er3,@(0x12345678:32,er1) ;017893c912345678
mov.b @+er3,@(0x1234:16,r1l.b) ;017893d11234
mov.w @0x1234:16,r1 ;6b011234
mov.w @0x12345678:32,r1 ;6b2112345678
- mov.w @er2,@er1 ;01580201
+ mov.w @er2,@er1 ;01580201
mov.w @er2,@(0x2:2,er1) ;01580211
mov.w @er2,@er1+ ;01580281
mov.w @er2,@-er1 ;015802b1
mov.w @(0x2:2,er2),@0x1234:16 ;015812401234
mov.w @(0x2:2,er2),@0x12345678:32 ;0158124812345678
- mov.w @-er2,@er1 ;0158b201
+ mov.w @-er2,@er1 ;0158b201
mov.w @-er2,@(0x2:2,er1) ;0158b211
mov.w @-er2,@er1+ ;0158b281
mov.w @-er2,@-er1 ;0158b2b1
mov.l #0x1:3,er3 ;0f9b
- mov.l #0x12345678:32,@er1 ;7a74123456780100
+ mov.l #0x12345678:32,@er1 ;7a74123456780100
mov.l #0x12345678:32,@(0x4:2,er1) ;7a74123456781100
- mov.l #0x12345678:32,@-er1 ;7a7412345678b100
- mov.l #0x12345678:32,@er1+ ;7a74123456788100
- mov.l #0x12345678:32,@er1- ;7a7412345678a100
- mov.l #0x12345678:32,@+er1 ;7a74123456789100
+ mov.l #0x12345678:32,@-er1 ;7a7412345678b100
+ mov.l #0x12345678:32,@er1+ ;7a74123456788100
+ mov.l #0x12345678:32,@er1- ;7a7412345678a100
+ mov.l #0x12345678:32,@+er1 ;7a74123456789100
mov.l #0x12345678:32,@(0x1234:16,er1) ;7a7412345678c1001234
mov.l #0x12345678:32,@(0x12345678:32,er1) ;7a7412345678c90012345678
mov.l #0x12345678:32,@(0x1234:16,r3l.b) ;7a7412345678d3001234
mov.l #0x12345678:32,@0x1234:16 ;7a741234567840001234
mov.l #0x12345678:32,@0x12345678:32 ;7a7412345678480012345678
- mov.l #0x1234:16,@er1 ;7a7c12340100
+ mov.l #0x1234:16,@er1 ;7a7c12340100
mov.l #0x1234:16,@(0x4:2,er1) ;7a7c12341100
- mov.l #0x1234:16,@-er1 ;7a7c1234b100
- mov.l #0x1234:16,@er1+ ;7a7c12348100
- mov.l #0x1234:16,@er1- ;7a7c1234a100
- mov.l #0x1234:16,@+er1 ;7a7c12349100
+ mov.l #0x1234:16,@-er1 ;7a7c1234b100
+ mov.l #0x1234:16,@er1+ ;7a7c12348100
+ mov.l #0x1234:16,@er1- ;7a7c1234a100
+ mov.l #0x1234:16,@+er1 ;7a7c12349100
mov.l #0x1234:16,@(0x1234:16,er1) ;7a7c1234c1001234
mov.l #0x1234:16,@(0x12345678:32,er1) ;7a7c1234c90012345678
mov.l #0x1234:16,@(0x1234:16,r3l.b) ;7a7c1234d3001234
mov.l er2,@0x1234:16 ;01006b821234
mov.l er2,@0x12345678:32 ;01006ba212345678
- mov.l @er2,er1 ;01006921
+ mov.l @er2,er1 ;01006921
mov.l @(0x4:2,er2),er1 ;01016921
- mov.l @er2+,er1 ;01006d21
- mov.l @-er2,er1 ;01036d21
- mov.l @+er2,er1 ;01016d21
- mov.l @er2-,er1 ;01026d21
+ mov.l @er2+,er1 ;01006d21
+ mov.l @-er2,er1 ;01036d21
+ mov.l @+er2,er1 ;01016d21
+ mov.l @er2-,er1 ;01026d21
mov.l @(0x1234:16,er1),er1 ;01006f111234
mov.l @(0x12345678:32,er1),er1 ;78906b2112345678
mov.l @(0x1234:16,r3l.b),er1 ;01016f311234
mov.l @0x1234:16,er1 ;01006b011234
mov.l @0x12345678:32,er1 ;01006b2112345678
- mov.l @er2,@er1 ;01080201
+ mov.l @er2,@er1 ;01080201
mov.l @er2,@(0x4:2,er1) ;01080211
mov.l @er2,@er1+ ;01080281
mov.l @er2,@-er1 ;010802b1
mov.l @-er2,@0x1234:16 ;0108b2401234
mov.l @-er2,@0x12345678:32 ;0108b24812345678
- mov.l @er2+,@er1 ;01088201
+ mov.l @er2+,@er1 ;01088201
mov.l @er2+,@(0x4:2,er1) ;01088211
mov.l @er2+,@er1+ ;01088281
mov.l @er2+,@-er1 ;010882b1
mov.l @er2+,@0x1234:16 ;010882401234
mov.l @er2+,@0x12345678:32 ;0108824812345678
- mov.l @er2-,@er1 ;0108a201
+ mov.l @er2-,@er1 ;0108a201
mov.l @er2-,@(0x4:2,er1) ;0108a211
mov.l @er2-,@er1+ ;0108a281
mov.l @er2-,@-er1 ;0108a2b1
mov.l @er2-,@0x1234:16 ;0108a2401234
mov.l @er2-,@0x12345678:32 ;0108a24812345678
- mov.l @+er2,@er1 ;01089201
+ mov.l @+er2,@er1 ;01089201
mov.l @+er2,@(0x4:2,er1) ;01089211
mov.l @+er2,@er1+ ;01089281
mov.l @+er2,@-er1 ;010892b1
.org 0x1234
.global _start
_start:
- bra 0x12+.+2 ;4012
- brn 0x12+.+2 ;4112
- bhi 0x12+.+2 ;4212
- bls 0x12+.+2 ;4312
- bcc 0x12+.+2 ;4412
- bcs 0x12+.+2 ;4512
- bne 0x12+.+2 ;4612
- beq 0x12+.+2 ;4712
- bvc 0x12+.+2 ;4812
- bvs 0x12+.+2 ;4912
- bpl 0x12+.+2 ;4a12
- bmi 0x12+.+2 ;4b12
- bge 0x12+.+2 ;4c12
- blt 0x12+.+2 ;4d12
- bgt 0x12+.+2 ;4e12
+ bra 0x12+.+2 ;4012
+ brn 0x12+.+2 ;4112
+ bhi 0x12+.+2 ;4212
+ bls 0x12+.+2 ;4312
+ bcc 0x12+.+2 ;4412
+ bcs 0x12+.+2 ;4512
+ bne 0x12+.+2 ;4612
+ beq 0x12+.+2 ;4712
+ bvc 0x12+.+2 ;4812
+ bvs 0x12+.+2 ;4912
+ bpl 0x12+.+2 ;4a12
+ bmi 0x12+.+2 ;4b12
+ bge 0x12+.+2 ;4c12
+ blt 0x12+.+2 ;4d12
+ bgt 0x12+.+2 ;4e12
ble 0x12+.+2 ;4f12
bra 0x1234+.+4 ;58001234
bsr/bs #0x7,@0xffff9abc:16,0x1234+.+8 ;6a109abc5cf01234
bsr/bs #0x7,@0x12345678:32,0x1234+.+0xa ;6a30123456785cf01234
- bra r2l.b ;5925
- bra r2.w ;5926
- bra er2.l ;5927
+ bra r2l.b ;5925
+ bra r2.w ;5926
+ bra er2.l ;5927
bsr 0x12+.+2 ;5512
bsr 0x1234+.+4 ;5c001234
- bsr r2l.b ;5d25
- bsr r2.w ;5d26
- bsr er2.l ;5d27
+ bsr r2l.b ;5d25
+ bsr r2.w ;5d26
+ bsr er2.l ;5d27
- jmp @er2 ;5920
+ jmp @er2 ;5920
jmp @0x123456:24 ;5a123456
jmp @0x12345678:32 ;590812345678
jmp @@0x12 ;5b12
jmp @@0x234 ;598d
- jsr @er2 ;5d20
+ jsr @er2 ;5d20
jsr @0x123456:24 ;5e123456
jsr @0x12345678:32 ;5d0812345678
jsr @@0x12 ;5f12
jsr @@0x234 ;5d8d
- rts ;5470
+ rts ;5470
rts/l er3 ;5403
rts/l er1-er2 ;5412
rts/l er2-er4 ;5424
rts/l er3-er6 ;5436
- trapa #0x3 ;5730
+ trapa #0x3 ;5730
- rte ;5670
+ rte ;5670
rte/l er3 ;5603
rte/l er1-er2 ;5612
rte/l er2-er4 ;5624
rte/l er3-er6 ;5636
- ldc.b #0x12:8,ccr ;0712
- ldc.b r3h,ccr ;0303
- ldc.w @er3,ccr ;01406930
- ldc.w @er3+,ccr ;01406d30
+ ldc.b #0x12:8,ccr ;0712
+ ldc.b r3h,ccr ;0303
+ ldc.w @er3,ccr ;01406930
+ ldc.w @er3+,ccr ;01406d30
ldc.w @(0x1234:16,er3),ccr ;01406f301234
ldc.w @(0x12345678:32,er3),ccr ;014078306b2012345678
ldc.w @0x1234:16,ccr ;01406b001234
ldc.w @0x12345678:32,ccr ;01406b2012345678
- ldc.b #0x12:8,exr ;01410712
- ldc.b r3h,exr ;0313
- ldc.w @er3,exr ;01416930
- ldc.w @er3+,exr ;01416d30
+ ldc.b #0x12:8,exr ;01410712
+ ldc.b r3h,exr ;0313
+ ldc.w @er3,exr ;01416930
+ ldc.w @er3+,exr ;01416d30
ldc.w @(0x1234:16,er3),exr ;01416f301234
- ldc.w @(0x12345678:32,er3),exr ;014178306b2012345678
+ ldc.w @(0x12345678:32,er3),exr ;014178306b2012345678
ldc.w @0x1234:16,exr ;01416b001234
ldc.w @0x12345678:32,exr ;01416b2012345678
- stc.b ccr,r1h ;0201
- stc.w ccr,@er1 ;01406990
- stc.w ccr,@-er1 ;01406d90
+ stc.b ccr,r1h ;0201
+ stc.w ccr,@er1 ;01406990
+ stc.w ccr,@-er1 ;01406d90
stc.w ccr,@(0x1234:16,er1) ;01406f901234
stc.w ccr,@(0x12345678:32,er1) ;014078106ba012345678
stc.w ccr,@0x1234:16 ;01406b801234
stc.w ccr,@0x12345678:32 ;01406ba012345678
- stc.b exr,r1h ;0211
- stc.w exr,@er1 ;01416990
- stc.w exr,@-er1 ;01416d90
+ stc.b exr,r1h ;0211
+ stc.w exr,@er1 ;01416990
+ stc.w exr,@-er1 ;01416d90
stc.w exr,@(0x1234:16,er1) ;01416f901234
stc.w exr,@(0x12345678:32,er1) ;014178106ba012345678
stc.w exr,@0x1234:16 ;01416b801234
stc.w exr,@0x12345678:32 ;01416ba012345678
- orc.b #0x12:8,ccr ;0412
- orc.b #0x12:8,exr ;01410412
+ orc.b #0x12:8,ccr ;0412
+ orc.b #0x12:8,exr ;01410412
- xorc.b #0x12:8,ccr ;0512
- xorc.b #0x12:8,exr ;01410512
+ xorc.b #0x12:8,ccr ;0512
+ xorc.b #0x12:8,exr ;01410512
- andc.b #0x12:8,ccr ;0612
- andc.b #0x12:8,exr ;01410612
+ andc.b #0x12:8,ccr ;0612
+ andc.b #0x12:8,exr ;01410612
- sleep ;0180
+ sleep ;0180
nop ;0000
movl vv(%rip), %edx
addl $1, %edx
movl %edx, vv(%rip)
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
# clztest.c:14
.LM5:
ret
movl vv(%rip), %edx
addl $1, %edx
movl %edx, vv(%rip)
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
# clztest.c:24
.LM10:
ret
popq %rbx
.LCFI1:
.LVL10:
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.LFE2:
.size _start, .-_start
/*
Copyright 2007-2025 Free Software Foundation, Inc.
-
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
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/>. */
/*
Copyright 2007-2025 Free Software Foundation, Inc.
-
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
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/>. */
/*
Copyright 2007-2025 Free Software Foundation, Inc.
-
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
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/>. */
.cfi_remember_state
jmp 2f
-
+
1: mov %rbp,%rsp
.cfi_restore %rbp
pop %rbp
__attribute__((noinline)) int
init (int *b)
- {
- return 0;
- }
+ {
+ return 0;
+ }
int
main (int argc, char *argv[])
# testsuite/gdb.dwarf2/fission-loclists-pie.c:24
.loc 1 24 0
movl $0, %eax
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.cfi_endproc
.LFE0:
.loc 1 30 0
addq $8, %rsp
.cfi_def_cfa_offset 8
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.cfi_endproc
.LFE1:
.loc 1 3 0
movl (%rdi), %eax
movl %eax, v(%rip)
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.cfi_endproc
.LFE0:
xorl %eax, %eax
addq $8, %rsp
.cfi_def_cfa_offset 8
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.cfi_endproc
.LFE1:
typedef intp *intpp;
typedef intpp *intppp;
-int __attribute__ ((noinline, used, noclone))
-bar (int i)
+int __attribute__ ((noinline, used, noclone))
+bar (int i)
{
intp j = &i;
intpp k = &j;
int __attribute__ ((noinline))
foo (int arg)
-{
+{
return arg;
}
/* This was compiled with a version of gcc modified to emit better
debuginfo for SRA'd structures. See:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43983
-
+
The original program is "pieces.c", in this directory.
*/
}
int main()
-{
+{
doit ();
abort ();
}
movl vv, %eax
addl $1, %eax
movl %eax, vv
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
# typeddwarf.c:30
.LM3:
ret
.LM30:
addl $12, %esp
.LCFI1:
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.LFE1:
.size f2, .-f2
movl vv, %eax
addl $1, %eax
movl %eax, vv
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
# typeddwarf.c:74
.LM33:
ret
movl vv, %eax
addl $1, %eax
movl %eax, vv
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
# typeddwarf.c:83
.LM36:
ret
.LCFI8:
popl %ebp
.LCFI9:
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.LFE4:
.size main, .-main
}
Then it was compiled with:
-
+
gcc -fvar-tracking{,-assignments} -gdwarf-3
-fno-inline{,-functions,-small-functions,-functions-called-once}
-O2
! it under the terms of the GNU General Public License as published by
! the Free Software Foundation; either version 3 of the License, or
! (at your option) any later version.
-!
+!
! This program is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! 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/>.
!
type foo
real :: a
type(bar) :: x
- character*7 :: b
+ character*7 :: b
end type foo
type(foo) :: q
type(bar) :: p
! Copyright 2010-2025 Free Software Foundation, Inc.
-!
+!
! This program is free software; you can redistribute it and/or modify
! it under the terms of the GNU General Public License as published by
! the Free Software Foundation; either version 3 of the License, or
! (at your option) any later version.
-!
+!
! This program is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! 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/>.
! Copyright 2010-2025 Free Software Foundation, Inc.
-!
+!
! This program is free software; you can redistribute it and/or modify
! it under the terms of the GNU General Public License as published by
! the Free Software Foundation; either version 3 of the License, or
! (at your option) any later version.
-!
+!
! This program is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! 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/>.
! Copyright 2009-2025 Free Software Foundation, Inc.
-!
+!
! This program is free software; you can redistribute it and/or modify
! it under the terms of the GNU General Public License as published by
! the Free Software Foundation; either version 3 of the License, or
! (at your option) any later version.
-!
+!
! This program is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! 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/>.
! it under the terms of the GNU General Public License as published by
! the Free Software Foundation; either version 3 of the License, or
! (at your option) any later version.
-!
+!
! This program is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! 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/>.
int add (int i)
{
- return i + i;
+ return i + i;
}
};
SSS::SSS (int x, const S& r) : a(x), b(r) { }
-class VirtualTest
-{
- private:
- int value;
-
- public:
- VirtualTest ()
- {
+class VirtualTest
+{
+ private:
+ int value;
+
+ public:
+ VirtualTest ()
+ {
value = 1;
- }
+ }
};
class Vbase1 : public virtual VirtualTest { };
class Vbase3 : public virtual VirtualTest { };
class Derived : public Vbase1, public Vbase2, public Vbase3
-{
- private:
- int value;
-
+{
+ private:
+ int value;
+
public:
- Derived ()
- {
- value = 2;
+ Derived ()
+ {
+ value = 2;
}
};
class Fake
{
int sname;
-
+
public:
Fake (const int name = 0):
sname (name)
outer.s.a = 3; /* MI outer breakpoint here */
- return outer;
+ return outer;
}
typedef struct string_repr
SSS& ref (sss);
Derived derived;
-
+
Fake fake (42);
#endif
nstype.elements[0] = 7;
nstype.elements[1] = 42;
nstype.len = 2;
-
+
nstype2 = nstype;
eval_sub ();
d.f = 4;
#endif
enum E e;
-
+
st.a = 3;
st.b = 5;
struct flex_member *f = (struct flex_member *) malloc (100);
f->items[0] = 111;
f->items[1] = 222;
-
+
return 0; /* break to inspect struct and array. */
}
.uleb128 5
.byte 2
.4byte .Lfunc_2
-
+
.byte 3 /* DW_LNS_advance_line */
.sleb128 1 /* ... to 8 */
};
int x;
char buffer[10];
-
+
protected:
int y;
B b;
-
+
private:
float z;
};
! Copyright 2009-2025 Free Software Foundation, Inc.
-!
+!
! This program is free software; you can redistribute it and/or modify
! it under the terms of the GNU General Public License as published by
! the Free Software Foundation; either version 3 of the License, or
! (at your option) any later version.
-!
+!
! This program is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! 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/>.
{
}
-void
+void
bar (void)
{
*(volatile char *)0 = 0; /* try to cause a segfault */
subroutine (sig);
}
-/* The first statement in subroutine () is a place for a breakpoint.
+/* The first statement in subroutine () is a place for a breakpoint.
Without it, the breakpoint is put on the while comparison and will
be hit at each iteration. */
struct_declarations.long_array[11] = 5678;
/* Struct/pointer/array tests */
- a0[0] = '0';
+ a0[0] = '0';
a1 = a0;
a2 = &a1;
a3 = &a2;
int array[21];
int a;
- a = 1;
+ a = 1;
incr_a(2);
}
mi_create_varobj S s "create varobj for s"
mi_list_varobj_children S {{S.a a 0 int} {S.b b 0 int}} \
"list children of S"
- mi_delete_varobj S.a "delete S.a"
+ mi_delete_varobj S.a "delete S.a"
mi_delete_varobj S.b "delete S.b"
mi_delete_varobj S "delete S"
:*/
return 99;
- /*: END: child_deletion :*/
+ /*: END: child_deletion :*/
}
int
exit (0);
}
-
+
x = 567;
/*: mi_varobj_update RX {RX} "update RX, 2"
mi_check_varobj_value RX 567 "check RX: expect 567"
- :*/
+ :*/
x = 567;
/*: mi_varobj_update RX {} "update RX, 3"
mi_delete_varobj RX "delete RX"
:*/
/* Dummy assignment to keep 'x' in scope. */
- x = 444;
+ x = 444;
/*: END: reference_update :*/
}
struct S { int i; int j; };
struct S2 : S {};
-
+
int base_in_reference_test (S2& s2)
{
/*: BEGIN: base_in_reference :*/
int x = s2.i + s2.j;
- /*:
+ /*:
mi_create_varobj "S2" "s2" "create varobj for s2"
mi_list_varobj_children "S2" {
{"S2.S" "S" "1" "S"}
mi_check_varobj_value "S2.S.public.i" "67" "check S2.S.public.i"
mi_check_varobj_value "S2.S.public.j" "89" "check S2.S.public.j"
mi_delete_varobj S2 "delete S2"
-
+
:*/
/*: END: base_in_reference :*/
return x;
}
-
+
void base_in_reference_test_main ()
{
S2 s;
int reference_to_pointer ()
{
- /*: BEGIN: reference_to_pointer :*/
+ /*: BEGIN: reference_to_pointer :*/
S s, *ptr_s, *& rptr_s = ptr_s;
s.i = 67;
s.j = 89;
ptr_s = &s;
- /*:
+ /*:
mi_create_varobj RPTR rptr_s "create varobj for rptr_s"
mi_list_varobj_children RPTR {{RPTR.public public 2}} \
{DP.public public 1}} "list children of DP"
mi_gdb_test "-var-info-path-expression DP.Base1" \
"\\^done,path_expr=\"\\(\\*\\(class Base1\\*\\) dp\\)\"" \
- "-var-info-path-expression DP.Base1"
+ "-var-info-path-expression DP.Base1"
mi_list_varobj_children DP.public { \
{DP.public.i i 0 int} \
} "list children of DP.public"
Derived d;
Base& ref = d;
const Base& constRef = d;
- /*:
+ /*:
set testname use_rtti_for_ref
set_print_object off $testname
check_new_derived_without_rtti ref {Base \&} $testname
{
/*: BEGIN: use_rtti_for_ptr_child :*/
Derived d;
- struct S {
+ struct S {
Base* ptr;
const Base* constPtr;
Base* const ptrConst;
ptrConst ( v ),
constPtrConst ( v ) {}
} s ( &d );
- /*:
+ /*:
set testname use_rtti_for_ptr_child
set_print_object off $testname
{
/*: BEGIN: use_rtti_for_ref_child :*/
Derived d;
- struct S {
+ struct S {
Base& ref;
const Base& constRef;
S ( Base& v ) :
ref ( v ),
constRef ( v ) {}
} s ( d );
- /*:
+ /*:
set testname use_rtti_for_ref_child
set_print_object off $testname
ptr ( v ) {}
} s ( ptr );
Derived d;
- /*:
+ /*:
set testname type_update_when_use_rtti
set_print_object on $testname
ptr ( v ) {}
} s ( ptr );
Derived d;
- /*:
+ /*:
set testname skip_type_update_when_not_use_rtti
with_test_prefix "ptr is nullptr" {
ptr = &d;
s.ptr = &d;
- /*:
+ /*:
with_test_prefix "ptr points at d" {
mi_varobj_update PTR {PTR PTR.public.A} \
"update ptr to derived type in $testname"
# gdb.mi/mi2-amd64-entry-value.c:23
.loc 1 23 0
movl $0, v(%rip)
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
# gdb.mi/mi2-amd64-entry-value.c:24
.loc 1 24 0
ret
# gdb.mi/mi2-amd64-entry-value.c:30
.loc 1 30 0
movl $10, %eax
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.cfi_endproc
.LFE1:
# gdb.mi/mi2-amd64-entry-value.c:36
.loc 1 36 0
movl $20, %eax
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.cfi_endproc
.LFE2:
.LCFI1:
.cfi_def_cfa_offset 8
.LVL4:
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.cfi_endproc
.LFE3:
.LCFI3:
.cfi_def_cfa_offset 8
.LVL7:
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.cfi_endproc
.LFE4:
# 60 "gdb.mi/mi2-amd64-entry-value.c" 1
breakhere_invalid:
# 0 "" 2
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
# gdb.mi/mi2-amd64-entry-value.c:61
.loc 1 61 0
#NO_APP
.loc 1 70 0
xorl %eax, %eax
.p2align 4,,1
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.cfi_endproc
.LFE6:
for (i = 0; i < NTHREADS; ++i)
{
- pthread_join (thread_id[i], NULL);
+ pthread_join (thread_id[i], NULL);
}
return 0;
{
int id = *(int *)arg;
int i = 0;
-
+
/* When gdb is running, it sets hidden breakpoints in the thread
library. The signals caused by these hidden breakpoints can
cause system calls such as 'sleep' to return early. Pay attention
int array[21];
int a;
- a = 1;
+ a = 1;
u.integer = a;
anonu.a = a;
s.integer = a;
} v1 = {1, {2, 3}};
int v2 = 4;
- /*:
+ /*:
with_test_prefix "create varobj V1 and V2" {
mi_create_varobj V1 v1 "create varobj for v1"
mi_create_varobj V2 v2 "create varobj for v2"
}
:*/
v2 = 5;
- /*:
+ /*:
mi_varobj_update * {V2} "update varobjs: V2 changed"
set_frozen V2 1
:*/
v2 = 6;
- /*:
+ /*:
mi_varobj_update * {} "update varobjs: nothing changed"
mi_check_varobj_value V2 5 "check V2: 5"
mi_varobj_update V2 {V2} "update V2 explicitly"
mi_check_varobj_value V1.nested.j 11 "check V1.nested.j: 11"
mi_check_varobj_value V1.nested.k 12 "check V1.nested.k: 12"
}
- :*/
-
+ :*/
+
/*: END: frozen :*/
}
and then try to reevaluate it in other frame without reparsing
the expression, we will access local variables using DWARF
location expression from the original frame, and are likely
- to grab wrong symbol. To reliably reproduce this bug, we need
+ to grab wrong symbol. To reliably reproduce this bug, we need
to wrap our variable with a bunch of buffers, so that those
buffers are accessed instead of the real one. */
int buffer1 = 10;
mi_check_varobj_value V.sharable 3 "access bitfield"
:*/
return;
- /*: END: bitfield :*/
+ /*: END: bitfield :*/
}
void
exit (0);
}
-
+
t._m2_contents = (char *)&data;
t._m2_high = 4;
/* include the <nul> in the string, even though high is set to 4. */
-
+
for (i=0; i<6; i++)
data[i] = input[i];
return foo (t);
.loc 1 3 0
popq %rbp
.cfi_def_cfa 7, 8
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.cfi_endproc
.LFE0:
ss.a = 10;
ss.d = 100.01;
ss_t = ss;
-
+
su.d = 100.1;
cs.s = ss;
init_flt (&flt, 42, 43);
init_ss (&ss, 1, 2);
-
+
return 0; /* break to inspect */
}
init_flt (&flt, 42, 43);
init_s (&s, 1);
-
+
return 0; /* break to inspect */
}
};
SSS::SSS (int x, const S& r) : a(x), b(r) { }
-class VirtualTest
-{
- private:
- int value;
-
- public:
- VirtualTest ()
- {
+class VirtualTest
+{
+ private:
+ int value;
+
+ public:
+ VirtualTest ()
+ {
value = 1;
- }
+ }
};
class Vbase1 : public virtual VirtualTest { };
class Vbase3 : public virtual VirtualTest { };
class Derived : public Vbase1, public Vbase2, public Vbase3
-{
- private:
- int value;
-
+{
+ private:
+ int value;
+
public:
- Derived ()
- {
- value = 2;
+ Derived ()
+ {
+ value = 2;
}
};
class Fake
{
int sname;
-
+
public:
Fake (const int name = 0):
sname (name)
outer.s.a = 3; /* MI outer breakpoint here */
- return outer;
+ return outer;
}
typedef struct string_repr
SSS& ref (sss);
Derived derived;
-
+
Fake fake (42);
init_s (&has_static_member::global, 23);
nstype.elements[0] = 7;
nstype.elements[1] = 42;
nstype.len = 2;
-
+
nstype2 = nstype;
eval_sub ();
# gdb.reverse/amd64-tailcall-reverse.c:23
.loc 1 23 0
movl $2, v(%rip)
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.cfi_endproc
.LFE0:
# gdb.reverse/amd64-tailcall-reverse.c:39
.loc 1 39 0
xorl %eax, %eax
-# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
ret
.cfi_endproc
.LFE2:
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-/*
+/*
Purpose of this test: to test breakpoints on consecutive instructions.
*/
double double_resultval;
int i;
- /* A "test load" that will insure that the function really returns
+ /* A "test load" that will insure that the function really returns
a ${type} (as opposed to just a truncated or part of a ${type}). */
for (i = 0; i < sizeof (testval.ffff); i++)
testval.ffff[i] = 0xff;
throughout the value, so we'll still detect truncated values. */
testval.float_testval = 2.7182818284590452354;/* long_long_checkpoint */
- float_resultval = float_func ();
+ float_resultval = float_func ();
testval.double_testval = 3.14159265358979323846; /* float_checkpoint */
- double_resultval = double_func ();
+ double_resultval = double_func ();
main_test = 1; /* double_checkpoint */
return 0; /* end of main */
}
/* Architecture tests for intel i386 platform. */
-void
+void
inc_dec_tests (void)
{
asm ("inc %eax");
asm ("dec %edi");
} /* end inc_dec_tests */
-int
+int
main ()
{
inc_dec_tests ();
float no1,no2,no3,no4,no5,no6,no7;
-float result,resultd,resultld;
+float result,resultd,resultld;
float *float_memory;
long double ldx = 88888888888888888888.88, ldy = 9999999999999999999.99;
double x = 100.345, y = 25.7789;
"ffree %st(5) \n\t"
"ffree %st(6) \n\t"
"ffree %st(7)");
-}
+}
/* initialization of floats */
void init_floats()
int main()
{
init_floats();
- empty_fpu_stack(); /* BEGIN I387-FLOAT-REVERSE */
-
+ empty_fpu_stack(); /* BEGIN I387-FLOAT-REVERSE */
+
asm("nop"); /* TEST ENV */
- asm ("fsave %0" : "=m"(*float_memory) : );
+ asm ("fsave %0" : "=m"(*float_memory) : );
asm ("frstor %0" : : "m"(*float_memory));
asm ("fstsw %ax"); /* test eax register */
asm ("fldln2");
asm ("fldz");
asm ("nop");
-
+
return 1; /* END I387-FLOAT-REVERSE */
}
"ffree %st(5) \n\t"
"ffree %st(6) \n\t"
"ffree %st(7)");
-}
+}
/* tests floating point arithmetic */
void test_arith_floats()
{
-
+
}
int main()
{
empty_fpu_stack(); /* BEGIN I387-FLOAT-REVERSE */
-
+
asm ("fld1"); /* test st0 register */
asm ("fldl2t"); /* test st0, st1 */
asm ("fldl2e"); /* test st0, st1, st2 */
asm ("fldz"); /* test st0, st1, st2, st3, st4, st5, st6 */
asm ("fld1"); /* test st0, st1, st2, st3, st4, st5, st6, st7 */
asm ("nop");
-
+
return 1; /* END I387-FLOAT-REVERSE */
}
/* Test register variable
Requires -- compiler honors 'register'. */
-void
+void
register_state (void)
{
register int a = 0;
/* main test driver */
-int
+int
main (int argc, char **argv)
{
register_state (); /* begin main */
function_static_state ();
module_static_state ();
module_global_state ();
-
+
return 0; /* end main */
}
* Aux function for machine state test.
*/
-void
+void
hide (int x)
{
}
{
kill (getpid (), SIGABRT);
return 0;
-}
+}
int x;
handle_HUP (0);
#endif
return 0;
-}
+}
int
gen_QUIT (void)
handle_USR2 (0);
#endif
return 0;
-}
+}
int
gen_PWR (void)
simply as places to try setting breakpoints at. They are
explicitly "one-line functions" to verify that this case works
(some versions of gcc have or have had problems with this).
-
+
These functions are in a separate source file to prevent an
optimizing compiler from inlining them and optimizing them away. */
#include "exclfwd.h"
-struct a
+struct a
{
int x, y;
};
gdb_test "p common0var0" "= 42"
# GDB seems to only understand common blocks local to a function.
- # These variables never get relocated to be relative to the common
+ # These variables never get relocated to be relative to the common
# block.
# I'm not sure whether it is valid to have a common block which
# is not local to a function.
# Make sure that the variable gets printed out correctly, without
# any sort of warning message.
- gdb_test_multiple "print $var" "variable $var printed property" {
+ gdb_test_multiple "print $var" "variable $var printed property" {
-re "^print $var\r*\n.\[0-9\]* = 42.*$gdb_prompt $" {
pass "variable $var printed properly"
}
va_end (ap);
}
-int
+int
shared_random ()
{
int result;
my_usleep (long usecs)
{
struct timeval timeout;
-
+
timeout.tv_sec = usecs / 1000000;
timeout.tv_usec = usecs % 1000000;
philosophers = xmalloc (num_philosophers * sizeof (*philosophers));
pthread_attr_init (&ta);
-
+
for (i = 0; i < num_philosophers; i++)
{
numbers[i] = i;
/* linuxthreads.exp: create philosopher */
pthread_create (&philosophers[i], &ta, philosopher, &numbers[i]);
}
-
+
pthread_attr_destroy (&ta);
}
/* Manythreads test program.
Copyright 2004-2025 Free Software Foundation, Inc.
- Written by Jeff Johnston <jjohnstn@redhat.com>
+ Written by Jeff Johnston <jjohnstn@redhat.com>
Contributed by Red Hat
This file is part of GDB.
return NULL;
}
-int
+int
main (int argc, char **argv)
{
pthread_attr_t attr;
/* Create a ton of quick-executing threads, then wait for them to
complete. */
- for (i = 0; i < 1000; ++i)
+ for (i = 0; i < 1000; ++i)
{
for (j = 0; j < 256; ++j)
{
return NULL;
}
-int
+int
main (int argc, char **argv)
{
pthread_attr_t attr;
sleep (1);
t += j;
}
-
+
exit (0);
}
return NULL;
}
-int
+int
main (int argc, char **argv)
{
pthread_attr_t attr;
pthread_create (&thr, NULL, thread_func, NULL);
pthread_join (thr, &ret);
for (x = 0; x < 10; x++)
- foo ();
+ foo ();
}
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-
+
This file is copied from schedlock.c. */
#include <stdio.h>
all_started = 0;
break;
}
- }
+ }
}
-
+
args[i] = 1;
/* Break here */
thread_function ((void *) i);
default:
fprintf (stderr, "Unknown error\n");
break;
- }
+ }
}
/* Routine for each thread to run, does nothing. */
{
int me = (long) vp;
int i;
-
+
/* Use a_global. */
a_global++;
continue;
}
else
- {
+ {
fprintf (stderr, "th %d wait on sem tell_thread failed\n", me);
print_error ();
return NULL;
thread_local_val[i] = 0;
another_thread_local_val[i] = 0;
}
-
+
if (sem_init (&tell_main, 0, 0) == -1)
{
fprintf (stderr, "tell_main semaphore init failed\n");
{
err = pthread_join(t[i], NULL );
if( err != 0 )
- {
+ {
fprintf (stderr, "error in thread %d join\n", i );
}
}
i = 10; /* Null line for setting bpts on. */
-
+
}
int
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-
+
This file is copied from schedlock.c. */
#include <stdio.h>
typedef void (*gdb_recursion_test_fp) (int, int, int, int, int, int, int);
gdb_recursion_test_fp gdb_recursion_test_ptr = gdb_recursion_test;
-void gdb_recursion_test (int depth,
- int q1,
- int q2,
- int q3,
- int q4,
- int q5,
+void gdb_recursion_test (int depth,
+ int q1,
+ int q2,
+ int q3,
+ int q4,
+ int q5,
int q6)
{ /* gdb_recursion_test line 0 */
int q = q1; /* gdbtestline 1 */
unsigned long *stack_ptr;
unsigned long end_of_stack;
- ridiculously_long_variable_name_with_equally_long_string_assignment =
+ ridiculously_long_variable_name_with_equally_long_string_assignment =
"ridiculously long variable name with equally long string assignment";
local_static = 9;
local_static_sizeof = sizeof (struct GDB_STRUCT_TEST);
local_long = local_reg + 1;
stack_ptr = (unsigned long *) &local_long;
- end_of_stack =
+ end_of_stack =
(unsigned long) &stack_ptr + sizeof(stack_ptr) + sizeof(end_of_stack) - 1;
gdb_char_test = gdb_struct1_test.c = (char) ((long) parm[1] & 0xff);
typedef int test_array [4];
-/*
+/*
* Global variables to be collected
*/
* Additional globals used in arithmetic tests
*/
-signed char c0, c1, c2, c3, c4, c5, c6, c7,
+signed char c0, c1, c2, c3, c4, c5, c6, c7,
c8, c9, c10, c11, c12, c13, c14, c15, cminus;
signed short s0, s1, s2, s3, s4, s5, s6, s7,
s8, s9, s10, s11, s12, s13, s14, s15, sminus;
int argstruct_test_func (argstruct)
test_struct argstruct;
{
- return (int) argstruct.memberc + argstruct.memberi +
+ return (int) argstruct.memberc + argstruct.memberi +
argstruct.memberf + argstruct.memberd;
}
for (i = 0; i < iters; ++i)
{
globfoo2 *= 45;
- globfoo2 += globfoo + globfoo3;
- globfoo2 *= globfoo + globfoo3;
- globfoo2 -= globarr[4] + globfoo3;
- globfoo2 *= globfoo + globfoo3;
- globfoo2 += globfoo + globfoo3;
+ globfoo2 += globfoo + globfoo3;
+ globfoo2 *= globfoo + globfoo3;
+ globfoo2 -= globarr[4] + globfoo3;
+ globfoo2 *= globfoo + globfoo3;
+ globfoo2 += globfoo + globfoo3;
}
now3 = myclock ();
total1 = now3 - now2;
{
globfoo2 *= 45;
globfoo2 += globfoo + globfoo3; /* set tracepoint here */
- globfoo2 *= globfoo + globfoo3;
- globfoo2 -= globarr[4] + globfoo3;
- globfoo2 *= globfoo + globfoo3;
- globfoo2 += globfoo + globfoo3;
+ globfoo2 *= globfoo + globfoo3;
+ globfoo2 -= globarr[4] + globfoo3;
+ globfoo2 *= globfoo + globfoo3;
+ globfoo2 += globfoo + globfoo3;
}
now5 = myclock ();
total2 = now5 - now4;
namespace export json2ton
variable version 0.4
-
+
}
proc ton::json2ton json {
# Parse JSON string json
#
# return: TON
-
+
set i [trr $json [string length $json]]
if {!$i} {return ""}
lassign [jscan $json $i] i ton
proc ton::trr {s i} {
# Trim righthand whitespace on the first i characters of s.
# return: number of remaining characters in s
-
+
while {[set j $i] &&
([string is space [set c [string index $s [incr i -1]]]]
|| $c eq "\n")} {}
# return list:
# - remaining string length
# - TON of number
-
+
set float [expr {$c eq "."}]
for {set j $i} {$i} {incr i -1} {
if {[string match $d [set c [string index $json $i-1]]]} break
# return list:
# - remaining string length
# - TON of string
-
+
for {set j $i} {$i} {incr i -1} {
set i [string last \" $json $i]
if {[string index $json $i-1] ne "\\"} break
# return list:
# - remaining string length
# - TON of array
-
+
set i [trr $json $i]
if {!$i} {
error "json string invalid:0: exhausted while parsing array."
set i [trr $json $i]
continue
} elseif {$c eq "\{"} break
- error "json string invalid:$i: parsing object."
+ error "json string invalid:$i: parsing object."
}
lappend r o
return [list $i [join [lreverse $r]]]
= (unsigned) reverse_frame[operands[1]].value;
cache->saved_regs[saved_register].set_addr (saved_address);
- }
+ }
else if (cache
- && (operands[0] == TILEGX_SP_REGNUM)
+ && (operands[0] == TILEGX_SP_REGNUM)
&& (operands[1] == TILEGX_LR_REGNUM))
lr_saved_on_stack_p = 1;
break;
large. (400 - 31)/2 == 184 */
#define MAX_AGENT_EXPR_LEN 184
-/*
+/*
Tracepoint.c:
This module defines the following debugger commands:
/* ACTIONS functions: */
/* The three functions:
- collect_pseudocommand,
- while_stepping_pseudocommand, and
+ collect_pseudocommand,
+ while_stepping_pseudocommand, and
end_actions_pseudocommand
are placeholders for "commands" that are actually ONLY to be used
within a tracepoint action list. If the actual function is ever called,
QUIT; /* Allow user to bail out with ^C. */
if (info_verbose)
{
- gdb_printf ("(%d, %s, %ld)\n",
+ gdb_printf ("(%d, %s, %ld)\n",
m_memranges[i].type,
paddress (current_inferior ()->arch (),
m_memranges[i].start),
/* Send down all the trace state variables too. */
for (const trace_state_variable &tsv : tvariables)
target_download_trace_state_variable (tsv);
-
+
/* Tell target to treat text-like sections as transparent. */
target_trace_set_readonly_regions ();
/* Set some mode flags. */
{
struct trace_status *ts = current_trace_status ();
int status;
-
+
status = target_get_trace_status (ts);
if (status == -1)
stopping_tracepoint = ts->stopping_tracepoint;
break;
}
-
+
if (stop_reason)
{
uiout->field_string ("stop-reason", stop_reason);
target_frameno = target_trace_find (type, num, addr1, addr2,
&target_tracept);
-
+
if (type == tfind_number
&& num == -1
&& target_frameno == -1)
/* A request for a non-existent trace frame has failed.
Our response will be different, depending on FROM_TTY:
- If FROM_TTY is true, meaning that this command was
+ If FROM_TTY is true, meaning that this command was
typed interactively by the user, then give an error
and DO NOT change the state of traceframe_number etc.
However if FROM_TTY is false, meaning that we're either
- in a script, a loop, or a user-defined command, then
+ in a script, a loop, or a user-defined command, then
DON'T give an error, but DO change the state of
traceframe_number etc. to invalid.
failed WITHOUT aborting. This allows you to write
scripts that search through the trace buffer until the end,
and then continue on to do something else. */
-
+
if (from_tty)
error (_("Target failed to find requested trace frame."));
else
#endif
}
}
-
+
tp = get_tracepoint_by_number_on_target (target_tracept);
reinit_frame_cache ();
error (_("May not look at trace frames while trace is running."));
}
-/* trace_find_command takes a trace frame number n,
- sends "QTFrame:<n>" to the target,
+/* trace_find_command takes a trace frame number n,
+ sends "QTFrame:<n>" to the target,
and accepts a reply that may contain several optional pieces
of information: a frame number, a tracepoint number, and an
indication of whether this is a trap frame or a stepping frame.
- The minimal response is just "OK" (which indicates that the
+ The minimal response is just "OK" (which indicates that the
target does not give us a frame number or a tracepoint number).
Instead of that, the target may send us a string containing
any combination of:
int frameno = -1;
check_trace_running (current_trace_status ());
-
+
if (args == 0 || *args == 0)
{ /* TFIND with no args means find NEXT trace frame. */
if (traceframe_number == -1)
error (_("not debugging trace buffer"));
else if (from_tty && traceframe_number == 0)
error (_("already at start of trace buffer"));
-
+
frameno = traceframe_number - 1;
}
/* A hack to work around eval's need for fp to have been collected. */
This command will take a sourceline for argument, just like BREAK
or TRACE (ie. anything that "decode_line_1" can handle).
- With no argument, this command will find the next trace frame
+ With no argument, this command will find the next trace frame
corresponding to a source line OTHER THAN THE CURRENT ONE. */
static void
CORE_ADDR func;
struct tramp_frame_cache *tramp_cache;
- /* tausq/2004-12-12: We used to assume if pc has a name or is in a valid
+ /* tausq/2004-12-12: We used to assume if pc has a name or is in a valid
section, then this is not a trampoline. However, this assumption is
false on HPUX which has a signal trampoline that has a name; it can
also be false when using an alternative signal stack. */
/* Disassembly display.
Copyright (C) 1998-2025 Free Software Foundation, Inc.
-
+
Contributed by Hewlett-Packard Company.
This file is part of GDB.
static void
tui_dummy_print_frame_info_listing_hook (struct symtab *s,
int line,
- int stopline,
+ int stopline,
int noerror)
{
}
prompt = "";
else
prompt = rl_display_prompt;
-
+
int c_pos = -1;
int c_line = -1;
WINDOW *w = tui_cmd_win ()->handle.get ();
for (int in = 0; in <= rl_end; in++)
{
unsigned char c;
-
+
if (in == rl_point)
{
getyx (w, c_line, c_pos);
to code that causes the compiler to generate an unused-value
warning. */
(void) wstandout (handle);
-
+
mvwaddnstr (handle, y, x, content.c_str (), field_width - 1);
if (content.size () < field_width)
waddstr (handle, n_spaces (field_width - content.size ()));
static void tui_scroll_backward_command (const char *, int);
static void tui_scroll_left_command (const char *, int);
static void tui_scroll_right_command (const char *, int);
-static void parse_scrolling_args (const char *,
- struct tui_win_info **,
+static void parse_scrolling_args (const char *,
+ struct tui_win_info **,
int *);
static void
show_tui_active_border_mode (struct ui_file *file,
int from_tty,
- struct cmd_list_element *c,
+ struct cmd_list_element *c,
const char *value)
{
gdb_printf (file, _("\
static const char *tui_border_mode = "normal";
static void
-show_tui_border_mode (struct ui_file *file,
+show_tui_border_mode (struct ui_file *file,
int from_tty,
- struct cmd_list_element *c,
+ struct cmd_list_element *c,
const char *value)
{
gdb_printf (file, _("\
static const char *tui_border_kind = "acs";
static void
-show_tui_border_kind (struct ui_file *file,
+show_tui_border_kind (struct ui_file *file,
int from_tty,
- struct cmd_list_element *c,
+ struct cmd_list_element *c,
const char *value)
{
gdb_printf (file, _("The kind of border for TUI windows is \"%s\".\n"),
{
#ifdef HAVE_RESIZE_TERM
resize_term (screenheight, screenwidth);
-#endif
+#endif
/* Turn keypad off while we resize. */
keypad (tui_cmd_win ()->handle.get (), FALSE);
tui_update_gdb_sizes ();
}
static void
-parse_scrolling_args (const char *arg,
+parse_scrolling_args (const char *arg,
struct tui_win_info **win_to_scroll,
int *num_to_scroll)
{
/* Draw a border around the window. */
static void
-box_win (struct tui_win_info *win_info,
+box_win (struct tui_win_info *win_info,
bool highlight_flag)
{
WINDOW *win;
void
tui_unhighlight_win (struct tui_win_info *win_info)
{
- if (win_info != NULL
+ if (win_info != NULL
&& win_info->can_box ()
&& win_info->handle != NULL)
{
}
bool
-tui_get_command_dimension (unsigned int *width,
+tui_get_command_dimension (unsigned int *width,
unsigned int *height)
{
if (!tui_active || (tui_cmd_win () == NULL))
return false;
-
+
*width = tui_cmd_win ()->width;
*height = tui_cmd_win ()->height;
return true;
\f
-/* Print a description of a type in the format of a
+/* Print a description of a type in the format of a
typedef for the current language.
NEW is the new name for a type TYPE. */
type_print (real_type, "", gdb_stdout, -1);
if (! full)
gdb_printf (" (incomplete object)");
- gdb_printf (" */\n");
+ gdb_printf (" */\n");
}
current_language->print_type (type, "", gdb_stdout, show, 0, &flags);
SELF_CHECK (sfd.get () >= 0);
unlink (filename);
-
+
gdb_file_up file = sfd.to_file ("rw");
SELF_CHECK (file != nullptr);
SELF_CHECK (sfd.get () == -1);
const void *baton);
/* Add a per-architecture frame register. */
-extern void user_reg_add (struct gdbarch *gdbarch, const char *name,
+extern void user_reg_add (struct gdbarch *gdbarch, const char *name,
user_reg_read_ftype *read, const void *baton);
#endif /* GDB_USER_REGS_H */
if (case_pass == case_sensitive_on)
return 0;
-
+
/* Otherwise the strings were equal in case insensitive way, make
a more fine grained comparison in a case sensitive way. */
};
struct v850_frame_cache
-{
+{
/* Base address. */
CORE_ADDR base;
LONGEST sp_offset;
CORE_ADDR pc;
-
+
/* Flag showing that a frame has been created in the prologue code. */
int uses_fp;
-
+
/* Saved registers. */
trad_frame_saved_reg *saved_regs;
};
v850_register_name (struct gdbarch *gdbarch, int regnum)
{
static const char *v850_reg_names[] =
- { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
- "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
- "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
+ { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
+ "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
+ "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
"r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31",
"eipc", "eipsw", "fepc", "fepsw", "ecr", "psw", "sr6", "sr7",
"sr8", "sr9", "sr10", "sr11", "sr12", "sr13", "sr14", "sr15",
}
return 0;
}
-
+
/* The value is a union which contains at least one field which
would be returned in registers according to these rules ->
returned in register. */
else if (insn == ((E_EP_REGNUM << 11) | 0x0000 | E_R1_REGNUM))
/* mov r1,ep */
ep_used = 0;
- else if (((insn & 0x07ff) == (0x0760 | E_SP_REGNUM)
+ else if (((insn & 0x07ff) == (0x0760 | E_SP_REGNUM)
|| (pi->uses_fp
&& (insn & 0x07ff) == (0x0760 | E_FP_REGNUM)))
&& pifsr
/* Given a pointer, return the size of its target.
If the pointer type is void *, then return 1.
If the target type is incomplete, then error out.
- This isn't a general purpose function, but just a
+ This isn't a general purpose function, but just a
helper for value_ptradd. */
static LONGEST
else
{
const char *name;
-
+
name = ptr_target->name ();
if (name == NULL)
error (_("Cannot perform pointer math on incomplete types, "
"an integer nor a pointer of the same type."));
sz = type_length_units (check_typedef (type1->target_type ()));
- if (sz == 0)
+ if (sz == 0)
{
warning (_("Type size unknown, assuming 1. "
"Try casting to a known type, or void *."));
}
/* Check to see if argument is a structure. This is called so
- we know whether to go ahead with the normal unop or look for a
+ we know whether to go ahead with the normal unop or look for a
user defined function instead.
For now, we do not overload the `&' operator. */
}
/* We know either arg1 or arg2 is a structure, so try to find the right
- user defined function. Create an argument vector that calls
+ user defined function. Create an argument vector that calls
arg1.operator @ (arg1,arg2) and return that value (where '@' is any
binary operator which is legal for GNU C++).
case BINOP_BITWISE_XOR:
v = v1 ^ v2;
break;
-
+
case BINOP_EQUAL:
v = v1 == v2;
break;
-
+
case BINOP_NOTEQUAL:
v = v1 != v2;
break;
/* Widen the scalar operand to a vector. */
struct value **v = t1_is_vec ? &arg2 : &arg1;
struct type *t = t1_is_vec ? type2 : type1;
-
+
if (t->code () != TYPE_CODE_FLT
&& t->code () != TYPE_CODE_DECFLOAT
&& !is_integral_type (t))
/* Local functions. */
-static struct value *search_struct_field (const char *, struct value *,
+static struct value *search_struct_field (const char *, struct value *,
struct type *, int);
static struct value *search_struct_method (const char *, struct value **,
bool overload_resolution = false;
static void
show_overload_resolution (struct ui_file *file, int from_tty,
- struct cmd_list_element *c,
+ struct cmd_list_element *c,
const char *value)
{
gdb_printf (file, _("Overload resolution in evaluating "
if (TYPE_IS_REFERENCE (check_typedef (type)))
{
/* We dereference type; then we recurse and finally
- we generate value of the given reference. Nothing wrong with
+ we generate value of the given reference. Nothing wrong with
that. */
struct type *t1 = check_typedef (type);
struct type *dereftype = check_typedef (t1->target_type ());
if (TYPE_IS_REFERENCE (check_typedef (arg2->type ())))
/* We deref the value and then do the cast. */
- return value_cast (type, coerce_ref (arg2));
+ return value_cast (type, coerce_ref (arg2));
/* Strip typedefs / resolve stubs in order to get at the type's
code/length, but remember the original type, to use as the
instead. */
gdb_assert (!TYPE_IS_REFERENCE (type));
- /* A cast to an undetermined-length array_type, such as
+ /* A cast to an undetermined-length array_type, such as
(TYPE [])OBJECT, is treated like a cast to (TYPE [N])OBJECT,
where N is sizeof(OBJECT)/sizeof(TYPE). */
if (code1 == TYPE_CODE_ARRAY)
low_bound,
new_length + low_bound - 1);
arg2->deprecated_set_type (create_array_type (alloc,
- element_type,
+ element_type,
range_type));
return arg2;
}
return value_from_mpz (to_type, longest);
}
- else if (code1 == TYPE_CODE_PTR && (code2 == TYPE_CODE_INT
- || code2 == TYPE_CODE_ENUM
+ else if (code1 == TYPE_CODE_PTR && (code2 == TYPE_CODE_INT
+ || code2 == TYPE_CODE_ENUM
|| code2 == TYPE_CODE_RANGE))
{
/* type->length () is the length of a pointer, but we really
default:
break;
}
-
+
/* If the field does not entirely fill a LONGEST, then zero the sign
bits. If the field is signed, and is negative, then sign
extend. */
LONGEST valmask = (((ULONGEST) 1) << toval->bitsize ()) - 1;
fieldval &= valmask;
- if (!type->is_unsigned ()
+ if (!type->is_unsigned ()
&& (fieldval & (valmask ^ (valmask >> 1))))
fieldval |= ~valmask;
base_addr = arg1->address () + boffset;
v2 = value_at_lazy (basetype, base_addr);
- if (target_read_memory (base_addr,
+ if (target_read_memory (base_addr,
v2->contents_raw ().data (),
v2->type ()->length ()) != 0)
error (_("virtual baseclass botch"));
TYPE_FN_FIELD_ARGS (f, j), *args))
{
if (TYPE_FN_FIELD_VIRTUAL_P (f, j))
- return value_virtual_fn_field (arg1p, f, j,
+ return value_virtual_fn_field (arg1p, f, j,
type, offset);
- if (TYPE_FN_FIELD_STATIC_P (f, j)
+ if (TYPE_FN_FIELD_STATIC_P (f, j)
&& static_memfuncp)
*static_memfuncp = 1;
v = value_fn_field (arg1p, f, j, type, offset);
if (v != NULL)
- return v;
+ return v;
}
j--;
}
non-standard coercions, 100 -> incompatible.
If a method is being searched for, VALP will hold the value.
- If a non-method is being searched for, SYMP will hold the symbol
+ If a non-method is being searched for, SYMP will hold the symbol
for it.
If a method is being searched for, and it is a static method,
find_overload_match (gdb::array_view<value *> args,
const char *name, enum oload_search_type method,
struct value **objp, struct symbol *fsym,
- struct value **valp, struct symbol **symp,
+ struct value **valp, struct symbol **symp,
int *staticp, const int no_adl,
const enum noside noside)
{
{
case TYPE_CODE_STRUCT:
case TYPE_CODE_UNION:
- return value_struct_elt_for_reference (curtype, 0, curtype,
+ return value_struct_elt_for_reference (curtype, 0, curtype,
name, expect_type,
want_address, noside);
case TYPE_CODE_NAMESPACE:
- return value_namespace_elt (curtype, name,
+ return value_namespace_elt (curtype, name,
want_address, noside);
case TYPE_CODE_ENUM:
}
}
-/* Compares the two method/function types T1 and T2 for "equality"
+/* Compares the two method/function types T1 and T2 for "equality"
with respect to the methods' parameters. If the types of the
two parameter lists are the same, returns 1; 0 otherwise. This
comparison may ignore any artificial parameters in T1 if
static struct value *
value_struct_elt_for_reference (struct type *domain, int offset,
struct type *curtype, const char *name,
- struct type *intype,
+ struct type *intype,
int want_address,
enum noside noside)
{
if (TYPE_FN_FIELD_STATIC_P (f, j))
{
- struct symbol *s =
+ struct symbol *s =
lookup_symbol (TYPE_FN_FIELD_PHYSNAME (f, j),
0, SEARCH_FUNCTION_DOMAIN, 0).symbol;
}
else
{
- struct symbol *s =
+ struct symbol *s =
lookup_symbol (TYPE_FN_FIELD_PHYSNAME (f, j),
0, SEARCH_FUNCTION_DOMAIN, 0).symbol;
v = value_struct_elt_for_reference (domain,
offset + base_offset,
TYPE_BASECLASS (t, i),
- name, intype,
+ name, intype,
want_address, noside);
if (v)
return v;
it up that way; this (frequently) works for types nested inside
classes. */
- return value_maybe_namespace_elt (curtype, name,
+ return value_maybe_namespace_elt (curtype, name,
want_address, noside);
}
enum noside noside)
{
struct value *retval = value_maybe_namespace_elt (curtype, name,
- want_address,
+ want_address,
noside);
if (retval == NULL)
- error (_("No symbol \"%s\" in namespace \"%s\"."),
+ error (_("No symbol \"%s\" in namespace \"%s\"."),
name, curtype->name ());
return retval;
and refer to the values computed for the object pointed to. */
struct type *
-value_rtti_indirect_type (struct value *v, int *full,
+value_rtti_indirect_type (struct value *v, int *full,
LONGEST *top, int *using_enc)
{
struct value *target = NULL;
NULL if they're not available. */
struct value *
-value_full_object (struct value *argp,
- struct type *rtype,
+value_full_object (struct value *argp,
+ struct type *rtype,
int xfull, int xtop,
int xusing_enc)
{
if (argp->lval () != lval_memory)
{
warning (_("Couldn't retrieve complete object of RTTI "
- "type %s; object may be in register(s)."),
+ "type %s; object may be in register(s)."),
real_type->name ());
return argp;
}
else if (val->type ()->code () == TYPE_CODE_FLT
|| val->type ()->code () == TYPE_CODE_INT)
- return value_literal_complex (val,
- value::zero (real_type, not_lval),
+ return value_literal_complex (val,
+ value::zero (real_type, not_lval),
type);
else
error (_("cannot cast non-number to complex"));
add_setshow_boolean_cmd ("overload-resolution", class_support,
&overload_resolution, _("\
Set overload resolution in evaluating C++ functions."), _("\
-Show overload resolution in evaluating C++ functions."),
+Show overload resolution in evaluating C++ functions."),
NULL, NULL,
show_overload_resolution,
&setlist, &showlist);
pretty-formatting disabled. */
void
get_no_prettyformat_print_options (struct value_print_options *opts)
-{
+{
*opts = user_print_options;
opts->prettyformat = Val_no_prettyformat;
}
}
/* Print a number according to FORMAT which is one of d,u,x,o,b,h,w,g.
- The raison d'etre of this function is to consolidate printing of
- LONG_LONG's into this one function. The format chars b,h,w,g are
+ The raison d'etre of this function is to consolidate printing of
+ LONG_LONG's into this one function. The format chars b,h,w,g are
from print_scalar_formatted(). Numbers are printed using C
format.
- USE_C_FORMAT means to use C format in all cases. Without it,
+ USE_C_FORMAT means to use C format in all cases. Without it,
'o' and 'x' format do not include the standard C radix prefix
- (leading 0 or 0x).
-
+ (leading 0 or 0x).
+
Hilfinger/2004-09-09: USE_C_FORMAT was originally called USE_LOCAL
and was intended to request formatting according to the current
language and would be used for most integers that GDB prints. The
val = int_string (val_long, 8, 0, 0, use_c_format); break;
default:
internal_error (_("failed internal consistency check"));
- }
+ }
gdb_puts (val, stream);
}
/* Print on STREAM using the given OPTIONS the index for the element
at INDEX of an array whose index type is INDEX_TYPE. */
-
-void
+
+void
maybe_print_array_index (struct type *index_type, LONGEST index,
struct ui_file *stream,
const struct value_print_options *options)
{
if (!options->print_array_indexes)
- return;
+ return;
current_language->print_array_index (index_type, index, stream, options);
}
omitted. */
void
-generic_printstr (struct ui_file *stream, struct type *type,
- const gdb_byte *string, unsigned int length,
+generic_printstr (struct ui_file *stream, struct type *type,
+ const gdb_byte *string, unsigned int length,
const char *encoding, int force_ellipses,
int quote_char, int c_style_terminator,
const struct value_print_options *options)
extern void generic_emit_char (int c, struct type *type, struct ui_file *stream,
int quoter, const char *encoding);
-extern void generic_printstr (struct ui_file *stream, struct type *type,
- const gdb_byte *string, unsigned int length,
+extern void generic_printstr (struct ui_file *stream, struct type *type,
+ const gdb_byte *string, unsigned int length,
const char *encoding, int force_ellipses,
int quote_char, int c_style_terminator,
const struct value_print_options *options);
{
if (len == 2)
{
- /* For some bizarre reason, "$$" is equivalent to "$$1",
+ /* For some bizarre reason, "$$" is equivalent to "$$1",
rather than to "$$0" as it ought to be! */
index = -1;
*endp += len;
type *type = nullptr);
/* Same as `allocate_register_lazy`, but make the value non-lazy.
-
+
The caller is responsible for filling the value's contents. */
static struct value *allocate_register (const frame_info_ptr &next_frame,
int regnum, type *type = nullptr);
innermost_block_tracker tracker (INNERMOST_BLOCK_FOR_SYMBOLS
| INNERMOST_BLOCK_FOR_REGISTERS);
- /* Wrap the call to parse expression, so we can
+ /* Wrap the call to parse expression, so we can
return a sensible error. */
try
{
/* For a root var, the name and the expr are the same. */
var->path_expr = expression;
- /* When the frame is different from the current frame,
+ /* When the frame is different from the current frame,
we must select the appropriate frame before parsing
the expression, otherwise the value will not be current.
Since select_frame is so benign, just call it for all cases. */
var->root->frame = get_frame_id (fi);
var->root->thread_id = inferior_thread ()->global_num;
old_id = get_frame_id (get_selected_frame (NULL));
- select_frame (fi);
+ select_frame (fi);
}
/* We definitely need to catch errors here. If evaluation of
{
var->format = format;
- if (varobj_value_is_changeable_p (var)
+ if (varobj_value_is_changeable_p (var)
&& var->value != nullptr && !var->value->lazy ())
{
var->print_value = varobj_value_get_print_value (var->value.get (),
if (pretty_printer == Py_None)
pretty_printer.reset (nullptr);
-
+
install_visualizer (var->dynamic, NULL, pretty_printer.release ());
}
}
/* Assign a new value to a variable object. If INITIAL is true,
this is the first assignment after the variable object was just
- created, or changed type. In that case, just assign the value
+ created, or changed type. In that case, just assign the value
and return false.
Otherwise, assign the new value, and return true if the value is
different from the current one, false otherwise. The comparison is
take care of releasing it when needed. */
static bool
install_new_value (struct varobj *var, struct value *value, bool initial)
-{
+{
bool changeable;
bool need_to_fetch;
bool changed = false;
var->to = to;
}
-void
+void
varobj_set_visualizer (struct varobj *var, const char *visualizer)
{
#if HAVE_PYTHON
changed.
The IS_EXPLICIT parameter specifies if this call is result
- of MI request to update this specific variable, or
+ of MI request to update this specific variable, or
result of implicit -var-update *. For implicit request, we don't
update frozen variables.
/* Update the root variable. value_of_root can return NULL
if the variable is no longer around, i.e. we stepped out of
- the frame in which a local existed. We are letting the
+ the frame in which a local existed. We are letting the
value_of_root variable dispose of the varobj if the type
has changed. */
newobj = value_of_root (varp, &type_changed);
r.type_changed = type_changed;
if (install_new_value ((*varp), newobj, type_changed))
r.changed = true;
-
+
if (newobj == NULL)
r.status = VAROBJ_NOT_IN_SCOPE;
r.value_installed = true;
{
/* Delete any children of this variable, too. */
for (varobj *child : var->children)
- {
+ {
if (!child)
continue;
}
/* If this variable has a parent, remove it from its parent's list. */
- /* OPTIMIZATION: if the parent of this variable is also being deleted,
+ /* OPTIMIZATION: if the parent of this variable is also being deleted,
(as indicated by remove_from_parent_p) we don't bother doing an
expensive list search to find the element to remove when we are
discarding the list afterwards. */
struct value *new_val = NULL;
struct varobj *var = *var_handle;
bool within_scope = false;
-
+
/* Only root variables can be updated... */
if (!is_root_p (var))
/* Not a root var. */
created. Technically, it's possible that the program became
multi-threaded since then, but we don't support such
scenario yet. */
- within_scope = check_scope (var);
+ within_scope = check_scope (var);
}
else
{
- *type_changed will be set to 1
- old varobj will be freed, and new one will be
created, with the same name.
- - *var_handle will be set to the new varobj
+ - *var_handle will be set to the new varobj
Otherwise, *type_changed will be set to 0. */
static struct value *
value_of_root (struct varobj **var_handle, bool *type_changed)
/* See varobj.h. */
-void
+void
varobj_re_set (void)
{
all_root_varobjs (varobj_re_set_iter);
/* The value of this expression or subexpression. A NULL value
indicates there was an error getting this value.
- Invariant: if varobj_value_is_changeable_p (this) is non-zero,
+ Invariant: if varobj_value_is_changeable_p (this) is non-zero,
the value is either NULL, or not lazy. */
value_ref_ptr value;
std::string print_value;
/* Is this variable frozen. Frozen variables are never implicitly
- updated by -var-update *
+ updated by -var-update *
or -var-update <direct-or-indirect-parent>. */
bool frozen = false;
tib_size = FULL_TIB_SIZE;
max = tib_size / size;
}
-
+
tib = (gdb_byte *) alloca (tib_size);
if (!target_get_tib_address (ptid, &thread_local_base))
{
gdb_printf (_("Unable to read thread information "
"block for %s at address %s\n"),
- target_pid_to_str (ptid).c_str (),
+ target_pid_to_str (ptid).c_str (),
paddress (current_inferior ()->arch (), thread_local_base));
return -1;
}
index = (gdb_byte *) tib;
- /* All fields have the size of a pointer, this allows to iterate
+ /* All fields have the size of a pointer, this allows to iterate
using the same for loop for both layouts. */
for (i = 0; i < max; i++)
{
gdb_printf (_("TIB[0x%s] is 0x%s\n"), phex (i * size, 2),
phex (val, size));
index += size;
- }
- return 1;
+ }
+ return 1;
}
/* Display thread information block of the current thread. */
/* Use this function to set x86_dr_low debug_register_length field
rather than setting it directly to check that the length is only
- set once. It also enables the 'maint set/show show-debug-regs'
+ set once. It also enables the 'maint set/show show-debug-regs'
command. */
extern void x86_set_debug_register_length (int len);
static foo2()
40 0x700
50 0x800
- 60 0x900
+ 60 0x900
and that breaks gdb's binary search on line numbers, if the
above table is not sorted on line numbers. And that sort
old_linetable = std::move (new_linetable);
}
-/* include file support: C_BINCL/C_EINCL pairs will be kept in the
+/* include file support: C_BINCL/C_EINCL pairs will be kept in the
following `IncludeChain'. At the end of each symtab (end_compunit_symtab),
we will determine if we should create additional symtab's to
represent if (the include files. */
can be called in the following two ways:
enter_line_range (subfile, beginoffset, endoffset,
startaddr, 0, firstLine) or
- enter_line_range (subfile, beginoffset, 0,
+ enter_line_range (subfile, beginoffset, 0,
startaddr, endaddr, firstLine)
endoffset points to the last line table entry that we should pay
/* beginning of include file */
/* In xlc output, C_BINCL/C_EINCL pair doesn't show up in sorted
order. Thus, when we see them, we might not know enough info
- to process them. Thus, we'll be saving them into a table
+ to process them. Thus, we'll be saving them into a table
(inclTable) and postpone their processing. */
record_include_begin (cs);
}
/* Activate the misc_func_recorded mechanism for
compiler- and linker-generated CSECTs like ".strcmp"
- and "@FIX1". */
+ and "@FIX1". */
if (namestring && (namestring[0] == '.'
|| namestring[0] == '@'))
{
}
/* Scan and build partial symbols for a symbol file.
- We have been initialized by a call to dbx_symfile_init, which
+ We have been initialized by a call to dbx_symfile_init, which
put all the relevant info into a "struct dbx_symfile_info",
hung off the objfile structure.
/* Function responsible for initializing the information
about the syscalls. It reads the XML file and fills the
struct syscalls_info with the values.
-
+
Returns the struct syscalls_info if the file is valid, NULL otherwise. */
static struct syscalls_info *
xml_init_syscalls_info (const char *filename)
/* Function used to set the name of the file which contains
information about the system calls present in the current
architecture.
-
+
This function *should* be called before anything else, otherwise
GDB won't be able to find the correct XML file to open and get
the syscalls definitions. */
tdesc_start_union, NULL },
{ "flags", flags_attributes, struct_union_children,
GDB_XML_EF_OPTIONAL | GDB_XML_EF_REPEATABLE,
- tdesc_start_flags, NULL },
+ tdesc_start_flags, NULL },
{ "enum", enum_attributes, enum_children,
GDB_XML_EF_OPTIONAL | GDB_XML_EF_REPEATABLE,
tdesc_start_enum, NULL },
&& t->code () != TYPE_CODE_ARRAY);
}
-/* Function: xstormy16_use_struct_convention
+/* Function: xstormy16_use_struct_convention
Returns non-zero if the given struct type will be returned using
a special convention, rather than the normal function return method.
7sed in the contexts of the "return" command, and of
- target function calls from the debugger. */
+ target function calls from the debugger. */
static int
xstormy16_use_struct_convention (struct type *type)
{
return !xstormy16_type_is_scalar (type)
|| type->length () > E_MAX_RETTYPE_SIZE_IN_REGS;
-}
+}
/* Function: xstormy16_extract_return_value
Find a function's return value in the appropriate registers (in
/* Function: xstormy16_store_return_value
Copy the function return value from VALBUF into the
- proper location for a function return.
+ proper location for a function return.
Called only in the context of the "return" command. */
-static void
+static void
xstormy16_store_return_value (struct type *type, struct regcache *regcache,
const gdb_byte *valbuf)
{
if (type->length () == 1)
- {
+ {
/* Add leading zeros to the value. */
gdb_byte buf[xstormy16_reg_size];
memset (buf, 0, xstormy16_reg_size);
;
/* Optional copying of args in r2-r7 to stack. */
- /* 72DS HHHH mov.b (rD, 0xHHHH), r(S-8)
+ /* 72DS HHHH mov.b (rD, 0xHHHH), r(S-8)
(bit3 always 1, bit2-0 = reg) */
/* 73DS HHHH mov.w (rD, 0xHHHH), r(S-8) */
else if ((inst & 0xfed8) == 0x72d8 && (inst & 0x0007) >= 2)
}
/* Function: xstormy16_skip_prologue
- If the input address is in a function prologue,
+ If the input address is in a function prologue,
returns the address of the end of the prologue;
else returns the input address.
- Note: the input address is likely to be the function start,
+ Note: the input address is likely to be the function start,
since this function is mainly used for advancing a breakpoint
to the first line, or stepping to the first line when we have
stepped into a function call. */
return;
}
-void
+void
supply_fpregset (struct regcache *regcache,
const gdb_fpregset_t *fpregsetp)
{
{
int tid = regcache->ptid ().lwp ();
gdb_gregset_t regs;
-
+
if (ptrace (PTRACE_GETREGS, tid, 0, (long) ®s) < 0)
{
perror_with_name (_("Couldn't get registers"));
return;
}
-
+
supply_gregset_reg (regcache, ®s, regnum);
}
-/* Store greg-register(s) in GDB's register
+/* Store greg-register(s) in GDB's register
array into the process/thread specified by TID. */
static void
return (areg > 15) ? -1 : areg;
}
-/* Read Xtensa register directly from the hardware. */
+/* Read Xtensa register directly from the hardware. */
static unsigned long
xtensa_read_register (int regnum)
{
return (unsigned long) value;
}
-/* Write Xtensa register directly to the hardware. */
+/* Write Xtensa register directly to the hardware. */
static void
xtensa_write_register (int regnum, ULONGEST value)
{
/* We have to find out how to deal with privileged registers.
Let's treat them as pseudo-registers, but we cannot read/write them. */
-
+
else if (tdep->call_abi == CallAbiCall0Only
|| regnum < tdep->a0_base)
{
reggroup_add (gdbarch, xtensa_cp[i]);
}
-static int
+static int
xtensa_coprocessor_register_group (const struct reggroup *group)
{
int i;
A-register where the current content of the reg came from (in terms
of an original reg and a constant). Negative values of c0_rt[n].fp_reg
mean that the original content of the register was saved to the stack.
- c0_rt[n].fr.ofs is NOT the offset from the frame base because we don't
+ c0_rt[n].fr.ofs is NOT the offset from the frame base because we don't
know where SP will end up until the entire prologue has been analyzed. */
#define C0_CONST -1 /* fr_reg value if register contains a constant. */
pointer. It's an AND mask. Zero,
if alignment was not adjusted. */
int c0_old_sp; /* In case of dynamic adjustment, it is
- a register holding unaligned sp.
+ a register holding unaligned sp.
C0_INEXP, when undefined. */
int c0_sp_ofs; /* If "c0_old_sp" was spilled it's a
stack offset. C0_NOSTK otherwise. */
-
+
xtensa_c0reg_t c0_rt[C0_NREGS]; /* Register tracking information. */
} xtensa_call0_frame_cache_t;
gdb_byte buf[8];
CORE_ADDR pc;
- DEBUGTRACE ("xtensa_unwind_pc (next_frame = %s)\n",
+ DEBUGTRACE ("xtensa_unwind_pc (next_frame = %s)\n",
host_address_to_string (next_frame.get ()));
frame_unwind_register (next_frame, gdbarch_pc_regnum (gdbarch), buf);
islots = xtensa_format_num_slots (isa, ifmt);
if (islots == XTENSA_UNDEFINED)
RETURN_FP;
-
+
for (is = 0; is < islots; ++is)
{
if (xtensa_format_get_slot (isa, ifmt, is, ins, slot))
RETURN_FP;
-
+
opc = xtensa_opcode_decode (isa, ifmt, is, slot);
- if (opc == XTENSA_UNDEFINED)
+ if (opc == XTENSA_UNDEFINED)
RETURN_FP;
-
+
opcname = xtensa_opcode_name (isa, opc);
if (strcasecmp (opcname, "mov.n") == 0
/* Possible candidate for setting frame pointer
from A1. This is what we are looking for. */
- if (xtensa_operand_get_field (isa, opc, 1, ifmt,
+ if (xtensa_operand_get_field (isa, opc, 1, ifmt,
is, slot, ®ister_operand) != 0)
RETURN_FP;
if (xtensa_operand_decode (isa, opc, 1, ®ister_operand) != 0)
RETURN_FP;
if (register_operand == 1) /* Mov{.n} FP A1. */
{
- if (xtensa_operand_get_field (isa, opc, 0, ifmt, is, slot,
+ if (xtensa_operand_get_field (isa, opc, 0, ifmt, is, slot,
®ister_operand) != 0)
RETURN_FP;
if (xtensa_operand_decode (isa, opc, 0,
if (
/* We have problems decoding the memory. */
- opcname == NULL
+ opcname == NULL
|| strcasecmp (opcname, "ill") == 0
|| strcasecmp (opcname, "ill.n") == 0
/* Hit planted breakpoint. */
return fp_regnum;
}
-/* The key values to identify the frame using "cache" are
+/* The key values to identify the frame using "cache" are
cache->base = SP (or best guess about FP) of this frame;
cache->pc = entry-PC (entry point of the frame function);
xtensa_gdbarch_tdep *tdep = gdbarch_tdep<xtensa_gdbarch_tdep> (gdbarch);
/* Get WINDOWBASE, WINDOWSTART, and PS registers. */
- wb = get_frame_register_unsigned (this_frame,
+ wb = get_frame_register_unsigned (this_frame,
tdep->wb_regnum);
ws = get_frame_register_unsigned (this_frame,
tdep->ws_regnum);
int callinc = CALLINC (ps);
ra = get_frame_register_unsigned
(this_frame, tdep->a0_base + callinc * 4);
-
+
/* ENTRY hasn't been executed yet, therefore callsize is still 0. */
cache->wd.callsize = 0;
cache->wd.wb = wb;
/* Set A0...A3. */
sp = get_frame_register_unsigned
(this_frame, tdep->a0_base + 1) - 16;
-
+
for (i = 0; i < 4; i++, sp += 4)
{
cache->wd.aregs[i] = sp;
}
else /* Call0 framework. */
{
- call0_frame_cache (this_frame, cache, pc);
+ call0_frame_cache (this_frame, cache, pc);
fp_regnum = cache->c0.fp_regnum;
}
xtensa_gdbarch_tdep *tdep = gdbarch_tdep<xtensa_gdbarch_tdep> (gdbarch);
if (tdep->call_abi != CallAbiCall0Only)
{
- regcache_raw_read_unsigned
+ regcache_raw_read_unsigned
(regcache, tdep->wb_regnum, &wb);
regcache_raw_read_unsigned (regcache, gdbarch_pc_regnum (gdbarch), &pc);
callsize = extract_call_winsize (gdbarch, pc);
/* Call0 ABI support routines. */
-/* Return true, if PC points to "ret" or "ret.n". */
+/* Return true, if PC points to "ret" or "ret.n". */
static int
call0_ret (CORE_ADDR start_pc, CORE_ADDR finish_pc)
islots = xtensa_format_num_slots (isa, ifmt);
if (islots == XTENSA_UNDEFINED)
RETURN_RET;
-
+
for (is = 0; is < islots; ++is)
{
if (xtensa_format_get_slot (isa, ifmt, is, ins, slot))
RETURN_RET;
-
+
opc = xtensa_opcode_decode (isa, ifmt, is, slot);
- if (opc == XTENSA_UNDEFINED)
+ if (opc == XTENSA_UNDEFINED)
RETURN_RET;
-
+
opcname = xtensa_opcode_name (isa, opc);
-
+
if ((strcasecmp (opcname, "ret.n") == 0)
|| (strcasecmp (opcname, "ret") == 0))
{
/* Call0 opcode class. Opcodes are preclassified according to what they
mean for Call0 prologue analysis, and their number of significant operands.
- The purpose of this is to simplify prologue analysis by separating
+ The purpose of this is to simplify prologue analysis by separating
instruction decoding (libisa) from the semantics of prologue analysis. */
enum xtensa_insn_kind
rwx_special_register (const char *opcname)
{
char ch = *opcname++;
-
+
if ((ch != 'r') && (ch != 'w') && (ch != 'x'))
return 0;
if (*opcname++ != 's')
opcname = xtensa_opcode_name (isa, opc);
- if (opcname == NULL
+ if (opcname == NULL
|| strcasecmp (opcname, "ill") == 0
|| strcasecmp (opcname, "ill.n") == 0)
opclass = c0opc_illegal;
opclass = c0opc_flow;
/* Also, classify specific opcodes that need to be tracked. */
- else if (strcasecmp (opcname, "add") == 0
+ else if (strcasecmp (opcname, "add") == 0
|| strcasecmp (opcname, "add.n") == 0)
opclass = c0opc_add;
else if (strcasecmp (opcname, "and") == 0)
opclass = c0opc_and;
- else if (strcasecmp (opcname, "addi") == 0
+ else if (strcasecmp (opcname, "addi") == 0
|| strcasecmp (opcname, "addi.n") == 0
|| strcasecmp (opcname, "addmi") == 0)
opclass = c0opc_addi;
else if (strcasecmp (opcname, "mov.n") == 0
|| strcasecmp (opcname, "or") == 0) /* Could be 'mov' asm macro. */
opclass = c0opc_mov;
- else if (strcasecmp (opcname, "movi") == 0
+ else if (strcasecmp (opcname, "movi") == 0
|| strcasecmp (opcname, "movi.n") == 0)
opclass = c0opc_movi;
else if (strcasecmp (opcname, "l32r") == 0)
opclass = c0opc_l32r;
- else if (strcasecmp (opcname, "s32i") == 0
+ else if (strcasecmp (opcname, "s32i") == 0
|| strcasecmp (opcname, "s32i.n") == 0)
opclass = c0opc_s32i;
else if (strcasecmp (opcname, "l32e") == 0)
break;
case c0opc_add:
/* 3 operands: dst, src1, src2. */
- gdb_assert (nods == 3);
+ gdb_assert (nods == 3);
if (src[odv[1]].fr_reg == C0_CONST)
{
dst[odv[0]].fr_reg = src[odv[2]].fr_reg;
is guaranteed valid only at the point in the function indicated by the PC.
May be used to skip the prologue or identify the ABI, w/o tracking.
- Returns: Address of first instruction after prologue, or PC (whichever
+ Returns: Address of first instruction after prologue, or PC (whichever
is first), or 0, if decoding failed (in libisa).
Input args:
start Start address of function/prologue.
struct symtab_and_line prologue_sal;
- DEBUGTRACE ("call0_analyze_prologue (start = 0x%08x, pc = 0x%08x, ...)\n",
+ DEBUGTRACE ("call0_analyze_prologue (start = 0x%08x, pc = 0x%08x, ...)\n",
(int)start, (int)pc);
/* Try to limit the scan to the end of the function if a non-zero pc
goto done;
}
- /* Analyze a bundle or a single instruction, using a snapshot of
+ /* Analyze a bundle or a single instruction, using a snapshot of
the register tracking info as input for the entire bundle so that
register changes do not take effect within this bundle. */
goto done;
opc = xtensa_opcode_decode (isa, ifmt, is, slot);
- DEBUGVERB ("[call0_analyze_prologue] instr addr = 0x%08x, opc = %d\n",
+ DEBUGVERB ("[call0_analyze_prologue] instr addr = 0x%08x, opc = %d\n",
(unsigned)ia, opc);
- if (opc == XTENSA_UNDEFINED)
+ if (opc == XTENSA_UNDEFINED)
opclass = c0opc_illegal;
else
opclass = call0_classify_opcode (isa, opc);
for (j = 0; j < nods && j < C0_MAXOPDS; ++j)
{
- fail = xtensa_operand_get_field (isa, opc, j, ifmt,
+ fail = xtensa_operand_get_field (isa, opc, j, ifmt,
is, slot, &odv[j]);
if (fail)
goto done;
CORE_ADDR sp, fp, ra;
int fp_regnum = C0_SP, c0_hasfp = 0, c0_frmsz = 0, prev_sp = 0, to_stk;
xtensa_gdbarch_tdep *tdep = gdbarch_tdep<xtensa_gdbarch_tdep> (gdbarch);
-
+
sp = get_frame_register_unsigned
(this_frame, tdep->a0_base + 1);
fp = sp; /* Assume FP == SP until proven otherwise. */
goto finish_frame_analysis;
}
}
-
+
/* Get the frame information and FP (if used) at the current PC.
If PC is in the prologue, the prologue analysis is more reliable
than DWARF info. We don't not know for sure, if PC is in the prologue,
else
prev_sp = fp + c0_frmsz;
- /* Frame size from debug info or prologue tracking does not account for
+ /* Frame size from debug info or prologue tracking does not account for
alloca() and other dynamic allocations. Adjust frame size by FP - SP. */
if (c0_hasfp)
{
to_stk = cache->c0.c0_rt[C0_RA].to_stk;
if (to_stk != C0_NOSTK)
- ra = (CORE_ADDR)
+ ra = (CORE_ADDR)
read_memory_integer (sp + c0_frmsz + cache->c0.c0_rt[C0_RA].to_stk,
4, byte_order);
}
else ra = 0;
}
-
+
finish_frame_analysis:
cache->pc = start_pc;
cache->ra = ra;
uint32_t at, as, offset;
- /* WindowUnderflow12 = true, when inside _WindowUnderflow12. */
- int WindowUnderflow12 = (current_pc & 0x1ff) >= 0x140;
+ /* WindowUnderflow12 = true, when inside _WindowUnderflow12. */
+ int WindowUnderflow12 = (current_pc & 0x1ff) >= 0x140;
isa = xtensa_default_isa;
gdb_assert (XTENSA_ISA_BSZ >= xtensa_isa_maxlength (isa));
if (xtensa_format_get_slot (isa, ifmt, is, ins, slot))
return xtNoExceptionHandler;
opc = xtensa_opcode_decode (isa, ifmt, is, slot);
- if (opc == XTENSA_UNDEFINED)
+ if (opc == XTENSA_UNDEFINED)
return xtNoExceptionHandler;
switch (call0_classify_opcode (isa, opc))
{
Return the pc of the first instruction after prologue. GDB calls this to
find the address of the first line of the function or (if there is no line
- number information) to skip the prologue for planting breakpoints on
- function entries. Use debug info (if present) or prologue analysis to skip
- the prologue to achieve reliable debugging behavior. For windowed ABI,
- only the 'entry' instruction is skipped. It is not strictly necessary to
+ number information) to skip the prologue for planting breakpoints on
+ function entries. Use debug info (if present) or prologue analysis to skip
+ the prologue to achieve reliable debugging behavior. For windowed ABI,
+ only the 'entry' instruction is skipped. It is not strictly necessary to
skip the prologue (Call0) or 'entry' (Windowed) because xt-gdb knows how to
- backtrace at any point in the prologue, however certain potential hazards
- are avoided and a more "normal" debugging experience is ensured by
+ backtrace at any point in the prologue, however certain potential hazards
+ are avoided and a more "normal" debugging experience is ensured by
skipping the prologue (can be disabled by defining DONT_SKIP_PROLOG).
For example, if we don't skip the prologue:
- Some args may not yet have been saved to the stack where the debug
info expects to find them (true anyway when only 'entry' is skipped);
- - Software breakpoints ('break' instrs) may not have been unplanted
- when the prologue analysis is done on initializing the frame cache,
+ - Software breakpoints ('break' instrs) may not have been unplanted
+ when the prologue analysis is done on initializing the frame cache,
and breaks in the prologue will throw off the analysis.
If we have debug info ( line-number info, in particular ) we simply skip
/* Mask. */
-typedef struct
+typedef struct
{
int reg_num;
int bit_start;
int bit_size;
} xtensa_reg_mask_t;
-typedef struct
+typedef struct
{
int count;
xtensa_reg_mask_t *mask;
/* Xtensa register representation. */
-typedef struct
+typedef struct
{
const char *name; /* Register name. */
int offset; /* Offset. */
#define WB_SHIFT 2
-/* We assign fixed numbers to the registers of the "current" window
- (i.e., relative to WB). The registers get remapped via the reg_map
- data structure to their corresponding register in the AR register
+/* We assign fixed numbers to the registers of the "current" window
+ (i.e., relative to WB). The registers get remapped via the reg_map
+ data structure to their corresponding register in the AR register
file (see xtensa-tdep.c). */
#endif /* GDB_XTENSA_TDEP_H */
/* Thread options GDB requested with QThreadOptions. */
gdb_thread_options thread_options = 0;
-
+
private:
process_info *m_process;
std::unique_ptr<struct regcache> m_regcache = nullptr;
{
int xmm0_regnum = find_regno (regcache->tdesc, "xmm0");
- for (i = 0; i < num_xmm_registers; i++)
+ for (i = 0; i < num_xmm_registers; i++)
{
collect_register (regcache, i + xmm0_regnum, raw);
p = fp->xmm_space + i * 16;
{
int ymm0h_regnum = find_regno (regcache->tdesc, "ymm0h");
- for (i = 0; i < num_xmm_registers; i++)
+ for (i = 0; i < num_xmm_registers; i++)
{
collect_register (regcache, i + ymm0h_regnum, raw);
p = fp->ymmh_space () + i * 16;
FILE *f = fopen ("/proc/sys/vm/mmap_min_addr", "r");
if (!f)
- {
+ {
snprintf (buf, sizeof (buf), "mmap_min_addr open failed: %s",
safe_strerror (errno));
set_trampoline_buffer_space (0, 0, buf);
if (fgets (buf, IPA_BUFSIZ, f))
sscanf (buf, "%llu", &mmap_min_addr);
-
+
fclose (f);
-
+
buffer_size = buffer_end - mmap_min_addr;
if (buffer_size >= min_buffer_size)
process_info *add_linux_process_no_mem_file (int pid, int attached);
/* Free resources associated to PROC and remove it. */
- void remove_linux_process (process_info *proc);
+ void remove_linux_process (process_info *proc);
/* Add a new thread. */
lwp_info *add_lwp (ptid_t ptid);
/* Mapping between the general-purpose registers in `struct user'
format and GDB's register array layout.
Note that the transfer layout uses 64-bit regs. */
-static /*const*/ int i386_regmap[] =
+static /*const*/ int i386_regmap[] =
{
RAX * 8, RCX * 8, RDX * 8, RBX * 8,
RSP * 8, RBP * 8, RSI * 8, RDI * 8,
/* Mapping between the general-purpose registers in `struct user'
format and GDB's register array layout. */
-static /*const*/ int i386_regmap[] =
+static /*const*/ int i386_regmap[] =
{
EAX * 4, ECX * 4, EDX * 4, EBX * 4,
UESP * 4, EBP * 4, ESI * 4, EDI * 4,
struct client_state
{
client_state ():
- own_buf ((char *) xmalloc (PBUFSIZ + 1))
+ own_buf ((char *) xmalloc (PBUFSIZ + 1))
{}
/* The thread set with an `Hc' packet. `Hc' is deprecated in favor of
{
internal_error ("error extracting trampoline_buffer_end");
}
-
+
if (buf)
{
buf[0] = '\0';
std::optional<int> timer_id;
- SCOPE_EXIT
+ SCOPE_EXIT
{
if (timer_id.has_value ())
delete_timer (*timer_id);
return curr_next;
}
-/* Remove the file descriptor FD from the list of monitored fd's:
+/* Remove the file descriptor FD from the list of monitored fd's:
i.e. we don't care anymore about events on the FD. */
void
delete_file_handler (int fd)
}
}
- /* Deactivate the file descriptor, by clearing its mask,
+ /* Deactivate the file descriptor, by clearing its mask,
so that it will not fire again. */
file_ptr->mask = 0;
gdb_client_data client_data,
std::string &&name, bool is_ui = false);
-extern int create_timer (int milliseconds,
- timer_handler_func *proc,
+extern int create_timer (int milliseconds,
+ timer_handler_func *proc,
gdb_client_data client_data);
extern void delete_timer (int id);
delim_string_to_char_ptr_vec (const char *str, char delimiter)
{
std::vector<gdb::unique_xmalloc_ptr<char>> retval;
-
+
delim_string_to_char_ptr_vec_append (&retval, str, delimiter);
return retval;
dirnames_to_char_ptr_vec (const char *dirnames)
{
std::vector<gdb::unique_xmalloc_ptr<char>> retval;
-
+
dirnames_to_char_ptr_vec_append (&retval, dirnames);
return retval;
/* Convert VAL to a numeral in the given radix. For
* radix 10, IS_SIGNED may be true, indicating a signed quantity;
- * otherwise VAL is interpreted as unsigned. If WIDTH is supplied,
+ * otherwise VAL is interpreted as unsigned. If WIDTH is supplied,
* it is the minimum width (0-padded if needed). USE_C_FORMAT means
- * to use C format in all cases. If it is false, then 'x'
+ * to use C format in all cases. If it is false, then 'x'
* and 'o' formats do not include a prefix (0x or leading 0). */
extern const char *int_string (LONGEST val, int radix, int is_signed, int width,
/* The ptid_t type and common functions operating on it.
Copyright (C) 1986-2025 Free Software Foundation, Inc.
-
+
This file is part of GDB.
This program is free software; you can redistribute it and/or modify