Forum > Debugger

problem executting tprocess with fpdebug

(1/5) > >>

calebs:
Hello all!
I've tried to debug a program that uses tprocess to call another executable and with fpdebug always returns
"failed to execute : 50".
Switched to gdb and worked ok.
Is there an option to solve this or is a missing feature?
Thanks
i'll post the code below


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---    ejecutable:=ruta+ejecutablerece;    prog:=TProcess.CREATE(nil);    prog.Executable:=ejecutable;    prog.Parameters.Add('/ult');    prog.Parameters.Add(tc);    prog.Parameters.Add(pdv);    prog.options:=prog.options+[powaitonexit, poUsePipes];    prog.ShowWindow:=swoMinimize;    prog.Execute;                                     >> here gives error    comprob:='-1';                                          

Martin_fr:
I can not reproduce (trunk and 2.0.10).
I used gdb.exe for testing. And that is executed.

But there may be many factors.

That is an "project raised exception....failed to execute"?

Error 50, does not seem to point to it, but could it be that some libraries are missing? or the environment path differs?
Error 50 => "ERROR_NOT_SUPPORTED"

Anything else about the exe, that could depend on environment, permissions or the like?

bonmario:

--- Quote from: calebs on September 02, 2020, 11:09:16 pm ---Hello all!
I've tried to debug a program that uses tprocess to call another executable and with fpdebug always returns
"failed to execute : 50".

--- End quote ---

Same problem for me: Windows 10 64 bit, with Lazarus 2.1.0 r63602 FPC 3.2.0 i386-win32-win32/win64
Same project, with gdb works.

Hi, Mario

marcov:
Sounds like a working dir problem, executing with relative paths, and gdb changing workdir to exe dir, and fpdebug not or so?

Martin_fr:
FpDebug also set a working dir (as given by the IDE,but that seems to be the correct one / it can be changed in "run params")

But that would affect the app that then calls TProcess. That could lead to an incorrect Path, but then the error would/should be: file not found.

I also just created a new user account on my system, without any admin privileges. But even then, I was able to start a new app with TProcess.

So without any additional info, I cannot do much about this.

Navigation

[0] Message Index

[#] Next page

Go to full version