KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

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

Article: Q50224
Product(s): See article
Version(s): 2.20 2.30 | 2.20 2.30
Operating System(s): MS-DOS | OS/2
Keyword(s): ENDUSER | | mspl13_basic
Last Modified: 17-JUL-1990

Question:

Is there a way to keep tabs on the contents of a buffer via a watch
command? We want to observe the contents of a 20-character buffer in
HEX. The buffer is not necessarily null terminated.

Response:

The way to watch a buffer in CodeView in hexadecimal with the Watch
command is to use Watch Bytes (wb) as follows:

   >wb *buffer L 10  ; this will watch the first 10 bytes of
                       buffer in HEX

For the given example, you should follow the previous command with the
following:

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

Please note that both the length specifier as well as 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 hex 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 INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.