From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EA267385770F; Fri, 1 Sep 2023 11:22:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EA267385770F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1693567328; bh=ffsewX5KcKvYXO2RCCDBu4Tca7ZFUNxs/gCdVyx9lWQ=; h=From:To:Subject:Date:From; b=ppZcnGUZ7GwV/6zmB4JtIpADOYisN4P2oejnC7ntKllrnmB+Nz4F82sOzPrWUXB+6 TUc+YCIUB+g4/LdzN257m8NIir5ROPu1TyOKjfr+Ld21kr14xvh2jVFnNcItC4ggtk XdgG3yXUQXH97WXQzDFX41dJc6Z/MT5Ar4cuUIWg= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug exp/30817] New: [gdb/exp] Different interpretation of print options between C and Fortran Date: Fri, 01 Sep 2023 11:22:07 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: exp X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW 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=3D30817 Bug ID: 30817 Summary: [gdb/exp] Different interpretation of print options between C and Fortran Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: exp Assignee: unassigned at sourceware dot org Reporter: vries at gcc dot gnu.org Target Milestone: --- I wrote a fortran variant of gdb.base/huge.c: ... $ cat test.f90 program arrays implicit none integer, dimension(2 * 1024 * 1024) :: array1 print *, 'Hello, World!', array1(1) end program arrays $ gfortran test.f90 -g ... For the gdb.base/huge.exp executable I used this: ... $ gdb -q -batch outputs/gdb.base/huge/huge -ex start -ex "set max-value-size unlimited" -ex "print a" Temporary breakpoint 1 at 0x40053b: file /data/vries/gdb/src/gdb/testsuite/gdb.base/huge.c, line 18. Temporary breakpoint 1, main () at /data/vries/gdb/src/gdb/testsuite/gdb.base/huge.c:18 18 memcpy (a, b, sizeof (a)); $1 =3D {0 } ... so I tried the same but got a different output: ... $ gdb -q a.out -ex start -ex "set max-value-size unlimited" -ex "print arra= y1" Reading symbols from a.out... Temporary breakpoint 1 at 0x400772: file test.f90, line 5. Starting program: /data/vries/gdb/a.out=20 Temporary breakpoint 1, arrays () at test.f90:5 5 print *, 'Hello, World!', array1(1) $1 =3D (0, , ...) ... Apparently there is a different interpretation of print settings. After adding "print elements unlimited", I get the same: ... $ gdb -q -batch a.out -ex start -ex "set max-value-size unlimited" -ex "set print elements unlimited" -ex "print array1" Temporary breakpoint 1 at 0x400772: file test.f90, line 5. Temporary breakpoint 1, arrays () at test.f90:5 5 print *, 'Hello, World!', array1(1) $1 =3D (0, ) ... The documentation says ( https://sourceware.org/gdb/onlinedocs/gdb/Print-Settings.html ): ... set print elements number-of-elements set print elements unlimited Set a limit on how many elements of an array GDB will print. If GDB is printing a large array, it stops printing after it has printed the number of elements set by the set print elements command. This limit also applies to = the display of strings. When GDB starts, this limit is set to 200. Setting number-of-elements to unlimited or zero means that the number of elements to print is unlimited. ... so I guess this is indeed multi-interpretable. My understanding of this is that this print setting tries to prevent printi= ng a lot, so I think the C behaviour makes more sense. --=20 You are receiving this mail because: You are on the CC list for the bug.=