public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Sergio Durigan Junior <sergiodj@redhat.com>
To: Peng Yu <pengyu.ut@gmail.com>
Cc: "gdb\@sourceware.org" <gdb@sourceware.org>
Subject: Re: Does logging work with fifo?
Date: Tue, 22 Jan 2019 20:06:00 -0000	[thread overview]
Message-ID: <871s541mqa.fsf@redhat.com> (raw)
In-Reply-To: <CABrM6wm-R87+SWvqys6QBQNaF1D0OXtDfoRrTgRzQNW3N0D4pw@mail.gmail.com>	(Peng Yu's message of "Mon, 21 Jan 2019 23:15:22 -0600")

On Tuesday, January 22 2019, Peng Yu wrote:

> I use the following command in the batch mode to print out the
> backtrace information.  /tmp/tmp.TNLBr685Zp is a fifo.
>
> ###
> set logging redirect
> set logging file /tmp/tmp.TNLBr685Zp
> set logging on
> commands 1-2644
> backtrace 2
> continue
> end
> run
> ###
>
> While the gdb process runs in the background (via & in shell), the
> fifo is catted (via the command cat) and piped (via pipeline '|' in
> shell) to a following process for reading and processing the logging
> output. However, it seems that sometimes it finishes prematurely. I
> have no clue what the problem is. Could it be that logging does not
> work well with fifo?

Initially I don't see a reason why this shouldn't work.  I did a very
basic test here and didn't find any problems, but it seems you have a
massive number of breakpoints and the generated output is much more than
I was able to generate.  What I did here was run a "while 1" command,
print a backtrace, and send all the output to the fifo.  No problems.

When you say that it "sometimes finishes prematurely", I assume that
it's not every time, correct?  Did you try running GDB from another
terminal, instead of running it in the background, to see if there's
anything happening there?

Thanks,

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/

      reply	other threads:[~2019-01-22 20:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-22  5:15 Peng Yu
2019-01-22 20:06 ` Sergio Durigan Junior [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871s541mqa.fsf@redhat.com \
    --to=sergiodj@redhat.com \
    --cc=gdb@sourceware.org \
    --cc=pengyu.ut@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).