From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16392 invoked by alias); 6 Feb 2003 23:24:20 -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 16380 invoked from network); 6 Feb 2003 23:24:19 -0000 Received: from unknown (HELO walton.kettenis.dyndns.org) (62.163.169.212) by 172.16.49.205 with SMTP; 6 Feb 2003 23:24:19 -0000 Received: from elgar.kettenis.dyndns.org (elgar.kettenis.dyndns.org [192.168.0.2]) by walton.kettenis.dyndns.org (8.12.6/8.12.5) with ESMTP id h16NOBHK001244; Fri, 7 Feb 2003 00:24:11 +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.6/8.12.6) with ESMTP id h16NOB0N027467; Fri, 7 Feb 2003 00:24:11 +0100 (CET) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: (from kettenis@localhost) by elgar.kettenis.dyndns.org (8.12.6/8.12.6/Submit) id h16NOABK027464; Fri, 7 Feb 2003 00:24:10 +0100 (CET) Date: Thu, 06 Feb 2003 23:24:00 -0000 Message-Id: <200302062324.h16NOABK027464@elgar.kettenis.dyndns.org> From: Mark Kettenis To: ac131313@redhat.com CC: mludvig@suse.cz, gdb@sources.redhat.com, gdb-patches@sources.redhat.com In-reply-to: <3E42A5F8.9080708@redhat.com> (message from Andrew Cagney on Thu, 06 Feb 2003 13:14:16 -0500) Subject: [PATCH] Re: regcache (Re: GDB respin) References: <200302031615.h13GFVP26477@duracef.shout.net> <3E3EA35D.3080300@redhat.com> <3E427169.5010702@suse.cz> <3E42A5F8.9080708@redhat.com> X-SW-Source: 2003-02/txt/msg00141.txt.bz2 Date: Thu, 06 Feb 2003 13:14:16 -0500 From: Andrew Cagney > diff -u -p -r1.33 -r1.34 > --- gdb/x86-64-tdep.c 26 Oct 2002 10:37:45 -0000 1.33 > +++ gdb/x86-64-tdep.c 26 Oct 2002 16:56:34 -0000 1.34 > @@ -925,11 +925,35 @@ x86_64_init_abi (struct gdbarch_info inf > + set_gdbarch_long_double_bit (gdbarch, 128); > + set_gdbarch_ps_regnum (gdbarch, 17); /* %eflags */ > + set_gdbarch_stab_reg_to_regnum (gdbarch, x86_64_dwarf2_reg_to_regnum); > + set_gdbarch_dwarf_reg_to_regnum (gdbarch, x86_64_dwarf2_reg_to_regnum); > + set_gdbarch_extract_return_value (gdbarch, NULL); > + set_gdbarch_store_return_value (gdbarch, NULL); > + set_gdbarch_extract_struct_value_address (gdbarch, NULL); > > If I comment out last three lines (those return_value related), the testsuite performs much better. But all the other lines seem have some influence on the results. Hmm, at least extract_return_value shouldn't be set to NULL. It should be doing: extract-return-value() -> legacy-extract-return-value() -> deprecated-extract-return-value() -> x86-64-extract-return-value So I'd at least remove the setting of that one. Since it is trying to restore the default, try setting it to legacy_...(). Same goes for store_return_value. I think extract_struct_value_address is puzzling but ok. Looks like I screwed up by assuming that setting things to NULL would make us invoke the default. Although I'd encourage Ludvig to make these functions regcache aware, I checked in the attached patch. I think it would be a good idea to have things working correctly before starting the conversion. Mark Index: ChangeLog from Mark Kettenis * x86-64-tdep.c (x86_64_init_abi): Set extract_return_value to legacy_extract_return_value and store_return_value to legacy_return_value. Index: x86-64-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/x86-64-tdep.c,v retrieving revision 1.46 diff -u -p -r1.46 x86-64-tdep.c --- x86-64-tdep.c 5 Jan 2003 14:07:03 -0000 1.46 +++ x86-64-tdep.c 6 Feb 2003 23:20:18 -0000 @@ -980,7 +980,7 @@ x86_64_init_abi (struct gdbarch_info inf set_gdbarch_read_fp (gdbarch, cfi_read_fp); /* FIXME: kettenis/20021026: Should be undeprecated. */ - set_gdbarch_extract_return_value (gdbarch, NULL); + set_gdbarch_extract_return_value (gdbarch, legacy_extract_return_value); set_gdbarch_deprecated_extract_return_value (gdbarch, x86_64_extract_return_value); set_gdbarch_push_arguments (gdbarch, x86_64_push_arguments); @@ -988,7 +988,7 @@ x86_64_init_abi (struct gdbarch_info inf set_gdbarch_pop_frame (gdbarch, x86_64_pop_frame); set_gdbarch_store_struct_return (gdbarch, x86_64_store_struct_return); /* FIXME: kettenis/20021026: Should be undeprecated. */ - set_gdbarch_store_return_value (gdbarch, NULL); + set_gdbarch_store_return_value (gdbarch, legacy_store_return_value); set_gdbarch_deprecated_store_return_value (gdbarch, x86_64_store_return_value); /* Override, since this is handled by x86_64_extract_return_value. */