Personal emacs config
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
3.3 KiB

  1. ;; Copyright (C) 2010-2011, 2014-2016, 2019 Free Software Foundation, Inc
  2. ;; Author: Rocky Bernstein <rocky@gnu.org>
  3. ;; This program is free software; you can redistribute it and/or modify
  4. ;; it under the terms of the GNU General Public License as published by
  5. ;; the Free Software Foundation, either version 3 of the License, or
  6. ;; (at your option) any later version.
  7. ;; This program is distributed in the hope that it will be useful,
  8. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. ;; GNU General Public License for more details.
  11. ;;; FIXME - think of a better name.
  12. ;;;
  13. ;;; Debugger regular expressions for many kinds of
  14. ;;; debuggers
  15. ;;; Here we have hash tables used in each kind of debugger
  16. ;;; and names for patterns matching fields in a location
  17. ;;; structure
  18. ;;; Code:
  19. ;; -------------------------------------------------------------------
  20. ;; Variables defining regular expressions (regexp:s).
  21. ;;
  22. (eval-when-compile (require 'cl-lib))
  23. (cl-defstruct realgud-loc-pat
  24. "Information to match and extract position and other related information typically
  25. output by a debugger inside a process shell"
  26. (num) ;; General number. Could be for example
  27. ;; breakpoint number,
  28. (string) ;; General string, Could be for example a list of
  29. ;; breakpoint number. Or can be used if for example
  30. ;; if we need more than one in a complicated re
  31. ;; where we can't assign a single number to a
  32. ;; file position as in Perl locations.
  33. (regexp) ;; a stack position, or thread number.
  34. (file-group) ;; Filename position in struct
  35. (line-group) ;; Line number position in struct
  36. ;; FIXME: fix code to handle lists of locs and then remove
  37. (alt-file-group) ;; Used when regexp is too complicated and use \|
  38. ;; e.g. perldb file loc regexps
  39. (alt-line-group) ;; ditto
  40. (char-offset-group) ;; Character offset position in struct
  41. (instruction-address-group)
  42. (column-group)
  43. (ignore-file-re) ;; Some debuggers create pseudo files in eval strings
  44. ;; for example "(eval)" in Ruby and Perl
  45. (text-group) ;; Some source text that should found at position
  46. (class-group) ;; Java doesn't refer to files, but class names
  47. (event-group) ;; Stopping event, e.g.statement, breakpoint,
  48. ;; call, return, exception, etc.
  49. (function-group) ;; function name
  50. )
  51. (defconst realgud:regexp-captured-num "\\([0-9]+\\)")
  52. (defvar realgud-pat-hash (make-hash-table :test 'equal)
  53. "Hash key is the debugger name, a string.
  54. The values of a hash entry is a realgud-loc-pat struct")
  55. (defvar realgud-command-hash (make-hash-table :test 'equal)
  56. "Hash key is the debugger name, a string.
  57. The value of a hash entry is a hash table mapping cannonic command name
  58. debugger-specific command name. For example, for trepanning:
  59. 'quit' -> 'quit!'")
  60. (defvar realgud:variable-basename-hash (make-hash-table :test 'equal)
  61. "Hash key is the debugger name, a string.
  62. The value of a hash
  63. entry is the base name to use that variables of that debugger use.
  64. For example, for 'gdb' it is 'realgud:gdb'.")
  65. (provide 'realgud-regexp)