#include "symtab.h"
#include "target.h"
#include "gdb-dlfcn.h"
-#include "gdb_stat.h"
+#include <sys/stat.h>
#include "exceptions.h"
#include "gdb_bfd.h"
mem_bfd_iovec_close (struct bfd *abfd, void *stream)
{
xfree (stream);
- return 1;
+
+ /* Zero means success. */
+ return 0;
}
/* For reading the file, we just need to pass through to target_read_memory and
/* (begin, end) will contain the PC range this entire blockvector
spans. */
- symtab->primary = 1;
+ set_symtab_primary (symtab, 1);
BLOCKVECTOR_MAP (symtab->blockvector) = NULL;
begin = stab->blocks->begin;
end = stab->blocks->end;
priv_data = cb->priv_data;
- objfile = allocate_objfile (NULL, 0);
- objfile->gdbarch = target_gdbarch ();
+ objfile = allocate_objfile (NULL, "<< JIT compiled code >>",
+ OBJF_NOT_FILENAME);
+ objfile->per_bfd->gdbarch = target_gdbarch ();
terminate_minimal_symbol_table (objfile);
- objfile->name = "<< JIT compiled code >>";
-
j = NULL;
for (i = obj->symtabs; i; i = j)
{
/* This call does not take ownership of SAI. */
make_cleanup_bfd_unref (nbfd);
- objfile = symbol_file_add_from_bfd (nbfd, 0, sai, OBJF_SHARED, NULL);
+ objfile = symbol_file_add_from_bfd (nbfd, bfd_get_filename (nbfd), 0, sai,
+ OBJF_SHARED | OBJF_NOT_FILENAME, NULL);
do_cleanups (old_cleanups);
add_objfile_entry (objfile, entry_addr);
jit_breakpoint_re_set_internal (struct gdbarch *gdbarch,
struct jit_program_space_data *ps_data)
{
- struct minimal_symbol *reg_symbol, *desc_symbol;
- struct objfile *objf;
+ struct bound_minimal_symbol reg_symbol;
+ struct minimal_symbol *desc_symbol;
struct jit_objfile_data *objf_data;
CORE_ADDR addr;
{
/* Lookup the registration symbol. If it is missing, then we
assume we are not attached to a JIT. */
- reg_symbol = lookup_minimal_symbol_and_objfile (jit_break_name, &objf);
- if (reg_symbol == NULL || SYMBOL_VALUE_ADDRESS (reg_symbol) == 0)
+ reg_symbol = lookup_minimal_symbol_and_objfile (jit_break_name);
+ if (reg_symbol.minsym == NULL
+ || SYMBOL_VALUE_ADDRESS (reg_symbol.minsym) == 0)
return 1;
- desc_symbol = lookup_minimal_symbol (jit_descriptor_name, NULL, objf);
+ desc_symbol = lookup_minimal_symbol (jit_descriptor_name, NULL,
+ reg_symbol.objfile);
if (desc_symbol == NULL || SYMBOL_VALUE_ADDRESS (desc_symbol) == 0)
return 1;
- objf_data = get_jit_objfile_data (objf);
- objf_data->register_code = reg_symbol;
+ objf_data = get_jit_objfile_data (reg_symbol.objfile);
+ objf_data->register_code = reg_symbol.minsym;
objf_data->descriptor = desc_symbol;
- ps_data->objfile = objf;
+ ps_data->objfile = reg_symbol.objfile;
}
else
objf_data = get_jit_objfile_data (ps_data->objfile);