From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31207 invoked by alias); 2 Sep 2009 07:09:38 -0000 Received: (qmail 31198 invoked by uid 22791); 2 Sep 2009 07:09:36 -0000 X-SWARE-Spam-Status: No, hits=0.0 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_41,J_CHICKENPOX_61,J_CHICKENPOX_71,J_CHICKENPOX_72,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-bw0-f208.google.com (HELO mail-bw0-f208.google.com) (209.85.218.208) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 02 Sep 2009 07:09:31 +0000 Received: by bwz4 with SMTP id 4so514750bwz.24 for ; Wed, 02 Sep 2009 00:09:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.76.5 with SMTP id d5mr3391016mul.131.1251875367900; Wed, 02 Sep 2009 00:09:27 -0700 (PDT) Date: Wed, 02 Sep 2009 07:09:00 -0000 Message-ID: <9309543c0909020009r7a0831afj23fa2ad42871421c@mail.gmail.com> Subject: problem with conditional breakpoints From: David Froger To: gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-09/txt/msg00014.txt.bz2 Hy, I have a problem using conditional breakpoints (I'm new to gdb. It's a really great software!). I write a little Fortran program to explain it, given below. Thanks for any reply and for your attention, David =3D=3D> versions $ gfortran -v gcc version 4.3.2 (Ubuntu 4.3.2-1ubuntu12) $ gdb -v GNU gdb 6.8-debian Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i486-linux-gnu". =3D=3D> The bash and gdb commands are: 1. It works: $ gfortran -g -o main.x main.f90 $ gdb ./main.x (gdb) b 20 if i=3D=3D2 && j=3D=3D2 2. It works: $ gfortran -g -o main.x main.f90 $ gdb ./main.x (gdb) b 55 if i=3D=3D2 && j=3D=3D2 3. It doesn't work: $ gfortran -g -o main.x main.f90 $ gdb ./main.x (gdb) b addmat (gdb) run (gdb) b 55 if i=3D=3D2 && j=3D=3D2 A syntax error in expression, near `=3D2 && j=3D=3D2'. =3D=3D> The Fortran 90 source file is: !file: main.f90 !=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D program main !sum two matrix S=3DA+B and print A,B,S !=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D implicit none integer,parameter:: nx=3D5, ny=3D3 integer:: i,j real,dimension(nx,ny):: A,B,S real:: lx=3D10., ly=3D20. !fill the matrix A and B do i =3D 1,nx do j =3D 1,ny =A0=A0 A(i,j) =3D real(i+j) !this is line 20 (breakpoint) =A0=A0 B(i,j) =3D real(i*j) enddo enddo !sum S=3DA+B call addmat(S,A,B,nx,ny) !print the matrx A, B and C write(*,*) 'Matrice A=3D' call affMat(A,nx,ny) write(*,*) write(*,*) 'Matrice B=3D' call affMat(B,nx,ny) write(*,*) write(*,*) 'Matrice S=3D' call affMat(S,nx,ny) write(*,*) end program main !=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D subroutine addmat(S,A,B,nx,ny) !sum two matrix A and B: S=3DA+B !=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D integer::nx,ny real,dimension(nx,ny),intent(in):: A,B real,dimension(nx,ny),intent(out):: S do i =3D 1,nx do j =3D 1,ny =A0=A0 S(i,j) =3D A(i,j)+B(i,j) !this a line 55 (breakpoint) enddo enddo end subroutine addmat !=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D subroutine affMat(matrice,nx,ny) !print a matrix with rows an columns !=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D implicit none integer nx, ny, i, j real matrice dimension matrice(nx,ny) character(len=3D2) ny_char write(ny_char,fmt=3D'(i2)') ny do i=3D1,nx =A0=A0 write(*,fmt=3D'('//ny_char//'f12.7)') ( matrice(i,j) , j=3D1,ny ) =A0=A0 !for instance, if ny=3D5, the previous line mean: =A0=A0 !write(*,fmt=3D'( 5f12.7)') ( matrice(i,j) , j=3D1,ny ) enddo end subroutine affMat