From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3657 invoked by alias); 12 Dec 2010 04:21:47 -0000 Received: (qmail 3648 invoked by uid 22791); 12 Dec 2010 04:21:46 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 12 Dec 2010 04:21:41 +0000 Received: (qmail 2066 invoked from network); 12 Dec 2010 04:21:39 -0000 Received: from unknown (HELO caradoc.them.org) (dan@127.0.0.2) by mail.codesourcery.com with ESMTPA; 12 Dec 2010 04:21:39 -0000 Date: Sun, 12 Dec 2010 04:21:00 -0000 From: Daniel Jacobowitz To: Ulrich Weigand Cc: gdb-patches@sourceware.org, rearnsha@arm.com, matthew.gretton-dann@arm.com Subject: Re: [rfc/rfa] Use ARM exception tables as GDB unwinder Message-ID: <20101212042135.GG11377@caradoc.them.org> References: <20101021204306.GU8337@caradoc.them.org> <201012011645.oB1GjVXw001375@d06av02.portsmouth.uk.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201012011645.oB1GjVXw001375@d06av02.portsmouth.uk.ibm.com> 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/msg00164.txt.bz2 On Wed, Dec 01, 2010 at 05:45:31PM +0100, Ulrich Weigand wrote: > Hmm, looking at DO_CALL a bit more I think this can actually be handled > inline just fine: > > #define DO_CALL(syscall_name, args) \ > DOARGS_##args; \ > mov ip, r7; \ > cfi_register (r7, ip); \ > ldr r7, =SYS_ify (syscall_name); \ > swi 0x0; \ > mov r7, ip; \ > cfi_restore (r7); \ > UNDOARGS_##args > > Note the calls to DOARGS_... / UNDOARGS_..., which actually save and > restore registers on the stack anyway (just not r7). Why not simply > have (a variant) of [UN]DOARGS_... save r7 to the stack, and then > provide both correct CFI and ARM unwind records for it? [ Saving > to IP would then be no longer necessary. ] > > Am I missing something here? I don't think you are missing anything, except a couple of cycles. We save r7 in ip because it ought to be faster loading and storing it on the stack. But we already take the position that the system call overhead is substantial compared to DO_CALL... so the extra two memory ops do not seem like a huge loss to me, especially if we can save on code size. I haven't looked at this code in a while, but isn't nptl/sysdep-cancel.h:PSEUDO broken for non-cancellable syscalls with many arguments? It calls DOARGS and then DO_CALL, but DO_CALL does DOARGS again. For 0-4 arguments it doesn't matter; I don't know if any of the 5/6/7 argument calls have a used nocancel variant. -- Daniel Jacobowitz CodeSourcery