About 50 results
Open links in new tab
  1. How to view a pointer like an array in GDB? - Stack Overflow

    Jul 20, 2018 · It first casts p to a pointer-to-array type (instead of pointer-to-element type pointing to the first element), then dereferences that pointer to get an array object. In C, this would decay back to a …

  2. gdb - how to view contents of an array of pointer? - Stack Overflow

    Sep 19, 2017 · I don't think gdb support printing 2D array itself, why? Because the definition of print *array@3 isn't printing the first three elements in array, instead, it is "priting *array (or array[0]) and …

  3. GDB print all values in char array - Stack Overflow

    Apr 9, 2015 · If you have a fixed-length array and want to see all the data in there - just ask to print the array and you will get the full output, because GDB knows about the size. If you have a pointer to a …

  4. How to print pointer content in GDB? - Stack Overflow

    Feb 2, 2013 · That's because p is already a pointer type. In my case 0x0804b680 is just a number and when 'p /s 0x0804b680' outputs '0x0804b680'. By prefixing '*', I'm telling GDB to treat 0x0804b680 as …

  5. c - Displaying struct values in GDB - Stack Overflow

    Sep 27, 2012 · In GDB, given a variable that points to a struct, print will display the raw pointer value and x will display the raw bytes pointed to. Is there any way to display the data pointed to as that …

  6. debugging - how to print 2d arry values in gdb - Stack Overflow

    Oct 21, 2013 · I got Cannot perform pointer math on incomplete types, try casting to a known type, or void *. I keep trying ptype optBoards I saw type = int [][0] I wildly guess optBoards should be a …

  7. c - Print character array to file in GDB - Stack Overflow

    Jan 30, 2013 · 13 I have an array of characters with about 100k entries. It seems like when in the function I print *buffer it is getting cut off prematurely. is there anything I can do to lengthen the …

  8. How to print `std::array` contents in gdb? - Stack Overflow

    Jul 20, 2013 · 2 I am not well familiar with gdb, and couldn't figure how to look for this scenario in gdb manual. I am trying to print contents of std::array in gdb. Below is the usecase I am trying to debug in …

  9. How to print content of a list of pointers in gdb? - Stack Overflow

    Mar 25, 2015 · (gdb) python > for i in range(nnn): > print x[i].dereference() > end You can wrap this in a new gdb command, written in Python, pretty easily. Another way is to use define to make your own …

  10. How do I print the elements of a C++ vector in GDB?

    Oct 31, 2008 · I want to examine the contents of a std::vector in GDB, how do I do it? Let's say it's a std::vector<int> for the sake of simplicity.