gdb python: Walking through array of structures

后端 未结 1 697
栀梦
栀梦 2021-01-27 01:38

Can\'t we traverse the array of structs ? I mean for each index by checking the content of structs and print each field accordingly? As we can do for a struct like



        
相关标签:
1条回答
  • 2021-01-27 02:40

    You can index an array using the [] notation. Like, if 'v' is a gdb.Value representing an array or a pointer, you can fetch the 5th element with v[5].

    The manual has a long section on the Value API that explains all of this.

    0 讨论(0)
提交回复
热议问题