/* Handle TIC6X (DSBT) shared libraries for GDB, the GNU Debugger.
- Copyright (C) 2010-2013 Free Software Foundation, Inc.
+ Copyright (C) 2010-2014 Free Software Foundation, Inc.
This file is part of GDB.
#include "defs.h"
-#include "gdb_string.h"
#include "inferior.h"
#include "gdbcore.h"
#include "solib.h"
#include "command.h"
#include "gdbcmd.h"
#include "elf-bfd.h"
-#include "exceptions.h"
#include "gdb_bfd.h"
#define GOT_MODULE_OFFSET 4
/* Link map address for main module. */
CORE_ADDR main_lm_addr;
- int enable_break2_done;
-
CORE_ADDR interp_text_sect_low;
CORE_ADDR interp_text_sect_high;
CORE_ADDR interp_plt_sect_low;
static void
dsbt_pspace_data_cleanup (struct program_space *pspace, void *arg)
{
- struct dsbt_info *info;
-
- info = program_space_data (pspace, solib_dsbt_pspace_data);
- xfree (info);
+ xfree (arg);
}
/* Get the current dsbt data. If none is found yet, add it now. This
if (info != NULL)
return info;
- info = XZALLOC (struct dsbt_info);
+ info = XCNEW (struct dsbt_info);
set_program_space_data (current_program_space, solib_dsbt_pspace_data, info);
- info->enable_break2_done = 0;
info->lm_base_cache = 0;
info->main_lm_addr = 0;
lm_base (void)
{
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
- struct minimal_symbol *got_sym;
+ struct bound_minimal_symbol got_sym;
CORE_ADDR addr;
gdb_byte buf[TIC6X_PTR_SIZE];
struct dsbt_info *info = get_dsbt_info ();
got_sym = lookup_minimal_symbol ("_GLOBAL_OFFSET_TABLE_", NULL,
symfile_objfile);
- if (got_sym != 0)
+ if (got_sym.minsym != 0)
{
- addr = SYMBOL_VALUE_ADDRESS (got_sym);
+ addr = BMSYMBOL_VALUE_ADDRESS (got_sym);
if (solib_dsbt_debug)
fprintf_unfiltered (gdb_stdlog,
"lm_base: get addr %x by _GLOBAL_OFFSET_TABLE_.\n",
return ((pc >= info->interp_text_sect_low && pc < info->interp_text_sect_high)
|| (pc >= info->interp_plt_sect_low && pc < info->interp_plt_sect_high)
- || in_plt_section (pc, NULL));
+ || in_plt_section (pc));
}
/* Print a warning about being unable to set the dynamic linker
info = get_dsbt_info ();
- if (info->enable_break2_done)
- return 1;
-
info->interp_text_sect_low = 0;
info->interp_text_sect_high = 0;
info->interp_plt_sect_low = 0;
/* Now (finally!) create the solib breakpoint. */
create_solib_event_breakpoint (target_gdbarch (), addr);
- info->enable_break2_done = 1;
ret = 1;
}
else
struct dsbt_info *info = get_dsbt_info ();
info->lm_base_cache = 0;
- info->enable_break2_done = 0;
info->main_lm_addr = 0;
if (info->main_executable_lm_info != 0)
{