From patchwork Thu Mar 5 09:01:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aktemur, Tankut Baris" X-Patchwork-Id: 38424 Received: (qmail 34847 invoked by alias); 5 Mar 2020 09:01:35 -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 34838 invoked by uid 89); 5 Mar 2020 09:01:35 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.2 required=5.0 tests=AC_FROM_MANY_DOTS, AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=nexting X-HELO: mga02.intel.com Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 05 Mar 2020 09:01:34 +0000 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Mar 2020 01:01:32 -0800 Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga001.fm.intel.com with ESMTP; 05 Mar 2020 01:01:31 -0800 Received: from ulvlx001.iul.intel.com (ulvlx001.iul.intel.com [172.28.207.17]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id 02591UZD019501; Thu, 5 Mar 2020 09:01:30 GMT Received: from ulvlx001.iul.intel.com (localhost [127.0.0.1]) by ulvlx001.iul.intel.com with ESMTP id 02591Uu0007201; Thu, 5 Mar 2020 10:01:30 +0100 Received: (from taktemur@localhost) by ulvlx001.iul.intel.com with LOCAL id 02591Tmk007197; Thu, 5 Mar 2020 10:01:29 +0100 From: Tankut Baris Aktemur To: gdb-patches@sourceware.org Subject: [PATCH] gdb, gdbserver, gdbsupport: add .gitattributes files Date: Thu, 5 Mar 2020 10:01:06 +0100 Message-Id: <1583398866-6771-1-git-send-email-tankut.baris.aktemur@intel.com> X-IsSubscribed: yes Create .gitattributes files in gdb/, gdbserver/, and gdbsupport/. The files specify cpp-style diffs for .h and .c files. This is particularly helpful if a class in a header file is modified. For instance, if the `stop_requested` field of `thread_info` in gdb/gdbthread.h is modified, we get the following diff with 'git diff' (using git version 2.17.1): @@ -379,7 +379,7 @@ public: struct target_waitstatus pending_follow; /* True if this thread has been explicitly requested to stop. */ - int stop_requested = 0; + bool stop_requested = 0; /* The initiating frame of a nexting operation, used for deciding which exceptions to intercept. If it is null_frame_id no Note that the context of the change shows up as 'public:'; not so useful. With the .gitattributes file, we get: @@ -379,7 +379,7 @@ class thread_info : public refcounted_object struct target_waitstatus pending_follow; /* True if this thread has been explicitly requested to stop. */ - int stop_requested = 0; + bool stop_requested = 0; /* The initiating frame of a nexting operation, used for deciding which exceptions to intercept. If it is null_frame_id no The context is successfully shown as 'class thread_info'. This patch creates a .gitattributes file per each of gdb, gdbserver, and gdbsupport folders. An alternative would be to define the attributes in the root folder -- this would impact all the top-level folders, though. I opted for the more conservative approach. gdb/ChangeLog: 2020-03-05 Tankut Baris Aktemur * .gitattributes: New file. gdbserver/ChangeLog: 2020-03-05 Tankut Baris Aktemur * .gitattributes: New file. gdbsupport/ChangeLog: 2020-03-05 Tankut Baris Aktemur * .gitattributes: New file. --- gdb/.gitattributes | 7 +++++++ gdbserver/.gitattributes | 6 ++++++ gdbsupport/.gitattributes | 6 ++++++ 3 files changed, 19 insertions(+) create mode 100644 gdb/.gitattributes create mode 100644 gdbserver/.gitattributes create mode 100644 gdbsupport/.gitattributes diff --git a/gdb/.gitattributes b/gdb/.gitattributes new file mode 100644 index 00000000000..8acadb9813e --- /dev/null +++ b/gdb/.gitattributes @@ -0,0 +1,7 @@ +# -*- conf -*- + +# Use cpp-style diffs for .h and .c files. This is useful +# if you modify classes defined in those files. + +*.h diff=cpp +*.c diff=cpp diff --git a/gdbserver/.gitattributes b/gdbserver/.gitattributes new file mode 100644 index 00000000000..6df25746593 --- /dev/null +++ b/gdbserver/.gitattributes @@ -0,0 +1,6 @@ +# -*- conf -*- + +# Use cpp-style diffs for .h files. This is useful +# if you modify classes defined in a header file. + +*.h diff=cpp diff --git a/gdbsupport/.gitattributes b/gdbsupport/.gitattributes new file mode 100644 index 00000000000..6df25746593 --- /dev/null +++ b/gdbsupport/.gitattributes @@ -0,0 +1,6 @@ +# -*- conf -*- + +# Use cpp-style diffs for .h files. This is useful +# if you modify classes defined in a header file. + +*.h diff=cpp