简体   繁体   English

如何让GDB前进到正确的位置?

[英]How can I get GDB to advance to the correct place?

I am using GDB with Microblaze assembly running under OVPsim. 我正在将GDB与在OVPsim下运行的Microblaze程序集一起使用。 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. 即,尽管我要求GDB前进到特定符号,但它远远超出了它-甚至似乎知道它已经远远超出了它。 I suppose I could ask it to advance to a particular address (in this case 0x574) but is there a more general solution? 我想我可以要求它前进到一个特定的地址(在这种情况下为0x574),但是还有更通用的解决方案吗?

The argument to the advance (and break ) command is either a function name, line number, label, or a * followed by an address expression. advance (和break )命令的参数可以是函数名称,行号,标签或*后跟地址表达式。

Specifying a function name will make gdb stop after the function's prologue. 指定函数名称将使gdb在函数序言之后停止。 If you want to stop at the exact starting address of the PTE_entry_empty function, you can do 如果要在PTE_entry_empty函数的确切起始地址处停止,可以执行

(gdb) advance *PTE_entry_empty

The use of * may seem counterintuitive, since there's no indirection involved. *的使用似乎违反直觉,因为其中没有间接关系。 Just consider it to be a keyword. 只需将其视为关键字即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM