Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    debugging with gdb and qemu

    I launched qemu virtual machine with this options
    qemu-system-x86_64 -s -S
    I did not set any data images because i just want to try gdb. I am going to spet some instructions through BIOS startup code.

    So i connected to virtual machine with gdb
    (gdb) target remote localhost:1234
    Remote debugging using localhost:1234
    0x0000fff0 in ?? ()
    Now that what i do
    (gdb) x/i $pc
    => 0xfff0: add %al,(%eax)
    (gdb) display/i $pc
    1: x/i $pc
    => 0xfff0: add %al,(%eax)
    (gdb) si
    0x0000e05b in ?? ()
    1: x/i $pc
    => 0xe05b: add %al,(%eax)
    (gdb) si
    0x0000c81e in ?? ()
    1: x/i $pc
    => 0xc81e: add %al,(%eax)
    (gdb) si
    0x0000c821 in ?? ()
    1: x/i $pc
    => 0xc821: add %al,(%eax)
    (gdb) si
    0x0000c827 in ?? ()
    1: x/i $pc
    => 0xc827: add %al,(%eax)
    As you see for some reason all instructions in memory are displayed as
    add %al,(%eax)
    This is equivalent as if the whole memory contained zeroes. But it doesn't! You see ho $pc changes? it does not increment 2 bytes all the time.
    What the promblem with gdb agai???

  2. #2
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    3rd rock from sun - Often seen near moon
    I don't know about how to debug using qemu. But you want to debug kernel source code -then using User mode linux is an easy/better approach.
    First they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    FOSS India Award winning ext3fs Undelete tool Online Linux Terminal

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts