Search code examples
assemblygdbmicroblazeovp

How can I get GDB to advance to the correct place?


I am using GDB with Microblaze assembly running under OVPsim. I have the following problem:

(gdb) advance PTE_entry_empty
0x00000598 in PTE_entry_empty()
1: x/i $pc
=> 0x598 <PTE_entry_empty+36>: mfs    r6, rear

ie., although I ask GDB to advance to a particular symbol it goes well beyond it - and even seems to know it has gone well beyond it. I suppose I could ask it to advance to a particular address (in this case 0x574) but is there a more general solution?


Solution

  • The argument to the advance (and break) command is either a function name, line number, label, or a * followed by an address expression.

    Specifying a function name will make gdb stop after the function's prologue. If you want to stop at the exact starting address of the PTE_entry_empty function, you can do

    (gdb) advance *PTE_entry_empty
    

    The use of * may seem counterintuitive, since there's no indirection involved. Just consider it to be a keyword.