/* Handle FR-V (FDPIC) shared libraries for GDB, the GNU Debugger.
- Copyright (C) 2004, 2007-2012 Free Software Foundation, Inc.
+ Copyright (C) 2004-2013 Free Software Foundation, Inc.
This file is part of GDB.
#include "defs.h"
-#include "gdb_string.h"
+#include <string.h>
#include "inferior.h"
#include "gdbcore.h"
#include "solib.h"
#include "gdb_bfd.h"
/* Flag which indicates whether internal debug messages should be printed. */
-static int solib_frv_debug;
+static unsigned int solib_frv_debug;
/* FR-V pointers are four bytes wide. */
enum { FRV_PTR_SIZE = 4 };
static struct int_elf32_fdpic_loadmap *
fetch_loadmap (CORE_ADDR ldmaddr)
{
- enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch);
+ enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
struct ext_elf32_fdpic_loadmap ext_ldmbuf_partial;
struct ext_elf32_fdpic_loadmap *ext_ldmbuf;
struct int_elf32_fdpic_loadmap *int_ldmbuf;
static CORE_ADDR
lm_base (void)
{
- enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch);
+ enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
struct minimal_symbol *got_sym;
CORE_ADDR addr;
gdb_byte buf[FRV_PTR_SIZE];
static struct so_list *
frv_current_sos (void)
{
- enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch);
+ enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
CORE_ADDR lm_addr, mgot;
struct so_list *sos_head = NULL;
struct so_list **sos_next_ptr = &sos_head;
for details.)
Note that the relocation of the main executable is also performed
- by SOLIB_CREATE_INFERIOR_HOOK(), however, in the case of core
+ by solib_create_inferior_hook(), however, in the case of core
files, this hook is called too late in order to be of benefit to
- SOLIB_ADD. SOLIB_ADD eventually calls this this function,
+ solib_add. solib_add eventually calls this this function,
frv_current_sos, and also precedes the call to
- SOLIB_CREATE_INFERIOR_HOOK(). (See post_create_inferior() in
+ solib_create_inferior_hook(). (See post_create_inferior() in
infcmd.c.) */
if (main_executable_lm_info == 0 && core_bfd != NULL)
frv_relocate_main_executable ();
{
return ((pc >= interp_text_sect_low && pc < interp_text_sect_high)
|| (pc >= interp_plt_sect_low && pc < interp_plt_sect_high)
- || in_plt_section (pc, NULL));
+ || in_plt_section (pc));
}
/* Given a loadmap and an address, return the displacement needed
static int
enable_break2 (void)
{
- enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch);
+ enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
int success = 0;
char **bkpt_namep;
asection *interp_sect;
if (interp_sect)
{
unsigned int interp_sect_size;
- gdb_byte *buf;
+ char *buf;
bfd *tmp_bfd = NULL;
int status;
CORE_ADDR addr, interp_loadmap_addr;
return 0;
}
- status = frv_fdpic_loadmap_addresses (target_gdbarch,
+ status = frv_fdpic_loadmap_addresses (target_gdbarch (),
&interp_loadmap_addr, 0);
if (status < 0)
{
remove_solib_event_breakpoints ();
/* Now (finally!) create the solib breakpoint. */
- create_solib_event_breakpoint (target_gdbarch, addr);
+ create_solib_event_breakpoint (target_gdbarch (), addr);
enable_break2_done = 1;
return 0;
}
- create_solib_event_breakpoint (target_gdbarch,
+ create_solib_event_breakpoint (target_gdbarch (),
symfile_objfile->ei.entry_point);
if (solib_frv_debug)
int changed;
struct obj_section *osect;
- status = frv_fdpic_loadmap_addresses (target_gdbarch,
+ status = frv_fdpic_loadmap_addresses (target_gdbarch (),
&interp_addr, &exec_addr);
if (status < 0 || (exec_addr == 0 && interp_addr == 0))
int osect_idx;
int seg;
- osect_idx = osect->the_bfd_section->index;
+ osect_idx = osect - symfile_objfile->sections;
/* Current address of section. */
addr = obj_section_addr (osect);
(CORE_ADDR entry_point, CORE_ADDR got_value, const char *name, bfd *abfd,
struct lm_info *lm)
{
- enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch);
+ enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
arelent *rel;
unsigned int i;
CORE_ADDR addr = 0;
frv_so_ops.bfd_open = solib_bfd_open;
/* Debug this file's internals. */
- add_setshow_zinteger_cmd ("solib-frv", class_maintenance,
- &solib_frv_debug, _("\
+ add_setshow_zuinteger_cmd ("solib-frv", class_maintenance,
+ &solib_frv_debug, _("\
Set internal debugging of shared library code for FR-V."), _("\
Show internal debugging of shared library code for FR-V."), _("\
When non-zero, FR-V solib specific internal debugging is enabled."),
- NULL,
- NULL, /* FIXME: i18n: */
- &setdebuglist, &showdebuglist);
+ NULL,
+ NULL, /* FIXME: i18n: */
+ &setdebuglist, &showdebuglist);
}