From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21714 invoked by alias); 2 Nov 2005 15:51:41 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 21697 invoked by uid 22791); 2 Nov 2005 15:51:38 -0000 Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 02 Nov 2005 15:51:38 +0000 Received: from elgar.sibelius.xs4all.nl (root@elgar.sibelius.xs4all.nl [192.168.0.2]) by sibelius.xs4all.nl (8.13.4/8.13.4) with ESMTP id jA2FpQ42001928; Wed, 2 Nov 2005 16:51:26 +0100 (CET) Received: from elgar.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by elgar.sibelius.xs4all.nl (8.13.4/8.13.3) with ESMTP id jA2FpQeC032564; Wed, 2 Nov 2005 16:51:26 +0100 (CET) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.13.4/8.13.4/Submit) id jA2FpO7D009728; Wed, 2 Nov 2005 16:51:24 +0100 (CET) Date: Wed, 02 Nov 2005 15:51:00 -0000 Message-Id: <200511021551.jA2FpO7D009728@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: woodzltc@cn.ibm.com CC: gdb@sources.redhat.com In-reply-to: (message from Wu Zhou on Wed, 2 Nov 2005 10:43:03 +0800 (CST)) Subject: Re: The root cause for SEGV in evaluating fortran function call, any solution or suggestion? References: X-SW-Source: 2005-11/txt/msg00034.txt.bz2 > X-From_: gdb-return-22951-m.m.kettenis=alumnus.utwente.nl@sourceware.org Wed Nov 2 03:39:44 2005 > Mailing-List: contact gdb-help@sourceware.org; run by ezmlm > Sender: gdb-owner@sourceware.org > Date: Wed, 2 Nov 2005 10:43:03 +0800 (CST) > From: Wu Zhou > X-UTwente-MailScanner-Information: Scanned by MailScanner. Contact helpdesk@ITBE.utwente.nl for more information. > X-UTwente-MailScanner: Found to be clean > X-MailScanner-From: gdb-return-22951-m.m.kettenis=alumnus.utwente.nl@sourceware.org > X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on > elgar.sibelius.xs4all.nl > X-Spam-Level: > X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=failed > version=3.0.4 > > Hi all, > > I had found the reason why gdb will drop into SEGV when evaluating the > fortran function calls. In g77 (gfortran might be the same), when we try > to call FUNC_NAME (ARGS), the ARGS is passed as the pointer to the real > parameters. > > While we issue "print FUNC_NAME (ARGS), these ARGS are passed as the > original types. So fortran code can't handle that and SEGV occurs. > Considering this special argument-passing mechanism, do we have any > workaround for it in gdb's evaluation code? Create a dummy memory address > for the arguments and pass that address instead? or any others? > > Your comments are highly appreciated. Thanks a lot. What you describe sounds very similar to what gdbarch_stabs_argument_has_addr is all about. Currently these are only used on SPARC, and only for stabs. One could argue that the debug information generated by g77 is wrong, because it doesn't reflect the actual implementation of FUNC_NAME. Or perhaps GDB symbol reading code causes problems. Can you post a concrete example of a function call that goes wrong, and add a bit of explanation about the types involved for those of us who are not very familiar with Fortran? Thanks, Mark