gdbarch_auxv_parse_ftype *auxv_parse;
gdbarch_vsyscall_range_ftype *vsyscall_range;
gdbarch_infcall_mmap_ftype *infcall_mmap;
+ gdbarch_infcall_munmap_ftype *infcall_munmap;
gdbarch_gcc_target_options_ftype *gcc_target_options;
gdbarch_gnu_triplet_regexp_ftype *gnu_triplet_regexp;
+ gdbarch_addressable_memory_unit_size_ftype *addressable_memory_unit_size;
};
/* Create a new ``struct gdbarch'' based on information provided by
then use that to allocate the architecture vector. */
struct obstack *obstack = XNEW (struct obstack);
obstack_init (obstack);
- gdbarch = obstack_alloc (obstack, sizeof (*gdbarch));
+ gdbarch = XOBNEW (obstack, struct gdbarch);
memset (gdbarch, 0, sizeof (*gdbarch));
gdbarch->obstack = obstack;
gdbarch->insn_is_jump = default_insn_is_jump;
gdbarch->vsyscall_range = default_vsyscall_range;
gdbarch->infcall_mmap = default_infcall_mmap;
+ gdbarch->infcall_munmap = default_infcall_munmap;
gdbarch->gcc_target_options = default_gcc_target_options;
gdbarch->gnu_triplet_regexp = default_gnu_triplet_regexp;
+ gdbarch->addressable_memory_unit_size = default_addressable_memory_unit_size;
/* gdbarch_alloc() */
return gdbarch;
return data;
}
+/* See gdbarch.h. */
+
+char *
+gdbarch_obstack_strdup (struct gdbarch *arch, const char *string)
+{
+ return obstack_strdup (arch->obstack, string);
+}
+
/* Free a gdbarch struct. This should never happen in normal
operation --- once you've created a gdbarch, you keep it around.
/* Skip verify of auxv_parse, has predicate. */
/* Skip verify of vsyscall_range, invalid_p == 0 */
/* Skip verify of infcall_mmap, invalid_p == 0 */
+ /* Skip verify of infcall_munmap, invalid_p == 0 */
/* Skip verify of gcc_target_options, invalid_p == 0 */
/* Skip verify of gnu_triplet_regexp, invalid_p == 0 */
+ /* Skip verify of addressable_memory_unit_size, invalid_p == 0 */
buf = ui_file_xstrdup (log, &length);
make_cleanup (xfree, buf);
if (length > 0)
fprintf_unfiltered (file,
"gdbarch_dump: address_to_pointer = <%s>\n",
host_address_to_string (gdbarch->address_to_pointer));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: addressable_memory_unit_size = <%s>\n",
+ host_address_to_string (gdbarch->addressable_memory_unit_size));
fprintf_unfiltered (file,
"gdbarch_dump: gdbarch_adjust_breakpoint_address_p() = %d\n",
gdbarch_adjust_breakpoint_address_p (gdbarch));
fprintf_unfiltered (file,
"gdbarch_dump: have_nonsteppable_watchpoint = %s\n",
plongest (gdbarch->have_nonsteppable_watchpoint));
- fprintf_unfiltered (file,
- "gdbarch_dump: stack_frame_destroyed_p = <%s>\n",
- host_address_to_string (gdbarch->stack_frame_destroyed_p));
fprintf_unfiltered (file,
"gdbarch_dump: in_solib_return_trampoline = <%s>\n",
host_address_to_string (gdbarch->in_solib_return_trampoline));
fprintf_unfiltered (file,
"gdbarch_dump: infcall_mmap = <%s>\n",
host_address_to_string (gdbarch->infcall_mmap));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: infcall_munmap = <%s>\n",
+ host_address_to_string (gdbarch->infcall_munmap));
fprintf_unfiltered (file,
"gdbarch_dump: gdbarch_info_proc_p() = %d\n",
gdbarch_info_proc_p (gdbarch));
fprintf_unfiltered (file,
"gdbarch_dump: stabs_argument_has_addr = <%s>\n",
host_address_to_string (gdbarch->stabs_argument_has_addr));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: stack_frame_destroyed_p = <%s>\n",
+ host_address_to_string (gdbarch->stack_frame_destroyed_p));
fprintf_unfiltered (file,
"gdbarch_dump: stap_gdb_register_prefix = %s\n",
pstring (gdbarch->stap_gdb_register_prefix));
}
int
-gdbarch_fast_tracepoint_valid_at (struct gdbarch *gdbarch, CORE_ADDR addr, int *isize, char **msg)
+gdbarch_fast_tracepoint_valid_at (struct gdbarch *gdbarch, CORE_ADDR addr, char **msg)
{
gdb_assert (gdbarch != NULL);
gdb_assert (gdbarch->fast_tracepoint_valid_at != NULL);
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_fast_tracepoint_valid_at called\n");
- return gdbarch->fast_tracepoint_valid_at (gdbarch, addr, isize, msg);
+ return gdbarch->fast_tracepoint_valid_at (gdbarch, addr, msg);
}
void
gdbarch->infcall_mmap = infcall_mmap;
}
+void
+gdbarch_infcall_munmap (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR size)
+{
+ gdb_assert (gdbarch != NULL);
+ gdb_assert (gdbarch->infcall_munmap != NULL);
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_infcall_munmap called\n");
+ gdbarch->infcall_munmap (addr, size);
+}
+
+void
+set_gdbarch_infcall_munmap (struct gdbarch *gdbarch,
+ gdbarch_infcall_munmap_ftype infcall_munmap)
+{
+ gdbarch->infcall_munmap = infcall_munmap;
+}
+
char *
gdbarch_gcc_target_options (struct gdbarch *gdbarch)
{
gdbarch->gnu_triplet_regexp = gnu_triplet_regexp;
}
+int
+gdbarch_addressable_memory_unit_size (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ gdb_assert (gdbarch->addressable_memory_unit_size != NULL);
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_addressable_memory_unit_size called\n");
+ return gdbarch->addressable_memory_unit_size (gdbarch);
+}
+
+void
+set_gdbarch_addressable_memory_unit_size (struct gdbarch *gdbarch,
+ gdbarch_addressable_memory_unit_size_ftype addressable_memory_unit_size)
+{
+ gdbarch->addressable_memory_unit_size = addressable_memory_unit_size;
+}
+
/* Keep a registry of per-architecture data-pointers required by GDB
modules. */
static void
append_name (const char ***buf, int *nr, const char *name)
{
- *buf = xrealloc (*buf, sizeof (char**) * (*nr + 1));
+ *buf = XRESIZEVEC (const char *, *buf, *nr + 1);
(*buf)[*nr] = name;
*nr += 1;
}