LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 05-25-2013, 06:21 PM   #1
atlantis43
Member
 
Registered: Feb 2013
Posts: 289

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
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,862
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
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
atlantis43
Member
 
Registered: Feb 2013
Posts: 289

Original Poster
Rep: Reputation: Disabled
NevemTeve;
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
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
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
atlantis43
Member
 
Registered: Feb 2013
Posts: 289

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
anish2good
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

zariga

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
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
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.
  


Reply



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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:50 PM.

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