The only thing I can think if is stdin/out/err are not setup correctly when 
launched out of the debugger. How does your program get launched? From a 
terminal on the command line?

printf will call fprintf() under the covers with stdout as the file handle. 
Maybe "stdout" can be checked for NULL with an if statement in your code? The 
theory would be that "stdout" would be null when not run under the debugger, 
and would be with run in lldb?

> On Oct 7, 2019, at 3:40 PM, Peter Rowat via lldb-dev 
> <lldb-dev@lists.llvm.org> wrote:
> 
> 
> I have a simple C program that has printf statements.
> It produces zero output.
> However when it’s run under lldb, it prints correct output. How could this be?
> 
> I tried replacing the printf statements by “fprintf” to a file: same 
> behaviour -
>    no file created and no output, but under lldb, the file is created with 
> correct output data.
> 
> Peter R
> 
> 
> 
> 
> 
> 
> _______________________________________________
> lldb-dev mailing list
> lldb-dev@lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev

_______________________________________________
lldb-dev mailing list
lldb-dev@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev

Reply via email to