Feature request - Different pointer typecast default behaviour in FpDebug watch
Original Reporter info from Mantis: ccrause @ccrause
-
Reporter name: Christo Crause
Original Reporter info from Mantis: ccrause @ccrause
- Reporter name: Christo Crause
Description:
When trying to view memory by type casting a literal address to a pointer, followed by de-referencing results in &LtPos;invalid> for the default watch style setting. See example in steps to reproduce.
One suggestion to return a slightly more descriptive message for the default watch setting is to call DoUnknown in TFpPascalPrettyPrinter.InternalPrintValue for any AValue.Kind that isn't handled in the case statement.
Attached a patch that moves DoUnknown to the "else" section of "case AValue.Kind of" for consideration.
Steps to reproduce:
Compile project below with debug symbols, place break point on second line of code in main and run to break point. Add a watch to get the address of variable w (@W), then use that literal address in another watch expression (e.g. pointer($62df30)^).
program project1;
var
w: word;
p: pointer;
begin
w := $ba;
if w = 0 then halt(byte(p^));
end.
Additional information:
Discussion for a bit of background: https://forum.lazarus.freepascal.org/index.php/topic,49039.msg354664.html#msg354664
Mantis conversion info:
- Mantis ID: 36836
- Build: 62811
- Version: 2.0.7 (SVN)