From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by sourceware.org (Postfix) with ESMTPS id 37103385C421 for ; Tue, 18 Jan 2022 19:48:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 37103385C421 Received: by mail-wm1-x329.google.com with SMTP id j5-20020a05600c1c0500b0034d2e956aadso754783wms.4 for ; Tue, 18 Jan 2022 11:48:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:date:to:cc:message-id:subject:mime-version :list-id; bh=FCqzg5SGbucTU+1bSfDeDjleKkof8mCI1GXfIU9NXNc=; b=Xp6NR3wJ3MHyCy2Y/SV0ZOJYziA7Tyx56o1UImC8krzRYqpCd4M2tvC1ayROipu/8c Il/4m7rEIAA2VGQpC0wD0G1xSnfhFpFv7meqh77H5HF9mIjdHIA8TBLxA0tQ/4GmbTDI OKLIFFw0Wx/cAPo+sxEz9e64w4ocVjjvQ7VGcgKSifMXRdXvC81gsNxS/9qPlmWJa4Lf QcI8d8od1GCWw8HMOl9LpjKIPCvwD8IHYChrcSdOoqiM5nhU+N/a9KCaF6s4D2IL8vgO vJIizzFF5oQjOPvWL67Ik70M3H5QIrD8pHeDic0U7Uyk7f1N/swk39TVtZhwNRR2UZ/V ka3Q== X-Gm-Message-State: AOAM531qYg+aqmbFGUzSBqrg4AYorwu73mwh2Tka9rCZcbB29MxQAIEo BGczXu+VewUBh8LGrvYj8SHOww== X-Google-Smtp-Source: ABdhPJyQq15hHIAT8YkolW5OMQ5OlDiD0Wng0daU2yc8Qqp0hzEzHW7EzvqAXu5I8IvluQy0CLW8oQ== X-Received: by 2002:a05:6000:102:: with SMTP id o2mr25048075wrx.691.1642535285934; Tue, 18 Jan 2022 11:48:05 -0800 (PST) Received: from jenkins.jenkins (ci.linaro.org. [88.99.136.175]) by smtp.gmail.com with ESMTPSA id y9sm10230533wrm.94.2022.01.18.11.48.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jan 2022 11:48:05 -0800 (PST) From: ci_notify@linaro.org X-Google-Original-From: linaro-infrastructure-errors@lists.linaro.org Date: Tue, 18 Jan 2022 19:48:03 +0000 (UTC) To: Tom Tromey Cc: gcc-regression@gcc.gnu.org Message-ID: <170253718.13489.1642535285416@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_native_build/master-arm X-Jenkins-Result: SUCCESS X-Spam-Status: No, score=-13.7 required=5.0 tests=BAYES_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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jan 2022 19:48:10 -0000 [TCWG CI] Regression caused by gdb: Move gdb_argv to gdbsupport: commit 7904e9613e0a2fc38e9abc06a916dea6a009c7b4 Author: Tom Tromey 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: =E2=80=98gd= b_argv=E2=80=99 was not declared in this scope # 00:01:18 ../../../../../../gdb/gdb/remote-sim.c:587:24: error: =E2=80=98a= rgv=E2=80=99 was not declared in this scope; did you mean =E2=80=98args=E2= =80=99? # 00:01:18 ../../../../../../gdb/gdb/remote-sim.c:643:3: error: =E2=80=98gd= b_argv=E2=80=99 was not declared in this scope # 00:01:18 ../../../../../../gdb/gdb/remote-sim.c:652:7: error: =E2=80=98bu= ilt_argv=E2=80=99 was not declared in this scope; did you mean =E2=80=98bui= ldargv=E2=80=99? # 00:01:18 ../../../../../../gdb/gdb/remote-sim.c:657:7: error: =E2=80=98bu= ilt_argv=E2=80=99 was not declared in this scope; did you mean =E2=80=98bui= ldargv=E2=80=99? # 00:01:18 ../../../../../../gdb/gdb/remote-sim.c:741:3: error: =E2=80=98gd= b_argv=E2=80=99 was not declared in this scope # 00:01:18 ../../../../../../gdb/gdb/remote-sim.c:742:14: error: =E2=80=98a= rgv=E2=80=99 was not declared in this scope; did you mean =E2=80=98args=E2= =80=99? # 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, REPRODUCT= ION 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-mas= ter-arm/7/artifact/artifacts/build-7904e9613e0a2fc38e9abc06a916dea6a009c7b4= / Last_good build: https://ci.linaro.org/job/tcwg_gnu_native_build-bisect-mas= ter-arm/7/artifact/artifacts/build-5947982f1dadfa72a6913f25cc4f56e137c7217e= / Baseline build: https://ci.linaro.org/job/tcwg_gnu_native_build-bisect-mast= er-arm/7/artifact/artifacts/build-baseline/ Even more details: https://ci.linaro.org/job/tcwg_gnu_native_build-bisect-m= aster-arm/7/artifact/artifacts/ Reproduce builds: 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/tcw= g_gnu_native_build-bisect-master-arm/7/artifact/artifacts/manifests/build-b= aseline.sh --fail curl -o artifacts/manifests/build-parameters.sh https://ci.linaro.org/job/t= cwg_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-b= isect-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.s= h # 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 .. Full commit (up to 1000 lines): commit 7904e9613e0a2fc38e9abc06a916dea6a009c7b4 Author: Tom Tromey Date: Tue Feb 25 18:14:19 2020 -0700 Move gdb_argv to gdbsupport =20 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" =20 /* 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" =20 =0C =20 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 #include "gdbsupport/pathstuff.h" #include "cli/cli-style.h" +#include "gdbsupport/buildargv.h" =20 void (*deprecated_file_changed_hook) (const char *); =20 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" =20 /* 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" =20 /* 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" =20 /* Prototypes for local functions */ =20 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"=09=09/* For command_loop. */ #include "main.h" +#include "gdbsupport/buildargv.h" =20 /* Each UI has its own independent set of interpreters. */ =20 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 #include +#include "gdbsupport/buildargv.h" =20 static struct partial_symbol *lookup_partial_symbol (struct objfile *, =09=09=09=09=09=09 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 #include "cli/cli-style.h" +#include "gdbsupport/buildargv.h" =20 /* 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" =20 #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" =20 /* 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" =20 #include #include 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 +#include "gdbsupport/buildargv.h" =20 /* Prototypes for local functions */ =20 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" =20 /* Helper macros. */ =20 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 #include "cli/cli-style.h" #include "expop.h" +#include "gdbsupport/buildargv.h" =20 #include =20 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" =20 void (*deprecated_error_begin_hook) (void); =20 @@ -2890,17 +2891,6 @@ ldirname (const char *filename) return dirname; } =20 -/* See utils.h. */ - -void -gdb_argv::reset (const char *s) -{ - char **argv =3D buildargv (s); - - freeargv (m_argv); - m_argv =3D argv; -} - /* Return ARGS parsed as a valid pid, or throw an error. */ =20 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); =20 extern int parse_escape (struct gdbarch *, const char **); =20 -/* 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 &) =3D delete; - gdb_argv &operator=3D (const gdb_argv &) =3D delete; - - gdb_argv &operator=3D (gdb_argv &&other) - { - freeargv (m_argv); - m_argv =3D other.m_argv; - other.m_argv =3D nullptr; - return *this; - } - - gdb_argv (gdb_argv &&other) - { - m_argv =3D other.m_argv; - other.m_argv =3D 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 =3D m_argv; - m_argv =3D 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 !=3D NULL); - return m_argv[arg]; - } - - /* Return the arguments array as an array view. */ - - gdb::array_view as_array_view () - { - return gdb::array_view (this->get (), this->count ()); - } - - gdb::array_view as_array_view () const - { - return gdb::array_view (this->get (), this->count = ()); - } - - /* Append arguments to this array. */ - void append (gdb_argv &&other) - { - int size =3D count (); - int argc =3D other.count (); - m_argv =3D XRESIZEVEC (char *, m_argv, (size + argc + 1)); - - for (int argi =3D 0; argi < argc; argi++) - { -=09/* Transfer ownership of the string. */ -=09m_argv[size++] =3D other.m_argv[argi]; -=09/* Ensure that destruction of OTHER works correctly. */ -=09other.m_argv[argi] =3D nullptr; - } - m_argv[size] =3D nullptr; - } - - /* Append arguments to this array. */ - void append (const gdb_argv &other) - { - int size =3D count (); - int argc =3D other.count (); - m_argv =3D XRESIZEVEC (char *, m_argv, (size + argc + 1)); - - for (int argi =3D 0; argi < argc; argi++) - m_argv[size++] =3D xstrdup (other.m_argv[argi]); - m_argv[size] =3D 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!=3D (std::nullptr_t) - { - return m_argv !=3D NULL; - } - - bool operator=3D=3D (std::nullptr_t) - { - return m_argv =3D=3D NULL; - } - -private: - - /* The wrapped array. */ - - char **m_argv; -}; - =0C /* Cleanup utilities. */ =20 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 . = */ + +#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 &) =3D delete; + gdb_argv &operator=3D (const gdb_argv &) =3D delete; + + gdb_argv &operator=3D (gdb_argv &&other) + { + freeargv (m_argv); + m_argv =3D other.m_argv; + other.m_argv =3D nullptr; + return *this; + } + + gdb_argv (gdb_argv &&other) + { + m_argv =3D other.m_argv; + other.m_argv =3D 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 =3D buildargv (str); + freeargv (m_argv); + m_argv =3D 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 =3D m_argv; + m_argv =3D 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 !=3D NULL); + return m_argv[arg]; + } + + /* Return the arguments array as an array view. */ + + gdb::array_view as_array_view () + { + return gdb::array_view (this->get (), this->count ()); + } + + gdb::array_view as_array_view () const + { + return gdb::array_view (this->get (), this->count = ()); + } + + /* Append arguments to this array. */ + void append (gdb_argv &&other) + { + int size =3D count (); + int argc =3D other.count (); + m_argv =3D XRESIZEVEC (char *, m_argv, (size + argc + 1)); + + for (int argi =3D 0; argi < argc; argi++) + { +=09/* Transfer ownership of the string. */ +=09m_argv[size++] =3D other.m_argv[argi]; +=09/* Ensure that destruction of OTHER works correctly. */ +=09other.m_argv[argi] =3D nullptr; + } + m_argv[size] =3D nullptr; + } + + /* Append arguments to this array. */ + void append (const gdb_argv &other) + { + int size =3D count (); + int argc =3D other.count (); + m_argv =3D XRESIZEVEC (char *, m_argv, (size + argc + 1)); + + for (int argi =3D 0; argi < argc; argi++) + m_argv[size++] =3D xstrdup (other.m_argv[argi]); + m_argv[size] =3D 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!=3D (std::nullptr_t) + { + return m_argv !=3D NULL; + } + + bool operator=3D=3D (std::nullptr_t) + { + return m_argv =3D=3D NULL; + } + +private: + + /* The wrapped array. */ + + char **m_argv; +}; + +#endif /* GDBSUPPORT_BUILDARGV_H */ >>From ci_notify@linaro.org Tue Jan 18 22:54:58 2022 Return-Path: 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 ; 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 ; Tue, 18 Jan 2022 14:54:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=256/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 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=BAYES_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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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 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: =E2=80=98gd= b_argv=E2=80=99 was not declared in this scope # 00:01:33 ../../../../../../gdb/gdb/remote-sim.c:587:24: error: =E2=80=98a= rgv=E2=80=99 was not declared in this scope; did you mean =E2=80=98args=E2= =80=99? # 00:01:33 ../../../../../../gdb/gdb/remote-sim.c:643:3: error: =E2=80=98gd= b_argv=E2=80=99 was not declared in this scope # 00:01:33 ../../../../../../gdb/gdb/remote-sim.c:652:7: error: =E2=80=98bu= ilt_argv=E2=80=99 was not declared in this scope; did you mean =E2=80=98bui= ldargv=E2=80=99? # 00:01:33 ../../../../../../gdb/gdb/remote-sim.c:657:7: error: =E2=80=98bu= ilt_argv=E2=80=99 was not declared in this scope; did you mean =E2=80=98bui= ldargv=E2=80=99? # 00:01:33 ../../../../../../gdb/gdb/remote-sim.c:741:3: error: =E2=80=98gd= b_argv=E2=80=99 was not declared in this scope # 00:01:33 ../../../../../../gdb/gdb/remote-sim.c:742:14: error: =E2=80=98a= rgv=E2=80=99 was not declared in this scope; did you mean =E2=80=98args=E2= =80=99? # 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, REPRODUCT= ION 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-mast= er-aarch64/24/artifact/artifacts/build-7904e9613e0a2fc38e9abc06a916dea6a009= c7b4/ Last_good build: https://ci.linaro.org/job/tcwg_gnu_cross_build-bisect-mast= er-aarch64/24/artifact/artifacts/build-5947982f1dadfa72a6913f25cc4f56e137c7= 217e/ Baseline build: https://ci.linaro.org/job/tcwg_gnu_cross_build-bisect-maste= r-aarch64/24/artifact/artifacts/build-baseline/ Even more details: https://ci.linaro.org/job/tcwg_gnu_cross_build-bisect-ma= ster-aarch64/24/artifact/artifacts/ Reproduce builds: 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/tcw= g_gnu_cross_build-bisect-master-aarch64/24/artifact/artifacts/manifests/bui= ld-baseline.sh --fail curl -o artifacts/manifests/build-parameters.sh https://ci.linaro.org/job/t= cwg_gnu_cross_build-bisect-master-aarch64/24/artifact/artifacts/manifests/b= uild-parameters.sh --fail curl -o artifacts/test.sh https://ci.linaro.org/job/tcwg_gnu_cross_build-bi= sect-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.s= h # 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 .. Full commit (up to 1000 lines): commit 7904e9613e0a2fc38e9abc06a916dea6a009c7b4 Author: Tom Tromey Date: Tue Feb 25 18:14:19 2020 -0700 Move gdb_argv to gdbsupport =20 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" =20 /* 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" =20 =0C =20 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 #include "gdbsupport/pathstuff.h" #include "cli/cli-style.h" +#include "gdbsupport/buildargv.h" =20 void (*deprecated_file_changed_hook) (const char *); =20 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" =20 /* 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" =20 /* 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" =20 /* Prototypes for local functions */ =20 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"=09=09/* For command_loop. */ #include "main.h" +#include "gdbsupport/buildargv.h" =20 /* Each UI has its own independent set of interpreters. */ =20 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 #include +#include "gdbsupport/buildargv.h" =20 static struct partial_symbol *lookup_partial_symbol (struct objfile *, =09=09=09=09=09=09 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 #include "cli/cli-style.h" +#include "gdbsupport/buildargv.h" =20 /* 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" =20 #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" =20 /* 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" =20 #include #include 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 +#include "gdbsupport/buildargv.h" =20 /* Prototypes for local functions */ =20 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" =20 /* Helper macros. */ =20 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 #include "cli/cli-style.h" #include "expop.h" +#include "gdbsupport/buildargv.h" =20 #include =20 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" =20 void (*deprecated_error_begin_hook) (void); =20 @@ -2890,17 +2891,6 @@ ldirname (const char *filename) return dirname; } =20 -/* See utils.h. */ - -void -gdb_argv::reset (const char *s) -{ - char **argv =3D buildargv (s); - - freeargv (m_argv); - m_argv =3D argv; -} - /* Return ARGS parsed as a valid pid, or throw an error. */ =20 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); =20 extern int parse_escape (struct gdbarch *, const char **); =20 -/* 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 &) =3D delete; - gdb_argv &operator=3D (const gdb_argv &) =3D delete; - - gdb_argv &operator=3D (gdb_argv &&other) - { - freeargv (m_argv); - m_argv =3D other.m_argv; - other.m_argv =3D nullptr; - return *this; - } - - gdb_argv (gdb_argv &&other) - { - m_argv =3D other.m_argv; - other.m_argv =3D 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 =3D m_argv; - m_argv =3D 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 !=3D NULL); - return m_argv[arg]; - } - - /* Return the arguments array as an array view. */ - - gdb::array_view as_array_view () - { - return gdb::array_view (this->get (), this->count ()); - } - - gdb::array_view as_array_view () const - { - return gdb::array_view (this->get (), this->count = ()); - } - - /* Append arguments to this array. */ - void append (gdb_argv &&other) - { - int size =3D count (); - int argc =3D other.count (); - m_argv =3D XRESIZEVEC (char *, m_argv, (size + argc + 1)); - - for (int argi =3D 0; argi < argc; argi++) - { -=09/* Transfer ownership of the string. */ -=09m_argv[size++] =3D other.m_argv[argi]; -=09/* Ensure that destruction of OTHER works correctly. */ -=09other.m_argv[argi] =3D nullptr; - } - m_argv[size] =3D nullptr; - } - - /* Append arguments to this array. */ - void append (const gdb_argv &other) - { - int size =3D count (); - int argc =3D other.count (); - m_argv =3D XRESIZEVEC (char *, m_argv, (size + argc + 1)); - - for (int argi =3D 0; argi < argc; argi++) - m_argv[size++] =3D xstrdup (other.m_argv[argi]); - m_argv[size] =3D 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!=3D (std::nullptr_t) - { - return m_argv !=3D NULL; - } - - bool operator=3D=3D (std::nullptr_t) - { - return m_argv =3D=3D NULL; - } - -private: - - /* The wrapped array. */ - - char **m_argv; -}; - =0C /* Cleanup utilities. */ =20 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 . = */ + +#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 &) =3D delete; + gdb_argv &operator=3D (const gdb_argv &) =3D delete; + + gdb_argv &operator=3D (gdb_argv &&other) + { + freeargv (m_argv); + m_argv =3D other.m_argv; + other.m_argv =3D nullptr; + return *this; + } + + gdb_argv (gdb_argv &&other) + { + m_argv =3D other.m_argv; + other.m_argv =3D 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 =3D buildargv (str); + freeargv (m_argv); + m_argv =3D 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 =3D m_argv; + m_argv =3D 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 !=3D NULL); + return m_argv[arg]; + } + + /* Return the arguments array as an array view. */ + + gdb::array_view as_array_view () + { + return gdb::array_view (this->get (), this->count ()); + } + + gdb::array_view as_array_view () const + { + return gdb::array_view (this->get (), this->count = ()); + } + + /* Append arguments to this array. */ + void append (gdb_argv &&other) + { + int size =3D count (); + int argc =3D other.count (); + m_argv =3D XRESIZEVEC (char *, m_argv, (size + argc + 1)); + + for (int argi =3D 0; argi < argc; argi++) + { +=09/* Transfer ownership of the string. */ +=09m_argv[size++] =3D other.m_argv[argi]; +=09/* Ensure that destruction of OTHER works correctly. */ +=09other.m_argv[argi] =3D nullptr; + } + m_argv[size] =3D nullptr; + } + + /* Append arguments to this array. */ + void append (const gdb_argv &other) + { + int size =3D count (); + int argc =3D other.count (); + m_argv =3D XRESIZEVEC (char *, m_argv, (size + argc + 1)); + + for (int argi =3D 0; argi < argc; argi++) + m_argv[size++] =3D xstrdup (other.m_argv[argi]); + m_argv[size] =3D 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!=3D (std::nullptr_t) + { + return m_argv !=3D NULL; + } + + bool operator=3D=3D (std::nullptr_t) + { + return m_argv =3D=3D NULL; + } + +private: + + /* The wrapped array. */ + + char **m_argv; +}; + +#endif /* GDBSUPPORT_BUILDARGV_H */ >>From hjl@sc.intel.com Wed Jan 19 02:10:56 2022 Return-Path: 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 ; 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" X-Spam-Status: No, score=-3465.5 required=5.0 tests=BAYES_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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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