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 8323631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T23:46:29+00:00 2026-06-08T23:46:29+00:00

In the following code: 1 #include <iostream> 2 3 using namespace std; 4 5

  • 0

In the following code:

 1 #include <iostream>
 2
 3 using namespace std;
 4
 5 int funcA(){
 6    cout << "A" << endl;
 7    return 1;
 8 }
 9
10 int funcB(){
11    cout << "B" << endl;
12    return 1;
13 }
14
15 int funcC(){
16    cout << "C" << endl;
17    return 1;
18 }
19
20 int funcAll( int a, int b, int c ){
21    return 1;
22 }
23
24 int main(){
25    cout << funcAll( funcA(), funcB(), funcC() ) << endl;
26    return 0;
27 }
28

Will be printed C, B, then A.

But when debuging and staying on line 25 if we command next on gdb the cursor goes to the line 26, if we command step gdb will step from funcC until funcA, but how to directly step on funcB OR funcA without setting a breakpoint or steping inside funcC.

  • 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-06-08T23:46:31+00:00Added an answer on June 8, 2026 at 11:46 pm

    The order of evaluation of the arguments of a function in C and C++ is unspecified. The compiler is free to reorder/interleave them however it sees fit, within certain constraints. So you cannot rely on funcC() getting called before funcA().

    If you want to ensure that the arguments will get evaluated in a certain order, break them up into separate statements like this:

    int a = funcA();
    int b = funcB();
    int c = funcC();
    cout << funcAll(a, b, c,) << endl;
    

    This will also make debugging easier.

    If you don’t want to rewrite your code, you still have some alternatives. The easiest thing to do is just set a breakpoint inside your function of interest, e.g.:

    break funcB
    

    Or if you only need to do this once, use a tbreak instead of break to set a temporary breakpoint which will clear itself after it’s hit for the first time.

    You can also use the nexti and stepi instructions to step one assembly instruction at a time. By looking at the disassembly with the disassemble command, you can step up to the appropriate call site (e.g. the call instruction on x86 or x86-64, or bl on PowerPC) using nexti, then stepi to step into it. stepi and nexti work like step and next, except they operate on assembly instructions instead of lines of code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The following code #include <iostream> using namespace std; int main() { const char* const
Consider the following code: #include <iostream> using namespace std; int main() { int x,
I have the following code: #include<iostream> using namespace std; typedef void (*HandlerFunc)(int, int); HandlerFunc
the following code #include <iostream> using namespace std; int main(){ char greeting[50] = goodmorning
Consider the following code: #include <iostream> using namespace std; class Test { static int
I am using the following code: #include <stdio.h> #include <iostream> using namespace std; int
i have following code #include <iostream> using namespace std; int main(int argc,char arg[]){ int
i have following code #include <iostream> using namespace std; int main(){ int i; char
I have following code: #include <iostream> using namespace std; template<class T> T max(T *data,int
I have the following code: #include <iostream> using namespace std; struct stud{ int roll;

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.