I am using gdb to debug gem5 (an emulator written in c++). This simulator is very code-intensive and uses a lot of complex structures. When I used vscode, I found that I couldn't jump to the definition of the function very well (the project is very large, there are many, many functions with the same name, and there are many codes written in special languages, which are automatically translated into c++).
I am using gdb to debug it. I found an uncomfortable debugging problem.
For example the following statement. I want to go into the initialAcc
function.
When I use gdb to debug, the breakpoint is set at this location.
this->fault = this->staticInst->initiateAcc(this, A(),B());
When I use s
to try to step into the function, it goes into operator->
function, then into the A
function, then into the B
function. Finally enter the initiateAcc function.
This is causing me a big problem.
For example, when I enter the A
or B
function, if I use n
in the last sentence, the initialAcc function will be executed directly, and the next statement will be reached, so that I cannot enter the initialAcc function. If I keep using s
, I may encounter a very long chain of calls.
In the end I didn't even know where I was going.
Setting a breakpoint directly on the statement at the beginning of initialAcc is a good choice, but since Vscode shows missing references, I can't find where the initialAcc
function is, which is why I use gdb. There are many functions that are automatically translated into C++ using some scripts. And I always have similar problems.
Is there a general way for me to directly enter this initiateAcc
function?
Thanks!