It seems that what I need is here:  
http://www.humbug.in/2010/utility-to-send-commands-or-data-to-other-terminals-ttypts/

I understand now the silliness of the original question, my ignorance  
on bash scripting put me searching for something on (K)GDB that has  
nothing to do with it.

Regards,
João

Citando joaoandrefe...@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=KGDB -e "minicom -o -w -p  
> /dev/pts/1 -S /home/cloud/Desktop/minicom.txt"
> gnome-terminal --window-with-profile=KGDB -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 <username>
> send <password>
> send su
> send <root_password>
> 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ão



------------------------------------------------------------------------------
_______________________________________________
Kgdb-bugreport mailing list
Kgdb-bugreport@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport

Reply via email to