From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30036 invoked by alias); 4 May 2011 15:17:41 -0000 Received: (qmail 30028 invoked by uid 22791); 4 May 2011 15:17:40 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 04 May 2011 15:17:27 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 1C735CB0219; Wed, 4 May 2011 17:17:26 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wNspC8Y0vEbt; Wed, 4 May 2011 17:17:23 +0200 (CEST) Received: from province.act-europe.fr (province.act-europe.fr [10.10.0.214]) by mel.act-europe.fr (Postfix) with ESMTP id 22D03CB01F8; Wed, 4 May 2011 17:17:23 +0200 (CEST) Received: by province.act-europe.fr (Postfix, from userid 560) id 15FA816480A; Wed, 4 May 2011 17:17:23 +0200 (CEST) Date: Wed, 04 May 2011 15:17:00 -0000 From: Jerome Guitton To: Mark Kettenis Cc: gdb-patches@sourceware.org Subject: Re: [RFA] Support for x86 on-stack trampolines Message-ID: <20110504151723.GB64873@adacore.com> References: <1304468424-2060-1-git-send-email-guitton@adacore.com> <201105041020.p44AKGt2025840@glazunov.sibelius.xs4all.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201105041020.p44AKGt2025840@glazunov.sibelius.xs4all.nl> User-Agent: Mutt/1.5.17 (2007-11-01) 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 X-SW-Source: 2011-05/txt/msg00096.txt.bz2 Mark Kettenis (mark.kettenis@xs4all.nl): > Hmm, I think the new name for i386_match_insn is confusing. Also, it > isn't really necessary to change its prototype. It returns a pointer > to the matched pattern, so some trivial pointer arithmetic will give > you the index into the array of patterns. OK, I don't mind pointer arithmetics. I'm not sure about the name; I haven't much imagination for names, I must say. Any suggestion? The thing that I would like to make clear is that this new function is different from i386_find_insn: it only checks one instruction pattern. It is used by both i386_find_insn (which tries to match one instruction against any pattern in a set) and by i386_match_insn_block (which checks that a given PC points inside a block of instruction matching an ordered list of patterns). > Is checking the instructions before checking the name the most > efficient way of doing this? I guess that it depends (big symbol tables vs low connection to target). In any case, to be consistent with the other sniffers, I should probably check the name first. Otherwise, I have taken the rest of your comments into account; and I will send an updated patch as soon as we have some proper name for i386_match_insn. Thank you for your review!