Waldek Hebisch wrote:
Adriaan van Os wrote:
Waldek Hebisch wrote:
BTW: if the same happens with standalone program (without modules) I should be able to reproduce it.
Sorry, not clear to me what you mean.
I have build a cross-compiler targetting Mac OSX. However, I do not have the complete toolchain (only bare compiler). Without full toolchain I can not compile RTS (the problem really is configure) and also I can not compile anything using GPC module.
If you have a testcase which does not use GPC module (directy or indirectly) I should be able to compile it. In fact, if a program uses no extra modules (units) at all debugging becomes easier.
I have tried the cross-compiler on various test programs and ATM it happily produced stabs debug info.
OK, I understand, I will look for a testcase (or try to isolate the problem).
Some observations:
- the problem does not occur when running gpc directly rather than
with make, even when passing the same compiler switches (this sounds like random behaviour and makes me think there is an uninitialized variable somewhere in the compiler source code)
- the problems disappears when I remove Turbo3 from the USES
clause in aturbo3test.pas
- the problem persists when I reduce the Turbo3 unit to nothing but
import
System (MemAvail => System_MemAvail, MaxAvail => System_MaxAvail);
Will try to further narrow this down in units/System.pas.
The problem disappears when I change
type PMemList = ^PMemList;
to
type PMemList = ^Pointer;
in the function MemAvail in units/system.pas. I think that explains it. Apparently the stabs symbol generator doesn't like the
type PMemList = ^PMemList
declaration.
Regards,
Adriaan van Os
Adriaan van Os a écrit:
The problem disappears when I change
type PMemList = ^PMemList;
to
type PMemList = ^Pointer;
in the function MemAvail in units/system.pas. I think that explains it. Apparently the stabs symbol generator doesn't like the
type PMemList = ^PMemList
Indeed. What does this mean: a type is a pointer to himself
In a rather old version of gpc I found
type PMemList = ^TMemList; TMemList = record Next : PMemList end;
Which makes sense for me. But this change has survived for many versions.
Maurice
Maurice Lombardi wrote:
Adriaan van Os a écrit:
The problem disappears when I change
type PMemList = ^PMemList;
to
type PMemList = ^Pointer;
in the function MemAvail in units/system.pas. I think that explains it. Apparently the stabs symbol generator doesn't like the
type PMemList = ^PMemList
Indeed. What does this mean: a type is a pointer to himself
It's just a place-holder for the MemAvail kludge. (Actually, the allocated memory is usually bigger than the declared size, and it's allocated with GetMem, not New. Usually GetMem is not recommended, but since these functions actually deal with memory size, GetMem seems more appropriate than, say, a schema type.)
In a rather old version of gpc I found
type PMemList = ^TMemList; TMemList = record Next : PMemList end;
Which makes sense for me.
Actually it's hardly different from the original type. Regularly, you can do just the same with both -- build lists (or graphs with at most one child per node) with no additional info.
But this change has survived for many versions.
AFAIR, the current definition didn't work with GPC when the function was originally written, therefore the record. But AFAIK, the current definition is valid Pascal, so I changed it sometime.
Frank
Frank Heckenbach a écrit:
Maurice Lombardi wrote:
type PMemList = ^PMemList
Indeed. What does this mean: a type is a pointer to himself
AFAIR, the current definition didn't work with GPC when the function was originally written, therefore the record. But AFAIK, the current definition is valid Pascal, so I changed it sometime.
Right. I should have read a pointer to a variable which has the same type as himself.
Maurice