From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24066 invoked by alias); 6 Nov 2014 18:23:15 -0000 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 Received: (qmail 24055 invoked by uid 89); 6 Nov 2014 18:23:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: sapo.pt Received: from relay2.ptmail.sapo.pt (HELO sapo.pt) (212.55.154.22) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 06 Nov 2014 18:23:07 +0000 Received: (qmail 15974 invoked by uid 0); 6 Nov 2014 18:23:03 -0000 Received: from unknown (HELO php04) (10.134.37.53) by relay2 with SMTP; 6 Nov 2014 18:23:03 -0000 Received: (qmail 17968 invoked by uid 64140); 6 Nov 2014 18:23:02 -0000 Received: from gtDEI-NATgw2.dei.uc.pt (gtDEI-NATgw2.dei.uc.pt [193.137.203.231]) by mail.sapo.pt (Horde Framework) with HTTP; Thu, 06 Nov 2014 18:23:02 +0000 Date: Thu, 06 Nov 2014 18:23:00 -0000 Message-ID: <20141106182302.Horde.PgzIDpXZnvCk2jabBJOFfA7@mail.sapo.pt> From: joaoandreferro@sapo.pt To: gdb@sourceware.org Subject: Re: Doubt turning GDB commands into bash script In-Reply-To: <20141105173707.Horde.YLsQWojsKNRsa4xuaCdSiA1@mail.sapo.pt> User-Agent: Dynamic Internet Messaging Program (DIMP) PTMail 5.3.4 X-PTMail-Version: PTMail 5.3.4 X-PTMail-User: eyJpdiI6IlE2dlFRK2x5OGh0bExZTUsxKzI5MHc9PSIsImQiOiJ6XC9COGlGYmt4MkRNVWFNaDRlZzdGU0s3Kzl1VVZUZmw4bHdVcFhzclF4UT0ifQ== Content-Type: text/plain; charset=UTF-8; format=flowed; DelSp=Yes MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2014-11/txt/msg00006.txt.bz2 It seems that what I need is here:=20=20 http://www.humbug.in/2010/utility-to-send-commands-or-data-to-other-termina= ls-ttypts/ I understand now the silliness of the original question, my ignorance=20=20 on bash scripting put me searching for something on (K)GDB that has=20=20 nothing to do with it. Regards, Jo=C3=A3o Citando joaoandreferro@sapo.pt: > Hello all, > > I'm trying to write a bash script that can handle my usage of (K)GDB. > It starts kdmx on one GNOME terminal, and then starts minicom on a > second terminal, and GDB on a third one. So far, so (more or less) > good. The thing goes tricky of course, when, after launching and > setting kdmx, minicom and GDB, I'll have to start and stop KGDB > execution many times, which means I will be sending "echo g > > /proc/sysrq-trigger" commands through minicom, perform some debugging > with GDB, send "cont" with GDB to resume execution, stop again, > perform some GDB commands, resume again, etc (the loop goes on). This > is achievable through a bash script? How can I specify that one > command goes to minicom and another one to KGDB? I understand that > maybe this doubt may not have to do with (K)GDB explicitly and is more > about bash scripting, but maybe there is some (K)GDB feature that I > don't know. I've been in the docs but haven't found anything on this. > My script goes below. > > 1. My bash script so far: > > #!/bin/bash > > cd /home/cloud/Desktop/Downloads/kdmx/ > ./kdmx -n -d -p/dev/ttyS0 -b115200 & > sleep 5 > gnome-terminal --window-with-profile=3DKGDB -e "minicom -o -w -p > /dev/pts/1 -S /home/cloud/Desktop/minicom.txt" > gnome-terminal --window-with-profile=3DKGDB -e cd > /home/cloud/Desktop/linux-2.6.32.4/ > gdb -write /home/cloud/Desktop/vmlinux -x /home/cloud/Desktop/script.gdb > > 2. minicom.txt: > > send > send > send su > send > send echo g > /proc/sysrq-trigger > > 3. script.gdb: > > set remotebaud 115200 > target remote /dev/pts/2 > set debug remote 1 > info reg $es > cont > > Regards, > Jo=C3=A3o