From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11578 invoked by alias); 27 Sep 2002 02:54:56 -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 11570 invoked from network); 27 Sep 2002 02:54:54 -0000 Received: from unknown (HELO localhost.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 27 Sep 2002 02:54:54 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id B10713E19; Thu, 26 Sep 2002 22:54:52 -0400 (EDT) Message-ID: <3D93C87C.4050603@redhat.com> Date: Thu, 26 Sep 2002 19:54:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.0) Gecko/20020824 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Michal Ludvig , Gerhard Tonn Cc: gdb-patches@sources.redhat.com, Jim blandy , Elena Zannoni Subject: Re: [PATCH RFC] DWARF2 CFI exploitation for Linux on S/390 References: <3D91908A.8030308@suse.cz> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-09/txt/msg00658.txt.bz2 > In order to adapt the code to the first item, I have introduced #defines > for DWARF2 registers and a REGNUM_TO_DWARF2_REG macro and its > implementation. See the attached patch for details. Looking just at the gdbarch.h addition REGNUM_TO_DWARF2_REG(). Is it possible to compute this using DWARF2_REGNUM_TO_REGNUM() or [better?] have dwarf2cfi convert everything to GDB regnums. Having everything in GDB REGNUM's would take away any need for conversion confusion. Also note: http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gdb&pr=325 The current code contains things like: int regs_size = sizeof (struct context_reg) * NUM_REGS; but it should be using (NUM_REGS + NUM_PSEUDO_REGS) because there is a very good chance that the REGNUM returned by DWARF2_REG_TO_REGNUM() is in the range [NUM_REGS .. NUM_REGS+NUM_PSEUD_REGS). > In order to consider the second item I have adapted the LOC_REF_ARG symbol > class handling in dwarf2read.c and findvar.c to use the BASEREG value if > DWARF2 is active. >> >> Finally I am interested in how signal frame and dummy frame handling is >> supposed to work with DWARF2 CFI support. Does anybody have done already >> work in this area? >> > That's the question I'm solving too. The first approach (for x86-64) is here: http://sources.redhat.com/ml/gdb-patches/2002-09/msg00384.html > Basically I don't set_gdbarch_*() directly to cfi_*() functions but instead to corresponding x86_64_*() functions, that eventually call cfi_*() themselves. For sighandler caller frames I'm afraid I'll have to manually fill appropriate structures in struct context (probably in those x86_64_*() functions). See: http://sources.redhat.com/ml/gdb/2002-09/msg00301.html The theory is that each frame has frame specific methods: register-unwind, saved-pc (and frame-chain(?)). So far a recursive frame->unwind() method has been added and all evidence suggests it is working well. The CFI code needs to be updated to work with that interface, and also work with the current regcache.[hc] interface. enjoy, Andrew