From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1879) id 70F183854830; Thu, 29 Sep 2022 23:57:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 70F183854830 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1664495853; bh=hCX6nnHKZ4HFtNwCIzjxk/I8aoMcCjvljzdgcSJhA2M=; h=From:To:Subject:Date:From; b=qts1fwtYvCyTLzV62kbp4DWQA2lGAJ5KuJDqrM7Tw8hGyrRdvmYdcnoJEdeH4UIL3 Vf2KzliyRImHGzTAx/TtHv70RdBaLGDRNEhWMGPY07ZaRlflZV3IF0D/pbdN6FZd1V Uaje0SW2qBBulnV1CJVB6iqG6ZrCNRiZwi/o9OSU= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Simon Marchi To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb: make target_auxv_parse static and rename X-Act-Checkin: binutils-gdb X-Git-Author: Simon Marchi X-Git-Refname: refs/heads/master X-Git-Oldrev: e2df8050fe75d54b03c8f4fbe4392bb568d212a4 X-Git-Newrev: 7dce788191bade507534c745ae1ae997b9e6ed78 Message-Id: <20220929235733.70F183854830@sourceware.org> Date: Thu, 29 Sep 2022 23:57:33 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D7dce788191ba= de507534c745ae1ae997b9e6ed78 commit 7dce788191bade507534c745ae1ae997b9e6ed78 Author: Simon Marchi Date: Thu Sep 29 16:08:24 2022 -0400 gdb: make target_auxv_parse static and rename =20 It is only used in auxv.c. Also, given it is not strictly a wrapper around target_ops::auxv (since 27a48a9223d0 "Add auxv parsing to the architecture vector."), I think that the name prefixed with target is a bit misleading. Rename to just parse_auxv. =20 Change-Id: I41cca055b92c8ede37c258ba6583746a07d8f77e Diff: --- gdb/auxv.c | 14 +++++++++----- gdb/auxv.h | 7 ------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/gdb/auxv.c b/gdb/auxv.c index a9337d9f7ff..76fc821c07c 100644 --- a/gdb/auxv.c +++ b/gdb/auxv.c @@ -306,12 +306,16 @@ svr4_auxv_parse (struct gdbarch *gdbarch, const gdb_b= yte **readptr, } =20 /* Read one auxv entry from *READPTR, not reading locations >=3D ENDPTR. + + Use the auxv_parse method from the current inferior's gdbarch, if defin= ed, + else use the current inferior's target stack's auxv_parse. + 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. */ -int -target_auxv_parse (const gdb_byte **readptr, const gdb_byte *endptr, - CORE_ADDR *typep, CORE_ADDR *valp) +static int +parse_auxv (const gdb_byte **readptr, const gdb_byte *endptr, CORE_ADDR *t= ypep, + CORE_ADDR *valp) { struct gdbarch *gdbarch =3D target_gdbarch(); =20 @@ -388,7 +392,7 @@ target_auxv_search (struct target_ops *ops, CORE_ADDR m= atch, CORE_ADDR *valp) size_t len =3D info->data->size (); =20 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. */ if (type =3D=3D match) @@ -561,7 +565,7 @@ fprint_target_auxv (struct ui_file *file, struct target= _ops *ops) const gdb_byte *ptr =3D data; size_t len =3D info->data->size (); =20 - 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); ++ents; diff --git a/gdb/auxv.h b/gdb/auxv.h index 2e8b2ab33fc..ab2a5dee5f7 100644 --- a/gdb/auxv.h +++ b/gdb/auxv.h @@ -46,13 +46,6 @@ extern int svr4_auxv_parse (struct gdbarch *gdbarch, con= st gdb_byte **readptr, const gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp); =20 -/* Read one auxv entry from *READPTR, not reading locations >=3D 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 *en= dptr, - CORE_ADDR *typep, CORE_ADDR *valp); - /* Extract the auxiliary vector entry with a_type matching MATCH. Return zero if no such entry was found, or -1 if there was an error getting the information. On success, return 1 after