projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
NEWS and documentation for alias default-args related concept and commands.
[deliverable/binutils-gdb.git]
/
gdb
/
solib-frv.c
diff --git
a/gdb/solib-frv.c
b/gdb/solib-frv.c
index 08fa5768676bedabf9216ddc45194ab5ba952873..bce33a3e4d61f287b05a98c755695b73425ed0e0 100644
(file)
--- a/
gdb/solib-frv.c
+++ b/
gdb/solib-frv.c
@@
-1,5
+1,5
@@
/* Handle FR-V (FDPIC) shared libraries for GDB, the GNU Debugger.
/* Handle FR-V (FDPIC) shared libraries for GDB, the GNU Debugger.
- Copyright (C) 2004-20
19
Free Software Foundation, Inc.
+ Copyright (C) 2004-20
20
Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
@@
-376,8
+376,6
@@
frv_current_sos (void)
this in the list of shared objects. */
if (got_addr != mgot)
{
this in the list of shared objects. */
if (got_addr != mgot)
{
- int errcode;
- gdb::unique_xmalloc_ptr<char> name_buf;
struct int_elf32_fdpic_loadmap *loadmap;
struct so_list *sop;
CORE_ADDR addr;
struct int_elf32_fdpic_loadmap *loadmap;
struct so_list *sop;
CORE_ADDR addr;
@@
-404,16
+402,15
@@
frv_current_sos (void)
addr = extract_unsigned_integer (lm_buf.l_name,
sizeof (lm_buf.l_name),
byte_order);
addr = extract_unsigned_integer (lm_buf.l_name,
sizeof (lm_buf.l_name),
byte_order);
- target_read_string (addr, &name_buf, SO_NAME_MAX_PATH_SIZE - 1,
-
&errcode
);
+ gdb::unique_xmalloc_ptr<char> name_buf
+
= target_read_string (addr, SO_NAME_MAX_PATH_SIZE - 1
);
if (solib_frv_debug)
fprintf_unfiltered (gdb_stdlog, "current_sos: name = %s\n",
name_buf.get ());
if (solib_frv_debug)
fprintf_unfiltered (gdb_stdlog, "current_sos: name = %s\n",
name_buf.get ());
- if (errcode != 0)
- warning (_("Can't read pathname for link map entry: %s."),
- safe_strerror (errcode));
+ if (name_buf == nullptr)
+ warning (_("Can't read pathname for link map entry."));
else
{
strncpy (sop->so_name, name_buf.get (),
else
{
strncpy (sop->so_name, name_buf.get (),
@@
-785,8
+782,7
@@
frv_relocate_main_executable (void)
main_executable_lm_info = new lm_info_frv;
main_executable_lm_info->map = ldm;
main_executable_lm_info = new lm_info_frv;
main_executable_lm_info->map = ldm;
- gdb::unique_xmalloc_ptr<struct section_offsets> new_offsets
- (XCNEWVEC (struct section_offsets, symfile_objfile->num_sections));
+ section_offsets new_offsets (symfile_objfile->section_offsets.size ());
changed = 0;
ALL_OBJFILE_OSECTIONS (symfile_objfile, osect)
changed = 0;
ALL_OBJFILE_OSECTIONS (symfile_objfile, osect)
@@
-800,7
+796,7
@@
frv_relocate_main_executable (void)
/* Current address of section. */
addr = obj_section_addr (osect);
/* Offset from where this section started. */
/* Current address of section. */
addr = obj_section_addr (osect);
/* Offset from where this section started. */
- offset =
ANOFFSET (symfile_objfile->section_offsets, osect_idx)
;
+ offset =
symfile_objfile->section_offsets[osect_idx]
;
/* Original address prior to any past relocations. */
orig_addr = addr - offset;
/* Original address prior to any past relocations. */
orig_addr = addr - offset;
@@
-809,10
+805,10
@@
frv_relocate_main_executable (void)
if (ldm->segs[seg].p_vaddr <= orig_addr
&& orig_addr < ldm->segs[seg].p_vaddr + ldm->segs[seg].p_memsz)
{
if (ldm->segs[seg].p_vaddr <= orig_addr
&& orig_addr < ldm->segs[seg].p_vaddr + ldm->segs[seg].p_memsz)
{
- new_offsets
->offsets
[osect_idx]
+ new_offsets[osect_idx]
= ldm->segs[seg].addr - ldm->segs[seg].p_vaddr;
= ldm->segs[seg].addr - ldm->segs[seg].p_vaddr;
- if (new_offsets
->offsets
[osect_idx] != offset)
+ if (new_offsets[osect_idx] != offset)
changed = 1;
break;
}
changed = 1;
break;
}
@@
-820,7
+816,7
@@
frv_relocate_main_executable (void)
}
if (changed)
}
if (changed)
- objfile_relocate (symfile_objfile, new_offsets
.get ()
);
+ objfile_relocate (symfile_objfile, new_offsets);
/* Now that symfile_objfile has been relocated, we can compute the
GOT value and stash it away. */
/* Now that symfile_objfile has been relocated, we can compute the
GOT value and stash it away. */
@@
-909,10
+905,7
@@
main_got (void)
CORE_ADDR
frv_fdpic_find_global_pointer (CORE_ADDR addr)
{
CORE_ADDR
frv_fdpic_find_global_pointer (CORE_ADDR addr)
{
- struct so_list *so;
-
- so = master_so_list ();
- while (so)
+ for (struct so_list *so : current_program_space->solibs ())
{
int seg;
lm_info_frv *li = (lm_info_frv *) so->lm_info;
{
int seg;
lm_info_frv *li = (lm_info_frv *) so->lm_info;
@@
-924,8
+917,6
@@
frv_fdpic_find_global_pointer (CORE_ADDR addr)
&& addr < map->segs[seg].addr + map->segs[seg].p_memsz)
return li->got_value;
}
&& addr < map->segs[seg].addr + map->segs[seg].p_memsz)
return li->got_value;
}
-
- so = so->next;
}
/* Didn't find it in any of the shared objects. So assume it's in the
}
/* Didn't find it in any of the shared objects. So assume it's in the
@@
-959,7
+950,7
@@
frv_fdpic_find_canonical_descriptor (CORE_ADDR entry_point)
if (sym == 0)
name = 0;
else
if (sym == 0)
name = 0;
else
- name =
SYMBOL_LINKAGE_NAME (sym
);
+ name =
sym->linkage_name (
);
/* Check the main executable. */
addr = find_canonical_descriptor_in_load_object
/* Check the main executable. */
addr = find_canonical_descriptor_in_load_object
@@
-970,10
+961,7
@@
frv_fdpic_find_canonical_descriptor (CORE_ADDR entry_point)
in list of shared objects. */
if (addr == 0)
{
in list of shared objects. */
if (addr == 0)
{
- struct so_list *so;
-
- so = master_so_list ();
- while (so)
+ for (struct so_list *so : current_program_space->solibs ())
{
lm_info_frv *li = (lm_info_frv *) so->lm_info;
{
lm_info_frv *li = (lm_info_frv *) so->lm_info;
@@
-982,8
+970,6
@@
frv_fdpic_find_canonical_descriptor (CORE_ADDR entry_point)
if (addr != 0)
break;
if (addr != 0)
break;
-
- so = so->next;
}
}
}
}
@@
-1117,8
+1103,6
@@
find_canonical_descriptor_in_load_object
CORE_ADDR
frv_fetch_objfile_link_map (struct objfile *objfile)
{
CORE_ADDR
frv_fetch_objfile_link_map (struct objfile *objfile)
{
- struct so_list *so;
-
/* Cause frv_current_sos() to be run if it hasn't been already. */
if (main_lm_addr == 0)
solib_add (0, 0, 1);
/* Cause frv_current_sos() to be run if it hasn't been already. */
if (main_lm_addr == 0)
solib_add (0, 0, 1);
@@
-1129,7
+1113,7
@@
frv_fetch_objfile_link_map (struct objfile *objfile)
/* The other link map addresses may be found by examining the list
of shared libraries. */
/* The other link map addresses may be found by examining the list
of shared libraries. */
- for (s
o = master_so_list (); so; so = so->next
)
+ for (s
truct so_list *so : current_program_space->solibs ()
)
{
lm_info_frv *li = (lm_info_frv *) so->lm_info;
{
lm_info_frv *li = (lm_info_frv *) so->lm_info;
@@
-1143,8
+1127,9
@@
frv_fetch_objfile_link_map (struct objfile *objfile)
struct target_so_ops frv_so_ops;
struct target_so_ops frv_so_ops;
+void _initialize_frv_solib ();
void
void
-_initialize_frv_solib (
void
)
+_initialize_frv_solib ()
{
frv_so_ops.relocate_section_addresses = frv_relocate_section_addresses;
frv_so_ops.free_so = frv_free_so;
{
frv_so_ops.relocate_section_addresses = frv_relocate_section_addresses;
frv_so_ops.free_so = frv_free_so;
This page took
0.035687 seconds
and
4
git commands to generate.