RE: watchpoint on Fortran array elements

Wadud Miah <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <VI1PR05MB34389E5D0A1F2B93AB013545C03C0@VI1PR05MB3438.eurprd05.prod.outlook.com>
Hi again,

I found out that GDB sets three watchpoints on an adjustable array element only - local arrays are not affected:

  subroutine sub1( array, n )
    integer :: n
    integer, dimension(n) :: array

    print *, array
  end subroutine sub1

(gdb) watch array(1)
Watchpoint 3: array(1)
(gdb) info watchpoints 
Num     Type           Disp Enb Address            What
3       watchpoint     keep y                      array(1)
3.1                         y                      array(1)
3.2                         y                      array(1)

And, this is for the Intel compiler. If I use GNU Fortran, I don’t see three watchpoints for watching an adjustable array element:

(gdb) watch array(1)
Hardware watchpoint 2: array(1)
(gdb) info watchpoints 
Num     Type           Disp Enb Address            What
2       hw watchpoint  keep y                      array(1)

Regards,
Wadud.

-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Wadud Miah
Sent: 06 January 2020 16:55
To: [email protected]
Subject: watchpoint on Fortran array elements

Hi,

I have set a watchpoint on a Fortran array element using GDB (version 8.3-7.fc30):

(gdb) watch vec(19)

But listing the watchpoints lists three watchpoints:

(gdb) info watchpoints
Num     Type           Disp Enb Address            What
12      watchpoint     keep y                      vec(19)
12.1                                       y                      vec(19)
12.2                                       y                      vec(19)

I don't understand why there are three watchpoints for a single array element. Any help will be greatly appreciated.

Regards,

-----------------------------------
Dr. Wadud Miah
Numerical Algorithms Group

Disclaimer

The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses and malware, and may have been automatically archived by Mimecast Ltd, an innovator in Software as a Service (SaaS) for business.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.