NO

Author Topic: [solved] Debugger- bar disalignment to source code  (Read 5213 times)

pointercrash()

  • Guest
[solved] Debugger- bar disalignment to source code
« on: August 12, 2009, 09:32:11 PM »
Hi Pelles- Community,

hope someone can help me, i've wasted this day on that:
The Problem
This morning i changed some lines of a module (and the depending modules, too). Since that the debugger highlights one line above in the module than it should. Means, at the entry point of a function (entered with F11) the comment line above the header is highlighted. Furthermore nothing works as usual: No variable highlighting, toggling of breakpoints fails. Vice versa i can't set breakpoints in the source or some of them are remarked (and deactivated) as set on unexecutable code at start of debugging.

Strange somehow, this fails only in one module, if i include 3 modules in main Zk.c, D2.c and Global.c, i get a behavior like this:
Code: [Select]
printf("from Zk: %d\n", ZkDummy(6,9)); // works
printf("from d2: %d\n", D2Dummy(3,9)); // works
printf("from global: %d\n",GlobalDummy(5 ,8)); // fails
printf("from Zk: %d\n", ZkDummy(6,9)); // works
printf("from global: %d\n",GlobalDummy(5 ,8)); // fails
printf("from d2: %d\n", D2Dummy(3,9)); // works
But i can't find sth. wrong or critical in that "evil" module. The only obvious difference is that "Global.c" includes a static library (compiled with speed optimization), but this was no problem some source changes before.

The Settings:
- Compiler+Assembler: Full debug code, no optimizations
- Linker with codeview+COFF

What i've tried:
- This problem basically came up with Pelles 5.0.1, i've upgraded to the actual Pelle 6.xx -> No FX
- Rebuilt the project from source -> No FX
- Changed OS (W2K->XP) -> No FX
- Changed PC -> No Fx
- Replayed the source -> the problem disappears -> No Solution

But one change in the globals.c forces 5 .. 50 lines changed in other modules, it's very difficult to get it step by step and i HAVE to change some things in the source.

So, i don't know what's up, is it a bug or my ignorance - i can't debug that module properly, which was emergently needed.

Any hints? Thanks for every little help!

Best regards
« Last Edit: August 14, 2009, 04:13:09 PM by pointercrash() »

Offline AlexN

  • Global Moderator
  • Member
  • *****
  • Posts: 394
    • Alex's Link Sammlung
Re: Debugger- bar disalignment to source code
« Reply #1 on: August 12, 2009, 10:13:58 PM »
Have you changed the source-code with poide or an external editor?

An external editor writes perhaps wrong EOL. CR (0x0d) or LF (0x0a) instead of CR+LF. The IDE show mayby shows such an code correct but the debugger gets confused.
best regards
 Alex ;)

pointercrash()

  • Guest
Re: Debugger- bar disalignment to source code
« Reply #2 on: August 12, 2009, 10:28:45 PM »
Have you changed the source-code with poide or an external editor?
Nope, i even copied to clipboard, deleted that file, removed it from project, generated a new file with the IDE, pasted from clipboard, saved and re- added it into project.

Sorry, no FX  :(

JohnF

  • Guest
Re: Debugger- bar disalignment to source code
« Reply #3 on: August 13, 2009, 06:05:07 PM »
I've seen this too but don't know what the cause is.

John

pointercrash()

  • Guest
Re: Debugger- bar disalignment to source code
« Reply #4 on: August 13, 2009, 07:43:02 PM »
So i tried to slim down my source, keeping the error alive. This worked until i kicked a header file with a needed prototype and reincluded it.
From then i could restore (with undo) the source to the last compilable level, but the error didn't appear again, still being far, far off from restauration of the entry source.

Simply uncommenting and reactivating the header didn't help my application, there still remains a difference - but which one?

Does it ring a bell?


JohnF

  • Guest
Re: Debugger- bar disalignment to source code
« Reply #5 on: August 14, 2009, 10:25:28 AM »
The problem always seems to be in code I've gotten from somewhere else, never my own. For example the following

Code: [Select]
#define  DECNUMDIGITS 38
#include "decNumber.h"
#include <stdio.h>

causes the debugger to be on the the wrong line. By rearranging the headers like so

Code: [Select]
#include <stdio.h>
#define  DECNUMDIGITS 38
#include "decNumber.h"

The debugger gets it right.

John

pointercrash()

  • Guest
Re: Debugger- bar disalignment to source code
« Reply #6 on: August 14, 2009, 03:44:56 PM »
The problem always seems to be in code I've gotten from somewhere else, never my own. For example the following ... causes the debugger to be on the the wrong line. By rearranging the headers like so ... the debugger gets it right.

John
Yesss Sir, this helped!!
Rearrangig the include sequence worked only in case where the foreign code was included as the last one.
Btw., the foreign code was a linux text file but it made no difference as i converted it into windows format (with CRLF).

Still weird somehow ;), but now i can continue to work.

Thanx a million, John!