Automatic variables like a1
will have an address only when the function containing them, main
in this case, has begun executing. The first few instructions of the function, called its prologue, allocate this space by, for example, subtracting an appropriate amount from the stack pointer on systems where stacks grow from high addresses toward low addresses.
If you type b main
and then run
, this should run enough of main
so that you can print the addresses of some or all of those variables. Note that, depending on optimizations done by the compiler, some variables might be placed in registers or might not get allocated at all, and will not have an address.