Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 66 lines (51 sloc) 1.363 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.
5 *
6 * Copyright (C) 2010, Apple Inc. All rights reserved.
7 */
8
9 #ifndef __DEBUGGER_H_
10 #define __DEBUGGER_H_
11
12 #if defined(__cplusplus)
13
14 class RoxorBreakPoint {
15 public:
16 static unsigned int IDs;
17 unsigned int id;
18 bool enabled;
19 std::string condition;
20
21 RoxorBreakPoint(void) {
22 id = ++IDs;
23 enabled = true;
24 }
25 };
26
27 class RoxorDebugger {
28 private:
29 std::map<std::string, RoxorBreakPoint *> breakpoints;
30 bool break_at_next;
31 std::string location;
32 RoxorBreakPoint *breakpoint;
33 rb_vm_binding_t *binding;
34 unsigned int frame;
35 int pipe;
36
37 bool send(std::string &data);
38 bool send(const char *str) {
39 std::string s(str);
40 return send(s);
41 }
42 bool recv(std::string &data);
43
44 unsigned int add_breakpoint(std::string &location);
45 RoxorBreakPoint *find_breakpoint(unsigned int bpid);
46 bool delete_breakpoint(unsigned int bpid);
47
48 VALUE evaluate_expression(VALUE self, rb_vm_block_t *block,
49 int lvars_size, va_list lvars, std::string expr);
50
51 public:
52 static RoxorDebugger *shared;
53
54 static RoxorDebugger *unix_server(void);
55
56 RoxorDebugger(int pipe);
57 ~RoxorDebugger();
58
59 void trap(const char *file, const int line, VALUE self,
60 rb_vm_block_t *block, int lvars_size, va_list lvars);
61 };
62
63 #endif /* __cplusplus */
64
65 #endif /* __DEBUGGER_H_ */
Something went wrong with that request. Please try again.