mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-26 01:23:10 +02:00
FpDebug: Cleanup of several issues introduced in r63899 #539c1f9a2b, in which a lot more was committed then planned. Among others utility functions to allow calling functions with parameters. The ability to set the value of (regvar) variables and some minor bug-fixes. As part of the parameter-support, addresses located in a register are not immediately read and converted to constants anymore. But the location of the actual register is stored. This might have unforeseen side-effects
git-svn-id: trunk@63900 -
This commit is contained in:
parent
539c1f9a2b
commit
566610a9ba
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -1460,6 +1460,7 @@ components/fpdebug/app/fpdserver/fpdserver.lpi svneol=native#text/plain
|
|||||||
components/fpdebug/app/fpdserver/fpdserver.lpr svneol=native#text/plain
|
components/fpdebug/app/fpdserver/fpdserver.lpr svneol=native#text/plain
|
||||||
components/fpdebug/app/fpdserver/readme.txt svneol=native#text/plain
|
components/fpdebug/app/fpdserver/readme.txt svneol=native#text/plain
|
||||||
components/fpdebug/fpdbgavrclasses.pas svneol=native#text/pascal
|
components/fpdebug/fpdbgavrclasses.pas svneol=native#text/pascal
|
||||||
|
components/fpdebug/fpdbgcallcontextinfo.pas svneol=native#text/pascal
|
||||||
components/fpdebug/fpdbgclasses.pp svneol=native#text/pascal
|
components/fpdebug/fpdbgclasses.pp svneol=native#text/pascal
|
||||||
components/fpdebug/fpdbgcommon.pas svneol=native#text/pascal
|
components/fpdebug/fpdbgcommon.pas svneol=native#text/pascal
|
||||||
components/fpdebug/fpdbgcontroller.pas svneol=native#text/plain
|
components/fpdebug/fpdbgcontroller.pas svneol=native#text/plain
|
||||||
|
44
components/fpdebug/fpdbgcallcontextinfo.pas
Normal file
44
components/fpdebug/fpdbgcallcontextinfo.pas
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
unit FpDbgCallContextInfo;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
DbgIntfBaseTypes,
|
||||||
|
FpDbgInfo,
|
||||||
|
FpdMemoryTools,
|
||||||
|
FpDbgDwarfDataClasses,
|
||||||
|
FpDbgDwarf;
|
||||||
|
|
||||||
|
type
|
||||||
|
{ TFpDbgInfoCallContext }
|
||||||
|
|
||||||
|
TFpDbgInfoCallContext = class(TFpDbgAbstractCallContext)
|
||||||
|
public
|
||||||
|
function CreateParamSymbol(AParamIndex: Integer; ASymbol: TFpSymbol): TFpValue; override;
|
||||||
|
end;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{ TFpDbgInfoCallContext }
|
||||||
|
|
||||||
|
function TFpDbgInfoCallContext.CreateParamSymbol(AParamIndex: Integer; ASymbol: TFpSymbol): TFpValue;
|
||||||
|
var
|
||||||
|
ParameterMemLocation: TFpDbgMemLocation;
|
||||||
|
TypeSymbol: TFpSymbol;
|
||||||
|
ParamSymbol: TFpSymbolDwarfFunctionResult;
|
||||||
|
begin
|
||||||
|
ParameterMemLocation := RegisterLoc(5);
|
||||||
|
TypeSymbol := ASymbol.TypeInfo;
|
||||||
|
ParamSymbol := TFpSymbolDwarfFunctionResult.Create(ASymbol.Name, TDbgDwarfSymbolBase(ASymbol).InformationEntry, TypeSymbol.Kind, ParameterMemLocation);
|
||||||
|
try
|
||||||
|
Result := ParamSymbol.Value;
|
||||||
|
finally
|
||||||
|
ParamSymbol.ReleaseReference;
|
||||||
|
end;
|
||||||
|
TFpValueDwarf(Result).Context := Self;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
|
|
@ -2099,11 +2099,6 @@ begin
|
|||||||
FStack.PushConst(NewValue);
|
FStack.PushConst(NewValue);
|
||||||
end;
|
end;
|
||||||
DW_OP_regx: begin
|
DW_OP_regx: begin
|
||||||
//if not FMemManager.ReadRegister(ULEB128toOrdinal(CurData), NewValue, FContext) then begin
|
|
||||||
// SetError;
|
|
||||||
// exit;
|
|
||||||
//end;
|
|
||||||
//FStack.PushConst(NewValue);
|
|
||||||
FStack.PushTargetRegister(ULEB128toOrdinal(CurData));
|
FStack.PushTargetRegister(ULEB128toOrdinal(CurData));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -493,7 +493,6 @@ type
|
|||||||
function GetProcedureAtAddress: TFpValue; virtual;
|
function GetProcedureAtAddress: TFpValue; virtual;
|
||||||
function GetMemManager: TFpDbgMemManager; virtual;
|
function GetMemManager: TFpDbgMemManager; virtual;
|
||||||
function GetSizeOfAddress: Integer; virtual;
|
function GetSizeOfAddress: Integer; virtual;
|
||||||
procedure DoReferenceReleased; override;
|
|
||||||
public
|
public
|
||||||
constructor Create(ALocationContext: TFpDbgLocationContext);
|
constructor Create(ALocationContext: TFpDbgLocationContext);
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
@ -1201,11 +1200,6 @@ begin
|
|||||||
Result := nil;
|
Result := nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFpDbgSymbolScope.DoReferenceReleased;
|
|
||||||
begin
|
|
||||||
inherited DoReferenceReleased;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TFpDbgSimpleLocationContext.GetMemManager: TFpDbgMemManager;
|
function TFpDbgSimpleLocationContext.GetMemManager: TFpDbgMemManager;
|
||||||
begin
|
begin
|
||||||
Result := FMemManager;
|
Result := FMemManager;
|
||||||
|
@ -26,13 +26,17 @@ resourcestring
|
|||||||
MsgfpErrInvalidNumber = 'Cannot parse number: %1:s';
|
MsgfpErrInvalidNumber = 'Cannot parse number: %1:s';
|
||||||
MsgfpErrCannotDereferenceType = 'Cannot dereference Expression "%1:s"';
|
MsgfpErrCannotDereferenceType = 'Cannot dereference Expression "%1:s"';
|
||||||
MsgfpErrTypeHasNoIndex = 'Cannot access indexed element in expression %1:s';
|
MsgfpErrTypeHasNoIndex = 'Cannot access indexed element in expression %1:s';
|
||||||
|
MsgfpErrChangeVariableNotSupported = 'Changing the value of this variable is not supported';
|
||||||
// 100 memreader error
|
// 100 memreader error
|
||||||
MsgfpInternalErrfpErrFailedReadMem = 'Internal error: Failed to read data from memory';
|
MsgfpInternalErrfpErrFailedReadMem = 'Internal error: Failed to read data from memory';
|
||||||
MsgfpInternalErrCanNotReadInvalidMem = 'Internal error: Missing data location';
|
MsgfpInternalErrCanNotReadInvalidMem = 'Internal error: Missing data location';
|
||||||
MsgfpErrReadMemSizeLimit = 'Memory read size exceeds limit';
|
MsgfpErrReadMemSizeLimit = 'Memory read size exceeds limit';
|
||||||
MsgfpErrCanNotReadMemAtAddr = 'Failed to read Mem at Address $%1:x';
|
MsgfpErrCanNotReadMemAtAddr = 'Failed to read Mem at Address $%1:x';
|
||||||
MsgfpErrFailedReadRegiseter = 'Failed to read data from register';
|
MsgfpErrFailedReadRegiseter = 'Failed to read data from register';
|
||||||
MsgfpInternalErrFailedWriteMem = 'Failed to write data';
|
MsgfpErrFailedWriteMem = 'Failed to write data';
|
||||||
|
MsgfpInternalErrCanNotWriteInvalidMem = 'Internal error writing data: Missing data location';
|
||||||
|
MsgfpErrCanNotWriteMemAtAddr = 'Failed to read Mem at Address $%1:x';
|
||||||
|
|
||||||
// 200 LocationParser
|
// 200 LocationParser
|
||||||
MsgfpErrLocationParser = 'Internal Error: Cannot calculate location.';
|
MsgfpErrLocationParser = 'Internal Error: Cannot calculate location.';
|
||||||
MsgfpErrLocationParserMemRead = '%1:s (while calculating location)'; // Pass on nested error
|
MsgfpErrLocationParserMemRead = '%1:s (while calculating location)'; // Pass on nested error
|
||||||
@ -199,13 +203,16 @@ begin
|
|||||||
fpErrInvalidNumber: Result := MsgfpErrInvalidNumber;
|
fpErrInvalidNumber: Result := MsgfpErrInvalidNumber;
|
||||||
fpErrCannotDereferenceType: Result := MsgfpErrCannotDereferenceType;
|
fpErrCannotDereferenceType: Result := MsgfpErrCannotDereferenceType;
|
||||||
fpErrTypeHasNoIndex: Result := MsgfpErrTypeHasNoIndex;
|
fpErrTypeHasNoIndex: Result := MsgfpErrTypeHasNoIndex;
|
||||||
|
fpErrChangeVariableNotSupported: Result := MsgfpErrChangeVariableNotSupported;
|
||||||
|
|
||||||
fpInternalErrCanNotReadInvalidMem: Result := MsgfpInternalErrCanNotReadInvalidMem;
|
fpInternalErrCanNotReadInvalidMem: Result := MsgfpInternalErrCanNotReadInvalidMem;
|
||||||
fpErrReadMemSizeLimit: Result := MsgfpErrReadMemSizeLimit;
|
fpErrReadMemSizeLimit: Result := MsgfpErrReadMemSizeLimit;
|
||||||
fpInternalErrFailedReadMem: Result := MsgfpInternalErrfpErrFailedReadMem;
|
fpInternalErrFailedReadMem: Result := MsgfpInternalErrfpErrFailedReadMem;
|
||||||
fpErrCanNotReadMemAtAddr: Result := MsgfpErrCanNotReadMemAtAddr;
|
fpErrCanNotReadMemAtAddr: Result := MsgfpErrCanNotReadMemAtAddr;
|
||||||
fpErrFailedReadRegister: Result := MsgfpErrFailedReadRegiseter;
|
fpErrFailedReadRegister: Result := MsgfpErrFailedReadRegiseter;
|
||||||
fpErrFailedWriteMem: Result := MsgfpInternalErrFailedWriteMem;
|
fpInternalErrCanNotWriteInvalidMem:Result := MsgfpInternalErrCanNotWriteInvalidMem;
|
||||||
|
fpErrFailedWriteMem: Result := MsgfpErrFailedWriteMem;
|
||||||
|
fpErrCanNotWriteMemAtAddr: Result := MsgfpErrCanNotWriteMemAtAddr;
|
||||||
|
|
||||||
fpErrLocationParser: Result := MsgfpErrLocationParser;
|
fpErrLocationParser: Result := MsgfpErrLocationParser;
|
||||||
fpErrLocationParserMemRead: Result := MsgfpErrLocationParserMemRead;
|
fpErrLocationParserMemRead: Result := MsgfpErrLocationParserMemRead;
|
||||||
|
@ -17,13 +17,29 @@ msgstr ""
|
|||||||
|
|
||||||
#: fperrormessages.msgfperrcannotreadmemataddr
|
#: fperrormessages.msgfperrcannotreadmemataddr
|
||||||
#, object-pascal-format
|
#, object-pascal-format
|
||||||
|
msgctxt "fperrormessages.msgfperrcannotreadmemataddr"
|
||||||
msgid "Failed to read Mem at Address $%1:x"
|
msgid "Failed to read Mem at Address $%1:x"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: fperrormessages.msgfperrcannotwritememataddr
|
||||||
|
#, object-pascal-format
|
||||||
|
msgctxt "fperrormessages.msgfperrcannotwritememataddr"
|
||||||
|
msgid "Failed to read Mem at Address $%1:x"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: fperrormessages.msgfperrchangevariablenotsupported
|
||||||
|
msgid "Changing the value of this variable is not supported"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: fperrormessages.msgfperrfailedreadregiseter
|
#: fperrormessages.msgfperrfailedreadregiseter
|
||||||
msgid "Failed to read data from register"
|
msgid "Failed to read data from register"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: fperrormessages.msgfperrfailedwritemem
|
||||||
|
msgctxt "fperrormessages.msgfperrfailedwritemem"
|
||||||
|
msgid "Failed to write data"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: fperrormessages.msgfperrinvalidnumber
|
#: fperrormessages.msgfperrinvalidnumber
|
||||||
#, object-pascal-format
|
#, object-pascal-format
|
||||||
msgid "Cannot parse number: %1:s"
|
msgid "Cannot parse number: %1:s"
|
||||||
@ -101,8 +117,8 @@ msgstr ""
|
|||||||
msgid "Internal error: Missing data location"
|
msgid "Internal error: Missing data location"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: fperrormessages.msgfpinternalerrfailedwritemem
|
#: fperrormessages.msgfpinternalerrcannotwriteinvalidmem
|
||||||
msgid "Failed to write data"
|
msgid "Internal error writing data: Missing data location"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: fperrormessages.msgfpinternalerrfperrfailedreadmem
|
#: fperrormessages.msgfpinternalerrfperrfailedreadmem
|
||||||
|
@ -28,13 +28,29 @@ msgstr "Impossível desreferenciar Expressão \"%1:s\""
|
|||||||
|
|
||||||
#: fperrormessages.msgfperrcannotreadmemataddr
|
#: fperrormessages.msgfperrcannotreadmemataddr
|
||||||
#, object-pascal-format
|
#, object-pascal-format
|
||||||
|
msgctxt "fperrormessages.msgfperrcannotreadmemataddr"
|
||||||
msgid "Failed to read Mem at Address $%1:x"
|
msgid "Failed to read Mem at Address $%1:x"
|
||||||
msgstr "Falha ao ler memória no endereço $%1:x"
|
msgstr "Falha ao ler memória no endereço $%1:x"
|
||||||
|
|
||||||
|
#: fperrormessages.msgfperrcannotwritememataddr
|
||||||
|
#, object-pascal-format, fuzzy
|
||||||
|
msgctxt "fperrormessages.msgfperrcannotwritememataddr"
|
||||||
|
msgid "Failed to read Mem at Address $%1:x"
|
||||||
|
msgstr "Falha ao ler memória no endereço $%1:x"
|
||||||
|
|
||||||
|
#: fperrormessages.msgfperrchangevariablenotsupported
|
||||||
|
msgid "Changing the value of this variable is not supported"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: fperrormessages.msgfperrfailedreadregiseter
|
#: fperrormessages.msgfperrfailedreadregiseter
|
||||||
msgid "Failed to read data from register"
|
msgid "Failed to read data from register"
|
||||||
msgstr "Falha ao ler dados do registrador"
|
msgstr "Falha ao ler dados do registrador"
|
||||||
|
|
||||||
|
#: fperrormessages.msgfperrfailedwritemem
|
||||||
|
msgctxt "fperrormessages.msgfperrfailedwritemem"
|
||||||
|
msgid "Failed to write data"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: fperrormessages.msgfperrinvalidnumber
|
#: fperrormessages.msgfperrinvalidnumber
|
||||||
#, object-pascal-format
|
#, object-pascal-format
|
||||||
msgid "Cannot parse number: %1:s"
|
msgid "Cannot parse number: %1:s"
|
||||||
@ -112,8 +128,8 @@ msgstr "Impossível acessar elemento indexado na expressão %1:s"
|
|||||||
msgid "Internal error: Missing data location"
|
msgid "Internal error: Missing data location"
|
||||||
msgstr "Erro interno: Localização dos dados faltando"
|
msgstr "Erro interno: Localização dos dados faltando"
|
||||||
|
|
||||||
#: fperrormessages.msgfpinternalerrfailedwritemem
|
#: fperrormessages.msgfpinternalerrcannotwriteinvalidmem
|
||||||
msgid "Failed to write data"
|
msgid "Internal error writing data: Missing data location"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: fperrormessages.msgfpinternalerrfperrfailedreadmem
|
#: fperrormessages.msgfpinternalerrfperrfailedreadmem
|
||||||
|
@ -27,13 +27,29 @@ msgstr "Невозможно разыменовать выражение \"%1:s\
|
|||||||
|
|
||||||
#: fperrormessages.msgfperrcannotreadmemataddr
|
#: fperrormessages.msgfperrcannotreadmemataddr
|
||||||
#, object-pascal-format
|
#, object-pascal-format
|
||||||
|
msgctxt "fperrormessages.msgfperrcannotreadmemataddr"
|
||||||
msgid "Failed to read Mem at Address $%1:x"
|
msgid "Failed to read Mem at Address $%1:x"
|
||||||
msgstr "Не удалось прочитать память по адресу $%1:x"
|
msgstr "Не удалось прочитать память по адресу $%1:x"
|
||||||
|
|
||||||
|
#: fperrormessages.msgfperrcannotwritememataddr
|
||||||
|
#, object-pascal-format, fuzzy
|
||||||
|
msgctxt "fperrormessages.msgfperrcannotwritememataddr"
|
||||||
|
msgid "Failed to read Mem at Address $%1:x"
|
||||||
|
msgstr "Не удалось прочитать память по адресу $%1:x"
|
||||||
|
|
||||||
|
#: fperrormessages.msgfperrchangevariablenotsupported
|
||||||
|
msgid "Changing the value of this variable is not supported"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: fperrormessages.msgfperrfailedreadregiseter
|
#: fperrormessages.msgfperrfailedreadregiseter
|
||||||
msgid "Failed to read data from register"
|
msgid "Failed to read data from register"
|
||||||
msgstr "Не удалось прочитать данные из регистра"
|
msgstr "Не удалось прочитать данные из регистра"
|
||||||
|
|
||||||
|
#: fperrormessages.msgfperrfailedwritemem
|
||||||
|
msgctxt "fperrormessages.msgfperrfailedwritemem"
|
||||||
|
msgid "Failed to write data"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: fperrormessages.msgfperrinvalidnumber
|
#: fperrormessages.msgfperrinvalidnumber
|
||||||
#, object-pascal-format
|
#, object-pascal-format
|
||||||
msgid "Cannot parse number: %1:s"
|
msgid "Cannot parse number: %1:s"
|
||||||
@ -111,8 +127,8 @@ msgstr "Невозможно получить доступ к элементу
|
|||||||
msgid "Internal error: Missing data location"
|
msgid "Internal error: Missing data location"
|
||||||
msgstr "Внутренняя ошибка: неизвестно расположение данных"
|
msgstr "Внутренняя ошибка: неизвестно расположение данных"
|
||||||
|
|
||||||
#: fperrormessages.msgfpinternalerrfailedwritemem
|
#: fperrormessages.msgfpinternalerrcannotwriteinvalidmem
|
||||||
msgid "Failed to write data"
|
msgid "Internal error writing data: Missing data location"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: fperrormessages.msgfpinternalerrfperrfailedreadmem
|
#: fperrormessages.msgfpinternalerrfperrfailedreadmem
|
||||||
|
Loading…
Reference in New Issue
Block a user