From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10782 invoked by alias); 15 Oct 2004 13:02:46 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 10756 invoked from network); 15 Oct 2004 13:02:44 -0000 Received: from unknown (HELO euclid.linsyssoft.com) (61.11.18.135) by sourceware.org with SMTP; 15 Oct 2004 13:02:44 -0000 Received: from linsyssoft.com (pronto [192.168.1.12]) by euclid.linsyssoft.com (8.12.8/8.12.8) with ESMTP id i9FCrK9D021527 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Fri, 15 Oct 2004 18:25:55 +0530 Message-ID: <416FC732.2020609@linsyssoft.com> Date: Fri, 15 Oct 2004 14:56:00 -0000 From: ashish mittal User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225 MIME-Version: 1.0 To: gdb@sources.redhat.com Subject: Possible improvement to i386 function prologue analysis. Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-10/txt/msg00323.txt.bz2 Hi, This is in reference to GDB's function prologue analysis (and updation of its internal register cache therefrom) on the x86 architecture. GDB file: gdb/i386-tdep.c i386_analyze_frame_setup() takes care of "Check for some special instructions that might be migrated by GCC into the prologue and skip them. At this point in the prologue, code should only touch the scratch registers %eax, %ecx and %edx,.." Instances have been observed when GCC generates these instructions between the prologue "push" instructions; for example, the following from the objdump of gdb: 0807a380 : 807a380: 55 push %ebp 807a381: 31 c0 xor %eax,%eax 807a383: 89 e5 mov %esp,%ebp 807a385: 57 push %edi 807a386: 31 d2 xor %edx,%edx 807a388: 31 c9 xor %ecx,%ecx 807a38a: 56 push %esi 807a38b: 53 push %ebx 807a38c: 81 ec 4c 01 00 00 sub $0x14c,%esp In the above instance, the function "i386_analyze_register_saves()", which takes care of populating the frame cache, will fail after reading the first register %edi. Please suggest if it would be worthwhile to work on a similar check for special instructions within the for loop in i386_analyze_register_saves(). This will enable it to continue reading saved registers over such occurances. I could work on a possible patch if you agree. Thanks, Ashish Mittal.