public inbox for gcc-regression@sourceware.org
help / color / mirror / Atom feed
* [TCWG CI] Regression caused by gdb: Move gdb_argv to gdbsupport
@ 2022-01-18 19:48 ci_notify
  0 siblings, 0 replies; only message in thread
From: ci_notify @ 2022-01-18 19:48 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gcc-regression

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=UTF-8, Size: 57058 bytes --]

[TCWG CI] Regression caused by gdb: Move gdb_argv to gdbsupport:
commit 7904e9613e0a2fc38e9abc06a916dea6a009c7b4
Author: Tom Tromey <tom@tromey.com>

    Move gdb_argv to gdbsupport

Results regressed to
# reset_artifacts:
-10
# true:
0
# build_abe binutils:
1
# build_abe gcc:
2
# build_abe linux:
4
# build_abe glibc:
5
# First few build errors in logs:
# 00:01:18 ../../../../../../gdb/gdb/remote-sim.c:585:3: error: ‘gdb_argv’ was not declared in this scope
# 00:01:18 ../../../../../../gdb/gdb/remote-sim.c:587:24: error: ‘argv’ was not declared in this scope; did you mean ‘args’?
# 00:01:18 ../../../../../../gdb/gdb/remote-sim.c:643:3: error: ‘gdb_argv’ was not declared in this scope
# 00:01:18 ../../../../../../gdb/gdb/remote-sim.c:652:7: error: ‘built_argv’ was not declared in this scope; did you mean ‘buildargv’?
# 00:01:18 ../../../../../../gdb/gdb/remote-sim.c:657:7: error: ‘built_argv’ was not declared in this scope; did you mean ‘buildargv’?
# 00:01:18 ../../../../../../gdb/gdb/remote-sim.c:741:3: error: ‘gdb_argv’ was not declared in this scope
# 00:01:18 ../../../../../../gdb/gdb/remote-sim.c:742:14: error: ‘argv’ was not declared in this scope; did you mean ‘args’?
# 00:01:18 make[1]: *** [Makefile:1656: remote-sim.o] Error 1
# 00:01:36 make: *** [Makefile:12079: all-gdb] Error 2

from
# reset_artifacts:
-10
# true:
0
# build_abe binutils:
1
# build_abe gcc:
2
# build_abe linux:
4
# build_abe glibc:
5
# build_abe gdb:
6

THIS IS THE END OF INTERESTING STUFF.  BELOW ARE LINKS TO BUILDS, REPRODUCTION INSTRUCTIONS, AND THE RAW COMMIT.

This commit has regressed these CI configurations:
 - tcwg_gnu_native_build/master-arm

First_bad build: https://ci.linaro.org/job/tcwg_gnu_native_build-bisect-master-arm/7/artifact/artifacts/build-7904e9613e0a2fc38e9abc06a916dea6a009c7b4/
Last_good build: https://ci.linaro.org/job/tcwg_gnu_native_build-bisect-master-arm/7/artifact/artifacts/build-5947982f1dadfa72a6913f25cc4f56e137c7217e/
Baseline build: https://ci.linaro.org/job/tcwg_gnu_native_build-bisect-master-arm/7/artifact/artifacts/build-baseline/
Even more details: https://ci.linaro.org/job/tcwg_gnu_native_build-bisect-master-arm/7/artifact/artifacts/

Reproduce builds:
<cut>
mkdir investigate-gdb-7904e9613e0a2fc38e9abc06a916dea6a009c7b4
cd investigate-gdb-7904e9613e0a2fc38e9abc06a916dea6a009c7b4

# Fetch scripts
git clone https://git.linaro.org/toolchain/jenkins-scripts

# Fetch manifests and test.sh script
mkdir -p artifacts/manifests
curl -o artifacts/manifests/build-baseline.sh https://ci.linaro.org/job/tcwg_gnu_native_build-bisect-master-arm/7/artifact/artifacts/manifests/build-baseline.sh --fail
curl -o artifacts/manifests/build-parameters.sh https://ci.linaro.org/job/tcwg_gnu_native_build-bisect-master-arm/7/artifact/artifacts/manifests/build-parameters.sh --fail
curl -o artifacts/test.sh https://ci.linaro.org/job/tcwg_gnu_native_build-bisect-master-arm/7/artifact/artifacts/test.sh --fail
chmod +x artifacts/test.sh

# Reproduce the baseline build (build all pre-requisites)
./jenkins-scripts/tcwg_gnu-build.sh @@ artifacts/manifests/build-baseline.sh

# Save baseline build state (which is then restored in artifacts/test.sh)
mkdir -p ./bisect
rsync -a --del --delete-excluded --exclude /bisect/ --exclude /artifacts/ --exclude /gdb/ ./ ./bisect/baseline/

cd gdb

# Reproduce first_bad build
git checkout --detach 7904e9613e0a2fc38e9abc06a916dea6a009c7b4
../artifacts/test.sh

# Reproduce last_good build
git checkout --detach 5947982f1dadfa72a6913f25cc4f56e137c7217e
../artifacts/test.sh

cd ..
</cut>

Full commit (up to 1000 lines):
<cut>
commit 7904e9613e0a2fc38e9abc06a916dea6a009c7b4
Author: Tom Tromey <tom@tromey.com>
Date:   Tue Feb 25 18:14:19 2020 -0700

    Move gdb_argv to gdbsupport
    
    This moves the gdb_argv class to a new header in gdbsupport.
---
 gdb/cli/cli-decode.h   |   1 +
 gdb/compile/compile.c  |   1 +
 gdb/exec.c             |   1 +
 gdb/guile/scm-string.c |   1 +
 gdb/inferior.c         |   1 +
 gdb/infrun.c           |   1 +
 gdb/interps.c          |   1 +
 gdb/psymtab.c          |   1 +
 gdb/skip.c             |   1 +
 gdb/source.c           |   1 +
 gdb/stack.c            |   1 +
 gdb/symfile.c          |   1 +
 gdb/symmisc.c          |   1 +
 gdb/tracefile.c        |   1 +
 gdb/tracepoint.c       |   1 +
 gdb/utils.c            |  12 +--
 gdb/utils.h            | 174 -----------------------------------------
 gdbsupport/buildargv.h | 204 +++++++++++++++++++++++++++++++++++++++++++++++++
 18 files changed, 220 insertions(+), 185 deletions(-)

diff --git a/gdb/cli/cli-decode.h b/gdb/cli/cli-decode.h
index 8f367bf4634..ed75d3dfc15 100644
--- a/gdb/cli/cli-decode.h
+++ b/gdb/cli/cli-decode.h
@@ -27,6 +27,7 @@
 #include "cli-script.h"
 #include "completer.h"
 #include "gdbsupport/intrusive_list.h"
+#include "gdbsupport/buildargv.h"
 
 /* Not a set/show command.  Note that some commands which begin with
    "set" or "show" might be in this category, if their syntax does
diff --git a/gdb/compile/compile.c b/gdb/compile/compile.c
index 3b76e102257..6794c93d60e 100644
--- a/gdb/compile/compile.c
+++ b/gdb/compile/compile.c
@@ -44,6 +44,7 @@
 #include "gdbsupport/gdb_unlinker.h"
 #include "gdbsupport/pathstuff.h"
 #include "gdbsupport/scoped_ignore_signal.h"
+#include "gdbsupport/buildargv.h"
 
 \f
 
diff --git a/gdb/exec.c b/gdb/exec.c
index f42862b2159..d9854d50f78 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -49,6 +49,7 @@
 #include <algorithm>
 #include "gdbsupport/pathstuff.h"
 #include "cli/cli-style.h"
+#include "gdbsupport/buildargv.h"
 
 void (*deprecated_file_changed_hook) (const char *);
 
diff --git a/gdb/guile/scm-string.c b/gdb/guile/scm-string.c
index 184eaaded07..bf558922db6 100644
--- a/gdb/guile/scm-string.c
+++ b/gdb/guile/scm-string.c
@@ -23,6 +23,7 @@
 #include "defs.h"
 #include "charset.h"
 #include "guile-internal.h"
+#include "gdbsupport/buildargv.h"
 
 /* Convert STRING to an int.
    STRING must be a valid integer.  */
diff --git a/gdb/inferior.c b/gdb/inferior.c
index c7a6ae87cf5..bebddb44173 100644
--- a/gdb/inferior.c
+++ b/gdb/inferior.c
@@ -35,6 +35,7 @@
 #include "target-descriptions.h"
 #include "readline/tilde.h"
 #include "progspace-and-thread.h"
+#include "gdbsupport/buildargv.h"
 
 /* Keep a registry of per-inferior data-pointers required by other GDB
    modules.  */
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 2335fc74dc0..2e7ed15723f 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -72,6 +72,7 @@
 #include "scoped-mock-context.h"
 #include "test-target.h"
 #include "gdbsupport/common-debug.h"
+#include "gdbsupport/buildargv.h"
 
 /* Prototypes for local functions */
 
diff --git a/gdb/interps.c b/gdb/interps.c
index d65698f0cb4..a475d8790c9 100644
--- a/gdb/interps.c
+++ b/gdb/interps.c
@@ -38,6 +38,7 @@
 #include "completer.h"
 #include "top.h"		/* For command_loop.  */
 #include "main.h"
+#include "gdbsupport/buildargv.h"
 
 /* Each UI has its own independent set of interpreters.  */
 
diff --git a/gdb/psymtab.c b/gdb/psymtab.c
index 7e2da485ba5..9db8a7aeba2 100644
--- a/gdb/psymtab.c
+++ b/gdb/psymtab.c
@@ -36,6 +36,7 @@
 #include "gdbcmd.h"
 #include <algorithm>
 #include <set>
+#include "gdbsupport/buildargv.h"
 
 static struct partial_symbol *lookup_partial_symbol (struct objfile *,
 						     struct partial_symtab *,
diff --git a/gdb/skip.c b/gdb/skip.c
index 2525b8b60db..3308252cb47 100644
--- a/gdb/skip.c
+++ b/gdb/skip.c
@@ -37,6 +37,7 @@
 #include "gdbsupport/gdb_optional.h"
 #include <list>
 #include "cli/cli-style.h"
+#include "gdbsupport/buildargv.h"
 
 /* True if we want to print debug printouts related to file/function
    skipping. */
diff --git a/gdb/source.c b/gdb/source.c
index 6bf4a4e881e..ab5cfc5a9d9 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -50,6 +50,7 @@
 #include "observable.h"
 #include "build-id.h"
 #include "debuginfod-support.h"
+#include "gdbsupport/buildargv.h"
 
 #define OPEN_MODE (O_RDONLY | O_BINARY)
 #define FDOPEN_MODE FOPEN_RB
diff --git a/gdb/stack.c b/gdb/stack.c
index 8239c76de20..b81be2962d4 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -55,6 +55,7 @@
 #include "gdbsupport/def-vector.h"
 #include "cli/cli-option.h"
 #include "cli/cli-style.h"
+#include "gdbsupport/buildargv.h"
 
 /* The possible choices of "set print frame-arguments", and the value
    of this setting.  */
diff --git a/gdb/symfile.c b/gdb/symfile.c
index 0449b919974..37ce01bb0e6 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -61,6 +61,7 @@
 #include "gdbsupport/selftest.h"
 #include "cli/cli-style.h"
 #include "gdbsupport/forward-scope-exit.h"
+#include "gdbsupport/buildargv.h"
 
 #include <sys/types.h>
 #include <fcntl.h>
diff --git a/gdb/symmisc.c b/gdb/symmisc.c
index ca803fc5342..4cbe338cb84 100644
--- a/gdb/symmisc.c
+++ b/gdb/symmisc.c
@@ -38,6 +38,7 @@
 #include "source.h"
 #include "readline/tilde.h"
 #include <cli/cli-style.h>
+#include "gdbsupport/buildargv.h"
 
 /* Prototypes for local functions */
 
diff --git a/gdb/tracefile.c b/gdb/tracefile.c
index 50510af9805..f7d9331e5b7 100644
--- a/gdb/tracefile.c
+++ b/gdb/tracefile.c
@@ -24,6 +24,7 @@
 #include "regcache.h"
 #include "gdbsupport/byte-vector.h"
 #include "gdbarch.h"
+#include "gdbsupport/buildargv.h"
 
 /* Helper macros.  */
 
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index dc5e7f141cf..33f5c7f59fe 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -58,6 +58,7 @@
 #include <algorithm>
 #include "cli/cli-style.h"
 #include "expop.h"
+#include "gdbsupport/buildargv.h"
 
 #include <unistd.h>
 
diff --git a/gdb/utils.c b/gdb/utils.c
index 3ee2b5444df..da60c1e4144 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -76,6 +76,7 @@
 #include "cli-out.h"
 #include "gdbsupport/gdb-safe-ctype.h"
 #include "bt-utils.h"
+#include "gdbsupport/buildargv.h"
 
 void (*deprecated_error_begin_hook) (void);
 
@@ -2890,17 +2891,6 @@ ldirname (const char *filename)
   return dirname;
 }
 
-/* See utils.h.  */
-
-void
-gdb_argv::reset (const char *s)
-{
-  char **argv = buildargv (s);
-
-  freeargv (m_argv);
-  m_argv = argv;
-}
-
 /* Return ARGS parsed as a valid pid, or throw an error.  */
 
 int
diff --git a/gdb/utils.h b/gdb/utils.h
index ac30fd5f114..5ac34eb41a9 100644
--- a/gdb/utils.h
+++ b/gdb/utils.h
@@ -120,180 +120,6 @@ extern int parse_pid_to_attach (const char *args);
 
 extern int parse_escape (struct gdbarch *, const char **);
 
-/* A wrapper for an array of char* that was allocated in the way that
-   'buildargv' does, and should be freed with 'freeargv'.  */
-
-class gdb_argv
-{
-public:
-
-  /* A constructor that initializes to NULL.  */
-
-  gdb_argv ()
-    : m_argv (NULL)
-  {
-  }
-
-  /* A constructor that calls buildargv on STR.  STR may be NULL, in
-     which case this object is initialized with a NULL array.  */
-
-  explicit gdb_argv (const char *str)
-    : m_argv (NULL)
-  {
-    reset (str);
-  }
-
-  /* A constructor that takes ownership of an existing array.  */
-
-  explicit gdb_argv (char **array)
-    : m_argv (array)
-  {
-  }
-
-  gdb_argv (const gdb_argv &) = delete;
-  gdb_argv &operator= (const gdb_argv &) = delete;
-
-  gdb_argv &operator= (gdb_argv &&other)
-  {
-    freeargv (m_argv);
-    m_argv = other.m_argv;
-    other.m_argv = nullptr;
-    return *this;
-  }
-
-  gdb_argv (gdb_argv &&other)
-  {
-    m_argv = other.m_argv;
-    other.m_argv = nullptr;
-  }
-
-  ~gdb_argv ()
-  {
-    freeargv (m_argv);
-  }
-
-  /* Call buildargv on STR, storing the result in this object.  Any
-     previous state is freed.  STR may be NULL, in which case this
-     object is reset with a NULL array.  If buildargv fails due to
-     out-of-memory, call malloc_failure.  Therefore, the value is
-     guaranteed to be non-NULL, unless the parameter itself is
-     NULL.  */
-
-  void reset (const char *str);
-
-  /* Return the underlying array.  */
-
-  char **get ()
-  {
-    return m_argv;
-  }
-
-  const char * const * get () const
-  {
-    return m_argv;
-  }
-
-  /* Return the underlying array, transferring ownership to the
-     caller.  */
-
-  ATTRIBUTE_UNUSED_RESULT char **release ()
-  {
-    char **result = m_argv;
-    m_argv = NULL;
-    return result;
-  }
-
-  /* Return the number of items in the array.  */
-
-  int count () const
-  {
-    return countargv (m_argv);
-  }
-
-  /* Index into the array.  */
-
-  char *operator[] (int arg)
-  {
-    gdb_assert (m_argv != NULL);
-    return m_argv[arg];
-  }
-
-  /* Return the arguments array as an array view.  */
-
-  gdb::array_view<char *> as_array_view ()
-  {
-    return gdb::array_view<char *> (this->get (), this->count ());
-  }
-
-  gdb::array_view<const char * const> as_array_view () const
-  {
-    return gdb::array_view<const char * const> (this->get (), this->count ());
-  }
-
-  /* Append arguments to this array.  */
-  void append (gdb_argv &&other)
-  {
-    int size = count ();
-    int argc = other.count ();
-    m_argv = XRESIZEVEC (char *, m_argv, (size + argc + 1));
-
-    for (int argi = 0; argi < argc; argi++)
-      {
-	/* Transfer ownership of the string.  */
-	m_argv[size++] = other.m_argv[argi];
-	/* Ensure that destruction of OTHER works correctly.  */
-	other.m_argv[argi] = nullptr;
-      }
-    m_argv[size] = nullptr;
-  }
-
-  /* Append arguments to this array.  */
-  void append (const gdb_argv &other)
-  {
-    int size = count ();
-    int argc = other.count ();
-    m_argv = XRESIZEVEC (char *, m_argv, (size + argc + 1));
-
-    for (int argi = 0; argi < argc; argi++)
-      m_argv[size++] = xstrdup (other.m_argv[argi]);
-    m_argv[size] = nullptr;
-  }
-
-  /* The iterator type.  */
-
-  typedef char **iterator;
-
-  /* Return an iterator pointing to the start of the array.  */
-
-  iterator begin ()
-  {
-    return m_argv;
-  }
-
-  /* Return an iterator pointing to the end of the array.  */
-
-  iterator end ()
-  {
-    return m_argv + count ();
-  }
-
-  bool operator!= (std::nullptr_t)
-  {
-    return m_argv != NULL;
-  }
-
-  bool operator== (std::nullptr_t)
-  {
-    return m_argv == NULL;
-  }
-
-private:
-
-  /* The wrapped array.  */
-
-  char **m_argv;
-};
-
 \f
 /* Cleanup utilities.  */
 
diff --git a/gdbsupport/buildargv.h b/gdbsupport/buildargv.h
new file mode 100644
index 00000000000..7a34d9b509d
--- /dev/null
+++ b/gdbsupport/buildargv.h
@@ -0,0 +1,204 @@
+/* RAII wrapper for buildargv
+
+   Copyright (C) 2021 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#ifndef GDBSUPPORT_BUILDARGV_H
+#define GDBSUPPORT_BUILDARGV_H
+
+#include "libiberty.h"
+
+/* A wrapper for an array of char* that was allocated in the way that
+   'buildargv' does, and should be freed with 'freeargv'.  */
+
+class gdb_argv
+{
+public:
+
+  /* A constructor that initializes to NULL.  */
+
+  gdb_argv ()
+    : m_argv (NULL)
+  {
+  }
+
+  /* A constructor that calls buildargv on STR.  STR may be NULL, in
+     which case this object is initialized with a NULL array.  */
+
+  explicit gdb_argv (const char *str)
+    : m_argv (NULL)
+  {
+    reset (str);
+  }
+
+  /* A constructor that takes ownership of an existing array.  */
+
+  explicit gdb_argv (char **array)
+    : m_argv (array)
+  {
+  }
+
+  gdb_argv (const gdb_argv &) = delete;
+  gdb_argv &operator= (const gdb_argv &) = delete;
+
+  gdb_argv &operator= (gdb_argv &&other)
+  {
+    freeargv (m_argv);
+    m_argv = other.m_argv;
+    other.m_argv = nullptr;
+    return *this;
+  }
+
+  gdb_argv (gdb_argv &&other)
+  {
+    m_argv = other.m_argv;
+    other.m_argv = nullptr;
+  }
+
+  ~gdb_argv ()
+  {
+    freeargv (m_argv);
+  }
+
+  /* Call buildargv on STR, storing the result in this object.  Any
+     previous state is freed.  STR may be NULL, in which case this
+     object is reset with a NULL array.  If buildargv fails due to
+     out-of-memory, call malloc_failure.  Therefore, the value is
+     guaranteed to be non-NULL, unless the parameter itself is
+     NULL.  */
+
+  void reset (const char *str)
+  {
+    char **argv = buildargv (str);
+    freeargv (m_argv);
+    m_argv = argv;
+  }
+
+  /* Return the underlying array.  */
+
+  char **get ()
+  {
+    return m_argv;
+  }
+
+  const char * const * get () const
+  {
+    return m_argv;
+  }
+
+  /* Return the underlying array, transferring ownership to the
+     caller.  */
+
+  ATTRIBUTE_UNUSED_RESULT char **release ()
+  {
+    char **result = m_argv;
+    m_argv = NULL;
+    return result;
+  }
+
+  /* Return the number of items in the array.  */
+
+  int count () const
+  {
+    return countargv (m_argv);
+  }
+
+  /* Index into the array.  */
+
+  char *operator[] (int arg)
+  {
+    gdb_assert (m_argv != NULL);
+    return m_argv[arg];
+  }
+
+  /* Return the arguments array as an array view.  */
+
+  gdb::array_view<char *> as_array_view ()
+  {
+    return gdb::array_view<char *> (this->get (), this->count ());
+  }
+
+  gdb::array_view<const char * const> as_array_view () const
+  {
+    return gdb::array_view<const char * const> (this->get (), this->count ());
+  }
+
+  /* Append arguments to this array.  */
+  void append (gdb_argv &&other)
+  {
+    int size = count ();
+    int argc = other.count ();
+    m_argv = XRESIZEVEC (char *, m_argv, (size + argc + 1));
+
+    for (int argi = 0; argi < argc; argi++)
+      {
+	/* Transfer ownership of the string.  */
+	m_argv[size++] = other.m_argv[argi];
+	/* Ensure that destruction of OTHER works correctly.  */
+	other.m_argv[argi] = nullptr;
+      }
+    m_argv[size] = nullptr;
+  }
+
+  /* Append arguments to this array.  */
+  void append (const gdb_argv &other)
+  {
+    int size = count ();
+    int argc = other.count ();
+    m_argv = XRESIZEVEC (char *, m_argv, (size + argc + 1));
+
+    for (int argi = 0; argi < argc; argi++)
+      m_argv[size++] = xstrdup (other.m_argv[argi]);
+    m_argv[size] = nullptr;
+  }
+
+  /* The iterator type.  */
+
+  typedef char **iterator;
+
+  /* Return an iterator pointing to the start of the array.  */
+
+  iterator begin ()
+  {
+    return m_argv;
+  }
+
+  /* Return an iterator pointing to the end of the array.  */
+
+  iterator end ()
+  {
+    return m_argv + count ();
+  }
+
+  bool operator!= (std::nullptr_t)
+  {
+    return m_argv != NULL;
+  }
+
+  bool operator== (std::nullptr_t)
+  {
+    return m_argv == NULL;
+  }
+
+private:
+
+  /* The wrapped array.  */
+
+  char **m_argv;
+};
+
+#endif /* GDBSUPPORT_BUILDARGV_H */
</cut>
>From ci_notify@linaro.org  Tue Jan 18 22:54:58 2022
Return-Path: <ci_notify@linaro.org>
X-Original-To: gcc-regression@gcc.gnu.org
Delivered-To: gcc-regression@gcc.gnu.org
Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com
 [IPv6:2a00:1450:4864:20::32d])
 by sourceware.org (Postfix) with ESMTPS id 005743858409
 for <gcc-regression@gcc.gnu.org>; Tue, 18 Jan 2022 22:54:54 +0000 (GMT)
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 005743858409
Received: by mail-wm1-x32d.google.com with SMTP id
 h206-20020a1c21d7000000b0034d95625e1fso1609381wmh.4
 for <gcc-regression@gcc.gnu.org>; Tue, 18 Jan 2022 14:54:54 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d\x1e100.net; s 210112;
 h=x-gm-message-state:from:date:to:cc:message-id:subject:mime-version
 :list-id;
 bh=EXKZM+6MYFfcTZxV1KJVflq0NwIW7BMoYVnjGTyD1Ik=;
 b=zM5HAxDHI/l1a9rJGTUnjVK/jKhNxXQYux22FCeQbn69O4wbnkK2h4cVy99CBDbIXW
 5VSiayztj3ZICDLz5t7SVfd/BvTp9HSJFMEcz4IvsP7r7COn1767NCkOZAB4QmBkqzLM
 XgXsIK1++Gz54gGuTqahTBIjbP86svRPg4Roah8AtzaDVgAD+BiqN7kvoENWI+DujBuN
 mIK6jIZ8WP72Tihg6rrilVCdcFBmsCKdoK9LAL1I5Nfil9bbwGTmLpk3RACGRPmmJlNP
 ERL4iZxchx6kkJwqUoRD9CoBYAe+n+LcpCBj5J9Fxnfu/SiryZR6Sb8q72IDuDVd7AZC
 iwJw=X-Gm-Message-State: AOAM5326e5ZSCJOQh2EKAyGx7KqJV8TzfsaTrQwhmOPmD9Op1QOHVs+b
 8AOjs6/t47kJLePT9Cj++NfEoQ=X-Google-Smtp-Source: ABdhPJwn5HKscYstgnlu8FbDY20VYJ1Y003t1T5nk040VKE9PLlHd8JK1Xay/K3j1d+qmq7y3/lpnw=X-Received: by 2002:a5d:46c7:: with SMTP id g7mr26446233wrs.671.1642546493823;
 Tue, 18 Jan 2022 14:54:53 -0800 (PST)
Received: from jenkins.jenkins (ci.linaro.org. [88.99.136.175])
 by smtp.gmail.com with ESMTPSA id p9sm4305815wmb.32.2022.01.18.14.54.53
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits%6/256);
 Tue, 18 Jan 2022 14:54:53 -0800 (PST)
From: ci_notify@linaro.org
X-Google-Original-From: linaro-infrastructure-errors@lists.linaro.org
Date: Tue, 18 Jan 2022 22:54:52 +0000 (UTC)
To: Tom Tromey <tom@tromey.com>
Cc: gcc-regression@gcc.gnu.org
Message-ID: <86984486.13535.1642546493140@jenkins.jenkins>
Subject: [TCWG CI] Regression caused by gdb: Move gdb_argv to gdbsupport
MIME-Version: 1.0
X-Jenkins-Job: TCWG Bisect tcwg_gnu_cross_build/master-aarch64
X-Jenkins-Result: SUCCESS
X-Spam-Status: No, score=-13.7 required=5.0 testsºYES_00, DKIM_SIGNED,
 DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_LOTSOFHASH,
 KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS,
 TXREP autolearn=ham autolearn_force=no version=3.4.4
X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on
 server2.sourceware.org
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Content-Filtered-By: Mailman/MimeDel 2.1.29
X-BeenThere: gcc-regression@gcc.gnu.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Gcc-regression mailing list <gcc-regression.gcc.gnu.org>
List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-regression>,
 <mailto:gcc-regression-request@gcc.gnu.org?subject=unsubscribe>
List-Archive: <https://gcc.gnu.org/pipermail/gcc-regression/>
List-Post: <mailto:gcc-regression@gcc.gnu.org>
List-Help: <mailto:gcc-regression-request@gcc.gnu.org?subject=help>
List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-regression>,
 <mailto:gcc-regression-request@gcc.gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 18 Jan 2022 22:54:58 -0000

[TCWG CI] Regression caused by gdb: Move gdb_argv to gdbsupport:
commit 7904e9613e0a2fc38e9abc06a916dea6a009c7b4
Author: Tom Tromey <tom@tromey.com>

    Move gdb_argv to gdbsupport

Results regressed to
# reset_artifacts:
-10
# true:
0
# build_abe binutils:
1
# build_abe stage1:
2
# build_abe linux:
3
# build_abe glibc:
4
# build_abe stage2:
5
# First few build errors in logs:
# 00:01:33 ../../../../../../gdb/gdb/remote-sim.c:585:3: error: ‘gdb_argv’ was not declared in this scope
# 00:01:33 ../../../../../../gdb/gdb/remote-sim.c:587:24: error: ‘argv’ was not declared in this scope; did you mean ‘args’?
# 00:01:33 ../../../../../../gdb/gdb/remote-sim.c:643:3: error: ‘gdb_argv’ was not declared in this scope
# 00:01:33 ../../../../../../gdb/gdb/remote-sim.c:652:7: error: ‘built_argv’ was not declared in this scope; did you mean ‘buildargv’?
# 00:01:33 ../../../../../../gdb/gdb/remote-sim.c:657:7: error: ‘built_argv’ was not declared in this scope; did you mean ‘buildargv’?
# 00:01:33 ../../../../../../gdb/gdb/remote-sim.c:741:3: error: ‘gdb_argv’ was not declared in this scope
# 00:01:33 ../../../../../../gdb/gdb/remote-sim.c:742:14: error: ‘argv’ was not declared in this scope; did you mean ‘args’?
# 00:01:33 make[1]: *** [Makefile:1652: remote-sim.o] Error 1
# 00:01:42 make: *** [Makefile:11723: all-gdb] Error 2

from
# reset_artifacts:
-10
# true:
0
# build_abe binutils:
1
# build_abe stage1:
2
# build_abe linux:
3
# build_abe glibc:
4
# build_abe stage2:
5
# build_abe gdb:
6
# build_abe qemu:
7

THIS IS THE END OF INTERESTING STUFF.  BELOW ARE LINKS TO BUILDS, REPRODUCTION INSTRUCTIONS, AND THE RAW COMMIT.

This commit has regressed these CI configurations:
 - tcwg_gnu_cross_build/master-aarch64

First_bad build: https://ci.linaro.org/job/tcwg_gnu_cross_build-bisect-master-aarch64/24/artifact/artifacts/build-7904e9613e0a2fc38e9abc06a916dea6a009c7b4/
Last_good build: https://ci.linaro.org/job/tcwg_gnu_cross_build-bisect-master-aarch64/24/artifact/artifacts/build-5947982f1dadfa72a6913f25cc4f56e137c7217e/
Baseline build: https://ci.linaro.org/job/tcwg_gnu_cross_build-bisect-master-aarch64/24/artifact/artifacts/build-baseline/
Even more details: https://ci.linaro.org/job/tcwg_gnu_cross_build-bisect-master-aarch64/24/artifact/artifacts/

Reproduce builds:
<cut>
mkdir investigate-gdb-7904e9613e0a2fc38e9abc06a916dea6a009c7b4
cd investigate-gdb-7904e9613e0a2fc38e9abc06a916dea6a009c7b4

# Fetch scripts
git clone https://git.linaro.org/toolchain/jenkins-scripts

# Fetch manifests and test.sh script
mkdir -p artifacts/manifests
curl -o artifacts/manifests/build-baseline.sh https://ci.linaro.org/job/tcwg_gnu_cross_build-bisect-master-aarch64/24/artifact/artifacts/manifests/build-baseline.sh --fail
curl -o artifacts/manifests/build-parameters.sh https://ci.linaro.org/job/tcwg_gnu_cross_build-bisect-master-aarch64/24/artifact/artifacts/manifests/build-parameters.sh --fail
curl -o artifacts/test.sh https://ci.linaro.org/job/tcwg_gnu_cross_build-bisect-master-aarch64/24/artifact/artifacts/test.sh --fail
chmod +x artifacts/test.sh

# Reproduce the baseline build (build all pre-requisites)
./jenkins-scripts/tcwg_gnu-build.sh @@ artifacts/manifests/build-baseline.sh

# Save baseline build state (which is then restored in artifacts/test.sh)
mkdir -p ./bisect
rsync -a --del --delete-excluded --exclude /bisect/ --exclude /artifacts/ --exclude /gdb/ ./ ./bisect/baseline/

cd gdb

# Reproduce first_bad build
git checkout --detach 7904e9613e0a2fc38e9abc06a916dea6a009c7b4
../artifacts/test.sh

# Reproduce last_good build
git checkout --detach 5947982f1dadfa72a6913f25cc4f56e137c7217e
../artifacts/test.sh

cd ..
</cut>

Full commit (up to 1000 lines):
<cut>
commit 7904e9613e0a2fc38e9abc06a916dea6a009c7b4
Author: Tom Tromey <tom@tromey.com>
Date:   Tue Feb 25 18:14:19 2020 -0700

    Move gdb_argv to gdbsupport
    
    This moves the gdb_argv class to a new header in gdbsupport.
---
 gdb/cli/cli-decode.h   |   1 +
 gdb/compile/compile.c  |   1 +
 gdb/exec.c             |   1 +
 gdb/guile/scm-string.c |   1 +
 gdb/inferior.c         |   1 +
 gdb/infrun.c           |   1 +
 gdb/interps.c          |   1 +
 gdb/psymtab.c          |   1 +
 gdb/skip.c             |   1 +
 gdb/source.c           |   1 +
 gdb/stack.c            |   1 +
 gdb/symfile.c          |   1 +
 gdb/symmisc.c          |   1 +
 gdb/tracefile.c        |   1 +
 gdb/tracepoint.c       |   1 +
 gdb/utils.c            |  12 +--
 gdb/utils.h            | 174 -----------------------------------------
 gdbsupport/buildargv.h | 204 +++++++++++++++++++++++++++++++++++++++++++++++++
 18 files changed, 220 insertions(+), 185 deletions(-)

diff --git a/gdb/cli/cli-decode.h b/gdb/cli/cli-decode.h
index 8f367bf4634..ed75d3dfc15 100644
--- a/gdb/cli/cli-decode.h
+++ b/gdb/cli/cli-decode.h
@@ -27,6 +27,7 @@
 #include "cli-script.h"
 #include "completer.h"
 #include "gdbsupport/intrusive_list.h"
+#include "gdbsupport/buildargv.h"
 
 /* Not a set/show command.  Note that some commands which begin with
    "set" or "show" might be in this category, if their syntax does
diff --git a/gdb/compile/compile.c b/gdb/compile/compile.c
index 3b76e102257..6794c93d60e 100644
--- a/gdb/compile/compile.c
+++ b/gdb/compile/compile.c
@@ -44,6 +44,7 @@
 #include "gdbsupport/gdb_unlinker.h"
 #include "gdbsupport/pathstuff.h"
 #include "gdbsupport/scoped_ignore_signal.h"
+#include "gdbsupport/buildargv.h"
 
 \f
 
diff --git a/gdb/exec.c b/gdb/exec.c
index f42862b2159..d9854d50f78 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -49,6 +49,7 @@
 #include <algorithm>
 #include "gdbsupport/pathstuff.h"
 #include "cli/cli-style.h"
+#include "gdbsupport/buildargv.h"
 
 void (*deprecated_file_changed_hook) (const char *);
 
diff --git a/gdb/guile/scm-string.c b/gdb/guile/scm-string.c
index 184eaaded07..bf558922db6 100644
--- a/gdb/guile/scm-string.c
+++ b/gdb/guile/scm-string.c
@@ -23,6 +23,7 @@
 #include "defs.h"
 #include "charset.h"
 #include "guile-internal.h"
+#include "gdbsupport/buildargv.h"
 
 /* Convert STRING to an int.
    STRING must be a valid integer.  */
diff --git a/gdb/inferior.c b/gdb/inferior.c
index c7a6ae87cf5..bebddb44173 100644
--- a/gdb/inferior.c
+++ b/gdb/inferior.c
@@ -35,6 +35,7 @@
 #include "target-descriptions.h"
 #include "readline/tilde.h"
 #include "progspace-and-thread.h"
+#include "gdbsupport/buildargv.h"
 
 /* Keep a registry of per-inferior data-pointers required by other GDB
    modules.  */
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 2335fc74dc0..2e7ed15723f 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -72,6 +72,7 @@
 #include "scoped-mock-context.h"
 #include "test-target.h"
 #include "gdbsupport/common-debug.h"
+#include "gdbsupport/buildargv.h"
 
 /* Prototypes for local functions */
 
diff --git a/gdb/interps.c b/gdb/interps.c
index d65698f0cb4..a475d8790c9 100644
--- a/gdb/interps.c
+++ b/gdb/interps.c
@@ -38,6 +38,7 @@
 #include "completer.h"
 #include "top.h"		/* For command_loop.  */
 #include "main.h"
+#include "gdbsupport/buildargv.h"
 
 /* Each UI has its own independent set of interpreters.  */
 
diff --git a/gdb/psymtab.c b/gdb/psymtab.c
index 7e2da485ba5..9db8a7aeba2 100644
--- a/gdb/psymtab.c
+++ b/gdb/psymtab.c
@@ -36,6 +36,7 @@
 #include "gdbcmd.h"
 #include <algorithm>
 #include <set>
+#include "gdbsupport/buildargv.h"
 
 static struct partial_symbol *lookup_partial_symbol (struct objfile *,
 						     struct partial_symtab *,
diff --git a/gdb/skip.c b/gdb/skip.c
index 2525b8b60db..3308252cb47 100644
--- a/gdb/skip.c
+++ b/gdb/skip.c
@@ -37,6 +37,7 @@
 #include "gdbsupport/gdb_optional.h"
 #include <list>
 #include "cli/cli-style.h"
+#include "gdbsupport/buildargv.h"
 
 /* True if we want to print debug printouts related to file/function
    skipping. */
diff --git a/gdb/source.c b/gdb/source.c
index 6bf4a4e881e..ab5cfc5a9d9 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -50,6 +50,7 @@
 #include "observable.h"
 #include "build-id.h"
 #include "debuginfod-support.h"
+#include "gdbsupport/buildargv.h"
 
 #define OPEN_MODE (O_RDONLY | O_BINARY)
 #define FDOPEN_MODE FOPEN_RB
diff --git a/gdb/stack.c b/gdb/stack.c
index 8239c76de20..b81be2962d4 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -55,6 +55,7 @@
 #include "gdbsupport/def-vector.h"
 #include "cli/cli-option.h"
 #include "cli/cli-style.h"
+#include "gdbsupport/buildargv.h"
 
 /* The possible choices of "set print frame-arguments", and the value
    of this setting.  */
diff --git a/gdb/symfile.c b/gdb/symfile.c
index 0449b919974..37ce01bb0e6 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -61,6 +61,7 @@
 #include "gdbsupport/selftest.h"
 #include "cli/cli-style.h"
 #include "gdbsupport/forward-scope-exit.h"
+#include "gdbsupport/buildargv.h"
 
 #include <sys/types.h>
 #include <fcntl.h>
diff --git a/gdb/symmisc.c b/gdb/symmisc.c
index ca803fc5342..4cbe338cb84 100644
--- a/gdb/symmisc.c
+++ b/gdb/symmisc.c
@@ -38,6 +38,7 @@
 #include "source.h"
 #include "readline/tilde.h"
 #include <cli/cli-style.h>
+#include "gdbsupport/buildargv.h"
 
 /* Prototypes for local functions */
 
diff --git a/gdb/tracefile.c b/gdb/tracefile.c
index 50510af9805..f7d9331e5b7 100644
--- a/gdb/tracefile.c
+++ b/gdb/tracefile.c
@@ -24,6 +24,7 @@
 #include "regcache.h"
 #include "gdbsupport/byte-vector.h"
 #include "gdbarch.h"
+#include "gdbsupport/buildargv.h"
 
 /* Helper macros.  */
 
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index dc5e7f141cf..33f5c7f59fe 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -58,6 +58,7 @@
 #include <algorithm>
 #include "cli/cli-style.h"
 #include "expop.h"
+#include "gdbsupport/buildargv.h"
 
 #include <unistd.h>
 
diff --git a/gdb/utils.c b/gdb/utils.c
index 3ee2b5444df..da60c1e4144 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -76,6 +76,7 @@
 #include "cli-out.h"
 #include "gdbsupport/gdb-safe-ctype.h"
 #include "bt-utils.h"
+#include "gdbsupport/buildargv.h"
 
 void (*deprecated_error_begin_hook) (void);
 
@@ -2890,17 +2891,6 @@ ldirname (const char *filename)
   return dirname;
 }
 
-/* See utils.h.  */
-
-void
-gdb_argv::reset (const char *s)
-{
-  char **argv = buildargv (s);
-
-  freeargv (m_argv);
-  m_argv = argv;
-}
-
 /* Return ARGS parsed as a valid pid, or throw an error.  */
 
 int
diff --git a/gdb/utils.h b/gdb/utils.h
index ac30fd5f114..5ac34eb41a9 100644
--- a/gdb/utils.h
+++ b/gdb/utils.h
@@ -120,180 +120,6 @@ extern int parse_pid_to_attach (const char *args);
 
 extern int parse_escape (struct gdbarch *, const char **);
 
-/* A wrapper for an array of char* that was allocated in the way that
-   'buildargv' does, and should be freed with 'freeargv'.  */
-
-class gdb_argv
-{
-public:
-
-  /* A constructor that initializes to NULL.  */
-
-  gdb_argv ()
-    : m_argv (NULL)
-  {
-  }
-
-  /* A constructor that calls buildargv on STR.  STR may be NULL, in
-     which case this object is initialized with a NULL array.  */
-
-  explicit gdb_argv (const char *str)
-    : m_argv (NULL)
-  {
-    reset (str);
-  }
-
-  /* A constructor that takes ownership of an existing array.  */
-
-  explicit gdb_argv (char **array)
-    : m_argv (array)
-  {
-  }
-
-  gdb_argv (const gdb_argv &) = delete;
-  gdb_argv &operator= (const gdb_argv &) = delete;
-
-  gdb_argv &operator= (gdb_argv &&other)
-  {
-    freeargv (m_argv);
-    m_argv = other.m_argv;
-    other.m_argv = nullptr;
-    return *this;
-  }
-
-  gdb_argv (gdb_argv &&other)
-  {
-    m_argv = other.m_argv;
-    other.m_argv = nullptr;
-  }
-
-  ~gdb_argv ()
-  {
-    freeargv (m_argv);
-  }
-
-  /* Call buildargv on STR, storing the result in this object.  Any
-     previous state is freed.  STR may be NULL, in which case this
-     object is reset with a NULL array.  If buildargv fails due to
-     out-of-memory, call malloc_failure.  Therefore, the value is
-     guaranteed to be non-NULL, unless the parameter itself is
-     NULL.  */
-
-  void reset (const char *str);
-
-  /* Return the underlying array.  */
-
-  char **get ()
-  {
-    return m_argv;
-  }
-
-  const char * const * get () const
-  {
-    return m_argv;
-  }
-
-  /* Return the underlying array, transferring ownership to the
-     caller.  */
-
-  ATTRIBUTE_UNUSED_RESULT char **release ()
-  {
-    char **result = m_argv;
-    m_argv = NULL;
-    return result;
-  }
-
-  /* Return the number of items in the array.  */
-
-  int count () const
-  {
-    return countargv (m_argv);
-  }
-
-  /* Index into the array.  */
-
-  char *operator[] (int arg)
-  {
-    gdb_assert (m_argv != NULL);
-    return m_argv[arg];
-  }
-
-  /* Return the arguments array as an array view.  */
-
-  gdb::array_view<char *> as_array_view ()
-  {
-    return gdb::array_view<char *> (this->get (), this->count ());
-  }
-
-  gdb::array_view<const char * const> as_array_view () const
-  {
-    return gdb::array_view<const char * const> (this->get (), this->count ());
-  }
-
-  /* Append arguments to this array.  */
-  void append (gdb_argv &&other)
-  {
-    int size = count ();
-    int argc = other.count ();
-    m_argv = XRESIZEVEC (char *, m_argv, (size + argc + 1));
-
-    for (int argi = 0; argi < argc; argi++)
-      {
-	/* Transfer ownership of the string.  */
-	m_argv[size++] = other.m_argv[argi];
-	/* Ensure that destruction of OTHER works correctly.  */
-	other.m_argv[argi] = nullptr;
-      }
-    m_argv[size] = nullptr;
-  }
-
-  /* Append arguments to this array.  */
-  void append (const gdb_argv &other)
-  {
-    int size = count ();
-    int argc = other.count ();
-    m_argv = XRESIZEVEC (char *, m_argv, (size + argc + 1));
-
-    for (int argi = 0; argi < argc; argi++)
-      m_argv[size++] = xstrdup (other.m_argv[argi]);
-    m_argv[size] = nullptr;
-  }
-
-  /* The iterator type.  */
-
-  typedef char **iterator;
-
-  /* Return an iterator pointing to the start of the array.  */
-
-  iterator begin ()
-  {
-    return m_argv;
-  }
-
-  /* Return an iterator pointing to the end of the array.  */
-
-  iterator end ()
-  {
-    return m_argv + count ();
-  }
-
-  bool operator!= (std::nullptr_t)
-  {
-    return m_argv != NULL;
-  }
-
-  bool operator== (std::nullptr_t)
-  {
-    return m_argv == NULL;
-  }
-
-private:
-
-  /* The wrapped array.  */
-
-  char **m_argv;
-};
-
 \f
 /* Cleanup utilities.  */
 
diff --git a/gdbsupport/buildargv.h b/gdbsupport/buildargv.h
new file mode 100644
index 00000000000..7a34d9b509d
--- /dev/null
+++ b/gdbsupport/buildargv.h
@@ -0,0 +1,204 @@
+/* RAII wrapper for buildargv
+
+   Copyright (C) 2021 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#ifndef GDBSUPPORT_BUILDARGV_H
+#define GDBSUPPORT_BUILDARGV_H
+
+#include "libiberty.h"
+
+/* A wrapper for an array of char* that was allocated in the way that
+   'buildargv' does, and should be freed with 'freeargv'.  */
+
+class gdb_argv
+{
+public:
+
+  /* A constructor that initializes to NULL.  */
+
+  gdb_argv ()
+    : m_argv (NULL)
+  {
+  }
+
+  /* A constructor that calls buildargv on STR.  STR may be NULL, in
+     which case this object is initialized with a NULL array.  */
+
+  explicit gdb_argv (const char *str)
+    : m_argv (NULL)
+  {
+    reset (str);
+  }
+
+  /* A constructor that takes ownership of an existing array.  */
+
+  explicit gdb_argv (char **array)
+    : m_argv (array)
+  {
+  }
+
+  gdb_argv (const gdb_argv &) = delete;
+  gdb_argv &operator= (const gdb_argv &) = delete;
+
+  gdb_argv &operator= (gdb_argv &&other)
+  {
+    freeargv (m_argv);
+    m_argv = other.m_argv;
+    other.m_argv = nullptr;
+    return *this;
+  }
+
+  gdb_argv (gdb_argv &&other)
+  {
+    m_argv = other.m_argv;
+    other.m_argv = nullptr;
+  }
+
+  ~gdb_argv ()
+  {
+    freeargv (m_argv);
+  }
+
+  /* Call buildargv on STR, storing the result in this object.  Any
+     previous state is freed.  STR may be NULL, in which case this
+     object is reset with a NULL array.  If buildargv fails due to
+     out-of-memory, call malloc_failure.  Therefore, the value is
+     guaranteed to be non-NULL, unless the parameter itself is
+     NULL.  */
+
+  void reset (const char *str)
+  {
+    char **argv = buildargv (str);
+    freeargv (m_argv);
+    m_argv = argv;
+  }
+
+  /* Return the underlying array.  */
+
+  char **get ()
+  {
+    return m_argv;
+  }
+
+  const char * const * get () const
+  {
+    return m_argv;
+  }
+
+  /* Return the underlying array, transferring ownership to the
+     caller.  */
+
+  ATTRIBUTE_UNUSED_RESULT char **release ()
+  {
+    char **result = m_argv;
+    m_argv = NULL;
+    return result;
+  }
+
+  /* Return the number of items in the array.  */
+
+  int count () const
+  {
+    return countargv (m_argv);
+  }
+
+  /* Index into the array.  */
+
+  char *operator[] (int arg)
+  {
+    gdb_assert (m_argv != NULL);
+    return m_argv[arg];
+  }
+
+  /* Return the arguments array as an array view.  */
+
+  gdb::array_view<char *> as_array_view ()
+  {
+    return gdb::array_view<char *> (this->get (), this->count ());
+  }
+
+  gdb::array_view<const char * const> as_array_view () const
+  {
+    return gdb::array_view<const char * const> (this->get (), this->count ());
+  }
+
+  /* Append arguments to this array.  */
+  void append (gdb_argv &&other)
+  {
+    int size = count ();
+    int argc = other.count ();
+    m_argv = XRESIZEVEC (char *, m_argv, (size + argc + 1));
+
+    for (int argi = 0; argi < argc; argi++)
+      {
+	/* Transfer ownership of the string.  */
+	m_argv[size++] = other.m_argv[argi];
+	/* Ensure that destruction of OTHER works correctly.  */
+	other.m_argv[argi] = nullptr;
+      }
+    m_argv[size] = nullptr;
+  }
+
+  /* Append arguments to this array.  */
+  void append (const gdb_argv &other)
+  {
+    int size = count ();
+    int argc = other.count ();
+    m_argv = XRESIZEVEC (char *, m_argv, (size + argc + 1));
+
+    for (int argi = 0; argi < argc; argi++)
+      m_argv[size++] = xstrdup (other.m_argv[argi]);
+    m_argv[size] = nullptr;
+  }
+
+  /* The iterator type.  */
+
+  typedef char **iterator;
+
+  /* Return an iterator pointing to the start of the array.  */
+
+  iterator begin ()
+  {
+    return m_argv;
+  }
+
+  /* Return an iterator pointing to the end of the array.  */
+
+  iterator end ()
+  {
+    return m_argv + count ();
+  }
+
+  bool operator!= (std::nullptr_t)
+  {
+    return m_argv != NULL;
+  }
+
+  bool operator== (std::nullptr_t)
+  {
+    return m_argv == NULL;
+  }
+
+private:
+
+  /* The wrapped array.  */
+
+  char **m_argv;
+};
+
+#endif /* GDBSUPPORT_BUILDARGV_H */
</cut>
>From hjl@sc.intel.com  Wed Jan 19 02:10:56 2022
Return-Path: <hjl@sc.intel.com>
X-Original-To: gcc-regression@gcc.gnu.org
Delivered-To: gcc-regression@gcc.gnu.org
Received: from mga14.intel.com (mga14.intel.com [192.55.52.115])
 by sourceware.org (Postfix) with ESMTPS id DFF513857C76
 for <gcc-regression@gcc.gnu.org>; Wed, 19 Jan 2022 02:10:53 +0000 (GMT)
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DFF513857C76
X-IronPort-AV: E=McAfee;i="6200,9189,10231"; a="245158581"
X-IronPort-AV: E=Sophos;i="5.88,298,1635231600"; d="scan'208";a="245158581"
Received: from fmsmga005.fm.intel.com ([10.253.24.32])
 by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 18 Jan 2022 18:10:52 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.88,298,1635231600"; d="scan'208";a="767099130"
Received: from scymds02.sc.intel.com ([10.82.73.244])
 by fmsmga005.fm.intel.com with ESMTP; 18 Jan 2022 18:10:52 -0800
Received: from gnu-clx-1.sc.intel.com (gnu-clx-1.sc.intel.com [172.25.70.216])
 by scymds02.sc.intel.com with ESMTP id 20J2Aq7R000670;
 Tue, 18 Jan 2022 18:10:52 -0800
Received: by gnu-clx-1.sc.intel.com (Postfix, from userid 1000)
 id AAD223E001F; Tue, 18 Jan 2022 18:10:52 -0800 (PST)
Date: Tue, 18 Jan 2022 18:10:52 -0800
To: skpgkp2@gmail.com, hjl.tools@gmail.com, gcc-regression@gcc.gnu.org
Subject: Regressions on native/master at commit r12-6704 vs commit
 r12-6697 on Linux/x86_64
User-Agent: Heirloom mailx 12.5 7/5/10
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-Id: <20220119021052.AAD223E001F@gnu-clx-1.sc.intel.com>
From: "H. J. Lu" <hjl@sc.intel.com>
X-Spam-Status: No, score=-3465.5 required=5.0 testsºYES_00, KAM_DMARC_STATUS,
 KAM_LAZY_DOMAIN_SECURITY, KAM_NUMSUBJECT, SPF_HELO_NONE, SPF_NONE,
 TXREP autolearn=no autolearn_force=no version=3.4.4
X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on
 server2.sourceware.org
X-BeenThere: gcc-regression@gcc.gnu.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Gcc-regression mailing list <gcc-regression.gcc.gnu.org>
List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-regression>,
 <mailto:gcc-regression-request@gcc.gnu.org?subject=unsubscribe>
List-Archive: <https://gcc.gnu.org/pipermail/gcc-regression/>
List-Post: <mailto:gcc-regression@gcc.gnu.org>
List-Help: <mailto:gcc-regression-request@gcc.gnu.org?subject=help>
List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-regression>,
 <mailto:gcc-regression-request@gcc.gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 19 Jan 2022 02:10:56 -0000

New failures:
FAIL: g++.dg/cpp0x/constexpr-compare2.C  -std=c++20 (test for excess errors)
FAIL: g++.dg/cpp0x/constexpr-compare2.C  -std=c++20 (test for excess errors)
FAIL: g++.dg/cpp0x/constexpr-compare2.C  -std=c++20 (test for excess errors)
FAIL: g++.dg/opt/pr91838.C  -std=c++20  scan-assembler pxor\\s+%xmm0,\\s+%xmm0
FAIL: g++.dg/vect/simd-bool-comparison-1.cc  -std=c++20  scan-tree-dump-times vect "vectorized 1 loops" 1
FAIL: g++.dg/vect/simd-bool-comparison-1.cc  -std=c++20  scan-tree-dump-times vect "vectorized 1 loops" 1
FAIL: g++.dg/vect/simd-bool-comparison-1.cc  -std=c++20  scan-tree-dump-times vect "vectorized 1 loops" 1
FAIL: g++.dg/vect/slp-pr87105.cc  -std=c++20  scan-tree-dump-times slp2 "basic block part vectorized" 1
FAIL: g++.dg/vect/slp-pr87105.cc  -std=c++20  scan-tree-dump-times slp2 "basic block part vectorized" 1
FAIL: g++.dg/vect/slp-pr87105.cc  -std=c++20  scan-tree-dump-times slp2 "basic block part vectorized" 1
FAIL: g++.dg/warn/pr104025.C  -std=gnu++14 (test for excess errors)
FAIL: g++.dg/warn/pr104025.C  -std=gnu++14 (test for excess errors)
FAIL: g++.dg/warn/pr104025.C  -std=gnu++14 (test for excess errors)
FAIL: g++.dg/warn/pr104025.C  -std=gnu++17 (test for excess errors)
FAIL: g++.dg/warn/pr104025.C  -std=gnu++17 (test for excess errors)
FAIL: g++.dg/warn/pr104025.C  -std=gnu++17 (test for excess errors)
FAIL: g++.dg/warn/pr104025.C  -std=gnu++20 (test for excess errors)
FAIL: g++.dg/warn/pr104025.C  -std=gnu++20 (test for excess errors)
FAIL: g++.dg/warn/pr104025.C  -std=gnu++20 (test for excess errors)
FAIL: g++.dg/warn/pr104025.C  -std=gnu++98 (test for excess errors)
FAIL: g++.dg/warn/pr104025.C  -std=gnu++98 (test for excess errors)
FAIL: g++.dg/warn/pr104025.C  -std=gnu++98 (test for excess errors)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 10)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 10)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 10)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 11)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 11)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 11)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 12)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 12)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 12)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 13)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 13)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 13)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 14)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 14)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 14)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 15)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 15)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 15)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 16)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 16)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 16)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 17)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 17)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 17)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 18)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 18)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 18)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 19)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 19)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 19)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 4)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 4)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 4)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 5)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 5)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 5)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 6)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 6)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 6)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 7)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 7)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 7)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 8)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 8)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 8)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 9)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 9)
FAIL: g++.target/i386/mv28.C  -std=c++20  (test for errors, line 9)
FAIL: g++.target/i386/pr82625.C  -std=gnu++20  scan-tree-dump-times optimized "return 4096;" 1
FAIL: g++.target/i386/pr82625.C  -std=gnu++20  scan-tree-dump-times optimized "return 4096;" 1
FAIL: g++.target/i386/pr82625.C  -std=gnu++20  scan-tree-dump-times optimized "return 4096;" 1
FAIL: g++.target/i386/pr82625.C  -std=gnu++20  scan-tree-dump-times optimized "return 8192;" 1
FAIL: g++.target/i386/pr82625.C  -std=gnu++20  scan-tree-dump-times optimized "return 8192;" 1
FAIL: g++.target/i386/pr82625.C  -std=gnu++20  scan-tree-dump-times optimized "return 8192;" 1
FAIL: g++.target/i386/pr98218-1.C  -std=gnu++20  scan-assembler-times pcmpgtd 2
FAIL: g++.target/i386/pr98218-1.C  -std=gnu++20  scan-assembler-times pcmpgtd 2

New passes:
FAIL: g++.dg/cpp0x/constexpr-compare2.C  -std=c++2a (test for excess errors)
FAIL: g++.dg/cpp0x/constexpr-compare2.C  -std=c++2a (test for excess errors)
FAIL: g++.dg/cpp0x/constexpr-compare2.C  -std=c++2a (test for excess errors)
FAIL: g++.dg/opt/pr91838.C  -std=c++2a  scan-assembler pxor\\s+%xmm0,\\s+%xmm0
FAIL: g++.dg/vect/simd-bool-comparison-1.cc  -std=c++2a  scan-tree-dump-times vect "vectorized 1 loops" 1
FAIL: g++.dg/vect/simd-bool-comparison-1.cc  -std=c++2a  scan-tree-dump-times vect "vectorized 1 loops" 1
FAIL: g++.dg/vect/simd-bool-comparison-1.cc  -std=c++2a  scan-tree-dump-times vect "vectorized 1 loops" 1
FAIL: g++.dg/vect/slp-pr87105.cc  -std=c++2a  scan-tree-dump-times slp2 "basic block part vectorized" 1
FAIL: g++.dg/vect/slp-pr87105.cc  -std=c++2a  scan-tree-dump-times slp2 "basic block part vectorized" 1
FAIL: g++.dg/vect/slp-pr87105.cc  -std=c++2a  scan-tree-dump-times slp2 "basic block part vectorized" 1
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 10)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 10)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 10)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 11)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 11)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 11)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 12)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 12)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 12)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 13)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 13)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 13)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 14)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 14)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 14)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 15)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 15)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 15)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 16)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 16)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 16)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 17)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 17)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 17)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 18)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 18)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 18)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 19)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 19)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 19)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 4)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 4)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 4)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 5)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 5)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 5)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 6)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 6)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 6)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 7)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 7)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 7)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 8)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 8)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 8)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 9)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 9)
FAIL: g++.target/i386/mv28.C  -std=c++2a  (test for errors, line 9)
FAIL: g++.target/i386/pr82625.C  -std=gnu++2a  scan-tree-dump-times optimized "return 4096;" 1
FAIL: g++.target/i386/pr82625.C  -std=gnu++2a  scan-tree-dump-times optimized "return 4096;" 1
FAIL: g++.target/i386/pr82625.C  -std=gnu++2a  scan-tree-dump-times optimized "return 4096;" 1
FAIL: g++.target/i386/pr82625.C  -std=gnu++2a  scan-tree-dump-times optimized "return 8192;" 1
FAIL: g++.target/i386/pr82625.C  -std=gnu++2a  scan-tree-dump-times optimized "return 8192;" 1
FAIL: g++.target/i386/pr82625.C  -std=gnu++2a  scan-tree-dump-times optimized "return 8192;" 1
FAIL: g++.target/i386/pr98218-1.C  -std=gnu++2a  scan-assembler-times pcmpgtd 2
FAIL: g++.target/i386/pr98218-1.C  -std=gnu++2a  scan-assembler-times pcmpgtd 2
ERROR: g++.dg/gcov/gcov-17.C  : error executing dg-final: can't read "script": no such variable
ERROR: g++.dg/gcov/gcov-17.C  : error executing dg-final: can't read "script": no such variable
ERROR: g++.dg/gcov/pr98273.C  : error executing dg-final: can't read "script": no such variable
ERROR: g++.dg/gcov/pr98273.C  : error executing dg-final: can't read "script": no such variable


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-18 19:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-18 19:48 [TCWG CI] Regression caused by gdb: Move gdb_argv to gdbsupport ci_notify

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