Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 71 lines (54 sloc) 1.486 kb
cf73725 experimental debugger
Laurent Sansonetti authored
1 /*
2 * MacRuby debugger.
3 *
4 * This file is covered by the Ruby license. See COPYING for more details.
7d7d3e8 @ferrous26 Change ownership to The MacRuby Team and update copyrights
ferrous26 authored
5 *
6 * Copyright (C) 2012, The MacRuby Team. All rights reserved.
9595725 update copyrights to 2011
Laurent Sansonetti authored
7 * Copyright (C) 2010-2011, Apple Inc. All rights reserved.
cf73725 experimental debugger
Laurent Sansonetti authored
8 */
9
10 #ifndef __DEBUGGER_H_
11 #define __DEBUGGER_H_
12
13 #if defined(__cplusplus)
14
a6a5d3e started to trim out the static library
Laurent Sansonetti authored
15 #if !defined(MACRUBY_STATIC)
16
cf73725 experimental debugger
Laurent Sansonetti authored
17 class RoxorBreakPoint {
18 public:
19 static unsigned int IDs;
20 unsigned int id;
21 bool enabled;
22 std::string condition;
23
24 RoxorBreakPoint(void) {
25 id = ++IDs;
26 enabled = true;
27 }
28 };
29
30 class RoxorDebugger {
31 private:
32 std::map<std::string, RoxorBreakPoint *> breakpoints;
33 bool break_at_next;
34 std::string location;
35 RoxorBreakPoint *breakpoint;
36 rb_vm_binding_t *binding;
37 unsigned int frame;
38 int pipe;
39
40 bool send(std::string &data);
41 bool send(const char *str) {
42 std::string s(str);
43 return send(s);
44 }
45 bool recv(std::string &data);
46
47 unsigned int add_breakpoint(std::string &location);
48 RoxorBreakPoint *find_breakpoint(unsigned int bpid);
49 bool delete_breakpoint(unsigned int bpid);
50
51 VALUE evaluate_expression(VALUE self, rb_vm_block_t *block,
52 int lvars_size, va_list lvars, std::string expr);
53
54 public:
55 static RoxorDebugger *shared;
56
57 static RoxorDebugger *unix_server(void);
58
59 RoxorDebugger(int pipe);
60 ~RoxorDebugger();
61
62 void trap(const char *file, const int line, VALUE self,
63 rb_vm_block_t *block, int lvars_size, va_list lvars);
64 };
65
a6a5d3e started to trim out the static library
Laurent Sansonetti authored
66 #endif // !MACRUBY_STATIC
67
cf73725 experimental debugger
Laurent Sansonetti authored
68 #endif /* __cplusplus */
69
70 #endif /* __DEBUGGER_H_ */
Something went wrong with that request. Please try again.