[mpich-discuss] Problem with gdb
Jarosław Bułat
kwant at agh.edu.pl
Mon Jul 28 17:29:02 CDT 2008
Dnia 28-07-2008, Pn o godzinie 13:41 -0700, Marcelo Tomim pisze:
> Hello Everyone,
>
> I have been trying to debug a program, but it freezes every time I try to run
> it in debug mode.
> This is what I type:
> mpiexec -gdb -n 3 ./my_program
>
> Then it does not return the command line and I have to kill it.
>
> Could anybody help me? I am using mpich2 1.0.5 on an AMD Athlon(tm) XP 1700+
> processor that runs on Kubuntu 8.0.4, for developing purposes.
I found, it's possible to debug program in more convenient way without
using commercial TotalView.
0. compile you program with -g flag (or -g3)
1. execute your system
2. find PID of process you would like to debug (one of your
my_program :-) )
3. attache gdb to this process set breakpoint or so...
In that way, you can use any graphical debugger with gdb support. This
way is much more convenient in comparison with plain gdb. You can debug
simultaneously as many processes as you want - one debugger for each
process. The catch is: you have to find PID of proces you would like to
debug and you need a little time between you start process and attache
debugger (put sleep(...) command, wait for specific signal, etc..).
I'm using kdbg (ubuntu 8.04 and gentoo) for debugging. It's one of many
graphics user interface for gdb command. Unfortunately I didn't found a
way to use debugger from eclipse or kdevelop which is superior in
compassion with kdbg.
Regards,
Jarek!
More information about the mpich-discuss
mailing list