From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14247 invoked by alias); 5 Nov 2014 17:37:13 -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 14235 invoked by uid 89); 5 Nov 2014 17:37:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.2 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; Wed, 05 Nov 2014 17:37:10 +0000 Received: (qmail 8750 invoked by uid 0); 5 Nov 2014 17:37:07 -0000 Received: from unknown (HELO php05) (10.134.37.54) by relay2 with SMTP; 5 Nov 2014 17:37:07 -0000 Received: (qmail 8732 invoked by uid 64140); 5 Nov 2014 17:37:07 -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; Wed, 05 Nov 2014 17:37:07 +0000 Date: Wed, 05 Nov 2014 17:37:00 -0000 Message-ID: <20141105173707.Horde.YLsQWojsKNRsa4xuaCdSiA1@mail.sapo.pt> From: joaoandreferro@sapo.pt To: gdb@sourceware.org Subject: Doubt turning GDB commands into bash script User-Agent: Dynamic Internet Messaging Program (DIMP) PTMail 5.3.3 X-PTMail-Version: PTMail 5.3.3 X-PTMail-User: eyJpdiI6IkpFQlFKMTJ4U3JicjJMQTI1UEhpS1E9PSIsImQiOiJOYlVvSEJDazU4N3grYzVEbFRqTXVKUWVOTVR0cXJidEI0WWoxeW5OZU9nPSJ9 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/msg00005.txt.bz2 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