public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/aoliva/heads/testme)] [libstdc++] [prettyprint] add local std::string use to more tests
@ 2023-03-03 13:11 Alexandre Oliva
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Oliva @ 2023-03-03 13:11 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:eea3ffc800cc5f15d0f73a3ee7ea78d7ffdb84c5

commit eea3ffc800cc5f15d0f73a3ee7ea78d7ffdb84c5
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Fri Mar 3 10:10:23 2023 -0300

    [libstdc++] [prettyprint] add local std::string use to more tests
    
    We're getting regressions after ugprading to GDB 13 in a few of the
    libstdc++ pretty-printing tests.  It might seem like a GDB regression,
    but that update has a new symbol reader, and Tom Tromey says it
    exposes a latent problem in the pretty-printer, namely, when a name is
    not defined locally in the local translation unit, GDB will look for
    it in other units, and if multiple different definitions are
    available, there are no guarantees as to which one it will find.
    
    Since libstdc++ contains units in which std::string maps to different
    types, in order to ensure the tests get the std::string definition we
    expect, we need std::string to be present in the debug information for
    the test itself, as we already do in other tests.
    
    
    for  libstdc++-v3/ChangeLog
    
            * testsuite/libstdc++-pretty-printers/80276.cc: Add
            std::string to debug info.
            * testsuite/libstdc++-pretty-printers/libfundts.cc: Likewise.
    
    
    Change-Id: I928617d44679c63d634c26f6db17d7580a9bcd8f
    TN: W223-034

Diff:
---
 libstdc++-v3/testsuite/libstdc++-prettyprinters/80276.cc     | 5 +++++
 libstdc++-v3/testsuite/libstdc++-prettyprinters/libfundts.cc | 6 ++++++
 2 files changed, 11 insertions(+)

diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/80276.cc b/libstdc++-v3/testsuite/libstdc++-prettyprinters/80276.cc
index db4de593808..1d6b0207106 100644
--- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/80276.cc
+++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/80276.cc
@@ -36,6 +36,11 @@ int
 main()
 {
   using namespace std;
+  // Ensure debug info for std::string is issued in the local
+  // translation unit, so that GDB won't pick up any alternate
+  // std::string notion that might be present in libstdc++.so.
+  string bah = "hi";
+  (void)bah;
   unique_ptr<vector<unique_ptr<vector<int>*>>> p1;
   unique_ptr<vector<unique_ptr<set<int>*>>[]> p2;
   unique_ptr<set<unique_ptr<vector<int>*>>[10]> p3;
diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/libfundts.cc b/libstdc++-v3/testsuite/libstdc++-prettyprinters/libfundts.cc
index b1c91033cc8..29e8bc8f194 100644
--- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/libfundts.cc
+++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/libfundts.cc
@@ -32,6 +32,12 @@ using std::experimental::string_view;
 int
 main()
 {
+  // Ensure debug info for std::string is issued in the local
+  // translation unit, so that GDB won't pick up any alternate
+  // std::string notion that might be present in libstdc++.so.
+  std::string bah = "hi";
+  (void)bah;
+
   string_view str = "string";
 // { dg-final { note-test str "\"string\"" } }

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

* [gcc(refs/users/aoliva/heads/testme)] [libstdc++] [prettyprint] add local std::string use to more tests
@ 2023-03-03 18:47 Alexandre Oliva
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Oliva @ 2023-03-03 18:47 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:65dda8714cacff31f7b493bd3aad78e5099785a0

commit 65dda8714cacff31f7b493bd3aad78e5099785a0
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Fri Mar 3 10:10:23 2023 -0300

    [libstdc++] [prettyprint] add local std::string use to more tests
    
    We're getting regressions after ugprading to GDB 13 in a few of the
    libstdc++ pretty-printing tests.  It might seem like a GDB regression,
    but that update has a new symbol reader, and Tom Tromey says it
    exposes a latent problem in the pretty-printer, namely, when a name is
    not defined locally in the local translation unit, GDB will look for
    it in other units, and if multiple different definitions are
    available, there are no guarantees as to which one it will find.
    
    Since libstdc++ contains units in which std::string maps to different
    types, in order to ensure the tests get the std::string definition we
    expect, we need std::string to be present in the debug information for
    the test itself, as we already do in other tests.
    
    
    for  libstdc++-v3/ChangeLog
    
            * testsuite/libstdc++-pretty-printers/80276.cc: Add
            std::string to debug info.
            * testsuite/libstdc++-pretty-printers/libfundts.cc: Likewise.

Diff:
---
 libstdc++-v3/testsuite/libstdc++-prettyprinters/80276.cc     | 5 +++++
 libstdc++-v3/testsuite/libstdc++-prettyprinters/libfundts.cc | 6 ++++++
 2 files changed, 11 insertions(+)

diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/80276.cc b/libstdc++-v3/testsuite/libstdc++-prettyprinters/80276.cc
index db4de593808..1d6b0207106 100644
--- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/80276.cc
+++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/80276.cc
@@ -36,6 +36,11 @@ int
 main()
 {
   using namespace std;
+  // Ensure debug info for std::string is issued in the local
+  // translation unit, so that GDB won't pick up any alternate
+  // std::string notion that might be present in libstdc++.so.
+  string bah = "hi";
+  (void)bah;
   unique_ptr<vector<unique_ptr<vector<int>*>>> p1;
   unique_ptr<vector<unique_ptr<set<int>*>>[]> p2;
   unique_ptr<set<unique_ptr<vector<int>*>>[10]> p3;
diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/libfundts.cc b/libstdc++-v3/testsuite/libstdc++-prettyprinters/libfundts.cc
index b1c91033cc8..29e8bc8f194 100644
--- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/libfundts.cc
+++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/libfundts.cc
@@ -32,6 +32,12 @@ using std::experimental::string_view;
 int
 main()
 {
+  // Ensure debug info for std::string is issued in the local
+  // translation unit, so that GDB won't pick up any alternate
+  // std::string notion that might be present in libstdc++.so.
+  std::string bah = "hi";
+  (void)bah;
+
   string_view str = "string";
 // { dg-final { note-test str "\"string\"" } }

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

end of thread, other threads:[~2023-03-03 18:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-03 13:11 [gcc(refs/users/aoliva/heads/testme)] [libstdc++] [prettyprint] add local std::string use to more tests Alexandre Oliva
2023-03-03 18:47 Alexandre Oliva

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).