From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 43732 invoked by alias); 15 Aug 2016 13:31:33 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 43718 invoked by uid 89); 15 Aug 2016 13:31:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=damage, collateral, focusing X-HELO: smtp.gentoo.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 15 Aug 2016 13:31:31 +0000 Received: from vapier.lan (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with SMTP id 1CC71340EF3; Mon, 15 Aug 2016 13:31:30 +0000 (UTC) Date: Mon, 15 Aug 2016 13:31:00 -0000 From: Mike Frysinger To: Nick Clifton Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] sim: unify symbol table handling Message-ID: <20160815133128.GY30544@vapier.lan> Mail-Followup-To: Nick Clifton , gdb-patches@sourceware.org References: <20160813195500.25598-1-vapier@gentoo.org> <9c6fd370-885a-4290-160c-e9898a87e051@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="rPgHZmYkQ+bUEpVC" Content-Disposition: inline In-Reply-To: <9c6fd370-885a-4290-160c-e9898a87e051@redhat.com> X-IsSubscribed: yes X-SW-Source: 2016-08/txt/msg00161.txt.bz2 --rPgHZmYkQ+bUEpVC Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1710 On 15 Aug 2016 10:22, Nick Clifton wrote: > Hi Mike, > > diff --git a/sim/aarch64/memory.h b/sim/aarch64/memory.h > > -extern void mem_add_blk (sim_cpu *, uint64_t, char *, uint64_t= , bfd_boolean); >=20 > (I have no problem with this part of the patch, but just to note > that it is nothing to do with unifying symbol table handling...) true, but it was collateral damage. by removing the (now unused & unneeded) bfd.h include from this header, this prototype broke (as it uses bfd_boolean). so i had to drop it as well. > > +int > > +trace_load_symbols (SIM_DESC sd) > > +{ >=20 > Wouldn't it make sense for trace_load_symbols to also remove useless > symbols and then sort the table ? Isn't this something that all=20 > sims will want ? [The code for remove_useless_symbols in aarch64/interp.c > is basically generic, not aarch64 specific]. i hadn't fully digested this bit of logic ... i was focusing on the bits the core already handled, and were requiring custom clean ups/callbacks in the non-common code. you're right though that we could update the core to include this code for the benefit of all. > > +bfd_vma > > +trace_sym_value (SIM_DESC sd, const char *name) > > +{ > > [...] > > + for (i =3D 0; i < STATE_PROG_SYMS_COUNT (sd); ++i) > > + if (strcmp (asymbols[i]->name, name) =3D=3D 0) > > + return bfd_asymbol_value (asymbols[i]); >=20 > If there was a flag to say that the symbol table was sorted, then > this lookup could be done using bsearch(). >=20 >=20 > So basically as far as I can see there is nothing wrong with the patch. > Certainly not from an AArch64 of MSP430 point of view. thanks. i'll merge this as-is, and add your ideas to my TODO list :). -mike --rPgHZmYkQ+bUEpVC Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXscQwAAoJEEFjO5/oN/WBc9MP/jYgRwr+6ULXBWnjzQE9pq9b PjYhU0iGJ6V22k7y+Xon5G0kFk7vtTH0BwMgHdWiCRrWTqlAg41WSSRasI6pXJtj dYo91xVkc0UMdpuGMV8oTWudEBok65b0NR0F5eSCWtGHe6T/WShhU6GxCEXM9OkC iG+axvw9lEcAa6m/4pWYu2ySU5zk0jwnZP5Mn/gMin1gLtPwVBmZO5od8yjspC+E LFKrYTKVLUjXCUUStOba8t07hPk5Jw4UxKkEglUQ3a21en2q1JDBJ83K1LSJnQkg etxpug66aAygA/ok71hbRvtUpDVpLjAAfFpM/Z1GxzQmCJvI5ffZc8bow15T3Mh+ 8sXkz3XbMHgbLi14NfTKiDpVwNPYL6PysZYKJnlHKej3KDOyVbYVI/BDLWlzaf3V f8cuzJjzY7LPKzGs+f7qVSXc3xUcl9KSCVXMrsVnlbQRK6zvJ6hR1irE/o6OrdyM 8M72E80kustIfGZcRUC+h9zltfDH+Xzxh1npJd28a1SYNP1PKpibJqxvDH0Rl+El +7nCd/5PtgaBdCE+COvIviOsqc6bAi1sVfsVQBZUgz0FWxonmCnriixq7lK8JyQ9 qUlK+XGUBnL4aKWoxjHIhuK6E9sP2uT9OTeaT/E3QP/8ffr/68KaAqLNm4VyTDx6 vUb56I9AypHoxWN5YQNE =iax7 -----END PGP SIGNATURE----- --rPgHZmYkQ+bUEpVC--