Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 309607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:45:26+00:00 2026-05-12T07:45:26+00:00

Sometimes I want to debug functions like this: my_func1(my_func2(my_func3(val))); Is there a way I

  • 0

Sometimes I want to debug functions like this:

my_func1(my_func2(my_func3(val)));

Is there a way I can step through this nested call in GDB?

I want to step through my_func3, then my_func2, then my_func1, etc.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T07:45:26+00:00Added an answer on May 12, 2026 at 7:45 am

    What command are you stepping with? next would go to next line when debugging my_func1(my_func2(my_func3(val)));, but step should enter my_func3.
    Example:

    int my_func1(int i)
    {
      return i;
    }
    
    int my_func2(int i)
    {
      return i;
    }
    
    int my_func3(int i)
    {
      return i;
    }
    
    int main(void)
    {
      return my_func1(my_func2(my_func3(1)));
    }
    

    Debugged:

    (gdb) b main
    Breakpoint 1 at 0x4004a4: file c.c, line 19.
    (gdb) run
    Starting program: test
    
    Breakpoint 1, main () at c.c:19
    19    return my_func1(my_func2(my_func3(1)));
    (gdb) step
    my_func3 (i=1) at c.c:14
    14    return i;
    (gdb) step
    15  }
    (gdb) step
    my_func2 (i=1) at c.c:9
    9   return i;
    (gdb) step
    10  }
    (gdb) step
    my_func1 (i=1) at c.c:4
    4   return i;
    (gdb) step
    5 }
    (gdb) step
    main () at c.c:20
    20  }
    (gdb) cont
    Continuing.
    
    Program exited with code 01.
    (gdb)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Windows's Snipping tool can capture the screen, but sometimes I want to capture the
Is there a way to temporary deactivate all (or selected) Google Chrome extensions? This
I have a small issue. Sometimes when I debug an application I want to
Sometimes Eclipse comes up saying hey you should debug this line!!! but doesn't actually
If I'm not online, I sometimes want to package some changes to a commit,
Sometimes I want to build Python or GCC from scratch just for fun, but
As I learn new features in Oracle, sometimes I want to test how a
I have 2 classes both inherit from the same interface. i want sometimes to
sometimes when i want a winforms control to be docked also to the right
Sometimes, I want to use an ObjectOutputStream to write something to a file or

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.