From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20251 invoked by alias); 1 Dec 2010 16:45:44 -0000 Received: (qmail 20242 invoked by uid 22791); 1 Dec 2010 16:45:43 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,SPF_SOFTFAIL,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mtagate2.uk.ibm.com (HELO mtagate2.uk.ibm.com) (194.196.100.162) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 01 Dec 2010 16:45:36 +0000 Received: from d06nrmr1707.portsmouth.uk.ibm.com (d06nrmr1707.portsmouth.uk.ibm.com [9.149.39.225]) by mtagate2.uk.ibm.com (8.13.1/8.13.1) with ESMTP id oB1GjXjU018526 for ; Wed, 1 Dec 2010 16:45:33 GMT Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1707.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id oB1GjX143399724 for ; Wed, 1 Dec 2010 16:45:33 GMT Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id oB1GjWgH001397 for ; Wed, 1 Dec 2010 09:45:32 -0700 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with SMTP id oB1GjVXw001375; Wed, 1 Dec 2010 09:45:31 -0700 Message-Id: <201012011645.oB1GjVXw001375@d06av02.portsmouth.uk.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Wed, 01 Dec 2010 17:45:31 +0100 Subject: Re: [rfc/rfa] Use ARM exception tables as GDB unwinder To: dan@codesourcery.com (Daniel Jacobowitz) Date: Wed, 01 Dec 2010 16:45:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org, rearnsha@arm.com, matthew.gretton-dann@arm.com In-Reply-To: <20101021204306.GU8337@caradoc.them.org> from "Daniel Jacobowitz" at Oct 21, 2010 04:43:07 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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/msg00005.txt.bz2 Dan Jacobowitz wrote: > On Thu, Oct 21, 2010 at 10:29:32PM +0200, Ulrich Weigand wrote: > > Right, for C code there should be no problem. The problems I've been > > seeing all come from *assembler* source files using the DO_CALL macro. > > This gets CFI correct, but doesn't create any unwind records ... > > Oh.... yes, we could move that out of line for ARM too. I don't like > the solution much though, because it lengthens all syscall backtraces > unnecessarily. > > We're getting into the point where backtraces using the ARM unwinder > are not useful for GDB because they're flow-insensitive. But if all > the callers of DO_CALL don't contain any other calls, we have the > option to record the ip = r7 save as if the syscall is the only > possible 'call site'. 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? Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com