linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Debugging a Process ...
@ 2002-10-24 21:46 Ivan Deras
  2002-10-25 23:39 ` Damir Cosic
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Ivan Deras @ 2002-10-24 21:46 UTC (permalink / raw)
  To: linux-c-programming

I want to know how to debug a process in Linux, i know that in Windows i 
can use Windows-API to attach a debugger process to the debugged 
process, but in Linux i don't know ...


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Debugging a Process ...
  2002-10-24 21:46 Debugging a Process Ivan Deras
@ 2002-10-25 23:39 ` Damir Cosic
  2002-10-26  7:44 ` Steven Smith
  2002-10-31 15:16 ` Nat Ersoz
  2 siblings, 0 replies; 5+ messages in thread
From: Damir Cosic @ 2002-10-25 23:39 UTC (permalink / raw)
  To: linux-c-programming



* find out PID of the process (man pidof)

* call gdb with name of the program you want to debug as an argument

* in gdb type `attach PID'


On Oct 10/24/02 15:46, Ivan Deras wrote:
> I want to know how to debug a process in Linux, i know that in Windows i 
> can use Windows-API to attach a debugger process to the debugged 
> process, but in Linux i don't know ...

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Debugging a Process ...
  2002-10-24 21:46 Debugging a Process Ivan Deras
  2002-10-25 23:39 ` Damir Cosic
@ 2002-10-26  7:44 ` Steven Smith
  2002-10-28 10:14   ` Ivan Deras
  2002-10-31 15:16 ` Nat Ersoz
  2 siblings, 1 reply; 5+ messages in thread
From: Steven Smith @ 2002-10-26  7:44 UTC (permalink / raw)
  To: Ivan Deras; +Cc: linux-c-programming

[-- Attachment #1: Type: text/plain, Size: 613 bytes --]

> I want to know how to debug a process in Linux, i know that in Windows i 
> can use Windows-API to attach a debugger process to the debugged 
> process, but in Linux i don't know ...
If you want to attach an existing debugger, look at the documentation
for that debugger (in gdb, it's ``gdb <program_name> <pid of program>'').
If you're thinking of writing your own, have a look at man ptrace.
This isn't the clearest of documents, so you may want to have a look
at the source to a few programs which use it, like gdb, strace, or
ltrace, before starting on your own.

Steven Smith,
sos22@cam.ac.uk.

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Debugging a Process ...
  2002-10-26  7:44 ` Steven Smith
@ 2002-10-28 10:14   ` Ivan Deras
  0 siblings, 0 replies; 5+ messages in thread
From: Ivan Deras @ 2002-10-28 10:14 UTC (permalink / raw)
  To: Steven Smith; +Cc: linux-c-programming

This is very helpful for me ... Thanks ...

Steven Smith wrote:

>>I want to know how to debug a process in Linux, i know that in Windows i 
>>can use Windows-API to attach a debugger process to the debugged 
>>process, but in Linux i don't know ...
>>    
>>
>If you want to attach an existing debugger, look at the documentation
>for that debugger (in gdb, it's ``gdb <program_name> <pid of program>'').
>If you're thinking of writing your own, have a look at man ptrace.
>This isn't the clearest of documents, so you may want to have a look
>at the source to a few programs which use it, like gdb, strace, or
>ltrace, before starting on your own.
>
>Steven Smith,
>sos22@cam.ac.uk.
>  
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Debugging a Process ...
  2002-10-24 21:46 Debugging a Process Ivan Deras
  2002-10-25 23:39 ` Damir Cosic
  2002-10-26  7:44 ` Steven Smith
@ 2002-10-31 15:16 ` Nat Ersoz
  2 siblings, 0 replies; 5+ messages in thread
From: Nat Ersoz @ 2002-10-31 15:16 UTC (permalink / raw)
  To: Ivan Deras; +Cc: linux-c-programming

> * in gdb type `attach PID'

You might find the "ddd" will provide a nice graphical interface to
gdb.  I've used it frequently, and am very pleased with it.  All gdb
commands should work within it.


-- 
_________________________________________
Nat Ersoz             nat.ersoz@myrio.com  -o) 
Myrio Corporation     Phone: 425.897.7278  /\\
3500 Carillon Point   Cell:  425.417.5182 _\_V
Kirkland, WA 98033    Fax:   425.897.5600



	     


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-10-31 15:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-24 21:46 Debugging a Process Ivan Deras
2002-10-25 23:39 ` Damir Cosic
2002-10-26  7:44 ` Steven Smith
2002-10-28 10:14   ` Ivan Deras
2002-10-31 15:16 ` Nat Ersoz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).