user194076
user194076

Reputation: 9017

How can I add breakpoint to internal function

I'm using GDB to step through the code.

The problem is my code has functions from external files. Is there a way on stepping through inner functions?

like this:

    int main 
    { 
    string a ="AAA"; 
    DoString(a);
    }

Is there a way on stepping through execution of DoString with GDB?

Upvotes: 2

Views: 96

Answers (2)

karlphillip
karlphillip

Reputation: 93410

After breaking at the function with break DoString , executing step will take you further down into the call and next will just step over it.

Upvotes: 0

Nikolai Fetissov
Nikolai Fetissov

Reputation: 84151

You mention assembly in the tags, so I assume the function is not in C. Just use si (short for stepi) GDB command to step one machine instruction at a time. See the manual.

Upvotes: 1

Related Questions