how to tell the debugger to redirect the debuggee's output to a file ? lazarus / 12-Debugger ---------------------------------------------------------------------- 440bx · 2018-07-28 20:46 Hello, basically what I'm trying to do is to debug a console program that would be started on the command line with its output redirected, i.e: TheProgram.exe > PutOutputHere how do I tell the debugger to redirect the debuggee's output (stdout) to the file "PutOutputHere" ? Thank you for your help. ---------------------------------------------------------------------- sash · 2018-07-28 22:51 Not related to debugging, but Menu -> Run -> Run Parameters -> Command line (without appname) "> out.txt" works for me. ---------------------------------------------------------------------- 440bx · 2018-07-29 03:04 Quote from: sash on July 29, 2018, 12:51:26 amNot related to debugging, but Menu -> Run -> Run Parameters -> Command line (without appname) "> out.txt" works for me. Thank you.  I tried that but, it didn't work for me.   My program sees the ">" and "out.txt" as command line parameters.  It was worth a try. Are you using a flavor of unix or Windows ? ---------------------------------------------------------------------- Martin_fr · 2018-07-29 17:45 Not tested: (unix /Mac only) Tools > Opiton > Debugger: Look through the property grid, there should be an option about "...Pty...". Try to put your filename there. This option is global. Not per project ---------------------------------------------------------------------- 440bx · 2018-07-29 18:30 Quote from: Martin_fr on July 29, 2018, 07:45:52 pmNot tested: (unix /Mac only) Tools > Opiton > Debugger: Look through the property grid, there should be an option about "...Pty...". Try to put your filename there. This option is global. Not per project Thank you Martin.  Maybe I didn't set the right field but, I didn't get any of those I tried to work.  I just added a little bit of code that is conditionally compiled to do the redirection "manually".  Not exactly elegant but, it serves the purpose.  It will do and it's easily re-useable Again, thank you. ---------------------------------------------------------------------- sash · 2018-07-29 20:06 Quote from: 440bx on July 29, 2018, 05:04:43 amI tried that but, it didn't work for me.   My program sees the ">" and "out.txt" as command line parameters. In Ubuntu Linux 18.04, simple console program Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i program console;begin  WriteLn('Params: ', ParamCount, ParamStr(1));  WriteLn('Press any key');  ReadLn;end. with given option creates a file "out.txt", and waits for to resume (I use View->Debug Windows-> Terminal Output for input) out.txt has following contents: QuoteParams: 0 Press any key ---------------------------------------------------------------------- 440bx · 2018-07-29 20:16 Quote from: sash on July 29, 2018, 10:06:24 pmQuote from: 440bx on July 29, 2018, 05:04:43 amI tried that but, it didn't work for me.   My program sees the ">" and "out.txt" as command line parameters. In Ubuntu Linux 18.04, simple console program Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i program console;begin  WriteLn('Params: ', ParamCount, ParamStr(1));  WriteLn('Press any key');  ReadLn;end. with given option creates a file "out.txt", and waits for to resume (I use View->Debug Windows-> Terminal Output for input) out.txt has following contents: QuoteParams: 0 Press any key I cannot make it work under Windows.  No matter what I do, it sees the redirection character and file to redirect to as command line parameters for the program.