In the IAR Embedded Workbench I have a pointer pointing to a buffer in memory. When watching the pointer, I can see the contents of the word it points to. How can I tell the Watch view to list a range of the buffer, from the pointer onwards, for some specified length of elements?
For example, enter the expression:
myPtr[0..2]
will display information equivalent to the three expressions:
myPtr[0]
myPtr[1]
myPtr[2]
From the Iar Embedded Workbench (9.20) help:
In windows where you can edit the Expression field and in the Quick Watch window, you can specify the number of elements to be displayed in the field by adding a semicolon followed by an integer. For example, to display only the three first elements of an array named
myArray
, or three elements in sequence starting with the element pointed to by a pointer, write:myArray;3
To display three elements pointed to by
myPtr
,myPtr+1
, andmyPtr+2
, write:myPtr;3
Optionally, add a comma and another integer that specifies which element to start with. For example, to display elements 10–14, write:
myArray;5,10
To display
myPtr+10
,myPtr+11
,myPtr+12
,myPtr+13
, andmyPtr+14
, write:myPtr;5,10
An alternative would be to view it in memory. Select View -> Memory and enter the pointer value (with 0x prefix). You can view and edit the range of data. Maybe not as "clean" as a traditional debugger variable viewer but it does the job.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With