
GDB Custom Commands: Dynamic Arrays - alottabit
https://testfit.io/devblog/gdb_custom_commands_dynamic_arrays
======
nneonneo
GDB supports expressions on both sides of the @ sign, so you could also
probably do

    
    
        p *values@array_size(values)
    

and that is probably short enough that you could wrap that in a macro. (Of
course, Python is definitely the more extensible/hackable option - but quick
'n' dirty can often be highly effective for debugging!)

~~~
alottabit
Yes, I'm aware! I didn't show/use it here to try to make it more obvious what
'@' would do to those less familiar with GDB. You would also have to either
manually count the number of elements or print the array size by itself
afterwards (if you care about the size).

I also used this as a stepping stone into some of the more complicated
extensions, which I hope to share in the future.

