Can you tell me how to change poDebugOnlyThisProcess ? i've changed the code in components\fpdebug\fpdbgwinclasses.pas and recompiled all lazarus but it keeps giving error 50.
That is exactly what I did. This is the only occurrence of poDebugProcess. And that I changed. Rebuild and done.
And searching gdb sources shows they use that flag too. Under some condition they use both together? But not sure when.
They also use CreateNewProcessGroup.
I have only searched the keywords in gdb, I have not studied the code around them.
If you cross compile to 32 bit, then you should get the exact same results, as if you compile in a 32 bit IDE. Its just the IDE that differs.
At least if you download the cross compiler add on from the lazarus download. => Because the lazarus-2.0.12-fpc-3.2.0-cross-i386-win32-win64.exe is really a native 32 bit fpc in disguise. It has just been renamed to be found as cross compiler.
But you can even go one step further. Install (or keep installed) the 32 bit compiler. Tools > Option: point to the 32 bit compiler (no cross compiling).
Your 64 bit IDE will compile all apps to 32 bit (you do NOT even have to change the targed in Project-Options, you keep it empty/default).
Only to rebuild the IDE, you need to then change back to the 64 bit fpc.
And of course any package in the IDE will be 64 bit, but in your app that package will be 32 bit. So that only matters if you write your own packages for the IDE.
Not saying I want to force you to a 64bit IDE. I would be happy to fix that do whatever extend is possible.
But currently I am not sure where to look....
On my tests, when the 64 bit app failed to launch, there was no event that Windows sent to FpDebug. So there was no answer from fpdebug that could have affected it.
It was simply that a debugger was attached in WOW64 mode. (32 bit on 64 bit OS)
You can add
-dDebuglnWinDebugEvents
and run the ide with
--debug-log=c:\file.log
it and I can see if I can spot something.
(If it compiles also uncomment all calls to "//DumpEvent" in fpdbgwinclasses.pas . BUt only if it compiles)
You can try to start without debugger, and attach (before the external process is launched). Just to see if it makes any diff....
But even if...
Again: You checked your gdb (with witch you said it worked) is actually 32 bit ?
While debugging, in the taskmanager it has the "(32bit)" suffix?