From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5792 invoked by alias); 26 Aug 2003 19:50:35 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 5783 invoked from network); 26 Aug 2003 19:50:34 -0000 Received: from unknown (HELO touchme.toronto.redhat.com) (207.219.125.105) by sources.redhat.com with SMTP; 26 Aug 2003 19:50:34 -0000 Received: from redhat.com (toocool.toronto.redhat.com [172.16.14.72]) by touchme.toronto.redhat.com (Postfix) with ESMTP id C0D4880034E for ; Tue, 26 Aug 2003 14:30:15 -0400 (EDT) Message-ID: <3F4BA737.7030805@redhat.com> Date: Tue, 26 Aug 2003 19:50:00 -0000 From: "J. Johnston" Organization: Red Hat Inc. User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 X-Accept-Language: en-us, en MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: ia64 patch to handle predicated insns in prologue Content-Type: multipart/mixed; boundary="------------030307050507050808040000" X-SW-Source: 2003-08/txt/msg00456.txt.bz2 This is a multi-part message in MIME format. --------------030307050507050808040000 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 708 The accompanying patch handles a bug in backtracing through glibc's sleep. The compiler generates some predicated insns prior to saving the return register b0 into a register stack register. The current code stops when it sees a predicated insn. The change makes the prologue examination stop only if the function is frameless or we have already seen the return register. This removes a number of failures in gdb.threads caused when we catch another thread in sleep and we try and backtrace. Ok to commit? -- Jeff J. 2003-08-26 Jeff Johnston * ia64-tdep.c (examine_prologue): Only stop at predicated insns if we are frameless or the return address register is already known. --------------030307050507050808040000 Content-Type: text/plain; name="ia64-tdep-predicated.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ia64-tdep-predicated.patch" Content-length: 996 Index: ia64-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/ia64-tdep.c,v retrieving revision 1.94 diff -u -r1.94 ia64-tdep.c --- ia64-tdep.c 26 Aug 2003 17:33:22 -0000 1.94 +++ ia64-tdep.c 26 Aug 2003 17:46:44 -0000 @@ -1143,11 +1143,18 @@ if (next_pc == 0) break; - if ((it == B && ((instr & 0x1e1f800003f) != 0x04000000000)) - || ((instr & 0x3fLL) != 0LL)) + if (it == B && ((instr & 0x1e1f800003f) != 0x04000000000)) { - /* Exit loop upon hitting a non-nop branch instruction - or a predicated instruction. */ + /* Exit loop upon hitting a non-nop branch instruction. */ + if (trust_limit) + lim_pc = pc; + break; + } + else if (((instr & 0x3fLL) != 0LL) && + (frameless || ret_reg != 0)) + { + /* Exit loop upon hitting a predicated instruction if + we already have the return register or if we are frameless. */ if (trust_limit) lim_pc = pc; break; --------------030307050507050808040000--