mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-04 19:00:27 +02:00
DBG: Watches improved mem-dump for objects; improved pointers
git-svn-id: trunk@28978 -
This commit is contained in:
parent
8e04bd3d98
commit
b29a1ef5d5
@ -9650,8 +9650,8 @@ function TGDBMIDebuggerCommandEvaluate.DoExecute: Boolean;
|
|||||||
var
|
var
|
||||||
ResultInfo: TGDBType;
|
ResultInfo: TGDBType;
|
||||||
begin
|
begin
|
||||||
ResultInfo := GetGDBTypeInfo(expr);
|
FTypeInfo := GetGDBTypeInfo(expr);
|
||||||
Result := ResultInfo <> nil;
|
Result := FTypeInfo <> nil;
|
||||||
if (not Result) and StoreError
|
if (not Result) and StoreError
|
||||||
then FTextValue := '<error>';
|
then FTextValue := '<error>';
|
||||||
if not Result
|
if not Result
|
||||||
@ -9659,8 +9659,7 @@ function TGDBMIDebuggerCommandEvaluate.DoExecute: Boolean;
|
|||||||
|
|
||||||
if NoAddressOp
|
if NoAddressOp
|
||||||
then expr := QuoteExpr(expr)
|
then expr := QuoteExpr(expr)
|
||||||
else expr := QuoteExpr(AddAddressOfToExpression(expr, ResultInfo));
|
else expr := QuoteExpr(AddAddressOfToExpression(expr, FTypeInfo));
|
||||||
FreeAndNil(ResultInfo);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
@ -9754,7 +9753,7 @@ function TGDBMIDebuggerCommandEvaluate.DoExecute: Boolean;
|
|||||||
Result := PrepareExpr(AnExpression, True);
|
Result := PrepareExpr(AnExpression, True);
|
||||||
if not Result
|
if not Result
|
||||||
then exit;
|
then exit;
|
||||||
FTextValue := IntToHex(GetPtrValue(AnExpression, [], True), TargetInfo^.TargetPtrSize*2);
|
FTextValue := PascalizePointer('0x' + IntToHex(GetPtrValue(AnExpression, [], True), TargetInfo^.TargetPtrSize*2));
|
||||||
if LastExecResult.State = dsError
|
if LastExecResult.State = dsError
|
||||||
then FTextValue := '<error>';
|
then FTextValue := '<error>';
|
||||||
end;
|
end;
|
||||||
@ -9764,8 +9763,19 @@ function TGDBMIDebuggerCommandEvaluate.DoExecute: Boolean;
|
|||||||
if not Result
|
if not Result
|
||||||
then exit;
|
then exit;
|
||||||
|
|
||||||
|
Result := False;
|
||||||
Size := 256;
|
Size := 256;
|
||||||
ExecuteCommand('-data-read-memory %s x 1 1 %u', [AnExpression, Size], R);
|
if (FTypeInfo <> nil) and (saInternalPointer in FTypeInfo.Attributes) then begin
|
||||||
|
Result := ExecuteCommand('-data-read-memory %s^ x 1 1 %u', [AnExpression, Size], R);
|
||||||
|
Result := Result and (R.State <> dsError);
|
||||||
|
// nil ?
|
||||||
|
if (R.State = dsError) and (pos('Unable to read memory', R.Values) > 0) then
|
||||||
|
Size := TargetInfo^.TargetPtrSize;
|
||||||
|
end;
|
||||||
|
if (not Result) then begin
|
||||||
|
Result := ExecuteCommand('-data-read-memory %s x 1 1 %u', [AnExpression, Size], R);
|
||||||
|
Result := Result and (R.State <> dsError);
|
||||||
|
end;
|
||||||
MemDump := TGDBMIMemoryDumpResultList.Create(R);
|
MemDump := TGDBMIMemoryDumpResultList.Create(R);
|
||||||
FTextValue := MemDump.AsText(0, MemDump.Count, TargetInfo^.TargetPtrSize*2);
|
FTextValue := MemDump.AsText(0, MemDump.Count, TargetInfo^.TargetPtrSize*2);
|
||||||
MemDump.Free;
|
MemDump.Free;
|
||||||
|
Loading…
Reference in New Issue
Block a user