public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/12574] New: print with name overloading
@ 2011-03-12  9:20 abo.pignard at wanadoo dot fr
  2022-03-17 16:36 ` [Bug ada/12574] " tromey at sourceware dot org
  2022-07-01 19:14 ` abo.pignard at wanadoo dot fr
  0 siblings, 2 replies; 3+ messages in thread
From: abo.pignard at wanadoo dot fr @ 2011-03-12  9:20 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=12574

           Summary: print with name overloading
           Product: gdb
           Version: 7.2
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ada
        AssignedTo: unassigned@sourceware.org
        ReportedBy: abo.pignard@wanadoo.fr


Created attachment 5300
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5300
Nested names Ada exemple.

Hello, some mismatch errors appear when printing strings with same nested
names.
Operating system: Mac OS X 10.6.5
Compiler:
$ gcc -v
Using built-in specs.
Target: x86_64-apple-darwin9.6.0
Configured with: ../src/configure --prefix=/usr/local/gnat
--with-build-time-tools=/lensk.a/gnatmail/release-gpl/build-lensk/obj
--with-gmp=/lensk.a/gnatmail/release-gpl/build-lensk/libmpfr/install
--with-mpfr=/lensk.a/gnatmail/release-gpl/build-lensk/libmpfr/install
--build=x86_64-apple-darwin9.6.0 --enable-languages=c,ada --disable-nls
--without-libiconv-prefix --disable-libmudflap --disable-libffi
--disable-libstdcxx-pch --disable-libada --enable-checking=release
--with-bugurl=URL:mailto:report@adacore.com
Thread model: posix
gcc version 4.3.6 20100603 for GNAT GPL 2010 (20100603) (GCC) 
Debugger:
GNU gdb (GDB) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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 "x86_64-apple-darwin10.5.0".
How to repeat:
compile attached exemple with: gnatmake -g testnest.adb
Then type following instructions:
(gdb) list
30                Put_line (Inner.My_String);
31                Put_line (My_String);
32                Put_line (testnest.My_String);
33             end;
34          end Inner;
35          Put_line (s); -- line35
36       end Test3;
37    
38    begin
39       Test2(My_String);
(gdb) break testnest.adb:35
Breakpoint 1 at 0x100001935: file testnest.adb, line 35.
(gdb) run
Starting program: /Users/blady/Documents/Programmation/Essais/testnest 
Outer Test string
Outer Test string
Local Test String
Outer Test string
Inner Test String
Inner Test String
Really Local String
Outer Test string

Breakpoint 1, testnest.test3 (s=...) at testnest.adb:35
35          Put_line (s); -- line35
(gdb) print my_string
Multiple matches for my_string
[0] cancel
[1] my_string at testnest.adb:28
[2] my_string at testnest.adb:24
[3] my_string at testnest.adb:15
> 1
$1 = "Inner Test String["00"]["00"]"
(gdb) print my_string
Multiple matches for my_string
[0] cancel
[1] my_string at testnest.adb:28
[2] my_string at testnest.adb:24
[3] my_string at testnest.adb:15
> 2
$2 = "Local Test String"
(gdb) print my_string
Multiple matches for my_string
[0] cancel
[1] my_string at testnest.adb:28
[2] my_string at testnest.adb:24
[3] my_string at testnest.adb:15
> 3
$3 = "n terminated by a"
(gdb) cont
Continuing.
Outer Test string
Outer Test string
Hello World. Welcome to GNAT

Program exited normally.

Errors:
my_string at line 28 should be "Really Local String", gdb outputs "Inner Test
String["00"]["00"]" ?!
my_string at line 24 should be "Inner Test String", gdb outputs "Local Test
String" ?!
my_string at line 15 should be "Local Test String", gdb outputs "n terminated
by a" ???!!!

HTH, Pascal.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug ada/12574] print with name overloading
  2011-03-12  9:20 [Bug ada/12574] New: print with name overloading abo.pignard at wanadoo dot fr
@ 2022-03-17 16:36 ` tromey at sourceware dot org
  2022-07-01 19:14 ` abo.pignard at wanadoo dot fr
  1 sibling, 0 replies; 3+ messages in thread
From: tromey at sourceware dot org @ 2022-03-17 16:36 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=12574

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org
         Resolution|---                         |WORKSFORME
             Status|NEW                         |RESOLVED

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
I think this works now.

I see:

(gdb) p my_string
Multiple matches for my_string
[0] cancel
[1] my_string at testnest.adb:15
[2] my_string at testnest.adb:24
[3] my_string at testnest.adb:28
> 1
$4 = "Local Test String"
(gdb) p my_string
Multiple matches for my_string
[0] cancel
[1] my_string at testnest.adb:15
[2] my_string at testnest.adb:24
[3] my_string at testnest.adb:28
> 2
$5 = "Inner Test String"
(gdb) p my_string
Multiple matches for my_string
[0] cancel
[1] my_string at testnest.adb:15
[2] my_string at testnest.adb:24
[3] my_string at testnest.adb:28
> 3
$6 = "Really Local String"


I'm not sure what was wrong earlier.  It might have been bad debug info.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug ada/12574] print with name overloading
  2011-03-12  9:20 [Bug ada/12574] New: print with name overloading abo.pignard at wanadoo dot fr
  2022-03-17 16:36 ` [Bug ada/12574] " tromey at sourceware dot org
@ 2022-07-01 19:14 ` abo.pignard at wanadoo dot fr
  1 sibling, 0 replies; 3+ messages in thread
From: abo.pignard at wanadoo dot fr @ 2022-07-01 19:14 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=12574

abo.pignard at wanadoo dot fr changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |VERIFIED

--- Comment #2 from abo.pignard at wanadoo dot fr ---
Verified with:
% gdb -v
GNU gdb (GDB) 12.1
...
% gdb bin/testnest
...
31                  Put_line (My_String);
(gdb) print my_string
Multiple matches for my_string
[0] cancel
[1] my_string at
/Users/blady/Documents/Programmation/AdaCore/Tests/2022/testnest.adb:15
[2] my_string at
/Users/blady/Documents/Programmation/AdaCore/Tests/2022/testnest.adb:24
[3] my_string at
/Users/blady/Documents/Programmation/AdaCore/Tests/2022/testnest.adb:28
> 1
$2 = "Local Test String"
(gdb) print my_string
Multiple matches for my_string
[0] cancel
[1] my_string at
/Users/blady/Documents/Programmation/AdaCore/Tests/2022/testnest.adb:15
[2] my_string at
/Users/blady/Documents/Programmation/AdaCore/Tests/2022/testnest.adb:24
[3] my_string at
/Users/blady/Documents/Programmation/AdaCore/Tests/2022/testnest.adb:28
> 2
$3 = "Inner Test String"
(gdb) print my_string
Multiple matches for my_string
[0] cancel
[1] my_string at
/Users/blady/Documents/Programmation/AdaCore/Tests/2022/testnest.adb:15
[2] my_string at
/Users/blady/Documents/Programmation/AdaCore/Tests/2022/testnest.adb:24
[3] my_string at
/Users/blady/Documents/Programmation/AdaCore/Tests/2022/testnest.adb:28
> 3
$4 = "Really Local String"
...
35            Put_line (s); -- line35
(gdb) print my_string
$5 = "Local Test String"

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-07-01 19:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-12  9:20 [Bug ada/12574] New: print with name overloading abo.pignard at wanadoo dot fr
2022-03-17 16:36 ` [Bug ada/12574] " tromey at sourceware dot org
2022-07-01 19:14 ` abo.pignard at wanadoo dot fr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).