Hi, while simulating a XC164, I can run and step through the disassembly window, but the debugger is unable to show me the correct line within the correct file. Instead it shows me another line in another file, which does not allow stepping correctly! Can this come from a special architecture of the source files? I explain : I have retrieved public-domain mrforth source files. These files are not organised in an academic way. Indeed, there is only one main C file, and all other files (both .h and .c) are just included at the top of it. Could this make Microvision get lost? How could I do to properly debug the source?
what is the optimization level?
Erik
Indeed, there is only one main C file, and all other files (both .h and .c) are just included at the top of it.
That's quite universally a Bad Idea. That it can cause problems like this:
Could this make Microvision get lost?
is actually just the least of your worries. As a general use, don't put definitions of anything into files that you're going to #include anywhere.
How could I do to properly debug the source?
Fix that messed-up modularization.
I am aware that this modularization is poor, but the code is not mine, and before rearranging it I need to understand it, which is easier while debugging. Thus, I would rather need a way to have the Microvision debugger work even on this code. Is there a way to achieve this?
No.
Because the debug information assumes that file.c compiles to file.obj - so the line number information relates to just file.c
If file.c includes otherfile.c, this messes things up!
You might be able to get around this by just preprocessing file.c to (typically) file.i, and then compiling file.i to file.obj - so that the debug line number information will relate to file.i (not file.c).
It is left as an exercise for the student to determine how to select "pre-process only" in the C166 compiler...