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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:58:29+00:00 2026-05-13T11:58:29+00:00

I am trying to add a breakpoint in my program using b {line number}

  • 0

I am trying to add a breakpoint in my program using

b {line number}

but I am always getting an error that says:

No symbol table is loaded.  Use the "file" command.

What should I do?

  • 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-13T11:58:29+00:00Added an answer on May 13, 2026 at 11:58 am

    Here is a quick start tutorial for gdb:

    /* test.c  */
    /* Sample program to debug.  */
    #include <stdio.h>
    #include <stdlib.h>
    
    int
    main (int argc, char **argv) 
    {
      if (argc != 3)
        return 1;
      int a = atoi (argv[1]);
      int b = atoi (argv[2]);
      int c = a + b;
      printf ("%d\n", c);
      return 0;
    }
    

    Compile with the -g3 option. g3 includes extra information, such as all the macro definitions present in the program.

    gcc -g3 -o test test.c
    

    Load the executable, which now contain the debugging symbols, into gdb:

    gdb --annotate=3 test.exe 
    

    Now you should find yourself at the gdb prompt. There you can issue commands to gdb.
    Say you like to place a breakpoint at line 11 and step through the execution, printing the values of the local variables – the following commands sequences will help you do this:

    (gdb) break test.c:11
    Breakpoint 1 at 0x401329: file test.c, line 11.
    (gdb) set args 10 20
    (gdb) run
    Starting program: c:\Documents and Settings\VMathew\Desktop/test.exe 10 20
    [New thread 3824.0x8e8]
    
    Breakpoint 1, main (argc=3, argv=0x3d5a90) at test.c:11
    (gdb) n
    (gdb) print a
    $1 = 10
    (gdb) n
    (gdb) print b
    $2 = 20
    (gdb) n
    (gdb) print c
    $3 = 30
    (gdb) c
    Continuing.
    30
    
    Program exited normally.
    (gdb) 
    

    In short, the following commands are all you need to get started using gdb:

    break file:lineno - sets a breakpoint in the file at lineno.
    set args - sets the command line arguments.
    run - executes the debugged program with the given command line arguments.
    next (n) and step (s) - step program and step program until it 
                            reaches a different source line, respectively. 
    print - prints a local variable
    bt -  print backtrace of all stack frames
    c - continue execution.
    

    Type help at the (gdb) prompt to get a list and description of all valid commands.

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

Sidebar

Ask A Question

Stats

  • Questions 368k
  • Answers 368k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer There is now: public static class StockStandardFunctions { public static… May 14, 2026 at 6:03 pm
  • Editorial Team
    Editorial Team added an answer https://cocoadev.github.io/ChooseYourOwnPrefix/ is probably your best bet. It's not "official", but… May 14, 2026 at 6:03 pm
  • Editorial Team
    Editorial Team added an answer Specific answers are difficult because they really depend on the… May 14, 2026 at 6:03 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.