From patchwork Sun Nov 24 11:54:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Edlinger X-Patchwork-Id: 36161 Received: (qmail 16585 invoked by alias); 24 Nov 2019 11:54:30 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 16576 invoked by uid 89); 24 Nov 2019 11:54:30 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-17.2 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.1 spammy=UD:buildsym.c, buildsymc, buildsym.c, dbxread.c X-HELO: EUR01-HE1-obe.outbound.protection.outlook.com Received: from mail-oln040092065026.outbound.protection.outlook.com (HELO EUR01-HE1-obe.outbound.protection.outlook.com) (40.92.65.26) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 24 Nov 2019 11:54:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dO5WK0FFAdOSHIY6xQhcMVJnhoXAhNZbLtEoY3SEyM104vJd51p/i/sxc4yLTdornQ4hgDKkRSWES5hdFsEBw28V2sMxBU92JvgCRBHyanzaOERBMC1nQEcLPIhNmiVyNkdp0kiUDmJO3jcYe6Sn9NLZv35bq8guhjUf91akSG8WNyjWFLQU59KTLXEFxoT4zxfFN0TEvXPiPbcdyvTTIfXA7VPPZ48FsDsFiczcZkza0n20j22lMFUMw1LV3cIdN5NRoFOenBcMPhjctRqwEZpbAfgVFMDJFHs2JhWhBEJykJTzNshzwkdwRj7K+AoUljF7gS18GUx69M0qbxWtyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iCxJnaWSMuJnW7zqkUKbt/NyTp6ZTIteu/bRidzca0o=; b=V5IO9yeTY9RWA3Es4VkPgQEdVePGphqRbDdw49idhuRmP4rLrAehKyXOlRAs1HY+Ruck5/CjaJtGW4TaWjxRG2t7yRI7UplIeImPp6F2koC+tWyXt0rRrCDwWVrcmVaiuWaJHQB0aWrHw2EBp4ac7Afd2kaLj+0yg1m2YPXhwZioy4REb3YXkfqUtOqjeiibmrpKdAhUFbypEDEV7V9XdNOv1BhYo2VnmdvSzc2jNN4RnpjBSc4nF+vkp8J8vr3201p74cBmO/XsQIWOO/CdLsZBJqwesuQXnj5y676lQQJB/WrOVN8/ydcS+8j6zrJhF/3fNrYmL0bYjqtZUzK5og== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from HE1EUR01FT019.eop-EUR01.prod.protection.outlook.com (10.152.0.60) by HE1EUR01HT044.eop-EUR01.prod.protection.outlook.com (10.152.1.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.17; Sun, 24 Nov 2019 11:54:24 +0000 Received: from VI1PR03MB4528.eurprd03.prod.outlook.com (10.152.0.57) by HE1EUR01FT019.mail.protection.outlook.com (10.152.0.179) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.17 via Frontend Transport; Sun, 24 Nov 2019 11:54:24 +0000 Received: from VI1PR03MB4528.eurprd03.prod.outlook.com ([fe80::49b8:a7e6:9f6f:862d]) by VI1PR03MB4528.eurprd03.prod.outlook.com ([fe80::49b8:a7e6:9f6f:862d%3]) with mapi id 15.20.2474.023; Sun, 24 Nov 2019 11:54:23 +0000 From: Bernd Edlinger To: "gdb-patches@sourceware.org" Subject: [PATCH] Fix setting breakpoints or stepping on line 65535 Date: Sun, 24 Nov 2019 11:54:23 +0000 Message-ID: x-microsoft-original-message-id: x-ms-exchange-transport-forked: True MIME-Version: 1.0 Hi, this removes code that is present from the very first git revisison 7b4ac7e1ed2c4616bce56d1760807798be87ac9e from 1988. It was in the gdb/dbxread.c at the time (and makes more sense for dbx line info format since line numbers are 16-bit entities in that debug format and debugging files with more than 65535 lines would not work anyway) but moved from there to gdb/buildsym.c which is used for dwarf line info as well, and excluding an arbitrary line number does certainly not make sense nowadays. Thanks Bernd. From 54a7631206a2cf54573fb4cc94474cb2f6f99245 Mon Sep 17 00:00:00 2001 From: Bernd Edlinger Date: Sun, 24 Nov 2019 09:37:22 +0100 Subject: [PATCH 2/2] Add a test case for line 65535 --- gdb/testsuite/gdb.base/line65535.c | 19 +++++++++++++++++++ gdb/testsuite/gdb.base/line65535.exp | 26 ++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 gdb/testsuite/gdb.base/line65535.c create mode 100644 gdb/testsuite/gdb.base/line65535.exp diff --git a/gdb/testsuite/gdb.base/line65535.c b/gdb/testsuite/gdb.base/line65535.c new file mode 100644 index 0000000..d80a294 --- /dev/null +++ b/gdb/testsuite/gdb.base/line65535.c @@ -0,0 +1,19 @@ +/* This testcase is part of GDB, the GNU debugger. + + Copyright 2019 Free Software Foundation, Inc. + + 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 . */ + +#line 65535 "line65535.c" +int main() { return 0; } diff --git a/gdb/testsuite/gdb.base/line65535.exp b/gdb/testsuite/gdb.base/line65535.exp new file mode 100644 index 0000000..2535ba5 --- /dev/null +++ b/gdb/testsuite/gdb.base/line65535.exp @@ -0,0 +1,26 @@ +# Copyright 2019 Free Software Foundation, Inc. + +# 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 . + +standard_testfile + +if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} { + return -1 +} + +gdb_test "break $srcfile:65535" \ + ".*Breakpoint 1 at .*: file $srcfile, line 65535\\..*" \ + "break at line 65535" + +return 0 -- 1.9.1