Display Pointer as Array?

Sysprogs forums Forums VisualGDB Display Pointer as Array?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #6653
    derwissel
    Participant

    Hi all,

    i am currently evaluating VisualGDB with VS2013(Pro) for our bare metal arm project, migrating from Eclipse..

    Toolchain is arm-eabi, GCC 4.9.2 with GDB 7.8.1

    Debug Package is Segger J-Link 2.0

    It all seems to be working quite nicely after just 1 day of setup for the project..

    However, i am missing the “Display as Array” functionalty of my Eclipse Debugger a lot – The internetz suggested one could achieve this in VS by typing the name of the pointer in the watch window, adding a “,n” with n as size specifier to get a array-type display – see http://blogs.msdn.com/b/habibh/archive/2009/06/05/size-specifier-how-to-display-a-c-c-pointer-as-an-array-in-the-visual-studio-debugger.aspx

    if i break in the example-function, enter foo,3 in the watch window, i get a new entry with name=foo,value=3,type=int, which is not what i expected. Accessing foo, or foo[2] works as expected, though. Whats the correct syntax here, to get this done?
    `

    uint32_t DoSomethingWithAPointerToArray(uint8_t* foo, uint16_t length)
    {
      for(uint8_t i = 0; i < length; i++)
      {
        foo[i]=0;
      }
    }

    thanks,

    derwissel

    • This topic was modified 8 years, 9 months ago by derwissel.
    • This topic was modified 8 years, 9 months ago by derwissel.
    #6666
    support
    Keymaster

    Hi,

    VisualGDB uses a different syntax for displaying pointers as arrays. Please use the following expression:

    *foo@length
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.