From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17879 invoked by alias); 27 May 2003 15:19:41 -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 15222 invoked from network); 27 May 2003 15:18:37 -0000 Received: from unknown (HELO kerberos.suse.cz) (195.47.106.10) by sources.redhat.com with SMTP; 27 May 2003 15:18:37 -0000 Received: from chimera.suse.cz (chimera.suse.cz [10.20.0.2]) by kerberos.suse.cz (SuSE SMTP server) with ESMTP id 69DB359E556; Tue, 27 May 2003 17:18:36 +0200 (CEST) Received: from suse.cz (naga.suse.cz [10.20.1.16]) by chimera.suse.cz (Postfix) with ESMTP id E9DF14FB5; Tue, 27 May 2003 17:18:35 +0200 (CEST) Message-ID: <3ED381CB.5050207@suse.cz> Date: Tue, 27 May 2003 15:19:00 -0000 From: Michal Ludvig Organization: SuSE CR, s.r.o. User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4b) Gecko/20030507 X-Accept-Language: cs, cz, en MIME-Version: 1.0 To: Mark Kettenis Cc: gdb Subject: dwarf-frame.c question Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-05/txt/msg00356.txt.bz2 Hi Mark, why do you decrement unwound PC in dwarf_frame_cache() before using it? dwarf-frame.c: 478 /* Unwind the PC. */ 479 fs->pc = frame_pc_unwind (next_frame); 480 if (get_frame_type (next_frame) == NORMAL_FRAME 481 && frame_relative_level (next_frame) >= 0) 482 fs->pc--; This makes a problem for a signal trampoline. If it is sitting on addresses say 0x40000140-0x40000150, the return address from signal handler is 0x40000140, but dwarf_frame_cache() says it is 0x4000013f and couldn't find it's CFI... This has a tragic consequence few lines below were you look for FDE but don't check if you find one. If you don't, line 488 segfaults. 484 /* Find the correct FDE. */ 485 fde = dwarf_frame_find_fde (&fs->pc); 486 487 /* Extract any interesting information from the CIE. */ 488 fs->data_align = fde->cie->data_alignment_factor; 489 fs->code_align = fde->cie->code_alignment_factor; 490 fs->retaddr_column = fde->cie->return_address_register; The problem is, that dwarf_frame_p() looks for the real return address and says that there is a debug info and sets unwinder to use dwarf2 methods for this farme. But the in unwinder itself in dwarf_frame_cache() looks for the decreased one and of course doesn't find it. I couldn't see any problems when I removed the decrementation, so why is it there? Michal Ludvig -- * SuSE CR, s.r.o * mludvig@suse.cz * (+420) 296.545.373 * http://www.suse.cz