Watch Bytes (wb) Command Can Be Used to Watch a Buffer in HEX

ID Number: Q50224

2.20 2.30 2.35 | 2.20 2.30 2.35

MS-DOS | OS/2

Question:

Is there a way to "track" the contents of a buffer via a Watch command

in CodeView versions 2.x? We want to observe the contents of a

20-character buffer in HEX. The buffer is not necessarily

null-terminated.

Response:

In versions of CodeView earlier than 3.0, you can watch a buffer in

CodeView in hexadecimal with the Watch command by using Watch Bytes

(wb) as follows:

>wb *buffer L 10 ; This will watch the first 10 bytes of

buffer in HEX.

For the given example, follow the previous command with:

>wb *(buffer + 10) L 10 ; This will watch the next 10 bytes in HEX.

Please note that both the length specifier and the number 10 used to

offset the pointer in the second command are taken in the current

radix. The example above assumes a radix of 10. You can explicitly

specify the base of the number in hexadecimal as follows:

>wb *buffer L 0x0a

>wb *(buffer + 0x0a) L 0x0a

For more information on the wb command in CodeView, see the "Microsoft

CodeView and Utilities, Microsoft Editor, Mixed-Language Programming

Guide" manual.

The Wx commands have been removed in CodeView versions 3.0 and later

and have been replaced with equivalent functionality in the Memory

window.