GDB error Value can't be converted to integer

10,600

Solution 1

You running it from a 64 Bit system so you should use register names as rip instead of eip and so on for all registers.

for example:

(gdb) x/x $rip
0x4004c8 :  0x4005d8b8

Get info registers to view all (gdb) info registers

rax            0x7ffff7dd9f60   140737351884640

rbx            0x0  0

rcx            0x0  0

rdx            0x7fffffffe188   140737488347528

rsi            0x7fffffffe178   140737488347512

rdi            0x1  1

rbp            0x7fffffffe090   0x7fffffffe090

rsp            0x7fffffffe090   0x7fffffffe090

r8             0x7ffff7dd8300   140737351877376

r9             0x7ffff7deb9e0   140737351956960

r10            0x7fffffffdee0   140737488346848

r11            0x7ffff7a68be0   140737348275168

r12            0x4003e0 4195296

r13            0x7fffffffe170   140737488347504

r14            0x0  0

r15            0x0  0

rip            0x4004c8 0x4004c8 

eflags         0x246    [ PF ZF IF ]

cs             0x33 51

ss             0x2b 43

ds             0x0  0

es             0x0  0

fs             0x0  0

Solution 2

(gdb) x/20x $esp
Value can't be converted to integer.

Try x/20x $rsp or x/20x $sp

Share:
10,600
Satish
Author by

Satish

Curious about everything.

Updated on June 04, 2022

Comments

  • Satish
    Satish almost 2 years

    I am trying to debug some application and i want to pass some data using following command but i am getting error.

        ....
        ....
        (gdb) x/20x $esp
        Value can't be converted to integer.
        (gdb)
    

    My GDB version is followin:

    #gdb -v
    GNU gdb (GDB) Red Hat Enterprise Linux (7.0.1-23.el5)
    Copyright (C) 2009 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 "x86_64-redhat-linux-gnu".
    For bug reporting instructions, please see:
    <http://www.gnu.org/software/gdb/bugs/>.