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