Page 1 of 1
[PB5.22LTSX86] Problem with debugger to Exe
Posted: Tue Mar 25, 2014 2:55 pm
by Falko
Sorry for this link in germany, but freak can read this
http://forums.purebasic.com/german/view ... 9d#p321319
My curl-program, if compiled to an exe with "debug" in every lines, makes problems for me.
it seems, into the exe are all lines with debug erased.
is it a bug?
(sorry my english, i hope you understand this)
Regards,
Falko
Re: [PB5.22LTSX86] Problem with debugger to Exe
Posted: Tue Mar 25, 2014 3:00 pm
by Shield
Well, of course the "Debug foo" lines are excluded from the final exe (i.e. without debug information).
That's how it has always been and I'm sure it's mentioned in the help.
Re: [PB5.22LTSX86] Problem with debugger to Exe
Posted: Tue Mar 25, 2014 3:09 pm
by Falko
Okay, you're right. In the help it is. This is me before never noticed until now.

Fred could just remove the command "debug" for the exe instead of a functioning line yet. But it seems not to go, I think.
Translated with google
Re: [PB5.22LTSX86] Problem with debugger to Exe
Posted: Tue Mar 25, 2014 3:18 pm
by Shield
Well, it does make sense to remove the entire line. Of course there are some arguments
against that behavior, but I'd say it's safer to remove the entire line than to risk
having debug code in the final executable.
Also, to change this in PB would break way too many sources.
Re: [PB5.22LTSX86] Problem with debugger to Exe
Posted: Tue Mar 25, 2014 3:33 pm
by PB
> Fred could just remove the command "debug" for the exe instead of a functioning line
No, because that breaks apps. The following would give a syntax error for line 4:
Code: Select all
OpenWindow(0,200,200,200,100,"test",#PB_Window_SystemMenu)
Repeat
ev=WaitWindowEvent()
Debug ev
Until ev=#PB_Event_CloseWindow
Don't use Debug for actual code. Use it to display debug info, as intended.
Re: [PB5.22LTSX86] Problem with debugger to Exe
Posted: Tue Mar 25, 2014 7:19 pm
by Falko
But here you can remove the entire line of the compiler because it makes no sense
to leave alone a variable.
I can already imagine that the compiler could distinguish whether a variable or a command is checked with debug.
Otherwise, I mus agree with you.
(translate with google)
Re: [PB5.22LTSX86] Problem with debugger to Exe
Posted: Wed Mar 26, 2014 5:46 am
by Shield
So...
Code: Select all
CompilerIf #PB_Compiler_Debugger
Macro DebugAny
Debug
EndMacro
CompilerElse
Macro DebugAny
EndMacro
CompilerEndIf
Procedure.i Foo()
PrintN("Test")
EndProcedure
Define var.i = 10
DebugAny OpenConsole()
DebugAny Foo()
Debug 10
Debug var
Input()
Add 'DebugAny' as a custom keyword and you're all set.
Re: [PB5.22LTSX86] Problem with debugger to Exe
Posted: Wed Mar 26, 2014 9:09 pm
by Falko
Hehe...
Thank you for the virtual Debugger

.