summaryrefslogtreecommitdiff
path: root/gdb/gdbtk/library/gdbevent.ith
blob: a594ef54a2d39c3a71c2d1b7be949ccf9eb8dcb7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
# GDBEvent class definitions for Insight.
# Copyright 2001 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# For reasons unknown to me, I cannot put any of the constructors
# in the implementation files. The very first instance of the class
# will call the (empty) constructor in here instead of the one
# defined in the implementation file. Sigh.

itcl::class GDBEvent {
  public method get {what} { return "" }
  public method handler {} { return "unknown" }
}

# BREAKPOINT EVENT
#
# This event is created/dispatched whenever a breakpoint is created,
# deleted, or modified.
#
# action ....... what type of BP event ("create", "delete", "modify")
# number ....... gdb's internal token for the BP
# file ......... filename in which event occurred
# function ..... function in which event occurred
# line ......... line number in file
# address ...... address of BP
# type ......... breakpoint type ("breakpoint", "hw breakpoint", "step resume", etc)
# enabled ...... BP enabled?
# disposition .. BP's disposition ("delete", "delstop", "disable", "donttouch")
# ignore_count . BP's ignore count
# commands ..... list of commands to run when BP hit
# condition .... BP condition
# thread ....... thread in which BP is set (or -1 for all threads) 
# hit_count .... number of times BP has been hit
# user_specification
#             .. text the user initially used to set this breakpoint
itcl::class BreakpointEvent {
  inherit GDBEvent

  public variable action {}
  public variable number {}

  #constructor {args} {}
  constructor {args} {
    eval configure $args

    # If creating/modifying a breakpoint, then get
    # all info about it and save it away.
    _init
  }
  #destructor { dbug I "" }

  public method get {what}
  public method handler {} { return "breakpoint" }

  private variable _file         {}
  private variable _function     {}
  private variable _line         {}
  private variable _address      {}
  private variable _type         {}
  private variable _enabled      {}
  private variable _disposition  {}
  private variable _ignore_count {}
  private variable _commands     {}
  private variable _condition    {}
  private variable _thread       {}
  private variable _hit_count    {}
  private variable _user_specification {}

  private method _init {}
}

# TRACEPOINT EVENT
#
# This event is created/dispatched whenever a tracepoint is created,
# deleted, or modified.
#
# action ....... what type of BP event ("create", "delete", "modify")
# number ....... gdb's internal token for the BP
# file ......... filename in which event occurred
# function ..... function in which event occurred
# line ......... line number in file
# address ...... address of BP
# enabled ...... BP enabled?
# pass_count ...
# step_count ...
# thread ....... thread in which BP is set (or -1 for all threads) 
# hit_count .... number of times BP has been hit
# actions ...... a list of actions to be performed when the tracepoint is hit
itcl::class TracepointEvent {
  inherit GDBEvent

  public variable action {}
  public variable number {}

  # For reasons unknown to me, I cannot put this in the implementation
  # file. The very first instance of the class will call this empty
  # constructor instead of the one defined in the implementation file.
  #constructor {args} {}
  constructor {args} {
    eval configure $args

    # If creating/modifying a tracepoint, then get
    # all info about it and save it away.
    _init
  }
  #destructor { dbug I "" }
  public method get {what}
  public method handler {} { return "tracepoint" }

  private variable _file       {}
  private variable _function   {}
  private variable _line       {}
  private variable _address    {}
  private variable _enabled    {}
  private variable _pass_count {}
  private variable _step_count {}
  private variable _thread     {}
  private variable _hit_count  {}
  private variable _actions    {}

  private method _init {}
}

# SET VARIABLE EVENT
#
# This event is created/dispatched whenever a "set" command successfully
# completes in gdb's command interpreter.
#
# variable ..... the variable that was changed
# value ........ the variable's new value
itcl::class SetVariableEvent {
  inherit GDBEvent

  public variable variable
  public variable value

  constructor {args} {
    eval configure $args
  }
  #destructor { dbug I "" }
  public method get {what}
  public method handler {} { return "set_variable" }
}

# BUSY EVENT
#
# This event is created/dispatched whenever the GUI or GDB is "busy".
# This could happen when the inferior is executing or when the GUI
# is, for example, fetching memory from the target.

itcl::class BusyEvent {
  inherit GDBEvent

  public method handler {} { return "busy" }
}

# IDLE EVENT
#
# This event is created/dispatched whenever the GUI and GDB is not
# "busy". Receipt of this event means that the GUI should be put into
# a state to accept input by the user.

itcl::class IdleEvent {
  inherit GDBEvent

  public method handler {} { return "idle" }
}

# UPDATE EVENT
#
# This event is created/dispatched whenever the target's state
# has changed. When an UpdateEvent is received, widgets should
# update their contents to reflect the inferior's new state.
#
# Right now, this just holds the output of gdb_loc...
#
# compile_filename - Filename stored in the symtab
# full_filename    - Full filename of file, if found in source search dir
# function         - Function name
# line             - Line number
# frame_pc         - Frame's PC
# pc               - Real stop PC
# shlib            - Shared library stopped in
#
# FIXME: Should probably put frame_pc and pc into different
# types of update events...
itcl::class UpdateEvent {
  inherit GDBEvent

  constructor {args} {}
  public method get {what}
  public method handler {} { return "update" }

  private variable _compile_filename {}
  private variable _function         {}
  private variable _full_filename    {}
  private variable _line             {}
  private variable _frame_pc         {}
  private variable _pc               {}
  private variable _shlib            {}
}

# ARCHITECTURE CHANGED EVENT
#
# This event is posted whenever the target architecture changes

itcl::class ArchChangedEvent {
  inherit GDBEvent

  public method handler {} { return "arch_changed" }
}