Found the limit

Started by Mark Strickland, December 18, 2005, 12:15:43 PM

Previous topic - Next topic

Mark Strickland

It appears that my poject is so large there are some problems with compiling.  I get this error:

515   Fixup overflow - You have a jump short instruction that exceeds its maximum length.

The reference is to some internal FF code.

IF FF_nResult then FUNCTION = FF_nResult:EXIT FUNCTION

My guess is this is a PB limit not FF and has to do with the size of the code.

There may not be an answer for this other than break the application into more module which will be painful.

Any suggestions?

Thanks.

TechSupport

How big is your EXE ??? I wonder what the limit would be. Maybe you'll have to send the source over to PB Support and have them trace where the overflow occurs.

Mark Strickland

Paul,

I always have lots of empty functions in FF programs from double clicking on a control to get to the code screen.  It always creates a CHANGE function that I never use.  I get others by accidentially double clicking labels, etc.  I looked at the generated code and these empty functions end up compiled.    I went back and deleted several hundred of these (1000+ controls in the app counting labels, etc) and the program will now compile.

The problem has nothing to do with empty functions other than that saved enough space to allow the program to compile.  Below are the compile stats:

Compiler Results

            PowerBASIC Compiler for Windows
            PB/Win  Version 8.01
            Copyright (c) 1996-2005 PowerBasic Inc.
            Venice, Florida USA
            All Rights Reserved

            Primary source:  C:\RX\PPS32W\CODEGEN_RX32W_MAIN.bas   {286604 total lines}
            Target compilation:  C:\RX\PPS32W\Rx32W.exe
            Compile time:  13.9 seconds, at 1237139 lines/minute

            2429172 bytes compiled code, 48753 bytes RTLibrary,
            57932 bytes string literals, and 92460 bytes dgroup.
            Executable stack size:  1048576 bytes.
            Disk image: 2766336 bytes   Memory image: 199145 bytes.

I wonder if the error message (Fixup Overflow) is bogus.  Most of the references for this PB error message I see are for ASM code and short jumps over +/- 127 bytes (the limit for a short jump).  As I deleted empty functions the error moved to a different place in the FF generated code.  Almost every time it was a multi-line statement (with colons) and ended in an EXIT FUNCTION.

I will continue cleaning the code but I will probably hit the wall again before I am done.  Because of the fully integrated nature of this app I will have trouble segmenting it.

QUESTIONS:

1) If I wanted to adjust the stack size (#STACK) where would I put it?

2) If I need to send the source to PB to have them look at it what do I need to send?  I can I hand compile the source myself?

3) If I do need to segment the app can I put FF forms in a separate DLL?  Should I just create a new project and select DLL output and move the forms to that project?  Many of the forms access GLOBALS so I will have to find a way to work around that issue.

4) Any other space saving thoughts other than tighter code?

Thanks for any help.

Roger Garstang

I put things like STACK settings in the "General" section outside my functions and such where I place globals and other stuff needed like Types, etc.  To send to PB you'd send all the CODEGEN...  files and instructions with directory structure and that the MAIN file is the MAIN file.  Since it isn't DDT it tends to lose them, but at least you sent it...let them figure out SDK.

Mark Strickland

For those of you that are old enough or watch TV re-runs --- Windows is clearly on the edge of the Twilight Zone and some days on the "other side".

I believe I had some memory corruption/allocation issues with my compile problems recently.  On the same day but before the compile problem I enabled XP Theme support and all of my function key handling, done with a Keyboard Hook, would not work.  When I turned XP Themes on and off I exited the FF Designer as required.  When I turned it back off and recompiled again the function key processing worked properly.  It was after that and I added a substantial amount of code to the app the compile problem appeared.  I deleted the empty functions and finally got the app to recompile (but never rebooted).

Today I tested a very small app with the Keyboard Hook for function key processing and it worked with XP Themes enabled.  I recompiled my huge application and everything works with XP Themes enabled.

I guess I am out of "The Zone".

There were no other indications of issues but I did not follow my own "standard advice" --- reboot and try again.

Now if I could only get WinLift working in a Tabbed application in place of XP Themes --- a project for later.

Thanks to all that responded.

TechSupport

Quote from: Mark StricklandNow if I could only get WinLift working in a Tabbed application in place of XP Themes --- a project for later.
I know exactly how you feel. I am writing FireFly 3 and trying to use WinXP as much as possible during development. All of the Tab Controls look horrible especially when icons are used. I am now drawing the tabs myself by setting the TCS_OWNERDRAWFIXED style and handling the icon and text display in the Form's WM_DRAWITEM message. It is a bit of a hassle but it does give me more control over the display and eliminates the XP Themes from interfering.

Mark Strickland

Paul,

I just did the same on some tabs.  I paint a different color rectangles on each tab as it gets focus and also change the font to bold.  In one case I use a white font on a dark background.

I did not bother with ICONS.

I have 27 total tabs on two levels so I had to do something.

The good news is the code is isolated to one spot for each set of tabs.

Pretty cool that you are using FF to write 3.0.

Roger Garstang

I posted something here a while back from the CodeProject site or whatever it is called and it had details on using themed tabs.  I never got to do much with it, but I know it is possible.  ATI uses themed tabs in the display options with icons fine.  I beleive it is just runtime linking to the theme dll and doing a custom draw like you are doing and if themes are enabled then using the dll to draw the tab in the theme look instead of the default background.

I too have to admit that some latest patches or something has even got my Windows acting weird...seems they pull this before every major release of Windows so the next appears more stable and you buy it.  It is beginning to tick me off.