This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug gdb/16813] New: documentation: run& and run >


https://sourceware.org/bugzilla/show_bug.cgi?id=16813

            Bug ID: 16813
           Summary: documentation: run& and run >
           Product: gdb
           Version: 7.7
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: dilyan.palauzov at aegee dot org

The node "Running > Your Program's Input and Output" suggests to call
  run > stdout
in order to redirect the standard output to a file.

The node Stopping > "Stopping and Starting Multi-threaded Programs" >
"Background Execution" says to call "run &" when one wants to start a program
in the background.

What shall one type, in order to run a program in the background and redirect
the standard input at the same time:
 run > stdout &
or
 run & > stdout
?

The first option is the answer, but this does not get clear by reading the GDB
manual.

The further, node Invocation > Invoking GDB, states

   You can optionally have 'gdb' pass any arguments after the executable file 
   to the inferior using '--args'.  This option stops option
   processing.
     gdb --args gcc -O2 -c foo.c
   This will cause 'gdb' to debug 'gcc', and to set 'gcc''s command-line  
   arguments (*note Arguments::) to '-O2 -c foo.c'.

For me this means, that calling
  gdb --args prog > stdout
would redirect the output from prog to the file stdout, but on my system  the >
sign has to be escaped to achieve this result.
  gdb --args prog \> stdout

Please add to the GDB manual, after the paragraph above something like

  To pass a redirection of the standard output for a program, put a slash
  before the > sign, like in
     gdb --args gcc -O2 -c foo.c \> gcc-out
  otherwise the whole output of gdb (including the invoked program) will 
  be redirected.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]