GDB:打印二维数组FORTRAN [英] gdb: Printing two dimensional fortran array

查看:1020
本文介绍了GDB:打印二维数组FORTRAN的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个问题用GDB打印在FORTRAN code二维数组的值。

Having an issue with using GDB to print the values of two dimensional arrays in fortran code.

(gdb) print var(1,2)
no such vector element

广泛的搜索后,我发现日〜2007年很多帖子 - 有关该问题的2010。大多数终端用户与别人暗示的补丁。已经这个问题曾经在当前版本(我使用7.4-2012.04)得到了解决?有没有关于该问题目前的职位,有没有被修复或适当变通可用?

After an extensive search I have found many posts dated ~2007 - 2010 about the problem. Most end with someone suggesting a patch. Has this issue ever been resolved in the current release (I'm using 7.4-2012.04)? There are no current posts on the subject, has it been fixed or a suitable work-around available?

一个建议是切换到c

(gdb) set language c
(gdb) print neighbours
$47 = 0xbfaeae44
(gdb) print *neighbours
$48 = 0xbfaeae44
(gdb) print 0xbfaeae44
$49 = 3215896132

我如何打印的价值指向,做这个指针算法?

How can I print the value pointed to and do pointer arithmetic with this?

感谢

推荐答案

是的,有已经在过去的问题与此有关。不知道这是在最新的GDB真实的。

Yes there have been problems with this in the past. Not sure if this is true in the latest gdb.

另外,你可以使用DBX(从的Solaris工作室)是免费提供的,并且具有更好的图形用户界面。顺便说一句的Solaris Studio包括一个调试器,分析仪,C / C ++ / Fortran编译器,Sunperf lib和整个安装不到演出。

Alternatively, you can use dbx (from Solaris Studio) that is freely available and has a nicer GUI. Btw Solaris Studio includes a debugger, analyzer, C/C++/Fortran compilers, Sunperf lib and the whole install is less than a gig.

我一直使用GNU编译器,但工作室的Solaris来得心应手与Fortran程序工作时,特意在调试/跟踪错误/警告,符合标准等,这通常是更好地反正检查code多的编译器。使用OpenMP(用于检测场比赛)时,分析仪是专很有帮助的。

I always use GNU compilers but Solaris Studio comes handy while working with Fortran programs specially while debugging/tracking bugs/warnings, conformance to standard etc. It is usually better to check your code with multiple compilers anyway. Analyzer is specially helpful when using OpenMP (for detecting races).

这篇关于GDB:打印二维数组FORTRAN的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆