About 296,000 results
Open links in new tab
  1. gdb - Find the exact address of variable Buf - Stack Overflow

    Nov 3, 2017 · The & operator will work when gdb is set to C language mode (and Objective-C). In any language mode you can use (gdb) info address buf Symbol "buf" is static storage at …

  2. Can we get address of a variable in a C program using GDB?

    Aug 4, 2021 · Yes, as long as your variable isn’t optimised away. For example, using ls with debug symbols: gdb ls >>> break main >>> run >>> print argv $1 = (char **) 0x7fffffffdd78 In …

  3. GDB Command Reference - print command - VisualGDB

    Note that if your expression refers to a local variable, you need to ensure that you have selected the correct frame. You can navigate frames using the up and down commands.

  4. Debugging with GDB - Examining Data

    Print as an address, both absolute in hexadecimal and as an offset from the nearest preceding symbol. You can use this format used to discover where (in what function) an unknown …

  5. Print Settings (Debugging with GDB) - sourceware.org

    GDB prints memory addresses showing the location of stack traces, structure values, pointer values, breakpoints, and so forth, even when it also displays the contents of those addresses. …

  6. GDB, how do I find the location of variables - Stack Overflow

    Feb 18, 2022 · (gdb) print secret $1 = 0x100403000 "secret" For something like an int you would have to use print &x to see the address as print x will just show the value.

  7. Debugging with GDB - Print Settings - GNU

    If you have a pointer and you are not sure where it points, try `set print symbol-filename on'. Then you can determine the name and source file location of the variable where it points, using `p/a …

  8. How does Linux use GDB to print the address of the variable

    (6) You can also use the address of the variable and the type of variable to print the value of the variable. This is also applicable to other types such as the structure.