From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19275 invoked by alias); 7 Aug 2012 14:22:03 -0000 Received: (qmail 19259 invoked by uid 22791); 7 Aug 2012 14:22:02 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,T_RP_MATCHES_RCVD 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; Tue, 07 Aug 2012 14:21:46 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q77ELjVS011316 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 7 Aug 2012 10:21:45 -0400 Received: from host2.jankratochvil.net (ovpn-116-39.ams2.redhat.com [10.36.116.39]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q77ELfiv019736 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 7 Aug 2012 10:21:44 -0400 Date: Tue, 07 Aug 2012 14:22:00 -0000 From: Jan Kratochvil To: Smith John Cc: gdb@sourceware.org Subject: Re: How to debug gdb using gdb ? Message-ID: <20120807142141.GA8073@host2.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: 2012-08/txt/msg00017.txt.bz2 On Tue, 07 Aug 2012 16:18:01 +0200, Smith John wrote: > but how can I send command to the debugged gdb procedure > which is children process , I find most easy to make child GDB non-interactive. So that you do not have to re-enter the exact commands to reproduce the problem each time. Therefore use -ex (or -x) for the child GDB: gdb -ex 'b breakpoint.c:9152' -ex r --args ./gdb ~/t/try5 -ex 'b display' -ex r -ex up -ex b -ex 'info b' -ex 'p/x $pc' -ex 'info line *$pc' -ex 'set confirm no' -ex q -q Regards, Jan