mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 09:08:59 +00:00
gdb: make target_auxv_parse static and rename
It is only used in auxv.c. Also, given it is not strictly a wrapper
around target_ops::auxv (since 27a48a9223 "Add auxv parsing to the
architecture vector."), I think that the name prefixed with target is a
bit misleading. Rename to just parse_auxv.
Change-Id: I41cca055b92c8ede37c258ba6583746a07d8f77e
This commit is contained in:
14
gdb/auxv.c
14
gdb/auxv.c
@@ -306,12 +306,16 @@ svr4_auxv_parse (struct gdbarch *gdbarch, const gdb_byte **readptr,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Read one auxv entry from *READPTR, not reading locations >= ENDPTR.
|
/* Read one auxv entry from *READPTR, not reading locations >= ENDPTR.
|
||||||
|
|
||||||
|
Use the auxv_parse method from the current inferior's gdbarch, if defined,
|
||||||
|
else use the current inferior's target stack's auxv_parse.
|
||||||
|
|
||||||
Return 0 if *READPTR is already at the end of the buffer.
|
Return 0 if *READPTR is already at the end of the buffer.
|
||||||
Return -1 if there is insufficient buffer for a whole entry.
|
Return -1 if there is insufficient buffer for a whole entry.
|
||||||
Return 1 if an entry was read into *TYPEP and *VALP. */
|
Return 1 if an entry was read into *TYPEP and *VALP. */
|
||||||
int
|
static int
|
||||||
target_auxv_parse (const gdb_byte **readptr, const gdb_byte *endptr,
|
parse_auxv (const gdb_byte **readptr, const gdb_byte *endptr, CORE_ADDR *typep,
|
||||||
CORE_ADDR *typep, CORE_ADDR *valp)
|
CORE_ADDR *valp)
|
||||||
{
|
{
|
||||||
struct gdbarch *gdbarch = target_gdbarch();
|
struct gdbarch *gdbarch = target_gdbarch();
|
||||||
|
|
||||||
@@ -388,7 +392,7 @@ target_auxv_search (struct target_ops *ops, CORE_ADDR match, CORE_ADDR *valp)
|
|||||||
size_t len = info->data->size ();
|
size_t len = info->data->size ();
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
switch (target_auxv_parse (&ptr, data + len, &type, &val))
|
switch (parse_auxv (&ptr, data + len, &type, &val))
|
||||||
{
|
{
|
||||||
case 1: /* Here's an entry, check it. */
|
case 1: /* Here's an entry, check it. */
|
||||||
if (type == match)
|
if (type == match)
|
||||||
@@ -561,7 +565,7 @@ fprint_target_auxv (struct ui_file *file, struct target_ops *ops)
|
|||||||
const gdb_byte *ptr = data;
|
const gdb_byte *ptr = data;
|
||||||
size_t len = info->data->size ();
|
size_t len = info->data->size ();
|
||||||
|
|
||||||
while (target_auxv_parse (&ptr, data + len, &type, &val) > 0)
|
while (parse_auxv (&ptr, data + len, &type, &val) > 0)
|
||||||
{
|
{
|
||||||
gdbarch_print_auxv_entry (gdbarch, file, type, val);
|
gdbarch_print_auxv_entry (gdbarch, file, type, val);
|
||||||
++ents;
|
++ents;
|
||||||
|
|||||||
@@ -46,13 +46,6 @@ extern int svr4_auxv_parse (struct gdbarch *gdbarch, const gdb_byte **readptr,
|
|||||||
const gdb_byte *endptr, CORE_ADDR *typep,
|
const gdb_byte *endptr, CORE_ADDR *typep,
|
||||||
CORE_ADDR *valp);
|
CORE_ADDR *valp);
|
||||||
|
|
||||||
/* Read one auxv entry from *READPTR, not reading locations >= ENDPTR.
|
|
||||||
Return 0 if *READPTR is already at the end of the buffer.
|
|
||||||
Return -1 if there is insufficient buffer for a whole entry.
|
|
||||||
Return 1 if an entry was read into *TYPEP and *VALP. */
|
|
||||||
extern int target_auxv_parse (const gdb_byte **readptr, const gdb_byte *endptr,
|
|
||||||
CORE_ADDR *typep, CORE_ADDR *valp);
|
|
||||||
|
|
||||||
/* Extract the auxiliary vector entry with a_type matching MATCH.
|
/* Extract the auxiliary vector entry with a_type matching MATCH.
|
||||||
Return zero if no such entry was found, or -1 if there was
|
Return zero if no such entry was found, or -1 if there was
|
||||||
an error getting the information. On success, return 1 after
|
an error getting the information. On success, return 1 after
|
||||||
|
|||||||
Reference in New Issue
Block a user