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

Side by Side Diff: bin/dbg_message.h

Issue 11144027: Fix race condition when posting debugger messages to the message queue (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 2 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 | « bin/dbg_connection.cc ('k') | bin/dbg_message.cc » ('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 (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef BIN_DBG_MESSAGE_H_ 5 #ifndef BIN_DBG_MESSAGE_H_
6 #define BIN_DBG_MESSAGE_H_ 6 #define BIN_DBG_MESSAGE_H_
7 7
8 #include "bin/builtin.h" 8 #include "bin/builtin.h"
9 #include "bin/utils.h" 9 #include "bin/utils.h"
10 10
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 205
206 // Initialize the message queue processing by setting up the appropriate 206 // Initialize the message queue processing by setting up the appropriate
207 // handlers. 207 // handlers.
208 static void Initialize(); 208 static void Initialize();
209 209
210 // Parses the input message and returns the command index if the message 210 // Parses the input message and returns the command index if the message
211 // contains a valid isolate specific command. 211 // contains a valid isolate specific command.
212 // It returns kInvalidCommand otherwise. 212 // It returns kInvalidCommand otherwise.
213 static int32_t LookupIsolateCommand(const char* buf, int32_t buflen); 213 static int32_t LookupIsolateCommand(const char* buf, int32_t buflen);
214 214
215 // Queue debugger message targetted for the isolate.
216 static bool AddIsolateMessage(Dart_IsolateId isolate_id,
217 int32_t cmd_idx,
218 const char* start,
219 const char* end,
220 int debug_fd);
221
222 // Interrupt isolate.
223 static bool InterruptIsolate(Dart_IsolateId isolate_id);
224
215 // Add Debugger Message Queue corresponding to the Isolate. 225 // Add Debugger Message Queue corresponding to the Isolate.
216 static DbgMsgQueue* AddIsolateMsgQueue(Dart_IsolateId isolate_id); 226 static DbgMsgQueue* AddIsolateMsgQueue(Dart_IsolateId isolate_id);
217 227
218 // Get Debugger Message Queue corresponding to the Isolate. 228 // Get Debugger Message Queue corresponding to the Isolate.
219 static DbgMsgQueue* GetIsolateMsgQueue(Dart_IsolateId isolate_id); 229 static DbgMsgQueue* GetIsolateMsgQueue(Dart_IsolateId isolate_id);
220 230
221 // Remove Debugger Message Queue corresponding to the Isolate. 231 // Remove Debugger Message Queue corresponding to the Isolate.
222 static void RemoveIsolateMsgQueue(Dart_IsolateId isolate_id); 232 static void RemoveIsolateMsgQueue(Dart_IsolateId isolate_id);
223 233
224 // Generic handlers for breakpoints, exceptions and delayed breakpoint 234 // Generic handlers for breakpoints, exceptions and delayed breakpoint
225 // resolution. 235 // resolution.
226 static void BptResolvedHandler(Dart_IsolateId isolate_id, 236 static void BptResolvedHandler(Dart_IsolateId isolate_id,
227 intptr_t bp_id, 237 intptr_t bp_id,
228 Dart_Handle url, 238 Dart_Handle url,
229 intptr_t line_number); 239 intptr_t line_number);
230 static void BreakpointHandler(Dart_IsolateId isolate_id, 240 static void BreakpointHandler(Dart_IsolateId isolate_id,
231 Dart_Breakpoint bpt, 241 Dart_Breakpoint bpt,
232 Dart_StackTrace trace); 242 Dart_StackTrace trace);
233 static void ExceptionThrownHandler(Dart_IsolateId isolate_id, 243 static void ExceptionThrownHandler(Dart_IsolateId isolate_id,
234 Dart_Handle exception, 244 Dart_Handle exception,
235 Dart_StackTrace stack_trace); 245 Dart_StackTrace stack_trace);
236 static void IsolateEventHandler(Dart_IsolateId isolate_id, 246 static void IsolateEventHandler(Dart_IsolateId isolate_id,
237 Dart_IsolateEvent kind); 247 Dart_IsolateEvent kind);
238 248
239 private: 249 private:
250 static DbgMsgQueue* GetIsolateMsgQueueLocked(Dart_IsolateId isolate_id);
251
240 static DbgMsgQueue* list_; 252 static DbgMsgQueue* list_;
241 static dart::Mutex msg_queue_list_lock_; 253 static dart::Mutex msg_queue_list_lock_;
242 254
243 DISALLOW_ALLOCATION(); 255 DISALLOW_ALLOCATION();
244 DISALLOW_IMPLICIT_CONSTRUCTORS(DbgMsgQueueList); 256 DISALLOW_IMPLICIT_CONSTRUCTORS(DbgMsgQueueList);
245 }; 257 };
246 258
247 #endif // BIN_DBG_MESSAGE_H_ 259 #endif // BIN_DBG_MESSAGE_H_
OLDNEW
« no previous file with comments | « bin/dbg_connection.cc ('k') | bin/dbg_message.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698