From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4550 invoked by alias); 13 Oct 2010 16:07:47 -0000 Received: (qmail 4532 invoked by uid 22791); 13 Oct 2010 16:07:45 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,TW_BJ,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO glazunov.sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 13 Oct 2010 16:07:37 +0000 Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by glazunov.sibelius.xs4all.nl (8.14.3/8.14.3) with ESMTP id o9DG7Ux3010007; Wed, 13 Oct 2010 18:07:30 +0200 (CEST) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.3/8.14.3/Submit) id o9DG7Twq004980; Wed, 13 Oct 2010 18:07:29 +0200 (CEST) Date: Wed, 13 Oct 2010 16:07:00 -0000 Message-Id: <201010131607.o9DG7Twq004980@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: kew@emc.com CC: gdb@sourceware.org In-reply-to: <4CB5CB63.5020901@emc.com> (kew@emc.com) Subject: Re: STABS records for 64-bit function arguments via registers in i386 References: <4CB5CB63.5020901@emc.com> Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2010-10/txt/msg00043.txt.bz2 > Date: Wed, 13 Oct 2010 11:08:19 -0400 > From: kew@emc.com > > Hi > > In i386 architecture (32 bit) gcc can optimize a static function to pass > function arguments via registers (instead of in the stack). For 64-bit > arguments, it uses 2 registers, but gdb reports only 1 (via "info > scope") when the binary being debugged is compiled using the STABS > debugging format. > > I checked using objdump and could see indeed only 1 N_RSYM record being > given (so no wonder gdb would only report 1 register). > > How does the STABS debugging format indicate the 2 registers used for > passing 64 function arguments in i386 architecture? Is this supported? Historically the convention has been that a 64-bit value is stored in register N and N + 1, where N is the register number that's stored in the STABS debugging information. If your compiler doesn't store 64-bit values in that way (and I think modern versions of GCC no longer do this) things will break. > If not, what's the process to add support for it? There isn't really. STABS is a historic debugging format that isn't expressive enough to support modern compilers and languages like C++. Use DWARF 2/3/4 instead.