From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 14FA63858289; Fri, 23 Dec 2022 12:36:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 14FA63858289 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1671798979; bh=InqF/2xBkOcnZleQBDpuopgSStOg+hwuNwUI0K+GG2c=; h=From:To:Subject:Date:From; b=ti01fT1EAycfo563cB1eVzaQz3LAqSk83YkBe4ZE3/EtjcLUoYA4mhdEd59+e8JPL iOFeucfHhgDGArFH39WYHkKfjsJPvxWHA/qm8s9t7lLnlmSkYtPTQ/G3iqTZ3cNmKb qE4+gQcA5ik3M4tE1qBdKZ6axrfqc5aHBhPoeDrQ= From: "andreemalcher at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug fortran/29937] New: Stepping Fortran(77) code always jumps back to subroutine header Date: Fri, 23 Dec 2022 12:36:18 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: fortran X-Bugzilla-Version: 8.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: minor X-Bugzilla-Who: andreemalcher at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29937 Bug ID: 29937 Summary: Stepping Fortran(77) code always jumps back to subroutine header Product: gdb Version: 8.2 Status: UNCONFIRMED Severity: minor Priority: P2 Component: fortran Assignee: unassigned at sourceware dot org Reporter: andreemalcher at gmail dot com Target Milestone: --- I have a rather large code base (proprietary) including F77, C and C++ code. The F77 parts are compiled with gfortran 11.2.0. Compiling with debugging symbols and running the application with gdb works fine so far, but for the Fortran part there is the following annoyance: For every `next` step in gdb, the debugger jumps to the corresponding subroutine header and I need to enter `next` again to go the the actual next line/statement. Consider the following snippet from a gdb session: ``` 843 DELTA =3D TIME - TOLD (gdb) n 97 SUBROUTINE THE_SUBROUTINE_HEADER (gdb) n 844 DELOLD(1) =3D DELTA (gdb) n 845 CALL COMCOF (gdb) n 97 SUBROUTINE THE_SUBROUTINE_HEADER (gdb) n 854 IF (ITL5 .NE. 0 .AND. (gdb) n 97 SUBROUTINE THE_SUBROUTINE_HEADER (gdb) n 854 IF (ITL5 .NE. 0 .AND. ``` I hope the point is clear. While I just want to step line by line through t= he code, I always have a superfluous step to `SUBROUTINE THE_SUBROUTINE_HEADER= `, as also evident when looking at the line numbers.=20 A few remarks: * Interestingly, for logical operators, it looks like for every operand I h= ave these additional calls (i.e. if I have something like `IF (A .AND. B .AND. = C)`, gdb will jump to the subroutine header three times). * The problem doesn't show up with the `advance` command, i.e. if I type `advance 900` to advance to line 900 in the example above, gdb will happily fast forward to the given location. * FWIW, this also happens when I run the debugger from an IDE (that is, usi= ng GDB/MI) * The C and C++ code is not affected, there gdb works like expected (in the same session). * A related question was posted on StackOverflow, but no replies have been posted so far: https://stackoverflow.com/questions/23744141/ddd-execution-line-jumps-to-su= broutine-top-continuation-line-fortran-77 Unfortunately I am not able to reproduce this bug in a small test program.= =20 Last but not least, things I have tried in the original program: * Try with gdb 10.1 and 11.1 (the latter has its own set of problems, e.g. stepping takes ages to complete) * Delete/remove everything from my ~/.gdbinit * remove all flags except for `-g -O0` * try with `-g3` but to no avail. Let me know in case you need further information or want me to test somethi= ng, I'll be happy to help. --=20 You are receiving this mail because: You are on the CC list for the bug.=