Skip to content

Commit

Permalink
gdb, gdbserver, gdbsupport: add .gitattributes files
Browse files Browse the repository at this point in the history
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  <[email protected]>

	* .gitattributes: New file.

gdbserver/ChangeLog:
2020-03-05  Tankut Baris Aktemur  <[email protected]>

	* .gitattributes: New file.

gdbsupport/ChangeLog:
2020-03-05  Tankut Baris Aktemur  <[email protected]>

	* .gitattributes: New file.
  • Loading branch information
barisaktemur committed Mar 5, 2020
1 parent 92d4b13 commit 842806c
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 0 deletions.
7 changes: 7 additions & 0 deletions gdb/.gitattributes
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions gdb/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2020-03-05 Tankut Baris Aktemur <[email protected]>

* .gitattributes: New file.

2020-03-04 Tom Tromey <[email protected]>

* symmisc.c (print_symbol_bcache_statistics)
Expand Down
6 changes: 6 additions & 0 deletions gdbserver/.gitattributes
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions gdbserver/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2020-03-05 Tankut Baris Aktemur <[email protected]>

* .gitattributes: New file.

2020-03-02 Andrew Burgess <[email protected]>

* remote-utils.cc (prepare_resume_reply): Add ability to convert T
Expand Down
6 changes: 6 additions & 0 deletions gdbsupport/.gitattributes
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions gdbsupport/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2020-03-05 Tankut Baris Aktemur <[email protected]>

* .gitattributes: New file.

2020-03-03 Simon Marchi <[email protected]>

* Makefile.in: Re-generate.
Expand Down

0 comments on commit 842806c

Please sign in to comment.