From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15461 invoked by alias); 24 Feb 2002 18:09:48 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 15135 invoked from network); 24 Feb 2002 18:09:42 -0000 Received: from unknown (HELO mandy.eunet.fi) (193.66.1.129) by sources.redhat.com with SMTP; 24 Feb 2002 18:09:42 -0000 Received: from alphatux2.ts.ray.fi (ws-002.ray.fi [193.64.14.2]) by mandy.eunet.fi (Postfix) with ESMTP id 97702A2A3 for ; Sun, 24 Feb 2002 20:09:13 +0200 (EET) (envelope-from jd@ts.ray.fi) Date: Sun, 24 Feb 2002 10:09:00 -0000 From: Iso-H To: gdb@sources.redhat.com Subject: Re: gdb-5.x and step over inline functions In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2002-02/txt/msg00289.txt.bz2 On Sun, 24 Feb 2002, Iso-H wrote: > On Sun, 24 Feb 2002, Daniel Jacobowitz wrote: > > > On Sun, Feb 24, 2002 at 03:14:00PM +0200, Iso-H wrote: > > > > > > On Sun, 24 Feb 2002, Eli Zaretskii wrote: > > > > > > > > > > > On Sun, 24 Feb 2002, Iso-H wrote: > > > > > > > > > Is there any way to step over inline functions > > > > > when using gdb >= 5.1 ? Some (commandline or other)option > > > > > perhaps? > > > > .... > > > > Could you provide a small testcase, with source and a compile > > commandline? > > It seems to be so that it is difficult to create > just simple "demo", but I'll try... > Ok. here it is; one file only ;) --------------------------------------------------------------- #include #include class Demo_t { public: inline Demo_t(int32_t); inline int32_t m_demomethod(int32_t); private: int32_t a_1; int32_t a_2; }; Demo_t::Demo_t(int32_t p_arg) { a_1 = p_arg; a_2 = 0; } int32_t Demo_t::m_demomethod( int32_t p_arg ) { return a_1 + p_arg; } int f_func( int32_t p_arg); //############################################### int main( int32_t p_argc, int8_t** pp_argv ) { printf("value: %d\n", f_func(2)); } //############################################### int f_func( int32_t p_arg ) { Demo_t a(1); printf("value: %d\n", a.m_demomethod(2)); } --------------------------------------------------------------- and compiling command is: g++ -O2 -g3 gdb-5.x-inline-test.cxx -o test.bin And here is gdb session: ------------------------------------------------------- #gdb test.bin GNU gdb 20020124 Copyright 2002 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "alphaev56-unknown-linux-gnu"... (gdb) list f_func 12 int32_t a_1; 13 int32_t a_2; 14 }; 15 16 Demo_t::Demo_t(int32_t p_arg) 17 { 18 a_1 = p_arg; 19 a_2 = 0; 20 } 21 (gdb) q # ------------------------------------------------------- As you can see, gdb doesn't show "f_func", but Demo_t's constructor instead ! There is also some variation; if constructor's "p_arg" parameter is removed then list dump is correct!? > > > > > > > -- Iso-H