/* Native support code for PPC AIX, for GDB the GNU debugger.
- Copyright (C) 2006-2017 Free Software Foundation, Inc.
+ Copyright (C) 2006-2018 Free Software Foundation, Inc.
Free Software Foundation, Inc.
#include "xcoffread.h"
#include "solib.h"
#include "solib-aix.h"
+#include "target-float.h"
#include "xml-utils.h"
/* If the kernel has to deliver a signal, it pushes a sigcontext
gdb_assert (len <= 8);
- convert_typed_floating (value_contents (arg), type,
- reg_val, reg_type);
+ target_float_convert (value_contents (arg), type, reg_val, reg_type);
regcache_cooked_write (regcache, fp_regnum, reg_val);
++f_argno;
}
if (readbuf)
{
regcache_cooked_read (regcache, tdep->ppc_fp0_regnum + 1, regval);
- convert_typed_floating (regval, regtype, readbuf, valtype);
+ target_float_convert (regval, regtype, readbuf, valtype);
}
if (writebuf)
{
- convert_typed_floating (writebuf, valtype, regval, regtype);
+ target_float_convert (writebuf, valtype, regval, regtype);
regcache_cooked_write (regcache, tdep->ppc_fp0_regnum + 1, regval);
}
branch_dest (struct regcache *regcache, int opcode, int instr,
CORE_ADDR pc, CORE_ADDR safety)
{
- struct gdbarch *gdbarch = get_regcache_arch (regcache);
+ struct gdbarch *gdbarch = regcache->arch ();
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
CORE_ADDR dest;
static std::vector<CORE_ADDR>
rs6000_software_single_step (struct regcache *regcache)
{
- struct gdbarch *gdbarch = get_regcache_arch (regcache);
+ struct gdbarch *gdbarch = regcache->arch ();
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
int ii, insn;
CORE_ADDR loc;
rs6000_aix_shared_library_to_xml (struct ld_info *ldi,
struct obstack *obstack)
{
- char *p;
-
obstack_grow_str (obstack, "<library name=\"");
- p = xml_escape_text (ldi->filename);
- obstack_grow_str (obstack, p);
- xfree (p);
+ std::string p = xml_escape_text (ldi->filename);
+ obstack_grow_str (obstack, p.c_str ());
obstack_grow_str (obstack, "\"");
if (ldi->member_name[0] != '\0')
{
obstack_grow_str (obstack, " member=\"");
p = xml_escape_text (ldi->member_name);
- obstack_grow_str (obstack, p);
- xfree (p);
+ obstack_grow_str (obstack, p.c_str ());
obstack_grow_str (obstack, "\"");
}
{
struct bfd_section *ldinfo_sec;
int ldinfo_size;
- gdb_byte *ldinfo_buf;
- struct cleanup *cleanup;
- LONGEST result;
ldinfo_sec = bfd_get_section_by_name (core_bfd, ".ldinfo");
if (ldinfo_sec == NULL)
bfd_errmsg (bfd_get_error ()));
ldinfo_size = bfd_get_section_size (ldinfo_sec);
- ldinfo_buf = (gdb_byte *) xmalloc (ldinfo_size);
- cleanup = make_cleanup (xfree, ldinfo_buf);
+ gdb::byte_vector ldinfo_buf (ldinfo_size);
if (! bfd_get_section_contents (core_bfd, ldinfo_sec,
- ldinfo_buf, 0, ldinfo_size))
+ ldinfo_buf.data (), 0, ldinfo_size))
error (_("unable to read .ldinfo section from core file: %s"),
bfd_errmsg (bfd_get_error ()));
- result = rs6000_aix_ld_info_to_xml (gdbarch, ldinfo_buf, readbuf,
- offset, len, 0);
-
- do_cleanups (cleanup);
- return result;
+ return rs6000_aix_ld_info_to_xml (gdbarch, ldinfo_buf.data (), readbuf,
+ offset, len, 0);
}
static void