From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29262 invoked by alias); 21 Dec 2010 11:20:13 -0000 Received: (qmail 29243 invoked by uid 22791); 21 Dec 2010 11:20:12 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 21 Dec 2010 11:20:07 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 77D742BAC39 for ; Tue, 21 Dec 2010 06:20:05 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 7XcFFB1U0P65 for ; Tue, 21 Dec 2010 06:20:05 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 520C22BAC7D for ; Tue, 21 Dec 2010 06:20:03 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 3D2001457B3; Tue, 21 Dec 2010 12:19:51 +0100 (CET) Date: Tue, 21 Dec 2010 11:20:00 -0000 From: Joel Brobecker To: gdb-patches@sourceware.org Subject: [RFC] how to call host-side stuff from -tdep code? Message-ID: <20101221111951.GE2596@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-12/txt/msg00371.txt.bz2 Hello, I am about 75% through porting FSF HEAD to ia64-hpux, and I have a question: I'm inside ia64-tdep.c, and I need to determine whether we're inside a system call or not. Apparently, the way to do that is to perform a call to ttrace (I'm planning on wrapping this inside a -nat.c file). But of course, you are not supposed to do that, since the -nat module is not available in the case of a cross debugger. To be more precise, the ttrace request is a TT_LWP_RUREGS, using an offset set to __reason. If the returned value is zero, then we're in a syscall. Otherwise, we're not. In a way, this could be thought of as a special register. I don't think that adding a raw register would be really be all that appealing, since it'd be accessible to the user. I thought about a pseudo register, but this seems awkward, if possible at all. My understanding is that pseudo-registers are really a thing of the target, which cannot depend on native stuff. It seems to me that the easiest solution right now is to add a new xfer object (say TARGET_OBJECT_IA64/"ia64.in_syscall"), and then use target_xfer_partial to get the information I needed. Is that what these objects were meant for? I considered adding a new target method, but that seems way overkill, just for one platform. Any other suggestion? -- Joel