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

When using powershell, sometimes I want to only display for example the name or
I have a flash program that loads movie clips dynamically and sometimes they want
Sometimes, in PL SQL you want to add a parameter to a Package, Function
Sometimes I find myself in the situation where I want to execute several sequential
I want to connect and execute one (or sometimes several) SQL statements, and NOT
I want to write to/delete a file but sometimes I get a crash if
I love the IDLE. However, sometimes I have 100-200 line scripts and I want
Using PHP's Image and GD functions you can use the following method to finally
Sometimes I don't want to break on reaching a line. I just want a
Sometimes I want to generate INSERT statements from the contents of a database table.

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.