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

problems with idb

milenko1976
Beginner
733 Views
I am trying to debug with idb,get this:
milenko@hp6830s:~/eik1$ idbc
Intel Debugger for applications running on Intel 64, Version 11.1, Build [1.2097.2.344]
(idb) load eik
load eik
^
Unable to parse input as legal command or C expression.
(idb)

eik is executable,code is fortran 77.
why?
my makefile:
F77 = ifort
LD = ifort
FFLAGS = -g -traceback -debug -m64 -O1
LDFLAGS = -g -traceback -debug
LIBS = -L$(INTEL_LIB) -lmkl_intel_lp64
OBJECTS_ARCHITECTURE = machine_intel.o
# Executables
eik: eik.o
$(F77) $(FFLAGS) -o eik eik.o
# Object files
eik.o: eik.f vel1.dat eik.para velo eik.out
$(F77) $(FFLAGS) -c eik.f -o eik.o
0 Kudos
4 Replies
Kevin_D_Intel
Employee
733 Views
"load" is a IDB-mode (related to DBX) compatible command. IDB defaults to GDB mode so use "file" instead.

You must start IDB in IDB-mode mode if you want to operate in that mode.

Start in IDB mode, then use load

$ idbc -dbx
Intel Debugger for applications running on Intel 64, Version 11.1, Build [1.2097.2.344]
(idb) load hello
Reading symbolic information from /tmp/hello...done
(idb) quit

Start in the default GDB mode, then use file

$ idbc
Intel Debugger for applications running on Intel 64, Version 11.1, Build [1.2097.2.344]
(idb) file hello
Reading symbols from /tmp/hello...done.
(idb) quit

0 Kudos
milenko1976
Beginner
733 Views
Thanks Kevin,now I see the difference.
0 Kudos
milenko1976
Beginner
733 Views
I have one more question.I have problem with soubrutine tl(is,j,dh,eitl,is,js).How should I track eitl value through the program?
0 Kudos
Kevin_D_Intel
Employee
733 Views

Inside routine tl, you can print the variable. I created a sample with eitl declared as an array. While debugging inside the routine tl, you can print the variable with a "print eitl command.

Or if you want, you can definea customcommand to do something like continue execution and print the variable each time the program stops at a breakpoint. Below I defined a custom command watchit which continues execution and prints the variable upon hitting the breakpoint that was set at line 20.

$ ifort -V -g -o sample sample.f90
Intel Fortran Intel 64 Compiler Professional for applications running on Intel 64, Version 11.1 Build 20100414 Package ID: l_cprof_p_11.1.072
Copyright (C) 1985-2010 Intel Corporation. All rights reserved.
Intel Fortran 11.1-2739
GNU ld version 2.17.50.0.6-5.el5 20061020

$ idbc
Intel Debugger for applications running on Intel 64, Version 11.1, Build [1.2097.2.344]

(idb) file sample
Reading symbols from /tmp/u76228/sample...done.

(idb) list 1,22
1 program sample
2 real :: dh(10),eitl(10)
3 integer :: is,j,js
4
5 is=10
6 j=1
7 js=10
8 dh=0.0
9 eitl=0.0
10
11 call tl(is,j,dh,eitl,js)
12 write(*,*)(eitl(i),i=1,js)
13 end
14
15 subroutine tl(is,j,dh,eitl,js)
16 real :: dh(js),eitl(js)
17 integer :: is,j,js,i
18
19 do i=j,js
20 eitl(i)=dh(i) + i
21 enddo
22 end

(idb) br 20
Breakpoint 1 at 0x402cb1: file /tmp/u76228/sample.f90, line 20.

(idb) run
[New Thread 46912496306752 (LWP 1219)]
[New Thread 46912496306752 (LWP 1219)]
Starting program: /tmp/u76228/sample

Breakpoint 1, tl (is=10, j=1, dh=(...), eitl=(...), js=10) at /tmp/u76228/sample.f90:20
20 eitl(i)=dh(i) + i

(idb) print eitl
$1 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}

(idb) c
Continuing.

Breakpoint 1, tl (is=10, j=1, dh=(...), eitl=(...), js=10) at /tmp/u76228/sample.f90:20
20 eitl(i)=dh(i) + i

(idb) print eitl
$2 = {1, 0, 0, 0, 0, 0, 0, 0, 0, 0}

(idb) c
Continuing.

Breakpoint 1, tl (is=10, j=1, dh=(...), eitl=(...), js=10) at /tmp/u76228/sample.f90:20
20 eitl(i)=dh(i) + i

(idb) print eitl
$2 = {1, 2, 0, 0, 0, 0, 0, 0, 0, 0}

(idb) define watchit
Type commands for definitions of "watchit".
End with a line saying just "end".
>continue
>print eitl
>end

(idb) watchit
Continuing.

Breakpoint 1, tl (is=10, j=1, dh=(...), eitl=(...), js=10) at /tmp/u76228/sample.f90:20
20 eitl(i)=dh(i) + i
$3 = {1, 2, 3, 0, 0, 0, 0, 0, 0, 0}

(idb) watchit
Continuing.

Breakpoint 1, tl (is=10, j=1, dh=(...), eitl=(...), js=10) at /tmp/u76228/sample.f90:20
20 eitl(i)=dh(i) + i

$4 = {1, 2, 3, 4, 0, 0, 0, 0, 0, 0}
(idb) quit

Hope that helps.

0 Kudos
Reply