From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29591 invoked by alias); 1 Aug 2004 13:54:38 -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 29581 invoked from network); 1 Aug 2004 13:54:37 -0000 Received: from unknown (HELO walton.kettenis.dyndns.org) (213.93.77.109) by sourceware.org with SMTP; 1 Aug 2004 13:54:37 -0000 Received: from elgar.kettenis.dyndns.org (elgar.kettenis.dyndns.org [192.168.0.2]) by walton.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id i71DsVJ8027550; Sun, 1 Aug 2004 15:54:31 +0200 (CEST) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: from elgar.kettenis.dyndns.org (localhost [127.0.0.1]) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id i71DsVMA055911; Sun, 1 Aug 2004 15:54:31 +0200 (CEST) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: (from kettenis@localhost) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6/Submit) id i71DsR1E055908; Sun, 1 Aug 2004 15:54:27 +0200 (CEST) Date: Sun, 01 Aug 2004 13:54:00 -0000 Message-Id: <200408011354.i71DsR1E055908@elgar.kettenis.dyndns.org> From: Mark Kettenis To: mec.gnu@mindspring.com Subject: Re: [PATCH] Partial fix for PR backtrace/1718 CC: eliz@gnu.org, gdb-patches@sources.redhat.com X-SW-Source: 2004-08/txt/msg00005.txt.bz2 [Sorry Michael and Eli, I managed to remove the Subject: line and therefore the list didn't accept this message] Date: Sun, 01 Aug 2004 01:35:39 -0400 From: Michael Chastain "Eli Zaretskii" wrote: > Perhaps, then, you could post a list of all the opcodes and subsequent > bytes that we need to cover in i386_analyze_frame_setup? The compiler could schedule just about anything into the prologue! There are some restrictions though, given that GCC can only play with a limited set of registers. Let's get empirical. I ran cc1plus and gdb through "objdump -d" and some perl fu. Thanks! This really is the info I need. Could you post (or mail me) the perl fu? We have to have "mov 0xADDRESS, %reg". After that, recognizing "cmpl $IMMEDIATE, 0xADDRESS" would help. That instruction gets scheduled even before "push %ebp". Those two additions would cover 99.9% of cc1plus and gdb. On System V ABI conforming systems, yes. On systems that use the -freg-struct-return by default (FreeBSD, OpenBSD, Cygwin and a few others) I guess there are a bit more possibilities. I'll try to address -freg-struct-return too. Anyway, I've got some ideas to make the prologue analyzer easily extendable. [snip] The 10 truly freaky prologues are: .plt : pushl 0x86039e8 | jmp *0x86039ec | add %al, (%eax) | add %al, (%eax) | jmp *0x86039f0 | push $0x0 | jmp 80494cc <_init+0x18> That's the PLT. GDB should already handle that one, and otherwise it'd deserve (and need) a special frame unwinder anyway like I did for SPARC. _start : xor %ebp, %ebp | pop %esi | mov %esp, %ecx | and $0xfffffff0, %esp | push %eax | push %esp | push %edx This one is rather special since it's the entry point. Thanks! Mark