Am 15.10.2010 19:58, schrieb And3mD:
Hello,
I found something I think can be problem with lazarus on win64:
True, using 32-bit wide Tag fields to store pointers is a bad idea on
x64. However, the problems with the debugger are more related to the use
of StrToIntDef instead of StrToInt64Def... (See attached file.)
Still, even when this is patch applied, debugging with an image base of
>32bit is not stable. Whenever I put a breakpoint on a writeln and I
single-step to the next statement, I get a segfault. But this may very
well be caused by GDB.
Cheers,
Willi
Index: gdbmidebugger.pp
===================================================================
--- gdbmidebugger.pp (revision 27526)
+++ gdbmidebugger.pp (working copy)
@@ -1641,7 +1641,7 @@
New(Disasm);
Disasm^.FileName := AFileName;
Disasm^.Line := ALine;
- Disasm^.Address := StrToIntDef(Unquote(InstList.Values['address']), 0);
+ Disasm^.Address := StrToInt64Def(Unquote(InstList.Values['address']), 0);
S := InstList.Values['func-name'];
if S <> FuncNameQ
then begin
@@ -1892,7 +1892,7 @@
then begin
Item := AsmList.Items[1];
InstList.Init(Item^.NamePtr, Item^.NameLen);
- AsmLine.Next := StrToIntDef(Unquote(InstList.Values['address']), 0);
+ AsmLine.Next := StrToInt64Def(Unquote(InstList.Values['address']),
0);
AddAsmLine(Addr, AsmLine);
end;
end;
@@ -4119,7 +4119,7 @@
S := GetPart(['at address ', ' at '], ['.', ' '], R.Values);
if S <> ''
then begin
- ExecuteCommand('-break-insert *%u', [StrToIntDef(S, 0)],
[cfIgnoreError], R);
+ ExecuteCommand('-break-insert *%u', [StrToInt64Def(S, 0)],
[cfIgnoreError], R);
if R.State = dsError then Exit(-1);
ResultList := TGDBMINameValueList.Create(R, ['bkpt']);
Result := StrToIntDef(ResultList.Values['number'], -1);
@@ -4243,7 +4243,7 @@
S := GetPart(['at address ', ' at '], ['.', ' '], R.Values);
if S <> ''
then begin
- FMainAddr := StrToIntDef(S, 0);
+ FMainAddr := StrToInt64Def(S, 0);
ExecuteCommand('-break-insert -t *%u', [FMainAddr], [cfIgnoreError],
R);
Result := R.State <> dsError;
if Result then Exit;
@@ -4255,7 +4255,7 @@
if not Result then Exit;
ResultList := TGDBMINameValueList.Create(R, ['bkpt']);
- FMainAddr := StrToIntDef(ResultList.Values['addr'], 0);
+ FMainAddr := StrToInt64Def(ResultList.Values['addr'], 0);
ResultList.Free;
end;
@@ -4353,7 +4353,7 @@
then begin
// We could not set our initial break to get info and allow stepping
// Try it with the program entry point
- FMainAddr := StrToIntDef(EntryPoint, 0);
+ FMainAddr := StrToInt64Def(EntryPoint, 0);
ExecuteCommand('-break-insert -t *%u', [FMainAddr], [cfIgnoreError], R);
TempInstalled := R.State <> dsError;
end;
@@ -4527,7 +4527,7 @@
and (TGDBMIDebugger(Debugger).FBreakAtMain = nil)
then begin
// Check if this BP is at the same location as the temp break
- if StrToIntDef(ResultList.Values['addr'], 0) =
TGDBMIDebugger(Debugger).FMainAddr
+ if StrToInt64Def(ResultList.Values['addr'], 0) =
TGDBMIDebugger(Debugger).FMainAddr
then TGDBMIDebugger(Debugger).FBreakAtMain := Self;
end;
_______________________________________________
fpc-devel maillist - [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel