Page 2 of 2

Re: Bug in MPLab-C18 standard libraries?

PostPosted: Thu May 15, 2003 12:31 am
by gerardlt
Hi Andrew,

Sorry it's taken a while to reply, it was getting a tad late here, and I'm trying to avoid all night debugging sessions. :-)

quote:

I must apologize for the gruffness of my previous response

That's ok. I might have been mistaken.

Problem re. MPLab versions seems a bit tricky.
I'll have a play around with compiler/linker options and see what happens. I think my time zone is ahead of yours, so I should have a few hours to muck around before you get this.

Many regards,

------------------
Gerard Thornley
Electron Software

[This message has been edited by gerardlt (edited May 15, 2003).]


Re: Bug in MPLab-C18 standard libraries?

PostPosted: Thu May 15, 2003 1:37 am
by gerardlt
Well, when I added the msgq.c file to my project, it compiled correctly.

My guess is that I haven't set some options correctly, but there's obviously a workaround here somewhere.

I wonder if you could email my project back to me with the file included, so I can compare with my results.

Regards,

------------------
Gerard Thornley
Electron Software


Re: Bug in MPLab-C18 standard libraries?

PostPosted: Fri May 16, 2003 12:09 am
by aek
Hi Gerard.

I have found the problem with MPLAB-C18 v2.20 and Salvo ... it's in the procedural abstraction optimization.

Specifically, if the Salvo context switcher OSCtxSw() is procedurally optimized, the code dies. See my post at microchip's dev tools forum for more info.

For now, MPLAB-C18 v2.2 Salvo users must apply the -Opa- switch to all source files that contain calls to OSCtxSw(), i.e. all source files with Salvo tasks in them.

------------------

[This message has been edited by aek (edited May 16, 2003).]


Re: Bug in MPLab-C18 standard libraries?

PostPosted: Fri May 16, 2003 12:57 am
by aek
Hi Gerard.
quote:
Well, when I added the msgq.c file to my project, it compiled correctly.
Are you running MPLAB-C18 v2.1 or v2.2?

My tests with v2.1 showed the same problem. My tests with v2.2 solved the problem, but introduced the problem of the procedural abstraction optimization (enabled by default) -- see SB-17 for more info.

Regards,

------------------


Re: Bug in MPLab-C18 standard libraries?

PostPosted: Fri May 16, 2003 2:43 am
by gerardlt
As reported from the compiler: MPLAB C18 v2.10(demo)

I would hope the demo is no different from the full version, but there's no knowing...

I've got a full version 1.10 (I hope the 2.20 upgrade will work on that), which I've been holding off installing since your report of problems.

Given that we now have a workaround, I'll probably go ahead and install that. Since I've been able to work productively with the existing compiler, I could continue with it until I can identify the reason the problem disappeared if that would be helpful?

With respect to:

quote:
the source-level debugging seems to be off in MPLAB -- one jumps to places that clearly aren't correct while single-stepping the code.

are you sure this wasn't caused by the optimiser? I had some really wierd things happen this afternoon with source-level debugging, which turned out to be optimisations. I also discovered that MPLab allows one to change the compiler settings when "Use Alternate Settings" is checked, and then silently ignores the changes.

Regards,

------------------
Gerard Thornley
Electron Software


Re: Bug in MPLab-C18 standard libraries?

PostPosted: Fri May 16, 2003 7:26 am
by aek
Hi Gerard.

Well, I don't understand why it "cleared up" in your installation whereas in mine the bank bug remained until I upgraded to v2.20. Maybe I missed something in the process ...

As you know, all of MPLAB-C18's upgrades have been free (which is nice). The only problems I see with v2.20 so far are the procedural abstraction problem (use -Opa- on all files that have Salvo tasks in them) and it appears that va_arg is broken in v2.20.

Yes, it would be helpful if you might identify how the problem disappeared. I don't like "hanging, mysterious" explanations.

The wierdness in debugging is almost certainly due to the optimizer. For reasons unknown to me (marketing?), MPLAB-C18's defaults to having its optimizations all ON. Most compilers play it safe and default to OFF. So that's probably what I was seeing ...

------------------


Re: Bug in MPLab-C18 standard libraries?

PostPosted: Fri May 23, 2003 9:30 am
by gerardlt
Hi Andrew,

Here's a curious fact regarding the "CLRF 0x17,1" bug.

When I removed the msgq.c in my project's src directory from the project, and added the one from salvo's src directory, the bug manifested itself. When I switched back to the one in my project's src directory it disappeared.

I suspect it may have something to do with the relative directory names in my include path. Or maybe it's the phase of the moon... :-)

------------------
Gerard Thornley
Electron Software