Provision for array as debugger variable

Pedro Alves pedro@codesourcery.com
Mon Sep 12 14:15:00 GMT 2011


On Monday 12 September 2011 13:44:15, Abhijit Halder wrote:

> in GDB we can do this to define a debugger variable:
> (gdb) set $var
> 
> The $var is a scalar variable. Can we define similarly an array?

(gdb) set $var1 = {0, 1}
(gdb) ptype $var1
type = int [2]
(gdb) p $var1
$1 = {0, 1}

(gdb) set $var2 = (char[2]) {0, 1}
(gdb) ptype $var2
type = char [2]
(gdb) p $var2
$2 = "\000\001"

-- 
Pedro Alves



More information about the Gdb-patches mailing list