Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[ptp-dev] Re: About PTP debugger support for Fortran program

Jie,

There are few issues here:

1. The ability of gdb to debug programs complied with ifort. gdb is designed to work with gfortran, so you need to check that it can actually debug the program (print variables correctly, etc.)

2. Fortran support in SDM. The SDM uses gdb to read the variable's type information from the program (src/utils/gdb_aif.c). This probably needs some work to understand fortran types (although I thought simple types like integers were working).

3. Language support in the debugger UI. Currently type information is displayed in raw form (although the value should be displayed correctly). We're working on adding language-specific rendering so the the correct fortran (or other language) type will be displayed correctly.

We have plans for (3) currently, but (2) is uncertain at the moment. We don't have plans for (1).

Your stack trace below seems to indicate that you're trying to display the value of a function (the type "&/is4" is a function with integer return type). It looks like this is a bug in the gdb AIF code.

Hope this helps.

Cheers,
Greg

On Jul 21, 2010, at 11:49 AM, JiangJie wrote:

Greg,

Current PTP parallel debugger (in 4.0) works pretty  well with C MPI and Serial program.
But when debugging Fortran program (f77 with ifort compiler), the sdm (server) usually fails and the debug session also fails.
The following is the stack trace of sdm when it exits abnormally with a Fortran debug session.

Program received signal SIGABRT, Aborted.
0x0000003f6c030215 in raise () from /lib64/libc.so.6
(gdb) bt
#0  0x0000003f6c030215 in raise () from /lib64/libc.so.6
#1  0x0000003f6c031cc0 in abort () from /lib64/libc.so.6
#2  0x0000003f6c06a7fb in __libc_message () from /lib64/libc.so.6
#3  0x0000003f6c075a36 in free () from /lib64/libc.so.6
#4  0x0000000000425958 in _aif_free (m=0x42a39a) at util.c:54
#5  0x0000000000419e17 in AIFFree (a=0x63dc10) at aif.c:79
#6  0x00000000004107bd in FreeDbgEvent (e=0x63d310) at src/utils/event.c:826
#7  0x0000000000406849 in GDBMIProgress () at src/server/gdbmi_backend.c:738
#8  0x00000000004049ab in svr_progress (db=0x637d60) at src/server/server_cmds.c:197
#9  0x000000000040475a in server (dbgr=0x637d60) at src/server/server.c:174
#10 0x00000000004022dd in main (argc=4, argv=0x7fffb8b1fcf8) at src/master/startup.c:242
(gdb) frame 5
#5  0x0000000000419e17 in AIFFree (a=0x63dc10) at aif.c:79
79    aif.c: No such file or directory.
    in aif.c
(gdb) p *a
$14 = {a_fds = 0x42a39a "&/is4", a_data = {a_data_len = 10, a_data_val = 0x63edf0 "\020�c"}}
(gdb) x/4xb 0x63dc10
0x63dc10:    0x9a    0xa3    0x42    0x00
(gdb) whatis a->a_fds
type = char *
(gdb) p (a->a_fds)
$16 = 0x42a39a "&/is4"
(gdb) x/4xb 0x42a39a
0x42a39a <__dso_handle+3218>:    0x26    0x2f    0x69    0x73
(gdb) x/5xb 0x42a39a
0x42a39a <__dso_handle+3218>:    0x26    0x2f    0x69    0x73    0x34
------------------------------------------------------------------------------------------------------------


It seems that current sdm can't support Fortran data types.
And If I'm correct, I remember that this Fortran problem has been in existence since the beginning of PTP project.
To fix this problem, lots of efforts are needed to add Fortran support into sdm code and UI debugger code.

Will the Fortran debug support be on the to-do list of PTP?

Regards,
Jie





聊天+搜索+邮箱 想要轻松出游,手机MSN帮你搞定! 立刻下载!


Back to the top