From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19443 invoked by alias); 11 Sep 2012 10:15:17 -0000 Received: (qmail 19434 invoked by uid 22791); 11 Sep 2012 10:15:16 -0000 X-SWARE-Spam-Status: No, hits=-5.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-wg0-f41.google.com (HELO mail-wg0-f41.google.com) (74.125.82.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 11 Sep 2012 10:15:03 +0000 Received: by wgbds1 with SMTP id ds1so1855098wgb.0 for ; Tue, 11 Sep 2012 03:15:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.180.97.33 with SMTP id dx1mr24023695wib.18.1347358501894; Tue, 11 Sep 2012 03:15:01 -0700 (PDT) Received: by 10.223.71.3 with HTTP; Tue, 11 Sep 2012 03:15:01 -0700 (PDT) In-Reply-To: References: Date: Tue, 11 Sep 2012 10:15:00 -0000 Message-ID: Subject: Re: debug gdb by gdb From: naga raj To: John Smith Cc: gdb@sourceware.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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-09/txt/msg00023.txt.bz2 Hi John, On Tue, Sep 11, 2012 at 3:06 PM, John Smith wrote: > hi, > > i am try to debug gdb by gdb , and a problem confused me > , here it is : how can i send command to the debugged gdb > process which is the child process of top-gdb ? > > as you know ,when I type command to the command line , this > command will always be send to top-gdb , and how to send > command to the child gdb dynamicly=EF=BC=9F > If you want to debug a gdb with gdb you can debug as below gdb --args child-gdb once you execute this command a gdb prompt of parent will appear where you can set break point or do any other stuff. once you set a breakpoint then enter run command now this time again another gdb console will come there you can commands for client gdb ex: [console]$ gdb --args mb-gdb a.out GNU gdb 6.1.1 Copyright 2004 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 condition= s. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db library "/lib/tls/libthread_db.so.1". (gdb) b microblaze_extract_return_value Breakpoint 1 at 0x804d451: file /gnu/mb_gnu//src/gdb/gdb/microblaze-tdep.c, line 621. (gdb) run Starting program: /gnu/mb_gnu/gnu/microblaze/lin/bin/mb-gdb a.out Detaching after fork from child process 546. GNU gdb (GDB) 7.4.50.20120403-cvs Copyright (C) 2012 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "--host=3Di686-pc-linux-gnu --target=3Dmicroblaze-xilinx-elf". For bug reporting instructions, please see: ... Reading symbols from /wrk/ptx/users/nagaraju/prgs/a.out...(no debugging symbols found)...done. (gdb) tar remote localhost:1234 Remote debugging using localhost:1234 > thanks! Hope this helps you Nagaraju