How to visualize pointer value when debugging in Delphi?

So, I have a variable buffPtr: TPointer It has a size of 16 and contains a series of numbers, basically starting at 0, let's say something like 013854351387365. I am sure that it contains values, because the application does what it does.

I want to see this value during debugging.

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

+6
source share
3 answers

I added the PAnsiChar (buffPtr) ^ watch

with View Properties as

Number of repetitions = 16 Decimal

enter image description here

+8
source

Just enter the expression for the clock PAnsiChar(buffPtr)^,16 or PByte(buffPtr)^,16 if you need ordinal / byte values.

The trick here is to add the number of repetitions of the pattern after the decimal point, for example ,16 .

This IMHO is more convenient than changing the properties of a watch, and it works with the F7 evaluation team in the IDE.

+9
source

Have you determined that the watch unloads the memory area? For some structures that help.

If you can recompile the application, define this:

 type T16Values = array[0..15] of Byte; P16Values = ^T16Values; 

Then draw a pointer to P16Values and view it.

If it is a different data type than Byte , modify the code above accordingly.

+3
source

All Articles