From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/8666 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCHv3 1/3] fix matching errors for overwritten registers in x86 CFI generation script Date: Tue, 13 Oct 2015 18:42:04 -0400 Message-ID: <20151013224204.GT8645@brightrain.aerifal.cx> References: <1444735732-12265-1-git-send-email-alexinbeijing@gmail.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1444776145 3556 80.91.229.3 (13 Oct 2015 22:42:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 13 Oct 2015 22:42:25 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-8678-gllmg-musl=m.gmane.org@lists.openwall.com Wed Oct 14 00:42:21 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1Zm8Gx-0003SJ-K1 for gllmg-musl@m.gmane.org; Wed, 14 Oct 2015 00:42:19 +0200 Original-Received: (qmail 13711 invoked by uid 550); 13 Oct 2015 22:42:17 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 13693 invoked from network); 13 Oct 2015 22:42:16 -0000 Content-Disposition: inline In-Reply-To: <1444735732-12265-1-git-send-email-alexinbeijing@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:8666 Archived-At: On Tue, Oct 13, 2015 at 01:28:50PM +0200, Alex Dowad wrote: > thanks to R. Felker for noticing 2 separate problems: > > - binary ops like ADD, AND, etc. overwrite the 2nd operand, not the 1st. > this confusion resulted from mixing up Intel and GNU asm syntax. > > - the regexps used to identify clobbered registers would erroneously match > index registers. in other words, the following asm: > > mov $0, (%eax,%ebx,4) > > ....would cause EBX to be considered as overwritten, which might prevent a > debugger from displaying a variable's value in a higher stack frame. > --- > > Here is the latest iteration. I have merged 2 previously separate commits, and > fixed up the matching of registers (for the purpose of identifying overwritten > registers). > > As usual, thanks for the feedback. AD Thanks! I'm committing them all now. I'm sorry for not catching this before -- I realized that the index register thing was also an existing bug in mov handling, not just a new bug added in the operand order patch, so I split it out into a separate commit. I did basic regression testing on i386 (making sure gdb backtrace from syscalls still works) and tested that the x86_64 also seems to work (it does). Rich