Skip to content

Commit 842806c

Browse files
committed
gdb, gdbserver, gdbsupport: add .gitattributes files
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.
1 parent 92d4b13 commit 842806c

File tree

6 files changed

+31
-0
lines changed

6 files changed

+31
-0
lines changed

gdb/.gitattributes

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# -*- conf -*-
2+
3+
# Use cpp-style diffs for .h and .c files. This is useful
4+
# if you modify classes defined in those files.
5+
6+
*.h diff=cpp
7+
*.c diff=cpp

gdb/ChangeLog

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2020-03-05 Tankut Baris Aktemur <[email protected]>
2+
3+
* .gitattributes: New file.
4+
15
2020-03-04 Tom Tromey <[email protected]>
26

37
* symmisc.c (print_symbol_bcache_statistics)

gdbserver/.gitattributes

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# -*- conf -*-
2+
3+
# Use cpp-style diffs for .h files. This is useful
4+
# if you modify classes defined in a header file.
5+
6+
*.h diff=cpp

gdbserver/ChangeLog

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2020-03-05 Tankut Baris Aktemur <[email protected]>
2+
3+
* .gitattributes: New file.
4+
15
2020-03-02 Andrew Burgess <[email protected]>
26

37
* remote-utils.cc (prepare_resume_reply): Add ability to convert T

gdbsupport/.gitattributes

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# -*- conf -*-
2+
3+
# Use cpp-style diffs for .h files. This is useful
4+
# if you modify classes defined in a header file.
5+
6+
*.h diff=cpp

gdbsupport/ChangeLog

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2020-03-05 Tankut Baris Aktemur <[email protected]>
2+
3+
* .gitattributes: New file.
4+
15
2020-03-03 Simon Marchi <[email protected]>
26

37
* Makefile.in: Re-generate.

0 commit comments

Comments
 (0)