mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-18 21:34:13 +08:00
2009-03-09 Paul Pluzhnikov <ppluzhnikov@google.com>
* solib.c (solib_contains_address_p): New function. (solib_name_from_address): Use it. * printcmd.c (display_uses_solib_p): Use it. * solib.h (solib_contains_address_p): Declare it.
This commit is contained in:
@ -1,3 +1,10 @@
|
|||||||
|
2009-03-09 Paul Pluzhnikov <ppluzhnikov@google.com>
|
||||||
|
|
||||||
|
* solib.c (solib_contains_address_p): New function.
|
||||||
|
(solib_name_from_address): Use it.
|
||||||
|
* printcmd.c (display_uses_solib_p): Use it.
|
||||||
|
* solib.h (solib_contains_address_p): Declare it.
|
||||||
|
|
||||||
2009-03-09 Jan Kratochvil <jan.kratochvil@redhat.com>
|
2009-03-09 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
* varobj.c (free_variable): Call value_free.
|
* varobj.c (free_variable): Call value_free.
|
||||||
|
@ -1767,7 +1767,7 @@ display_uses_solib_p (const struct display *d,
|
|||||||
struct expression *const exp = d->exp;
|
struct expression *const exp = d->exp;
|
||||||
|
|
||||||
if (d->block != NULL
|
if (d->block != NULL
|
||||||
&& solib_name_from_address (d->block->startaddr) == solib->so_name)
|
&& solib_contains_address_p (solib, d->block->startaddr))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
for (i = 0; i < exp->nelts; )
|
for (i = 0; i < exp->nelts; )
|
||||||
@ -1783,7 +1783,7 @@ display_uses_solib_p (const struct display *d,
|
|||||||
SYMBOL_OBJ_SECTION (symbol);
|
SYMBOL_OBJ_SECTION (symbol);
|
||||||
|
|
||||||
if (block != NULL
|
if (block != NULL
|
||||||
&& solib_name_from_address (block->startaddr) == solib->so_name)
|
&& solib_contains_address_p (solib, block->startaddr))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (section && section->objfile == solib->objfile)
|
if (section && section->objfile == solib->objfile)
|
||||||
|
24
gdb/solib.c
24
gdb/solib.c
@ -834,6 +834,21 @@ info_sharedlibrary_command (char *ignore, int from_tty)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Return 1 if ADDRESS lies within SOLIB. */
|
||||||
|
|
||||||
|
int
|
||||||
|
solib_contains_address_p (const struct so_list *const solib,
|
||||||
|
CORE_ADDR address)
|
||||||
|
{
|
||||||
|
struct section_table *p;
|
||||||
|
|
||||||
|
for (p = solib->sections; p < solib->sections_end; p++)
|
||||||
|
if (p->addr <= address && address < p->endaddr)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
GLOBAL FUNCTION
|
GLOBAL FUNCTION
|
||||||
@ -862,15 +877,8 @@ solib_name_from_address (CORE_ADDR address)
|
|||||||
struct so_list *so = 0; /* link map state variable */
|
struct so_list *so = 0; /* link map state variable */
|
||||||
|
|
||||||
for (so = so_list_head; so; so = so->next)
|
for (so = so_list_head; so; so = so->next)
|
||||||
{
|
if (solib_contains_address_p (so, address))
|
||||||
struct section_table *p;
|
|
||||||
|
|
||||||
for (p = so->sections; p < so->sections_end; p++)
|
|
||||||
{
|
|
||||||
if (p->addr <= address && address < p->endaddr)
|
|
||||||
return (so->so_name);
|
return (so->so_name);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
@ -47,6 +47,10 @@ extern void solib_create_inferior_hook (void);
|
|||||||
|
|
||||||
extern char *solib_name_from_address (CORE_ADDR);
|
extern char *solib_name_from_address (CORE_ADDR);
|
||||||
|
|
||||||
|
/* Return 1 if ADDR lies within SOLIB. */
|
||||||
|
|
||||||
|
extern int solib_contains_address_p (const struct so_list *, CORE_ADDR);
|
||||||
|
|
||||||
/* Return 1 if PC lies in the dynamic symbol resolution code of the
|
/* Return 1 if PC lies in the dynamic symbol resolution code of the
|
||||||
run time loader. */
|
run time loader. */
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user