public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Does logging work with fifo?
@ 2019-01-22  5:15 Peng Yu
  2019-01-22 20:06 ` Sergio Durigan Junior
  0 siblings, 1 reply; 2+ messages in thread
From: Peng Yu @ 2019-01-22  5:15 UTC (permalink / raw)
  To: gdb

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?

Thanks.

-- 
Regards,
Peng

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Does logging work with fifo?
  2019-01-22  5:15 Does logging work with fifo? Peng Yu
@ 2019-01-22 20:06 ` Sergio Durigan Junior
  0 siblings, 0 replies; 2+ messages in thread
From: Sergio Durigan Junior @ 2019-01-22 20:06 UTC (permalink / raw)
  To: Peng Yu; +Cc: gdb

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/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-01-22 20:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-22  5:15 Does logging work with fifo? Peng Yu
2019-01-22 20:06 ` Sergio Durigan Junior

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).