From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12615 invoked by alias); 6 Nov 2011 09:54:30 -0000 Received: (qmail 12606 invoked by uid 22791); 6 Nov 2011 09:54:29 -0000 X-SWARE-Spam-Status: No, hits=-7.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS,TW_XZ X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 06 Nov 2011 09:54:14 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pA69sDTg030065 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 6 Nov 2011 04:54:13 -0500 Received: from host1.jankratochvil.net (ovpn-116-24.ams2.redhat.com [10.36.116.24]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id pA69sBoA024052 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 6 Nov 2011 04:54:12 -0500 Received: from host1.jankratochvil.net (localhost [127.0.0.1]) by host1.jankratochvil.net (8.14.4/8.14.4) with ESMTP id pA69sAdr031457; Sun, 6 Nov 2011 10:54:10 +0100 Received: (from jkratoch@localhost) by host1.jankratochvil.net (8.14.4/8.14.4/Submit) id pA69s9ZD031456; Sun, 6 Nov 2011 10:54:09 +0100 Date: Sun, 06 Nov 2011 09:54:00 -0000 From: Jan Kratochvil To: phoeagon Cc: gdb@sourceware.org Subject: Re: Call function but step by step? Message-ID: <20111106095409.GA31422@host1.jankratochvil.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes 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: 2011-11/txt/msg00041.txt.bz2 On Sun, 06 Nov 2011 10:46:58 +0100, phoeagon wrote: > eh, i wonder if this feature exists or if it's appropriate to add. > that is to call a function explicitly (just like "call func" command) > but instead of executing the function all at once, the cursor stops at > the entry (as if the function is called at the point and we used step > in to trace into it) and wait for further commands (which can be, say, > step or next, which is very useful)... It is a common practice: (gdb) break new_block Breakpoint 2 at 0x7d44fb: file mdebugread.c, line 4867. (gdb) p new_block(0) Breakpoint 2, new_block (type=FUNCTION_BLOCK) at mdebugread.c:4867 4867 struct block *retval = xzalloc (sizeof (struct block)); The program being debugged stopped while in a function called from GDB. Evaluation of the expression containing the function (new_block) will be abandoned. When the function is done executing, GDB will silently stop. (gdb) bt #0 new_block (type=FUNCTION_BLOCK) at mdebugread.c:4867 #1 #2 main (argc=1, argv=0x7fffffffdfe8) at gdb.c:30 (gdb) next 4869 if (type == FUNCTION_BLOCK) Regards, Jan