From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7024 invoked by alias); 13 Sep 2003 14:25:19 -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 6971 invoked from network); 13 Sep 2003 14:25:18 -0000 Received: from unknown (HELO walton.kettenis.dyndns.org) (213.93.115.144) by sources.redhat.com with SMTP; 13 Sep 2003 14:25:18 -0000 Received: from elgar.kettenis.dyndns.org (elgar.kettenis.dyndns.org [192.168.0.2]) by walton.kettenis.dyndns.org (8.12.6p2/8.12.5) with ESMTP id h8DEP7xA008230; Sat, 13 Sep 2003 16:25:07 +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.6p2/8.12.6) with ESMTP id h8DEP6JA012303; Sat, 13 Sep 2003 16:25:06 +0200 (CEST) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: (from kettenis@localhost) by elgar.kettenis.dyndns.org (8.12.6p2/8.12.6/Submit) id h8DEP6ZF012300; Sat, 13 Sep 2003 16:25:06 +0200 (CEST) Date: Sat, 13 Sep 2003 14:25:00 -0000 Message-Id: <200309131425.h8DEP6ZF012300@elgar.kettenis.dyndns.org> From: Mark Kettenis To: ac131313@redhat.com CC: gdb@sources.redhat.com, dan@debian.org In-reply-to: <3F5CCDDD.4010809@redhat.com> (message from Andrew Cagney on Mon, 08 Sep 2003 14:43:41 -0400) Subject: Re: REG_STRUCT_HAS_ADDR References: <200309062206.h86M62no012596@elgar.kettenis.dyndns.org> <3F5CCDDD.4010809@redhat.com> X-SW-Source: 2003-09/txt/msg00181.txt.bz2 Date: Mon, 08 Sep 2003 14:43:41 -0400 From: Andrew Cagney > Unfortunately this breaks debugging with stabs, since stabsread.c uses > the same REG_STRUCT_HAS_ADDR to see if a function argument is passed > by value or by reference. I think we really want to get rid of the > broken code in infcall.c in the long run. Therefore I looked for a > way to disable it for "modern" targets, i.e. targets that define > PUSH_DUMMY_CALL as opposed to the old PUSH_DUMMY_FRAME & friends. > Looking at the code I found that the following targets (besides SPARC) > are using REG_STRUCT_HAS_ADDR: Instead, add a new method: STABS_REG_STRUCT_HAS_ADDR with a default of: if (DEPRECATED_REG_STRUCT_HAS_ADDR_P () return REG_STRUCT ... (); else return 0; (no predicate) (I think I've got that right) (better name?) and deprecate REG_STRUCT_HAS_ADDR{,_P}. I think stabsread.c can then switch to the STABS variant. That should let you safely disentangle the SPARC without breaking "stabsread.c". That's a good strategy. However, making this stabs-specific seems wrong to me. The new method will simply indicate whether the ABI silently uses pass by reference instead of pass by value for function argument of a certain type. Therefore I don't think we should put STABS in the name. What about PASS_ARGUMENT_BY_REFERENCE? I'm going to drop the GCC_P argument too, since nobody is using it. I'll post a patch later today. > - if (REG_STRUCT_HAS_ADDR_P ()) > + if (REG_STRUCT_HAS_ADDR_P () > + && !gdbarch_push_dummy_call_p (current_gdbcarch)) The switch to push_dummy_call_p shouldn't cause unexpected side effects such as disabling REG_STRUCT_HAS_ADDR_P. From memory, I've got the current code down to just one and even that doesn't really need it. I had doubts whether I could get away with this. Anyway, this saves me from building a MIPS cross-environment ;-). Mark