mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-03 09:38:13 +02:00
DBG: fixed display of a=b" watches
git-svn-id: trunk@28734 -
This commit is contained in:
parent
7f2ff17b32
commit
a52df4f32a
@ -8305,17 +8305,23 @@ function TGDBMIDebuggerCommand.GetGDBTypeInfo(const AExpression: String): TGDBTy
|
||||
var
|
||||
WIExprRes, PTypeRes, WITypeRes: TGDBMIExecResult;
|
||||
WIExprVal, WIExprValCln, WITypeValS2: String;
|
||||
f: Boolean;
|
||||
begin
|
||||
Result := nil;
|
||||
WIExprValCln := '';
|
||||
if ExecuteCommand('whatis %s', [AExpression], WIExprRes)
|
||||
and (WIExprRes.State <> dsError)
|
||||
f := ExecuteCommand('whatis %s', [AExpression], WIExprRes);
|
||||
|
||||
if (PTypeRes.State = dsError) and (pos('msg="No symbol ', PTypeRes.Values) > 0)
|
||||
then exit;
|
||||
|
||||
if f and (WIExprRes.State <> dsError)
|
||||
then begin
|
||||
WIExprVal := ParseTypeFromGdb(WIExprRes.Values);
|
||||
WIExprValCln := WIExprVal;
|
||||
while (WIExprValCln<>'') and (WIExprValCln[1] in ['^', '&']) do delete(WIExprValCln, 1, 1);
|
||||
|
||||
if (pos(' ', WIExprValCln) > 0) or (WIExprValCln = '') then begin
|
||||
// TODO: if the next ptype fails, (e.g. for "bool"), we may not need to fall-back
|
||||
if ExecuteCommand('ptype %s', [AExpression], PTypeRes) // can not ptype with spaces
|
||||
and (PTypeRes.State <> dsError)
|
||||
then begin
|
||||
@ -8324,6 +8330,7 @@ begin
|
||||
end;
|
||||
end
|
||||
else begin
|
||||
// TODO: if the next ptype fails, (e.g. for "bool"), we may not need to fall-back
|
||||
if ExecuteCommand('ptype %s', [WIExprValCln], PTypeRes)
|
||||
and (PTypeRes.State <> dsError)
|
||||
then begin
|
||||
@ -8343,9 +8350,6 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
if (PTypeRes.State = dsError) and (pos('msg="No symbol ', PTypeRes.Values) > 0)
|
||||
then exit;
|
||||
|
||||
// try ptype on the value
|
||||
if not ExecuteCommand('ptype %s', [AExpression], PTypeRes)
|
||||
or (PTypeRes.State = dsError)
|
||||
|
@ -72,7 +72,7 @@ const
|
||||
Match_ArgTFoo1 = '<TFoo> = \{.+ValueInt = 31';
|
||||
// Todo: Dwarf fails with dereferenced var pointer types
|
||||
|
||||
ExpectBrk1NoneNil: Array [1..49] of TWatchExpectation = (
|
||||
ExpectBrk1NoneNil: Array [1..55] of TWatchExpectation = (
|
||||
{ records }
|
||||
|
||||
(Exp: 'ArgTRec'; Mtch: Match_ArgTRec; Kind: skRecord; TpNm: 'TRec'; Flgs: []),
|
||||
@ -103,6 +103,8 @@ const
|
||||
(Exp: 'PVarTNewRec'; Mtch: '^\^TNewRec\('+Match_PasPointer; Kind: skPointer; TpNm: '^TNewRec'; Flgs: []),
|
||||
(Exp: 'PVarTNewRec^'; Mtch: Match_ArgTNewRec; Kind: skRecord; TpNm: 'TNewRec'; Flgs: []),
|
||||
|
||||
{ Classes }
|
||||
|
||||
(Exp: 'ArgTFoo'; Mtch: Match_ArgTFoo; Kind: skClass; TpNm: 'TFoo'; Flgs: []),
|
||||
(Exp: 'VArgTFoo'; Mtch: Match_ArgTFoo; Kind: skClass; TpNm: 'TFoo'; Flgs: []),
|
||||
(Exp: 'ArgPFoo'; Mtch: 'PFoo\('+Match_PasPointer; Kind: skPointer; TpNm: 'PFoo'; Flgs: []),
|
||||
@ -110,9 +112,16 @@ const
|
||||
(Exp: 'ArgPFoo^'; Mtch: Match_ArgTFoo1; Kind: skClass; TpNm: 'TFoo'; Flgs: []),
|
||||
(Exp: 'VArgPFoo^'; Mtch: Match_ArgTFoo1; Kind: skClass; TpNm: 'TFoo'; Flgs: [fnoDwrf]),
|
||||
|
||||
(Exp: 'ArgTFoo=ArgTFoo'; Mtch: 'True'; Kind: skSimple; TpNm: 'bool'; Flgs: []),
|
||||
(Exp: 'VArgTFoo=VArgTFoo'; Mtch: 'True'; Kind: skSimple; TpNm: 'bool'; Flgs: []),
|
||||
(Exp: 'ArgTFoo=VArgTFoo'; Mtch: 'True'; Kind: skSimple; TpNm: 'bool'; Flgs: []),
|
||||
(Exp: 'ArgTFoo=ArgPFoo'; Mtch: 'False'; Kind: skSimple; TpNm: 'bool'; Flgs: []),
|
||||
(Exp: 'ArgPFoo=ArgPPFoo^'; Mtch: 'True'; Kind: skSimple; TpNm: 'bool'; Flgs: []),
|
||||
|
||||
(Exp: '@ArgTFoo'; Mtch: '(P|\^T)Foo\('+Match_PasPointer; Kind: skPointer; TpNm: '(P|\^T)Foo'; Flgs: [fTpMtch]),
|
||||
|
||||
(*
|
||||
|
||||
{ Classes }
|
||||
(Exp: 'ArgPPFoo'; Mtch: ''; Kind: sk; TpNm: 'PPFoo'; Flgs: []),
|
||||
(Exp: 'VArgPPFoo'; Mtch: ''; Kind: sk; TpNm: 'PPFoo'; Flgs: []),
|
||||
(Exp: 'ArgTSamePFoo'; Mtch: ''; Kind: sk; TpNm: 'TSamePFoo'; Flgs: []),
|
||||
|
Loading…
Reference in New Issue
Block a user