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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:33:13+00:00 2026-06-02T01:33:13+00:00

I am using gdb-7.0.1 and I think I have detected a bug in a

  • 0

I am using gdb-7.0.1 and I think I have detected a bug in a certain section of my code, which
has a for loop. The for loop looks like

for (int i=0 ; i< end ; ++i )
{
   //Code here.
}

Here end is a very large integer. The code does not crash at the first iteration, and seems to crash somewhere at iteration number end/2.

Since I want to understand the behaviour of the code at iteration number end/2 , just stepping and nexting from i=0 till I reach this iteration point, is unfeasible.

Is there a way to tell gdb to continue through a for loop till i gets the value end/2 and then wait for the user to manually step through iteration number end/2?

I am using gcc-4.5.2 on Ubuntu Linux

  • 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-02T01:33:16+00:00Added an answer on June 2, 2026 at 1:33 am

    When you set the breakpoint it’ll give you a breakpoint number (for the moment, let’s assume it’s 1). You’ll then make that breakpoint conditional, something like:

    condition 1 i==end/2
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Do we have a way to view assembly and c code both using gdb.
I'm using a third party code which has its own implementation for std::ostream operator<<,
Is there a way to list all the loaded modules using gdb, just like
I know how to get the assembly code of my program using gdb but
I have an issue with my program using much more memory than I think
Okey, I have two strings containing numbers like shown here using debugger: String 1
So I am debugging an x86 program using GDB. I am in a certain
I know about specifying source locations using gdb. But I am wondering if there's
I'm working on a multithreaded application, and I want to debug it using GDB.
I am attempting to use GDB to debug a Stellaris LM3S8962 Evaluation board using

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.