Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(486)

Side by Side Diff: include/v8-debug.h

Issue 100155: Re-submit http://codereview.chromium.org/99122 (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/debug.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2008 the V8 project authors. All rights reserved. 1 // Copyright 2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 * A client object passed to the v8 debugger whose ownership will be taken by 85 * A client object passed to the v8 debugger whose ownership will be taken by
86 * it. v8 is always responsible for deleting the object. 86 * it. v8 is always responsible for deleting the object.
87 */ 87 */
88 class ClientData { 88 class ClientData {
89 public: 89 public:
90 virtual ~ClientData() {} 90 virtual ~ClientData() {}
91 }; 91 };
92 92
93 93
94 /** 94 /**
95 * A message object passed to the debug message handler.
96 */
97 class Message {
98 public:
99 /**
100 * Check type of message.
101 */
102 virtual bool IsEvent() const = 0;
103 virtual bool IsResponse() const = 0;
104 virtual DebugEvent GetEvent() const = 0;
105
106 /**
107 * Indicate whether this is a response to a continue command which will
108 * start the VM running after this is processed.
109 */
110 virtual bool WillStartRunning() const = 0;
111
112 /**
113 * Access to execution state and event data. Don't store these cross
114 * callbacks as their content becomes invalid. These objects are from the
115 * debugger event that started the debug message loop.
116 */
117 virtual Handle<Object> GetExecutionState() const = 0;
118 virtual Handle<Object> GetEventData() const = 0;
119
120 /**
121 * Get the debugger protocol JSON.
122 */
123 virtual Handle<String> GetJSON() const = 0;
124
125 /**
126 * Get the context active when the debug event happened. Note this is not
127 * the current active context as the JavaScript part of the debugger is
128 * running in it's own context which is entered at this point.
129 */
130 virtual Handle<Context> GetEventContext() const = 0;
131
132 /**
133 * Client data passed with the corresponding request if any. This is the
134 * client_data data value passed into Debug::SendCommand along with the
135 * request that led to the message or NULL if the message is an event. The
136 * debugger takes ownership of the data and will delete it even if there is
137 * no message handler.
138 */
139 virtual ClientData* GetClientData() const = 0;
140
141 virtual ~Message() {}
142 };
143
144
145 /**
95 * Debug event callback function. 146 * Debug event callback function.
96 * 147 *
97 * \param event the type of the debug event that triggered the callback 148 * \param event the type of the debug event that triggered the callback
98 * (enum DebugEvent) 149 * (enum DebugEvent)
99 * \param exec_state execution state (JavaScript object) 150 * \param exec_state execution state (JavaScript object)
100 * \param event_data event specific data (JavaScript object) 151 * \param event_data event specific data (JavaScript object)
101 * \param data value passed by the user to SetDebugEventListener 152 * \param data value passed by the user to SetDebugEventListener
102 */ 153 */
103 typedef void (*EventCallback)(DebugEvent event, 154 typedef void (*EventCallback)(DebugEvent event,
104 Handle<Object> exec_state, 155 Handle<Object> exec_state,
105 Handle<Object> event_data, 156 Handle<Object> event_data,
106 Handle<Value> data); 157 Handle<Value> data);
107 158
108 159
109 /** 160 /**
110 * Debug message callback function. 161 * Debug message callback function.
111 * 162 *
112 * \param message the debug message 163 * \param message the debug message handler message object
113 * \param length length of the message 164 * \param length length of the message
114 * \param data the data value passed when registering the message handler 165 * \param data the data value passed when registering the message handler
115 * \param client_data the data value passed into Debug::SendCommand along 166
116 * with the request that led to the message or NULL if the message is an
117 * asynchronous event. The debugger takes ownership of the data and will
118 * delete it before dying even if there is no message handler.
119 * A MessageHandler does not take posession of the message string, 167 * A MessageHandler does not take posession of the message string,
120 * and must not rely on the data persisting after the handler returns. 168 * and must not rely on the data persisting after the handler returns.
121 */ 169 */
122 typedef void (*MessageHandler)(const uint16_t* message, int length, 170 typedef void (*MessageHandler)(const Message& message);
123 ClientData* client_data);
124 171
125 /** 172 /**
126 * Debug host dispatch callback function. 173 * Debug host dispatch callback function.
127 */ 174 */
128 typedef void (*HostDispatchHandler)(); 175 typedef void (*HostDispatchHandler)();
129 176
130 // Set a C debug event listener. 177 // Set a C debug event listener.
131 static bool SetDebugEventListener(EventCallback that, 178 static bool SetDebugEventListener(EventCallback that,
132 Handle<Value> data = Handle<Value>()); 179 Handle<Value> data = Handle<Value>());
133 180
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 }; 226 };
180 227
181 228
182 } // namespace v8 229 } // namespace v8
183 230
184 231
185 #undef EXPORT 232 #undef EXPORT
186 233
187 234
188 #endif // V8_DEBUG_H_ 235 #endif // V8_DEBUG_H_
OLDNEW
« no previous file with comments | « no previous file | src/debug.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698