Add dwarf2_per_objfile parameter to allocate_piece_closure
[deliverable/binutils-gdb.git] / gdb / gdb-code-style.el
index 58978312e94bd655d4fb7e872e357990d0f4dd75..47e99b2b9d59698140a06572b27d9c14e12b1d76 100644 (file)
@@ -1,6 +1,6 @@
 ;;; gdb-code-style.el --- code style checker for GDB contributors
 
-;; Copyright (C) 2012 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2020 Free Software Foundation, Inc.
 
 ;; Author: Yao Qi <yao@codesourcery.com>
 ;; Created: 17 April 2012
 
 (add-hook 'c-mode-common-hook 'gdb-include-hook)
 
-;;; gdb-code-style.el ends here
\ No newline at end of file
+;; Check marker up.  If the marker up is missing, like,
+;;   warning ("abc");
+;; The '(' and '"' will be highlight.
+(defun gdb-markup-hook ()
+  (font-lock-add-keywords
+   nil
+   '(("\\<\\(warning\\|error\\)[ ]*\\(\([^_]\\)" 2 font-lock-warning-face t))))
+
+(add-hook 'c-mode-common-hook 'gdb-markup-hook)
+
+(defun gdb-comment-hook ()
+  ;; A space should follow "/*", otherwise report a warning.
+  ;; If the comment is like:
+  ;; /*F.  */
+  ;; The 'F' will be highlight.
+  (font-lock-add-keywords
+   nil
+   '(("/\\*\\([^ ]\\).*\\*/" 1 font-lock-warning-face t)))
+  ;; Two spaces are needed between "." and "*/".  Report warning if there
+  ;; is no space (".*/") or only one space (". */").
+  ;; If the comment is like:
+  ;; /* ABC. */ or /* ABC.*/
+  ;; the '.' is highlight.
+  (font-lock-add-keywords
+   nil
+   '(("\\<[[:ascii:]]*\\(\\.[ ]?\\)\\*/" 1 font-lock-warning-face t)))
+  )
+(add-hook 'c-mode-common-hook 'gdb-comment-hook)
+
+;; Set c-set-offset 'innamespace as a safe value to be used in .dir-locals.el.
+(setq safe-local-variable-values
+      (cons safe-local-variable-values
+           '((eval c-set-offset 'innamespace 0)
+             (c-offsets-alist (innamespace . 0)))))
+;;; gdb-code-style.el ends here
This page took 0.028695 seconds and 4 git commands to generate.