From patchwork Mon Aug 16 20:30:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 44672 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BC0CC3958C1F for ; Mon, 16 Aug 2021 20:31:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BC0CC3958C1F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1629145883; bh=1oNam61VcFp098IEAr6Zg1shH/2rw4mRO1Th9euJ34I=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=S7MezhJslEkznyofGcHB8xZPbG+tz9srZm7TaWB6wRjKNy53AwmukmsvXfr7U/ba4 rOh1gUpq3UXtMFTY0Wc8vNVaWnUXebz6jV9GG3DJVPQDxgKjrgeZlGnAiklqoARAe6 tdmGfUZhbkSlPIlD2a3an2kjawqTPl2rL3JshJSA= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by sourceware.org (Postfix) with ESMTPS id 89FA8385E82B; Mon, 16 Aug 2021 20:30:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 89FA8385E82B Received: by mail-pj1-x102b.google.com with SMTP id m24-20020a17090a7f98b0290178b1a81700so2177440pjl.4; Mon, 16 Aug 2021 13:30:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=1oNam61VcFp098IEAr6Zg1shH/2rw4mRO1Th9euJ34I=; b=CVP8iiQcq+3iAYyhDEVepSupODq8wLhxU85N0qSbAgNZ7toqgakgeO/sndhmSe0QfC PpB3rYRlzNN7SKwu6iTPioAm5pRQQMLS/v3rV/lJ3ZimzpD/+z5hLZTwsmyTNzRed+DO JhdI8Jam0XE55RTwOLl1wHBJkKUe4vRfDx77KqdB7ppxf+cF+LUqLgeZ5gGS5WUyG8pQ IrWgS0avRyXEfM/2Xr5hU4yGlDNICFppTHowXrCUQ5/8BSyVYdmpGDd8mAm/aunyp/Nc NCOcncyFXkHH/t+kSRFaTn2aKwObyjyj3b32iO+D82NwHmFcW/Xd32UdYVojSIZk7GuI 9MGQ== X-Gm-Message-State: AOAM533V8Sx87RuL68VM7YX0yWZ0kHhjTVcZC0Ijg82ASyFJQRm0+M+3 8dIaFUw6Xf2936ghQ8+92MNwV6IgpRQ= X-Google-Smtp-Source: ABdhPJw5zBnx9KTkOLr/fDELs/UPb/PCsmZ4R3nT2hLIRF8jZ5LDJHL3D1nPUhzo/OoB6lgA1wyB6w== X-Received: by 2002:a17:902:e54e:b029:12d:76cd:6744 with SMTP id n14-20020a170902e54eb029012d76cd6744mr56199plf.0.1629145851752; Mon, 16 Aug 2021 13:30:51 -0700 (PDT) Received: from gnu-cfl-2.localdomain ([172.58.38.240]) by smtp.gmail.com with ESMTPSA id s188sm56078pfb.4.2021.08.16.13.30.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Aug 2021 13:30:51 -0700 (PDT) Received: by gnu-cfl-2.localdomain (Postfix, from userid 1000) id 256D6C0330; Mon, 16 Aug 2021 13:30:50 -0700 (PDT) Date: Mon, 16 Aug 2021 13:30:50 -0700 To: GNU C Library , GDB Subject: [PATCH v2] gdbserver: Check r_version < 1 for Linux debugger interface Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-3033.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, 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 X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: "H.J. Lu via Libc-alpha" From: "H.J. Lu" Reply-To: "H.J. Lu" Cc: Simon Marchi Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Update gdbserver to check r_version < 1 instead of r_version != 1 so that r_version can be bumped for a new field in the glibc debugger interface to support multiple namespaces. Since so far, the gdbserver only reads fields defined for r_version == 1, it is compatible with r_version >= 1. All future glibc debugger interface changes will be backward compatible. If there is ever the need for backward incompatible change to the glibc debugger interface, a new DT_XXX element will be provided to access the new incompatible interface. PR gdb/11839 * linux-low.cc (linux_process_target::qxfer_libraries_svr4): Check r_version < 1 instead of r_version != 1. --- gdbserver/linux-low.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdbserver/linux-low.cc b/gdbserver/linux-low.cc index 5c6191d941c..fc7a995351d 100644 --- a/gdbserver/linux-low.cc +++ b/gdbserver/linux-low.cc @@ -6845,7 +6845,7 @@ linux_process_target::qxfer_libraries_svr4 (const char *annex, if (linux_read_memory (priv->r_debug + lmo->r_version_offset, (unsigned char *) &r_version, sizeof (r_version)) != 0 - || r_version != 1) + || r_version < 1) { warning ("unexpected r_debug version %d", r_version); }