Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to visualize the value of a pointer while debugging in Delphi?

So, I have a variable buffPtr: TPointer It has a size of 16 and contains a series of numbers, mostly starting with 0, say something like 013854351387365. I'm sure it contains values, because the application does what it does fine.

I want to see this value while I'm debugging.

If I add "PAnsiChar(buffPtr)^" to the watches I only see the first byte.

like image 385
Craig Stevensson Avatar asked Jan 08 '13 16:01

Craig Stevensson


1 Answers

Just type in the watch expression PAnsiChar(buffPtr)^,16 or PByte(buffPtr)^,16 if you want the ordinal/byte values.

The trick here is to add the number of pattern repeat after a comma, like ,16.

It is IMHO more convenient than changing the Watch Properties, and it works with the F7 evaluation command of the IDE.

like image 94
Arnaud Bouchez Avatar answered Sep 29 '22 11:09

Arnaud Bouchez