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 09-24-2005, 08:18 PM   #1
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203

Rep: Reputation: 45
gdb questions..


Hi is it possible when debugging a prog with the gdb to view what gdb is executing> I need that because my programme stops and i want to ifnd out where,,, One way for doing that is to place watchpooints everywhere and to see where it stops... but my programmes i big enough for such procedure
 
Old 09-25-2005, 01:21 AM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
I'm not sure I understand the question, but you can attach to a live process with gdb.

FOR EXAMPLE:
1. You think the program is hanging - you don't know where, but you can see it "get stuck".
2. You compile the program with "-g" (permitting debugging), and let it run (normally, outside the debugger or in - it doesn't matter)
3. When it hangs...
4. You do:
a) ps -eaf|grep MYPROG
<= GET THE PID
b) gdb MYPROG MYPID
<= ATTACH TO THE LIVE PROCESS AND DEBUG

'Hope that helps .. PSM
 
Old 09-25-2005, 02:42 AM   #3
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203

Original Poster
Rep: Reputation: 45
exactly this but when the gdb starts i want by issuing some commands to be able to check what was the last thing the programme has do.....
 
  


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
normal gdb and spec gdb for kgdb Igor007 Programming 1 09-23-2005 04:15 PM
normal gdb and spec gdb for kgdb Igor007 Linux - Newbie 1 09-23-2005 01:41 PM
gdb .. looking for 32 bit gdb.. for ia64 suse.. nkshirsagar SUSE / openSUSE 0 12-09-2004 03:02 AM
How to use GDB ? indian Programming 4 09-06-2004 05:11 AM
more about gdb jiangdir Programming 0 08-12-2001 09:36 PM

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

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