This is listed in "Other known bugs"
forward referencing pointers generate debug info that appears as generic pointers; no information of `with' statements is currently given to the debugger; error in debug entries generated for objects
Is this the same as this problem:
type xptr = ^x_type; x_type = record stuff ... next : xptr; end; var xlist, x : xptr; begin new(xlist); xlist.next:=nil; ... x := xlist; repeat with x^ do begin new(next); x := next; until no_more_to_create;
At runtime: Program received signal SIGSEGV, Segmentation fault. Inside gdb: (gdb) print x[0] Attempt to dereference a generic pointer.
Obviously next can be "pointer" and xptr can be defined after x_type, but it is inconvenient to change code based on one of the building blocks of Pascal.
--Chris
Christopher Ferrall wrote:
This is listed in "Other known bugs"
forward referencing pointers generate debug info that appears as generic pointers; no information of `with' statements is currently given to the debugger; error in debug entries generated for objects
Is this the same as this problem:
I think so.
type xptr = ^x_type; x_type = record stuff ... next : xptr; end; var xlist, x : xptr; begin new(xlist); xlist.next:=nil;
^
... x := xlist; repeat with x^ do begin new(next); x := next; until no_more_to_create;
You're not setting the last next field to nil, so maybe that's causing the segfault later. But, of course, without real code, I can't tell.
Obviously next can be "pointer" and xptr can be defined after x_type, but it is inconvenient to change code based on one of the building blocks of Pascal.
If you can help fixing this bug, that's very welcome. Currently, the only person who is familiar with this code (Peter) is too busy ..
Frank
On Fri, 22 Jun 2001, Christopher Ferrall wrote:
This is listed in "Other known bugs"
forward referencing pointers generate debug info that appears as generic pointers; no information of `with' statements is currently given to the debugger; error in debug entries generated for objects
Is this the same as this problem:
type xptr = ^x_type; x_type = record stuff ... next : xptr; end; var xlist, x : xptr; begin new(xlist); xlist.next:=nil;
This line should read: new(xlist); xlist^.next:=nil;
... x := xlist; repeat with x^ do begin
Since there is no code here to end the loop replaced it with a for-loop. Also the begin does not have a matching end.
new(next); x := next;
until no_more_to_create;
At runtime: Program received signal SIGSEGV, Segmentation fault. Inside gdb: (gdb) print x[0] Attempt to dereference a generic pointer.
While I have not used gbd, with the changes above the program works. Increasing the size of the for-loop to force it to run out of heap and the program exits with a "out of heap" message. Conclusion: you are dereferencing a pointer but the dereference is in code you didn't supply.
Hope this helps Russ