if (m_core_gdbarch != nullptr
&& gdbarch_core_xfer_siginfo_p (m_core_gdbarch))
{
- LONGEST l = gdbarch_core_xfer_siginfo (m_core_gdbarch, readbuf,
- offset, len);
+ struct bfd *cbfd = current_program_space->core_bfd ();
+ gdb_assert (cbfd != nullptr);
+ LONGEST l = gdbarch_core_xfer_siginfo (m_core_gdbarch, *cbfd,
+ readbuf, offset, len);
if (l >= 0)
{
/* Implement the "core_xfer_siginfo" gdbarch method. */
static LONGEST
-fbsd_core_xfer_siginfo (struct gdbarch *gdbarch, gdb_byte *readbuf,
- ULONGEST offset, ULONGEST len)
+fbsd_core_xfer_siginfo (struct gdbarch *gdbarch, struct bfd &cbfd,
+ gdb_byte *readbuf, ULONGEST offset, ULONGEST len)
{
size_t siginfo_size;
return -1;
thread_section_name section_name (".note.freebsdcore.lwpinfo", inferior_ptid);
- bfd *cbfd = current_program_space->core_bfd ();
- asection *section = bfd_get_section_by_name (cbfd, section_name.c_str ());
+ asection *section = bfd_get_section_by_name (&cbfd, section_name.c_str ());
if (section == NULL)
return -1;
gdb_byte buf[4];
- if (!bfd_get_section_contents (cbfd, section, buf,
+ if (!bfd_get_section_contents (&cbfd, section, buf,
LWPINFO_OFFSET + LWPINFO_PL_FLAGS, 4))
return -1;
else
siginfo_offset = LWPINFO_OFFSET + LWPINFO64_PL_SIGINFO;
- if (!bfd_get_section_contents (cbfd, section, readbuf,
+ if (!bfd_get_section_contents (&cbfd, section, readbuf,
siginfo_offset + offset, len))
return -1;
}
LONGEST
-gdbarch_core_xfer_siginfo (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, ULONGEST len)
+gdbarch_core_xfer_siginfo (struct gdbarch *gdbarch, struct bfd &cbfd, gdb_byte *readbuf, ULONGEST offset, ULONGEST len)
{
gdb_assert (gdbarch != NULL);
gdb_assert (gdbarch->core_xfer_siginfo != NULL);
if (gdbarch_debug >= 2)
gdb_printf (gdb_stdlog, "gdbarch_core_xfer_siginfo called\n");
- return gdbarch->core_xfer_siginfo (gdbarch, readbuf, offset, len);
+ return gdbarch->core_xfer_siginfo (gdbarch, cbfd, readbuf, offset, len);
}
void
extern void set_gdbarch_core_thread_name (struct gdbarch *gdbarch, gdbarch_core_thread_name_ftype *core_thread_name);
/* Read offset OFFSET of TARGET_OBJECT_SIGNAL_INFO signal information
- from core file into buffer READBUF with length LEN. Return the number
+ from core file CBFD into buffer READBUF with length LEN. Return the number
of bytes read (zero indicates EOF, a negative value indicates failure). */
extern bool gdbarch_core_xfer_siginfo_p (struct gdbarch *gdbarch);
-typedef LONGEST (gdbarch_core_xfer_siginfo_ftype) (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, ULONGEST len);
-extern LONGEST gdbarch_core_xfer_siginfo (struct gdbarch *gdbarch, gdb_byte *readbuf, ULONGEST offset, ULONGEST len);
+typedef LONGEST (gdbarch_core_xfer_siginfo_ftype) (struct gdbarch *gdbarch, struct bfd &cbfd, gdb_byte *readbuf, ULONGEST offset, ULONGEST len);
+extern LONGEST gdbarch_core_xfer_siginfo (struct gdbarch *gdbarch, struct bfd &cbfd, gdb_byte *readbuf, ULONGEST offset, ULONGEST len);
extern void set_gdbarch_core_xfer_siginfo (struct gdbarch *gdbarch, gdbarch_core_xfer_siginfo_ftype *core_xfer_siginfo);
/* Read x86 XSAVE layout information from core file into XSAVE_LAYOUT.
Method(
comment="""
Read offset OFFSET of TARGET_OBJECT_SIGNAL_INFO signal information
-from core file into buffer READBUF with length LEN. Return the number
+from core file CBFD into buffer READBUF with length LEN. Return the number
of bytes read (zero indicates EOF, a negative value indicates failure).
""",
type="LONGEST",
name="core_xfer_siginfo",
- params=[("gdb_byte *", "readbuf"), ("ULONGEST", "offset"), ("ULONGEST", "len")],
+ params=[
+ ("struct bfd &", "cbfd"),
+ ("gdb_byte *", "readbuf"),
+ ("ULONGEST", "offset"),
+ ("ULONGEST", "len")
+ ],
predicate=True,
)
interface. */
static LONGEST
-linux_core_xfer_siginfo (struct gdbarch *gdbarch, gdb_byte *readbuf,
- ULONGEST offset, ULONGEST len)
+linux_core_xfer_siginfo (struct gdbarch *gdbarch, struct bfd &cbfd,
+ gdb_byte *readbuf, ULONGEST offset, ULONGEST len)
{
thread_section_name section_name (".note.linuxcore.siginfo", inferior_ptid);
- asection *section
- = bfd_get_section_by_name (current_program_space->core_bfd (),
- section_name.c_str ());
- if (section == NULL)
+ asection *section = bfd_get_section_by_name (&cbfd, section_name.c_str ());
+ if (section == nullptr)
return -1;
- if (!bfd_get_section_contents (current_program_space->core_bfd (), section,
- readbuf, offset, len))
+ if (!bfd_get_section_contents (&cbfd, section, readbuf, offset, len))
return -1;
return len;