answersLogoWhite

0


Best Answer

Assuming that you have written a program named abc.c and created executable abc.

Steps:

1. run your program from command line ./abc

3. get the PID processid of the program from PS aux | grep abc

3. start the gdb from command line

4. type following command on GDB prompt

(gdb) attach PID

where PID = your program's processid got from step 1.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you debug a program that is already running?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the sort cut for running c plus plus program?

It depends on the particular IDE. Visual Studio uses <Ctrl>F5 to start a program in non-debug mode, and F5 to start a program in debug mode.


This is a crossword question. correct errors in a computer program. this a 5 letter word. i already have eg?

debug


How do you debug a program in visual basic?

Press the debug icon.


What is the process of testing and eliminating errors in a program?

debug debug


How do you debug an iPod touch?

An iPod Touch comes already debugged. There is no reason for you to debug what is already debugged.


What program removes glitches?

debug


How can you debug a C program in Unix?

You can debug C programs using gdb on Unix.


If you can debug codewith break point in Release mode then what is actual necessity of Debug mode?

You are confusing debug mode with debug build. A build simply defines a specific set of compiler options to produce an executable. You can define as many builds as you like so you can easily switch from one configuration to the other without having to continually reconfigure the compiler options. For instance, if you are working on a 64-bit machine you might choose to create a separate executable specifically for 32-bit systems, therefore you need a separate build configuration with the appropriate compiler options. A debug build is simply a compiler configuration that is ideally suited to debugging because it has no compiler optimisations and may include source code that will not be compiled in the release build. However, release builds can also be debugged. As developer you will have access to the program debug database, but you can also make this database available to your users if you wish them to be able to debug your release builds. Debug mode is not the same as a debug build. When you run your program from within the debugger (or from within your IDE) then you are in debug mode. In this mode, the program is attached to the debugger and all breakpoints set within the debugger will be honoured, even if it is a release build you are running. But when the program is executed outside of the debugger then you are in standalone (normal) mode and the breakpoints will have no effect, even in debug builds. Your debugger will typically provide some means to execute the program outside of the debugger. In Microsoft Visual Studio, for instance, F5 runs the program in debug mode while CTRL+F5 runs the program in standalone mode. When an exception occurs in standalone mode, the operating system will ask if you want to debug the program or terminate the program. If you choose to debug, then the operating system will ask you to specify your debugger. If the debugger is already running then that will be listed as one of the options but you can choose to use a new instance of the same debugger or choose another debugger entirely (if one is available). Once you select the debugger, the debugger attaches itself to the process and sets up the debugging environment. Provided the program's debug database is available, the debugger will then isolate the problem and present the code to you just as if you'd run the program in debug mode. If the database is not available, the program will be disassembled instead -- you won't have access to the source code.


What is computer program which removes glitches?

debug


Code View Debug info use in vb 6?

The program should have a help area. search the helpe area for information about the debug information the program displays/


What does this mean and how do i remove it Just in Time debugging However no debuggers are registered that can debug this exception Unable to JIT debug?

You are attempting to run a debug version of a machine code program, but you do not have the required debugger.


What is the full form of MP LAB?

Make program debug/executive