print &my_global
должно работать нормально.Быстрый пример:
#include <stdio.h>
int x = 12;
int main(int argc, char **argv)
{
printf("%d\n", x);
return 0;
}
Затем сборка и отладка:
$ make example
clang -g example.c -o example
$ gdb example
(gdb) break main
Breakpoint 1 at 0x100000f04: file example.c, line 8.
(gdb) run
Starting program: example
Reading symbols for shared libraries +. done
Breakpoint 1, main () at example.c:8
8 printf("%d\n", x);
(gdb) print &x
$1 = (int *) 0x100001068
Current language: auto; currently minimal