examine command in gdb?Improve INSERT-per-second performance of SQLite?GDB: What to do when you type “list” to see the code in C, but it prints to you “No source file for address __________”GDB examine command, multiple units at target addressIos Debugging with GDB and No Symbols - Examine ObjectsGDB examine command confusionExamining strings using gdbget return address GDBGDB find command error “warning: Unable to access x bytes of target memory at y, halting search”What mechanism overwrites the return address of a stack frame, preventing certain buffer overflow exploits?Finding argv address in GDB

How to move the player while also allowing forces to affect it

Why do we use polarized capacitors?

Is this food a bread or a loaf?

Shall I use personal or official e-mail account when registering to external websites for work purpose?

How could a lack of term limits lead to a "dictatorship?"

Manga about a female worker who got dragged into another world together with this high school girl and she was just told she's not needed anymore

What happens when a metallic dragon and a chromatic dragon mate?

Should the British be getting ready for a no-deal Brexit?

Ideas for 3rd eye abilities

Typesetting a double Over Dot on top of a symbol

What do you call something that goes against the spirit of the law, but is legal when interpreting the law to the letter?

Does the average primeness of natural numbers tend to zero?

Can a planet have a different gravitational pull depending on its location in orbit around its sun?

New order #4: World

Is ipsum/ipsa/ipse a third person pronoun, or can it serve other functions?

What does "enim et" mean?

What do the Banks children have against barley water?

Denied boarding due to overcrowding, Sparpreis ticket. What are my rights?

What is the offset in a seaplane's hull?

If a centaur druid Wild Shapes into a Giant Elk, do their Charge features stack?

Is "plugging out" electronic devices an American expression?

Are white and non-white police officers equally likely to kill black suspects?

Does bootstrapped regression allow for inference?

A poker game description that does not feel gimmicky



examine command in gdb?


Improve INSERT-per-second performance of SQLite?GDB: What to do when you type “list” to see the code in C, but it prints to you “No source file for address __________”GDB examine command, multiple units at target addressIos Debugging with GDB and No Symbols - Examine ObjectsGDB examine command confusionExamining strings using gdbget return address GDBGDB find command error “warning: Unable to access x bytes of target memory at y, halting search”What mechanism overwrites the return address of a stack frame, preventing certain buffer overflow exploits?Finding argv address in GDB






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0
















A number can also be prepended to the format of the examine command
to examine multiple units at the target address.




source: hacking the art of exploration



(gdb) x/2x $eip
0x8048384 <main+16>: 0x00fc45c7 0x83000000

(gdb) x/x $eip
0x8048384 <main+16>: 0x00fc45c7


I know that the second examine command returns the memory address that eip is currently locating. What about the first one which returns two memory address?










share|improve this question






















  • $eip can be seen as a pointer variable. So in C terms, x/x $eip prints $eip[0] and x/2x $eip prints $eip[0] and $eip[1].

    – Some programmer dude
    Mar 8 at 7:19











  • OK, what does they indicate?

    – Henok Tesfaye
    Mar 8 at 7:21











  • Then let me ask you this: Do you know what EIP is and what it's used for? What do you think that $eip is pointing at?

    – Some programmer dude
    Mar 8 at 7:24











  • Yes, EIP is a register inside the CPU, it is used to hold the memory address of instructions in our program which is currently executing. $eip is pointing to the address in the .text section of our program.

    – Henok Tesfaye
    Mar 8 at 7:27












  • My question is, there is only 1 $eip, so why it shows two memory address?

    – Henok Tesfaye
    Mar 8 at 7:31

















0
















A number can also be prepended to the format of the examine command
to examine multiple units at the target address.




source: hacking the art of exploration



(gdb) x/2x $eip
0x8048384 <main+16>: 0x00fc45c7 0x83000000

(gdb) x/x $eip
0x8048384 <main+16>: 0x00fc45c7


I know that the second examine command returns the memory address that eip is currently locating. What about the first one which returns two memory address?










share|improve this question






















  • $eip can be seen as a pointer variable. So in C terms, x/x $eip prints $eip[0] and x/2x $eip prints $eip[0] and $eip[1].

    – Some programmer dude
    Mar 8 at 7:19











  • OK, what does they indicate?

    – Henok Tesfaye
    Mar 8 at 7:21











  • Then let me ask you this: Do you know what EIP is and what it's used for? What do you think that $eip is pointing at?

    – Some programmer dude
    Mar 8 at 7:24











  • Yes, EIP is a register inside the CPU, it is used to hold the memory address of instructions in our program which is currently executing. $eip is pointing to the address in the .text section of our program.

    – Henok Tesfaye
    Mar 8 at 7:27












  • My question is, there is only 1 $eip, so why it shows two memory address?

    – Henok Tesfaye
    Mar 8 at 7:31













0












0








0









A number can also be prepended to the format of the examine command
to examine multiple units at the target address.




source: hacking the art of exploration



(gdb) x/2x $eip
0x8048384 <main+16>: 0x00fc45c7 0x83000000

(gdb) x/x $eip
0x8048384 <main+16>: 0x00fc45c7


I know that the second examine command returns the memory address that eip is currently locating. What about the first one which returns two memory address?










share|improve this question















A number can also be prepended to the format of the examine command
to examine multiple units at the target address.




source: hacking the art of exploration



(gdb) x/2x $eip
0x8048384 <main+16>: 0x00fc45c7 0x83000000

(gdb) x/x $eip
0x8048384 <main+16>: 0x00fc45c7


I know that the second examine command returns the memory address that eip is currently locating. What about the first one which returns two memory address?







c gdb






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 8 at 7:16









Henok TesfayeHenok Tesfaye

757522




757522












  • $eip can be seen as a pointer variable. So in C terms, x/x $eip prints $eip[0] and x/2x $eip prints $eip[0] and $eip[1].

    – Some programmer dude
    Mar 8 at 7:19











  • OK, what does they indicate?

    – Henok Tesfaye
    Mar 8 at 7:21











  • Then let me ask you this: Do you know what EIP is and what it's used for? What do you think that $eip is pointing at?

    – Some programmer dude
    Mar 8 at 7:24











  • Yes, EIP is a register inside the CPU, it is used to hold the memory address of instructions in our program which is currently executing. $eip is pointing to the address in the .text section of our program.

    – Henok Tesfaye
    Mar 8 at 7:27












  • My question is, there is only 1 $eip, so why it shows two memory address?

    – Henok Tesfaye
    Mar 8 at 7:31

















  • $eip can be seen as a pointer variable. So in C terms, x/x $eip prints $eip[0] and x/2x $eip prints $eip[0] and $eip[1].

    – Some programmer dude
    Mar 8 at 7:19











  • OK, what does they indicate?

    – Henok Tesfaye
    Mar 8 at 7:21











  • Then let me ask you this: Do you know what EIP is and what it's used for? What do you think that $eip is pointing at?

    – Some programmer dude
    Mar 8 at 7:24











  • Yes, EIP is a register inside the CPU, it is used to hold the memory address of instructions in our program which is currently executing. $eip is pointing to the address in the .text section of our program.

    – Henok Tesfaye
    Mar 8 at 7:27












  • My question is, there is only 1 $eip, so why it shows two memory address?

    – Henok Tesfaye
    Mar 8 at 7:31
















$eip can be seen as a pointer variable. So in C terms, x/x $eip prints $eip[0] and x/2x $eip prints $eip[0] and $eip[1].

– Some programmer dude
Mar 8 at 7:19





$eip can be seen as a pointer variable. So in C terms, x/x $eip prints $eip[0] and x/2x $eip prints $eip[0] and $eip[1].

– Some programmer dude
Mar 8 at 7:19













OK, what does they indicate?

– Henok Tesfaye
Mar 8 at 7:21





OK, what does they indicate?

– Henok Tesfaye
Mar 8 at 7:21













Then let me ask you this: Do you know what EIP is and what it's used for? What do you think that $eip is pointing at?

– Some programmer dude
Mar 8 at 7:24





Then let me ask you this: Do you know what EIP is and what it's used for? What do you think that $eip is pointing at?

– Some programmer dude
Mar 8 at 7:24













Yes, EIP is a register inside the CPU, it is used to hold the memory address of instructions in our program which is currently executing. $eip is pointing to the address in the .text section of our program.

– Henok Tesfaye
Mar 8 at 7:27






Yes, EIP is a register inside the CPU, it is used to hold the memory address of instructions in our program which is currently executing. $eip is pointing to the address in the .text section of our program.

– Henok Tesfaye
Mar 8 at 7:27














My question is, there is only 1 $eip, so why it shows two memory address?

– Henok Tesfaye
Mar 8 at 7:31





My question is, there is only 1 $eip, so why it shows two memory address?

– Henok Tesfaye
Mar 8 at 7:31












1 Answer
1






active

oldest

votes


















0














The examine command of gdb has the following syntax:



x/[n][f][u]


where n, f and u are optional and n is the length, f the format and u the unit size.



Possible formats are:



  • s (null terminated string)

  • i (machine code instruction)

  • x (hexadecimal value)

If no unit size can be one of the following values:



  • b (bytes)

  • h (2 bytes)

  • w (4 bytes)

  • g (8 bytes)

where w is the default.



Therefore x/2x prints 2 hexadecimal values with a size of 4 bytes from your code segment.






share|improve this answer

























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55058445%2fexamine-command-in-gdb%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    The examine command of gdb has the following syntax:



    x/[n][f][u]


    where n, f and u are optional and n is the length, f the format and u the unit size.



    Possible formats are:



    • s (null terminated string)

    • i (machine code instruction)

    • x (hexadecimal value)

    If no unit size can be one of the following values:



    • b (bytes)

    • h (2 bytes)

    • w (4 bytes)

    • g (8 bytes)

    where w is the default.



    Therefore x/2x prints 2 hexadecimal values with a size of 4 bytes from your code segment.






    share|improve this answer





























      0














      The examine command of gdb has the following syntax:



      x/[n][f][u]


      where n, f and u are optional and n is the length, f the format and u the unit size.



      Possible formats are:



      • s (null terminated string)

      • i (machine code instruction)

      • x (hexadecimal value)

      If no unit size can be one of the following values:



      • b (bytes)

      • h (2 bytes)

      • w (4 bytes)

      • g (8 bytes)

      where w is the default.



      Therefore x/2x prints 2 hexadecimal values with a size of 4 bytes from your code segment.






      share|improve this answer



























        0












        0








        0







        The examine command of gdb has the following syntax:



        x/[n][f][u]


        where n, f and u are optional and n is the length, f the format and u the unit size.



        Possible formats are:



        • s (null terminated string)

        • i (machine code instruction)

        • x (hexadecimal value)

        If no unit size can be one of the following values:



        • b (bytes)

        • h (2 bytes)

        • w (4 bytes)

        • g (8 bytes)

        where w is the default.



        Therefore x/2x prints 2 hexadecimal values with a size of 4 bytes from your code segment.






        share|improve this answer















        The examine command of gdb has the following syntax:



        x/[n][f][u]


        where n, f and u are optional and n is the length, f the format and u the unit size.



        Possible formats are:



        • s (null terminated string)

        • i (machine code instruction)

        • x (hexadecimal value)

        If no unit size can be one of the following values:



        • b (bytes)

        • h (2 bytes)

        • w (4 bytes)

        • g (8 bytes)

        where w is the default.



        Therefore x/2x prints 2 hexadecimal values with a size of 4 bytes from your code segment.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Mar 8 at 7:29

























        answered Mar 8 at 7:23









        kalehmannkalehmann

        2,7631023




        2,7631023





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55058445%2fexamine-command-in-gdb%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

            Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

            Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved