Debugger (I think)

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Templar
Posts: 51
Joined: Sun Apr 01, 2018 5:37 pm
DBs Used: DBF

Re: Debugger (I think)

Post by Templar »

edk wrote: Thu Apr 19, 2018 4:00 pm What does it mean that you are not able to control whether the debugger is activated or not :?:
During compilation, you decide if the debugger is to be attached to the program. There is no possibility that the debugger will be attached in a random way.

It seems to me rather a problem with runtime changed CP than with a debugger.
What does it mean? I honestly don't know!! :?
The strange part is that I am working on 3 different applications at the moment. One is the main program, one is its installer and one is its helpfile. They use several modules in common and each has some unique to itself. Today, the installer is compiling without the debugger, the main program and help are both compiling WITH the debugger. I am doing exactly the same operation for each of them. A few days ago, they were all compiling without the debugger and nothing radical has changed. All very odd.
Templar
Posts: 51
Joined: Sun Apr 01, 2018 5:37 pm
DBs Used: DBF

Re: Debugger (I think)

Post by Templar »

serge_girard wrote: Thu Apr 19, 2018 10:56 am Hi Templar,

I cannot help here. I don't use this debugging-tool. May I suggest the following 'trick' to do about the same:
At start of your program:

Code: Select all

SET PRINTER TO C:\somefolder\debug.txt
SET PRINTER ON 
SET CONSOLE OFF
// continue your program
? 'print your debug info'
// etc. continue your program

Thanks.  In fact becasue the Clipper debugger was never very effective I gave it up and sort of wrote error messages into my own program.  So the errors it finds are all very expected (my own mis-typing or other stupidity).  I too would like not to use the debugger but I can't see how to turn the uddy thing off! :?
edk
Posts: 909
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: Debugger (I think)

Post by edk »

How do you recognize if the debugger is included in the program or is not. Are you able to call the debugger window from the program at the moment when you think the program is with the debugger :?:
I mean, if you correctly assume that the debugger is responsible for the issue :idea:
Templar
Posts: 51
Joined: Sun Apr 01, 2018 5:37 pm
DBs Used: DBF

Re: Debugger (I think)

Post by Templar »

Good point! I will investigate that. Watch this space.... Templar
Templar
Posts: 51
Joined: Sun Apr 01, 2018 5:37 pm
DBs Used: DBF

Re: Debugger (I think)

Post by Templar »

This has become stranger and stranger!

Having been away from it for a while, I have now come back.

The first 70 lines of the program set variables, draw screens and check everything is ok. When I run the program, I end up with the screen looking like SreenA below: funny squiggles and wrong characters.

However, if I copy those same lines lines out and paste them as a program all on their own, I get what it should be (as in ScreenB).

And as if that isn't strange enough, when I came to HMG and started doing this conversion, about a month ago, it all worked fine and drew the screens as expected. It seems that somehow, some part of the program ( a part which it hasn't even called yet ) is setting a different character set.

How can that be? Templar
Attachments
ScreenB.jpg
ScreenB.jpg (16.12 KiB) Viewed 3297 times
ScreenA.jpg
ScreenA.jpg (19.33 KiB) Viewed 3297 times
Templar
Posts: 51
Joined: Sun Apr 01, 2018 5:37 pm
DBs Used: DBF

Re: Debugger (I think)

Post by Templar »

Hold on... Some progress

I tried insterting these lines into each program:
@5,3 say "Chr 205 is "+chr(205)
@7,3 say "Chr 204 is "+chr(204)
@9,3 say "Chr 185 is "+chr(185)
and the results are as shown on Screens C and D attached. Something is definitely changing the character set, although it isn't a function called by the program. This is even stanger! Templar
Attachments
ScreenD.jpg
ScreenD.jpg (25.08 KiB) Viewed 3297 times
ScreenC.jpg
ScreenC.jpg (18.53 KiB) Viewed 3297 times
edk
Posts: 909
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: Debugger (I think)

Post by edk »

Try to display characters 204, 205, 185 every few lines in the program and check at what point the character set is swapped.
#request, #include are the same in both prg?

Do you run both programs as standalone exe or do you run exe from the other?
Templar
Posts: 51
Joined: Sun Apr 01, 2018 5:37 pm
DBs Used: DBF

Re: Debugger (I think)

Post by Templar »

edk wrote: Tue May 01, 2018 5:52 am Try to display characters 204, 205, 185 every few lines in the program and check at what point the character set is swapped.
#request, #include are the same in both prg?

Do you run both programs as standalone exe or do you run exe from the other?
It doesn't change during the program. Right from the start, one produces one set of characters and the other one produces the other. They are both standalone.

But then I tried adding another line: @5,3 say "X is "+chr(X)
'X' has not been defined, so this causes a crash, and the messages I get are shown on screens E and F attached. When it has swapped the character sets, I get the full error message (as from the debugger) and when it hasn't swapped them, I don't.

All very odd. What can be going on?
Templar
Attachments
with standard ASCII character set
with standard ASCII character set
ScreenF.jpg (55.98 KiB) Viewed 3279 times
with "wrong" character set
with "wrong" character set
ScreenE.jpg (60.54 KiB) Viewed 3279 times
edk
Posts: 909
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: Debugger (I think)

Post by edk »

The message on Screen E does not come from the debugger. Both come from the Errorlevel subsystem. The one on screen E from HMG, and the one screen F from a pure harbour.
Do you have #include "hmg.ch" in all prg?

Do you compile programs in the same way every time, eg using only IDE or only via build.bat?
Templar
Posts: 51
Joined: Sun Apr 01, 2018 5:37 pm
DBs Used: DBF

Re: Debugger (I think)

Post by Templar »

AH, that's very useful about the error messages. Thanks for that.
No, I have never had #include "hmg.ch" is any programs. I just tried doing that and it didn't make any difference. Yes I always compile them the same way, using the HMG desktop and hitting "F5"!
Post Reply