Re: How to run gdbserver and gdb in two different windows?

Ronaldo Ferreira de Lima <[email protected]>
Newsgroups gmane.comp.gnu.screen.user
Message-ID <20141228011952.GA1128@textmode>
On Fri, Dec 26, 2014 at 03:01:49PM -0500, jenia.ivlev wrote:
[...]
> I can't get it to work the way I want to.
> 
> So let me say exactly what I want to do.
> I want to write a bash script that will:
> 
> 1. I'm in screen right now.
> 2. I want to create a new window with a shell. if I had to
>    press it on the keyboard it would be `C-a c`
> 3. I want to start a program in that window
> 4. I want to be able to nagivate to that window, from the first screen
>    window by pressing `C-a "` and up/down and enter.
> 
> 
> How do I achieve this?
> 
> 1. I tried:
> 
>     /usr/bin/screen -S gdbserver gdbserver port:1234 editor
> 
> This simply run the process in the current window without even renaming
> it.
> 
> 2. I tried: 
>   
>     /usr/bin/screen -dmS gdbserver gdbserver port:1234 editor
> 
> This runs a process somewhere in the background. I need it to be in this
> screen session. I want to be able to navigate to it if I need to.
> 
> 
> So again, how do I simply run screen (from the shell) and tell it to
> create a new window, in the screen session where I 
> am right now, and run a program in that newly created window?
> 
> Thanks in advance for your kind help and time
> Jenia

I think that I undestand. Normaly I use a procedure like:

    screen -t gdbserver       
    screen -p gdbserver -X $'gdbserver port:1234 editor\n'
    screen -t gdb
    screen -p gdb -X $'gdb\n'

[]'s
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.