From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11207 invoked by alias); 31 May 2002 20:39:56 -0000 Mailing-List: contact sid-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: sid-owner@sources.redhat.com Received: (qmail 11200 invoked from network); 31 May 2002 20:39:55 -0000 Received: from unknown (HELO touchme.toronto.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 31 May 2002 20:39:55 -0000 Received: from toenail.toronto.redhat.com (unknown [172.16.14.211]) by touchme.toronto.redhat.com (Postfix) with ESMTP id 47F12B8013; Fri, 31 May 2002 16:39:55 -0400 (EDT) Received: (from fche@localhost) by toenail.toronto.redhat.com (8.11.6/8.11.6) id g4VKdtX04137; Fri, 31 May 2002 16:39:55 -0400 Date: Fri, 31 May 2002 13:39:00 -0000 From: "Frank Ch. Eigler" To: Ben Elliston Cc: sid@sources.redhat.com Subject: Re: CPU disassembler-memory accessor Message-ID: <20020531163954.C32174@redhat.com> References: <15604.59813.750421.114817@tooth.toronto.redhat.com> <20020529115301.C17962@redhat.com> <15607.56973.58661.290693@tooth.toronto.redhat.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="ZmUaFz6apKcXQszQ" Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <15607.56973.58661.290693@tooth.toronto.redhat.com>; from bje@redhat.com on Fri, May 31, 2002 at 04:35:25PM -0400 X-SW-Source: 2002-q2/txt/msg00026.txt.bz2 --ZmUaFz6apKcXQszQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 738 Hi - > Thanks for the feedback. How's this instead? > [...] Almost perfect: > + inline bool > + basic_cpu::read_disasm_memory (sid::host_int_4 address, sid::big_int= _1& value) const > + { > + sid::bus* bus; > + bus =3D (this->disassembler_bus) ? this->disassembler_bus : this->= insn_bus; > +=20=20=20=20=20=20 > + try > + { > + if (LIKELY (bus->read (address, value) =3D=3D sid::bus::ok)) > + return true; > + } > + catch (cpu_memory_fault& f) > + { > + return false; > + } > } This function is IMO still unnecessary. For one, sid::bus::read can never throw an exception (it's declared throw()). Why not just inline " ... bus->read (address, value) ... " into cgen_read_memory? - FChE --ZmUaFz6apKcXQszQ Content-Type: application/pgp-signature Content-Disposition: inline Content-length: 232 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE899+aVZbdDOm/ZT0RAiIFAJ0TaZzgaLbi04/6sk9ZRgr2IuvMxgCfbQzL W7feJ8itirSu7FdNKIkSYm8= =/f1G -----END PGP SIGNATURE----- --ZmUaFz6apKcXQszQ--