Share your knowledge at the LQ Wiki.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 09-28-2006, 02:47 PM   #1
LQ Newbie
Registered: Jul 2006
Distribution: Debian 3.X
Posts: 14

Rep: Reputation: 0
gdb hangs on function call

OS: Debian GNU/Linux 3.1
GNU gdb 6.3-debian

I wrote a program that has 3 source files.

I am calling an external function in one of my source files (function from a different source file).

When I run the executible, there is no problem.

When I debug, however and try to step into the extern,
it hangs up indefineitely. It will not recover.

I am purely command line, no X - Windows here.

I believe that it may have to do with updating symbols at this point.

Is there a good way to do this?


Last edited by astropirhana; 09-28-2006 at 03:28 PM.
Old 09-29-2006, 01:51 AM   #2
Senior Member
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 110Reputation: 110
Maybe you forgot to compile the other source file with gcc's "-g" option, and the function you called from the other source file hangs (infinite loop or blocking syscall or so...) ??
Old 09-29-2006, 08:01 AM   #3
LQ Newbie
Registered: Jul 2006
Distribution: Debian 3.X
Posts: 14

Original Poster
Rep: Reputation: 0
Thanks for your response,
I do compile with the -g option.

Not blocking or looping just stepping into the function.

I am also noting that it takes a while to execute TCP/IP functions in the debugger.

Why would it hang this way?

Solved: Not really sure why, but the debugger seems to have updated the symbol file on its own.
Theories are welcome though.

Last edited by astropirhana; 09-29-2006 at 01:32 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
unable to step through function in shared object library using gdb markhod Programming 2 01-03-2009 02:00 AM
understanding gdb output of a C function in disassembled form. koodoo Programming 7 04-12-2006 10:55 AM
How to call another function from a function? geminigal Programming 4 04-21-2005 10:41 PM
gdb won't single step thru the function frankie_DJ Programming 2 10-06-2004 05:50 AM
how to call function?? harpal Programming 3 04-29-2003 05:59 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:27 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration