NO

Author Topic: Cannot debug easily  (Read 4026 times)

Grincheux

  • Guest
Cannot debug easily
« on: May 12, 2021, 09:51:24 AM »
Yestirday I installed W10 and Pelles tools.
When I debug the program the breakpoints are not on the good line and I must show the dissassembly code to know what is the current line.

Can someone help me?

Offline Vortex

  • Member
  • *
  • Posts: 865
    • http://www.vortex.masmcode.com
Re: Cannot debug easily
« Reply #1 on: May 12, 2021, 10:45:24 AM »
Hi Grincheux,

Did you specify the /Zd option? Checking the options provided by Poasm :

Code: [Select]
/Zd                 Enable line number debugging information
Code: [Select]
\PellesC\bin\poasm /AIA32 /Zi /Zd Window.asm
\PellesC\bin\polink /SUBSYSTEM:WINDOWS /LIBPATH:\PellesC\Lib\Win /DEBUG /DEBUGTYPE:COFF Window.obj kernel32.lib user32.lib

Code it... That's all...

Grincheux

  • Guest
Re: Cannot debug easily
« Reply #2 on: May 12, 2021, 01:57:06 PM »
In the dialog box for the assembler I selected

Debug Informations : FULL
and for the linker
Debugging informations: "Pelles C Format"

It is the first time I have that kind of problem with PoAsm
I have no anti-virus and my pc is clean.
In fact I have copied the folder WiW to WiW and renamed the files.
I join my project.
If I debug WiW no problem.

I would like to ask you if the command "CINCLUDE" could be used win windows.h and others.

If you knew how many messages I would like to post with the tile "Help Vortex"!

Grincheux

  • Guest
Re: Cannot debug easily
« Reply #3 on: May 12, 2021, 02:04:16 PM »
Here is the screen shot

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Re: Cannot debug easily
« Reply #4 on: May 12, 2021, 06:17:30 PM »
Do you use the POIDE editor or use another one?
Seems the same problem as when you copy your posts...
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

Grincheux

  • Guest
Re: Cannot debug easily
« Reply #5 on: May 12, 2021, 07:47:14 PM »
I use PoIde

Grincheux

  • Guest
Re: Cannot debug easily
« Reply #6 on: May 12, 2021, 08:41:34 PM »
I have not done anything and that is OK! :-\ :-\ :-\ :-\ :-\

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Re: Cannot debug easily
« Reply #7 on: May 12, 2021, 09:54:21 PM »
Have you modified/removed comments in the file or in includes?
Sometime under undefined circumstances the handling of comments fools the compiler that emits wrong debug line numbers.
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

Grincheux

  • Guest
Re: Cannot debug easily
« Reply #8 on: May 12, 2021, 10:32:33 PM »
I have just included sqlite3.lib in the dialogbox for the linker.
I have created a new C file for the project
That's all

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Re: Cannot debug easily
« Reply #9 on: May 12, 2021, 11:00:21 PM »
I have just included sqlite3.lib in the dialogbox for the linker.
I have created a new C file for the project
That's all
Something has influenced the line number counting.
This is a subtle bug, never completely removed.
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: Cannot debug easily
« Reply #10 on: May 15, 2021, 08:42:29 PM »
Short answer:
This is a (corner case) problem in the assembler. Until it's fixed, you can do the following:
Append a comment line to WiW2.inc. Any comment will do, as long as the file doesn't end with a number without radix etc.

Longer answer:
Sometimes the assembler needs to peek at the following character(s). This is done by reading character(s) from the file
and then pushing them back to a buffer, which is inspected first when reading the next time.

There is also a "stack" structure for files (real and virtual), where a newly opened file is "pushed" and later "popped"
when EOF is reached. Same story for the main file and included files.

(You can see where this is going, right?)

Peeking at the very end of an included file will pop this file, and the peeked character will be pushed on the file now
at the top of the stack. Normally not a big deal, except when one of the characters is a new-line character which means
this file suddenly has a new "hidden" line, pushing the remaining lines down (in terms of line numbers).


/Pelle