From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6386 invoked by alias); 13 Dec 2003 15:09:34 -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 6370 invoked from network); 13 Dec 2003 15:09:31 -0000 Received: from unknown (HELO walton.kettenis.dyndns.org) (213.93.115.144) by sources.redhat.com with SMTP; 13 Dec 2003 15:09:31 -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 hBDF9U9h005349 for ; Sat, 13 Dec 2003 16:09:30 +0100 (CET) (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 hBDF9UrL035998 for ; Sat, 13 Dec 2003 16:09:30 +0100 (CET) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: (from kettenis@localhost) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6/Submit) id hBDF9TLA035995; Sat, 13 Dec 2003 16:09:29 +0100 (CET) Date: Sat, 13 Dec 2003 15:09:00 -0000 Message-Id: <200312131509.hBDF9TLA035995@elgar.kettenis.dyndns.org> From: Mark Kettenis To: gdb-patches@sources.redhat.com Subject: [PATCH] Remove zero PC check from blockframe.c:inside_main_func() X-SW-Source: 2003-12/txt/msg00355.txt.bz2 It really makes no sense to check for a zero PC here. This function is only colled from frame.c:get_prev_frame(), and there we already deal with PC being zero. The whole concept of using a zero PC as a marker for the end of the frame chain is somewhat flawed. It prevents us from providing a meaningful backtrace when the program has called a null function pointer; see backtrace/1476. At the very least we will have to treat a zero PC in the innermost differently. Classifying the a zero PC as being inside the "main" function doesn't help. Therefore this patch removes the first obstackle in fixing that PR. Objections. Otherwise I'll commit this within a few days. Mark Index: ChangeLog from Mark Kettenis * blockframe.c (inside_main_func): Don't treat a zero PC specially. Needed to fix PR backtrace/1476. Index: blockframe.c =================================================================== RCS file: /cvs/src/src/gdb/blockframe.c,v retrieving revision 1.83 diff -u -p -r1.83 blockframe.c --- blockframe.c 13 Dec 2003 13:16:52 -0000 1.83 +++ blockframe.c 13 Dec 2003 14:50:01 -0000 @@ -73,17 +73,12 @@ deprecated_inside_entry_file (CORE_ADDR } /* Test whether PC is in the range of addresses that corresponds to - the "main" function. - - A PC of zero is always considered to be the bottom of the stack. */ + the "main" function. */ int inside_main_func (CORE_ADDR pc) { struct minimal_symbol *msymbol; - - if (pc == 0) - return 1; if (symfile_objfile == 0) return 0;