Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8815851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:28:45+00:00 2026-06-14T04:28:45+00:00

Possible Duplicate: Using gdb to check register’s values I know that to read from

  • 0

Possible Duplicate:
Using gdb to check register’s values

I know that to read from the memory location below:

 mov %esi, (%eax)

when in GDB I can use

 (gdb) display *(int *)$eax

If a want to read from memory location 0x8(%eax), which command can I use in GDB? I tried to use some variants of the display command above, but I was not successful.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T04:28:46+00:00Added an answer on June 14, 2026 at 4:28 am

    You can use display if you want to see the expression after any new step. This is useful if you want to watch this expression. if you simply want to show the state of an exepression just use print.

    For example:

    print $eax
    print *(int *)$esp
    

    if you want to take a look for example at an int stored at location 0x8(%eax) you can use

    print *(int *)($eax+8)
    

    Sometimes it seems you need to omit the $ in front of the registers to make gdb work correctly.

    Here a simple dump of a debugging session on a 32 Bit x86 executable:

    d:\temp\C++11>gdb test.exe
    GNU gdb (GDB) 7.5
    Copyright (C) 2012 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
    and "show warranty" for details.
    This GDB was configured as "i686-pc-mingw32".
    For bug reporting instructions, please see:
    <http://www.gnu.org/software/gdb/bugs/>...
    Reading symbols from d:\temp\C++11\test.exe...(no debugging symbols found)...don
    e.
    (gdb) start
    Temporary breakpoint 1 at 0x4013c1
    Starting program: d:\temp\C++11\test.exe
    [New Thread 340.0x1bc0]
    
    Temporary breakpoint 1, 0x004013c1 in main ()
    (gdb) print $eax
    $1 = 1
    (gdb) info register $eax
    eax            0x1      1
    (gdb) info register
    eax            0x1      1
    ecx            0x28ff30 2686768
    edx            0x8e3c8  582600
    ebx            0x7efde000       2130567168
    esp            0x28ff08 0x28ff08
    ebp            0x28ff18 0x28ff18
    esi            0x0      0
    edi            0x0      0
    eip            0x4013c1 0x4013c1 <main+17>
    eflags         0x202    [ IF ]
    cs             0x23     35
    ss             0x2b     43
    ds             0x2b     43
    es             0x2b     43
    fs             0x53     83
    gs             0x2b     43
    (gdb) print *(int *)$esp
    $2 = 2686768
    (gdb) print *(int *)($esp+8)
    $3 = 0
    (gdb)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: GCC problem : using a member of a base class that depends
Possible Duplicate: Using C# regular expressions to remove HTML tags Extract Content from Div
Possible Duplicate: Using comparison operators in Scala’s pattern matching system For below method I
Possible Duplicate: Using ZXing to create an android barcode scanning app I know it
Possible Duplicate: filter using Q object with dynamic from user? I am working on
Possible Duplicate: Problem calling a Local HTML File from XCode I am using the
Possible Duplicate: Using A* to solve Travelling Salesman Problem I have recently learned that
Possible Duplicate: Using bind1st for a method that takes argument by reference I have
Possible Duplicate: Using Git with an existing Xcode project Setting up a git repository
Possible Duplicate: Using ASP.NET Controls without databinding My previous question yielded few results so

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.