On Tue, Feb 25, 2025 at 08:28:34PM +0100, Samuel Thibault wrote:
> Hello,
> 
> Zhaoming Luo, le mar. 25 févr. 2025 21:14:14 +0800, a ecrit:
> > The program './runtests.pl -g 546' stopped at [0] several times before
> > the test is really running, so I think some preparations involved
> > io_select_common. However, after the test is running, I set a breakpoint
> > at [1](it's like playing pingpong between two gdbs :-)). The test still
> > stops at [0] several times, so I think it's quite hard to find which
> > EINTR caused the failure.
> 
> Hard doesn't mean impossible, just not trivial ;)
> 
> Remember that you can e.g. put printfs inside pfinet, so you can see
> them intermixed with the printfs from your program. In the end it's not
> that inconvenient compared to gdb.

I don't think it works, first I tried to add a printf in
io_select_common() but I didn't see the content of printf in output. I
gave it a try with the hello translator:

In trivfs_S_io_read:
```
else if (! (cred->po->openmodes & O_READ))
  return EBADF;

+ fprintf (stdout, "HIIIII\n");
/* Get the offset. */
op = cred->po->hook;
if (offs == -1)
  offs = op->offs;
```

Attach it to a node and `cat /tmp/hello`. I didn't see the output of the
fprintf.

Best,
Zhaoming
> 
> (Yes, some people will shout loudly that "printfs is not debugging tool".
> They probably never debugged an embedded or kernel system)


Reply via email to