Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

idb with multiple source

roddur
Beginner
495 Views

with multiple file as subroutine compiled with make, how can i set a breakpoint in some point? suppose, i want to find value of argument A on a subroutine S ....its easy if there is a single source code....but what if each subprogram is written as a seperate file?

I have gone through the intel's manual....so its not RTFM....may be U(nderstand)TFM?

0 Kudos
3 Replies
roddur
Beginner
495 Views
Plz reply the post...even if it quite idiotic.....i am really stuck
0 Kudos
Kevin_D_Intel
Employee
495 Views

You can set a break point in the subroutine using the subroutine's name. See the example below and the "br sub1" command.

[bash]$ cat -n sample1.f90
     1  program sample
     2  integer i
     3  call sub1(i)
     4  end

$ cat -n sub1.f90
     1  subroutine sub1(i)
     2  integer i
     3  print *,"i = ",i
     4  end

$ ifort -V -c -g sub1.f90
Intel Fortran Intel 64 Compiler Professional for applications running on Intel 64, Version 11.1    Build 20100203 Package ID: l_cprof_p_11.1.069
Copyright (C) 1985-2010 Intel Corporation.  All rights reserved.

 Intel Fortran 11.1-2692

$ ifort -V -g sample1.f90 sub1.o
Intel Fortran Intel 64 Compiler Professional for applications running on Intel 64, Version 11.1    Build 20100203 Package ID: l_cprof_p_11.1.069
Copyright (C) 1985-2010 Intel Corporation.  All rights reserved.

 Intel Fortran 11.1-2692
GNU ld version 2.17.50.0.6-5.el5 20061020

$ idbc a.out
Intel Debugger for applications running on Intel 64, Version 11.1, Build [1.2097.2.333]
------------------
object file name: a.out
Reading symbols from /tmp/a.out...done.

(idb) br sub1
Breakpoint 1 at 0x402b1c: file /tmp/sub1.f90, line 3.

(idb) r
[New Thread 46912496306752 (LWP 18883)]
[New Thread 46912496306752 (LWP 18883)]
Starting program: /tmp/a.out

Breakpoint 1, sub1 (i=0) at /tmp/sub1.f90:3
3       print *,"i = ",i

(idb) list
1       subroutine sub1(i)
2       integer i
3       print *,"i = ",i
4       end
(idb)
[/bash]
0 Kudos
TimP
Honored Contributor III
495 Views
The point is that you can stop at subroutine entry, then set an internal break point, without reference a priori to the location of the source code. The debug-enabled code has a record of where the source was at compile time. If you have moved the source, the debugger should open a pop-up asking you to browse for it.
0 Kudos
Reply