View the Most Wanted LQ Wiki articles.
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 05-25-2013, 06:21 PM   #1
Registered: Feb 2013
Posts: 287

Rep: Reputation: Disabled
how to get gdb to step thru called functions

Trying to use gdb to check on code, but when I use -tui and reach a function call, I am unable to evaluate what happens in the called function-----it simply stays in main with the returned value.
Anyone who understands my problem and can provide what I need to do to correct this?
Old 05-25-2013, 11:07 PM   #2
Senior Member
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 2,520

Rep: Reputation: 696Reputation: 696Reputation: 696Reputation: 696Reputation: 696Reputation: 696
in gdb,
s[step]: enter the called function
n[ext]: execute the called function at once
1 members found this post helpful.
Old 05-26-2013, 12:44 AM   #3
Registered: Feb 2013
Posts: 287

Original Poster
Rep: Reputation: Disabled
Yes, that was very helpful. Unfortunately, it didn't help me with my code problem, but that's for tomorrow to try to figure what's wrong.
I've always tried to avoid the 's'tep command, as the code shown is way over my head. But that combination will be very helpful to me in the future.
Old 05-26-2013, 02:43 PM   #4
LQ 5k Club
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,396
Blog Entries: 2

Rep: Reputation: 904Reputation: 904Reputation: 904Reputation: 904Reputation: 904Reputation: 904Reputation: 904Reputation: 904
I think you want to be prudent about where you step over functions, and where you step into functions. Stepping into library functions like Standard C Lib functions or third party API functions is usually not helpful. Stepping into the functions you create for your own project is more likely to be useful.
--- rod.
1 members found this post helpful.
Old 05-26-2013, 07:28 PM   #5
Registered: Feb 2013
Posts: 287

Original Poster
Rep: Reputation: Disabled
yes, that's exactly what I was experiencing. Now that I see how to step 'into' a function, it becomes so much more clear.
Old 07-01-2013, 02:12 AM   #6
LQ Newbie
Registered: Jul 2011
Posts: 15

Rep: Reputation: Disabled
GDB Tutorials

gdb for pthread debug

gdb core dump analysis for beginners

gdb tutorial how to start with GDB


Last edited by anish2good; 07-01-2013 at 02:14 AM.
1 members found this post helpful.
Old 07-16-2013, 02:44 PM   #7
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,823

Rep: Reputation: 120Reputation: 120
Anish2good, please do not use LQ to promote your youtube videos. In 13 out of your total of 15 posts, you have links back to your youtube content.
1 members found this post helpful.


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
how to step into so file in GDB wj123 Programming 2 01-04-2013 09:21 AM
scull_read and scull_write functions are not called linuxaddected Linux - Kernel 3 04-18-2011 10:47 AM
[SOLVED] Gdb did not step into function when "step" typed!!! 915086731 Programming 4 06-23-2010 09:44 AM
Functions in .so file not called. priyeshwadhwa Linux - Newbie 2 02-22-2008 04:05 AM
gdb in glibc functions Harald Rudell Programming 0 09-05-2007 02:45 PM

All times are GMT -5. The time now is 08:28 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