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

  • Home
  • SEARCH
  • 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 6748825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:36:48+00:00 2026-05-26T12:36:48+00:00

Is it possible to get the gdb debugger to work with gcc-style nested functions?

  • 0

Is it possible to get the gdb debugger to work with gcc-style nested functions? If so, what versions of gcc/gdb are needed?

  • 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-26T12:36:49+00:00Added an answer on May 26, 2026 at 12:36 pm

    It appears that gcc/gdb have got the hang of it. With earlier versions it just didn’t work, but here’s a transcript of a simple session:

    jla@jla-desktop$ gdb --version
    GNU gdb (GDB) Fedora (7.2-51.fc14)
    Copyright (C) 2010 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
    and "show warranty" for details.
    This GDB was configured as "i686-redhat-linux-gnu".
    For bug reporting instructions, please see:
    <http://www.gnu.org/software/gdb/bugs/>.
    ~
    jla@jla-desktop$ gcc --version
    gcc (GCC) 4.5.1 20100924 (Red Hat 4.5.1-4)
    Copyright (C) 2010 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    
    ~
    jla@jla-desktop$ cat hello.c
    #include<stdio.h>
    
    void main(void)
    {
        char* hello="hello";
        int sub(int a){
            int b;
            int c;
            b=a;
            a++;
            c=a;
            return a+b+c;
        }
    
        printf("%s(%i)\n", hello, sub(3));
    }
    
    ~
    jla@jla-desktop$ gcc -ggdb3 hello.c -o hello
    ~
    jla@jla-desktop$ gdb hello
    GNU gdb (GDB) Fedora (7.2-51.fc14)
    Copyright (C) 2010 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
    and "show warranty" for details.
    This GDB was configured as "i686-redhat-linux-gnu".
    For bug reporting instructions, please see:
    <http://www.gnu.org/software/gdb/bugs/>...
    Reading symbols from /home/jla/hello...done.
    (gdb) b main
    Breakpoint 1 at 0x80483f1: file hello.c, line 5.
    (gdb) list
    1   #include<stdio.h>
    2   
    3   void main(void)
    4   {
    5       char* hello="hello";
    6       int sub(int a){
    7           int b;
    8           int c;
    9           b=a;
    10          a++;
    (gdb) r
    Starting program: /home/jla/hello 
    
    Breakpoint 1, main () at hello.c:5
    5       char* hello="hello";
    Missing separate debuginfos, use: debuginfo-install glibc-2.13-2.i686
    (gdb) info locals
    hello = 0x7aeff4 "|\355z"
    (gdb) s
    15      printf("%s(%i)\n", hello, sub(3));
    (gdb) s
    sub (a=3) at hello.c:9
    9           b=a;
    (gdb) info locals
    b = 134518388
    c = 0
    (gdb) p a
    $1 = 3
    (gdb) p b
    $2 = 134518388
    (gdb) p c
    $3 = 0
    (gdb) where
    #0  sub (a=3) at hello.c:9
    #1  0x08048405 in main () at hello.c:15
    (gdb) 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to get gdb or use some other tools to create a
Is it possible to get the value of unused variable using GDB? Is there
Is it possible to get gdb to disassemble machine code interactively. For example: (gdb)
Possible Duplicate: Get CVS history for a particular user Is it possible to list
Possible Duplicate: Get all files from VSS for a given date? I need to
Is is possible to get login credentials such as name/id if user does login
Is it possible to get a thread dump of a Java Web Start application?
Is it possible to get the x,y coordinates of a Flex app within an
Is it possible to get notified (without polling, but via an event) when a
Is it possible to get the text of an OleDbCommand with all parameters replaced

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.