google-cloud-debugger 0.36.2 → 0.42.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +4 -2
- data/CHANGELOG.md +47 -0
- data/CONTRIBUTING.md +6 -7
- data/LOGGING.md +1 -1
- data/OVERVIEW.md +28 -59
- data/ext/google/cloud/debugger/debugger_c/tracer.c +8 -33
- data/lib/google-cloud-debugger.rb +14 -15
- data/lib/google/cloud/debugger.rb +18 -16
- data/lib/google/cloud/debugger/agent.rb +4 -1
- data/lib/google/cloud/debugger/breakpoint.rb +9 -9
- data/lib/google/cloud/debugger/breakpoint/evaluator.rb +19 -25
- data/lib/google/cloud/debugger/breakpoint/source_location.rb +6 -6
- data/lib/google/cloud/debugger/breakpoint/stack_frame.rb +5 -5
- data/lib/google/cloud/debugger/breakpoint/status_message.rb +4 -6
- data/lib/google/cloud/debugger/breakpoint/variable.rb +8 -11
- data/lib/google/cloud/debugger/breakpoint/variable_table.rb +1 -1
- data/lib/google/cloud/debugger/credentials.rb +9 -6
- data/lib/google/cloud/debugger/debuggee.rb +4 -4
- data/lib/google/cloud/debugger/middleware.rb +1 -1
- data/lib/google/cloud/debugger/rails.rb +2 -2
- data/lib/google/cloud/debugger/service.rb +28 -66
- data/lib/google/cloud/debugger/snappoint.rb +4 -7
- data/lib/google/cloud/debugger/transmitter.rb +1 -1
- data/lib/google/cloud/debugger/version.rb +1 -1
- metadata +14 -72
- data/lib/google/cloud/debugger/v2.rb +0 -243
- data/lib/google/cloud/debugger/v2/controller2_client.rb +0 -373
- data/lib/google/cloud/debugger/v2/controller2_client_config.json +0 -41
- data/lib/google/cloud/debugger/v2/credentials.rb +0 -42
- data/lib/google/cloud/debugger/v2/debugger2_client.rb +0 -481
- data/lib/google/cloud/debugger/v2/debugger2_client_config.json +0 -51
- data/lib/google/cloud/debugger/v2/doc/google/devtools/clouddebugger/v2/controller.rb +0 -91
- data/lib/google/cloud/debugger/v2/doc/google/devtools/clouddebugger/v2/data.rb +0 -443
- data/lib/google/cloud/debugger/v2/doc/google/devtools/clouddebugger/v2/debugger.rb +0 -151
- data/lib/google/cloud/debugger/v2/doc/google/devtools/source/v1/source_context.rb +0 -162
- data/lib/google/cloud/debugger/v2/doc/google/protobuf/empty.rb +0 -29
- data/lib/google/cloud/debugger/v2/doc/google/protobuf/timestamp.rb +0 -113
- data/lib/google/devtools/clouddebugger/v2/controller_pb.rb +0 -50
- data/lib/google/devtools/clouddebugger/v2/controller_services_pb.rb +0 -98
- data/lib/google/devtools/clouddebugger/v2/data_pb.rb +0 -108
- data/lib/google/devtools/clouddebugger/v2/debugger_pb.rb +0 -77
- data/lib/google/devtools/clouddebugger/v2/debugger_services_pb.rb +0 -66
- data/lib/google/devtools/source/v1/source_context_pb.rb +0 -90
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 538aafa3b8ea1fadaef4a81651207de8ff2044ac8edeb5e31dfa7dc9d1b04293
|
4
|
+
data.tar.gz: 7ceec9bc919b53b965d855958d1fc71ef8a0b1d959c53d02345ade43d4d258f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cfac793f4d80491da98f423aa28d013e127cdc6f3b2bedd441caedd8a11aaaee4e946c117741dc589c5850af77354564ffdf8efa0592591029b0467c351d4b73
|
7
|
+
data.tar.gz: ade965963e90484abe885c6f1ab2ef7b90267e510ae11ea7a26ae270045a454a7d7c5f5bac8a3a43d72f9589ee004ce628a39d4ccee4f897404bb4b8e0ccb6a7
|
data/AUTHENTICATION.md
CHANGED
@@ -76,7 +76,8 @@ The environment variables that google-cloud-debugger checks for project ID are:
|
|
76
76
|
1. `DEBUGGER_PROJECT`
|
77
77
|
2. `GOOGLE_CLOUD_PROJECT`
|
78
78
|
|
79
|
-
The environment variables that google-cloud-debugger checks for credentials are
|
79
|
+
The environment variables that google-cloud-debugger checks for credentials are
|
80
|
+
configured on `Google::Cloud::Debugger::V2::Debugger::Credentials`:
|
80
81
|
|
81
82
|
1. `DEBUGGER_CREDENTIALS` - Path to JSON file, or JSON contents
|
82
83
|
2. `DEBUGGER_KEYFILE` - Path to JSON file, or JSON contents
|
@@ -95,7 +96,8 @@ client = Google::Cloud::Debugger.new
|
|
95
96
|
|
96
97
|
### Configuration
|
97
98
|
|
98
|
-
The **Project ID** and **Credentials JSON** can be configured
|
99
|
+
The **Project ID** and the path to the **Credentials JSON** file can be configured
|
100
|
+
instead of placing them in environment variables or providing them as arguments.
|
99
101
|
|
100
102
|
```ruby
|
101
103
|
require "google/cloud/debugger"
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,52 @@
|
|
1
1
|
# Release History
|
2
2
|
|
3
|
+
### 0.42.1 / 2021-07-08
|
4
|
+
|
5
|
+
#### Documentation
|
6
|
+
|
7
|
+
* Update AUTHENTICATION.md in handwritten packages
|
8
|
+
|
9
|
+
### 0.42.0 / 2021-03-31
|
10
|
+
|
11
|
+
#### Features
|
12
|
+
|
13
|
+
* Drop support for Ruby 2.4 and note that Ruby 3.0 is also unsupported
|
14
|
+
|
15
|
+
### 0.41.0 / 2020-09-16
|
16
|
+
|
17
|
+
#### Features
|
18
|
+
|
19
|
+
* quota_project can be set via library configuration
|
20
|
+
|
21
|
+
### 0.40.0 / 2020-07-21
|
22
|
+
|
23
|
+
This is a major update that removes the "low-level" client interface code, and
|
24
|
+
instead adds the new `google-cloud-debugger-v2` gem as a dependency.
|
25
|
+
The new dependency is a rewritten low-level client, produced by a next-
|
26
|
+
generation client code generator, with improved performance and stability.
|
27
|
+
|
28
|
+
This change should have no effect on the high-level interface that most users
|
29
|
+
will use. The one exception is that the (mostly undocumented) `client_config`
|
30
|
+
argument, for adjusting low-level parameters such as RPC retry settings on
|
31
|
+
client objects, has been removed. If you need to adjust these parameters, use
|
32
|
+
the configuration interface in `google-cloud-debugger-v2`.
|
33
|
+
|
34
|
+
Substantial changes have been made in the low-level interfaces, however. If you
|
35
|
+
are using the low-level classes under the `Google::Cloud::Debugger::V2` module,
|
36
|
+
please review the docs for the new `google-cloud-debugger-v2` gem. In
|
37
|
+
particular:
|
38
|
+
|
39
|
+
* Some classes have been renamed, notably the client class itself.
|
40
|
+
* The client constructor takes a configuration block instead of configuration
|
41
|
+
keyword arguments.
|
42
|
+
* All RPC method arguments are now keyword arguments.
|
43
|
+
|
44
|
+
### 0.36.3 / 2020-07-06
|
45
|
+
|
46
|
+
#### Bug Fixes
|
47
|
+
|
48
|
+
* Fix segfaults on Ruby 2.7
|
49
|
+
|
3
50
|
### 0.36.2 / 2020-05-28
|
4
51
|
|
5
52
|
#### Documentation
|
data/CONTRIBUTING.md
CHANGED
@@ -24,9 +24,9 @@ be able to accept your pull requests.
|
|
24
24
|
In order to use the google-cloud-debugger console and run the project's tests,
|
25
25
|
there is a small amount of setup:
|
26
26
|
|
27
|
-
1. Install Ruby. google-cloud-debugger requires Ruby 2.
|
28
|
-
manage your Ruby and gem installations
|
29
|
-
[rbenv](https://github.com/rbenv/rbenv), or
|
27
|
+
1. Install Ruby. google-cloud-debugger requires Ruby 2.5+. It is not currently
|
28
|
+
supported on Ruby 3. You may choose to manage your Ruby and gem installations
|
29
|
+
with [RVM](https://rvm.io/), [rbenv](https://github.com/rbenv/rbenv), or
|
30
30
|
[chruby](https://github.com/postmodern/chruby).
|
31
31
|
|
32
32
|
2. Install [Bundler](http://bundler.io/).
|
@@ -45,7 +45,7 @@ there is a small amount of setup:
|
|
45
45
|
|
46
46
|
```sh
|
47
47
|
$ cd google-cloud-debugger/
|
48
|
-
$ bundle
|
48
|
+
$ bundle install
|
49
49
|
```
|
50
50
|
|
51
51
|
## Console
|
@@ -119,7 +119,7 @@ If you alter an example's title, you may encounter breaking tests.
|
|
119
119
|
### Debugger Acceptance Tests
|
120
120
|
|
121
121
|
The Debugger acceptance tests interact with the live service API. Follow the
|
122
|
-
instructions in the {file:AUTHENTICATION.md Authentication
|
122
|
+
instructions in the {file:AUTHENTICATION.md Authentication Guide} for enabling
|
123
123
|
the Debugger API. Occasionally, some API features may not yet be generally
|
124
124
|
available, making it difficult for some contributors to successfully run the
|
125
125
|
entire acceptance test suite. However, please ensure that you do successfully
|
@@ -184,5 +184,4 @@ $ bundle exec rake rubocop
|
|
184
184
|
## Code of Conduct
|
185
185
|
|
186
186
|
Please note that this project is released with a Contributor Code of Conduct. By
|
187
|
-
participating in this project you agree to abide by its terms. See
|
188
|
-
{file:CODE_OF_CONDUCT.md Code of Conduct} for more information.
|
187
|
+
participating in this project you agree to abide by its terms. See {file:CODE_OF_CONDUCT.md Code of Conduct} for more information.
|
data/LOGGING.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
To enable logging for this library, set the logger for the underlying
|
4
4
|
[gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. The logger
|
5
5
|
that you set may be a Ruby stdlib
|
6
|
-
[`Logger`](https://ruby-doc.org/stdlib
|
6
|
+
[`Logger`](https://ruby-doc.org/stdlib/libdoc/logger/rdoc/Logger.html) as
|
7
7
|
shown below, or a
|
8
8
|
[`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
|
9
9
|
that will write logs to [Stackdriver
|
data/OVERVIEW.md
CHANGED
@@ -147,12 +147,9 @@ For further information on the Debugger API, see
|
|
147
147
|
```ruby
|
148
148
|
require "google/cloud/debugger/v2"
|
149
149
|
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
controller2_client = Controller2Client.new
|
154
|
-
debuggee = Debuggee.new
|
155
|
-
response = controller2_client.register_debuggee(debuggee)
|
150
|
+
controller_client = Google::Cloud::Debugger::V2::Controller::Client.new
|
151
|
+
debuggee = Google::Cloud::Debugger::V2::Debuggee.new
|
152
|
+
response = controller_client.register_debuggee debuggee: debuggee
|
156
153
|
debuggee_id = response.debuggee.id
|
157
154
|
```
|
158
155
|
See [Stackdriver Debugger Debuggee
|
@@ -163,23 +160,18 @@ Upon successful registration, the response debuggee object will contain a
|
|
163
160
|
debuggee_id that's later needed to interact with the other Stackdriver Debugger
|
164
161
|
API.
|
165
162
|
|
166
|
-
See {Google::Cloud::Debugger::V2::Controller2Client} for details.
|
167
|
-
|
168
163
|
### List Active Breakpoints
|
169
164
|
|
170
165
|
```ruby
|
171
166
|
require "google/cloud/debugger/v2"
|
172
167
|
|
173
|
-
|
174
|
-
controller2_client = Controller2Client.new
|
168
|
+
controller_client = Google::Cloud::Debugger::V2::Controller::Client.new
|
175
169
|
|
176
170
|
debuggee_id = ''
|
177
|
-
response =
|
171
|
+
response = controller_client.list_active_breakpoints debuggee_id: debuggee_id
|
178
172
|
breakpoints = response.breakpoints
|
179
173
|
```
|
180
174
|
|
181
|
-
See {Google::Cloud::Debugger::V2::Controller2Client} for details.
|
182
|
-
|
183
175
|
### Update Active Breakpoint
|
184
176
|
|
185
177
|
Users can send custom snapshots for active breakpoints using this API.
|
@@ -187,110 +179,87 @@ Users can send custom snapshots for active breakpoints using this API.
|
|
187
179
|
```ruby
|
188
180
|
require "google/cloud/debugger/v2"
|
189
181
|
|
190
|
-
|
191
|
-
Controller2Client = Google::Cloud::Debugger::V2::Controller2Client
|
192
|
-
|
193
|
-
controller2_client = Controller2Client.new
|
182
|
+
controller_client = Google::Cloud::Debugger::V2::Controller::Client.new
|
194
183
|
debuggee_id = ''
|
195
|
-
breakpoint = Breakpoint.new
|
196
|
-
response =
|
197
|
-
|
184
|
+
breakpoint = Google::Cloud::Debugger::V2::Breakpoint.new
|
185
|
+
response = controller_client.update_active_breakpoint(
|
186
|
+
debuggee_id: debuggee_id, breakpoint: breakpoint)
|
198
187
|
```
|
199
188
|
|
200
189
|
See [Stackdriver Debugger Breakpoint
|
201
190
|
doc](https://cloud.google.com/debugger/api/reference/rpc/google.devtools.clouddebugger.v2#google.devtools.clouddebugger.v2.Breakpoint)
|
202
191
|
for all available fields for breakpoint.
|
203
192
|
|
204
|
-
See {Google::Cloud::Debugger::V2::Controller2Client} for details.
|
205
|
-
|
206
193
|
### Set Breakpoint
|
207
194
|
|
208
195
|
```ruby
|
209
196
|
require "google/cloud/debugger/v2"
|
210
197
|
|
211
|
-
|
212
|
-
Debugger2Client = Google::Cloud::Debugger::V2::Debugger2Client
|
213
|
-
|
214
|
-
debugger2_client = Debugger2Client.new
|
198
|
+
debugger_client = Google::Cloud::Debugger::V2::Debugger::Client.new
|
215
199
|
debuggee_id = ''
|
216
|
-
breakpoint = Breakpoint.new
|
200
|
+
breakpoint = Google::Cloud::Debugger::V2::Breakpoint.new
|
217
201
|
client_version = ''
|
218
|
-
response =
|
219
|
-
|
202
|
+
response = debugger_client.set_breakpoint(
|
203
|
+
debuggee_id: debuggee_id, breakpoint: breakpoint,
|
204
|
+
client_version: client_version)
|
220
205
|
```
|
221
206
|
|
222
207
|
See [Stackdriver Debugger Breakpoint
|
223
208
|
doc](https://cloud.google.com/debugger/api/reference/rpc/google.devtools.clouddebugger.v2#google.devtools.clouddebugger.v2.Breakpoint)
|
224
209
|
for fields needed to specify breakpoint location.
|
225
210
|
|
226
|
-
See {Google::Cloud::Debugger::V2::Debugger2Client} for details.
|
227
|
-
|
228
211
|
### Get Breakpoint
|
229
212
|
|
230
213
|
```ruby
|
231
214
|
require "google/cloud/debugger/v2"
|
232
215
|
|
233
|
-
|
234
|
-
|
235
|
-
debugger2_client = Debugger2Client.new
|
216
|
+
debugger_client = Google::Cloud::Debugger::V2::Debugger::Client.new
|
236
217
|
debuggee_id = ''
|
237
218
|
breakpoint_id = ''
|
238
219
|
client_version = ''
|
239
|
-
response =
|
240
|
-
|
220
|
+
response = debugger_client.get_breakpoint(
|
221
|
+
debuggee_id: debuggee_id, breakpoint_id: breakpoint_id,
|
222
|
+
client_version: client_version)
|
241
223
|
```
|
242
224
|
|
243
|
-
See {Google::Cloud::Debugger::V2::Debugger2Client} for details.
|
244
|
-
|
245
225
|
### Delete Breakpoint
|
246
226
|
|
247
227
|
```ruby
|
248
228
|
require "google/cloud/debugger/v2"
|
249
229
|
|
250
|
-
|
251
|
-
|
252
|
-
debugger2_client = Debugger2Client.new
|
230
|
+
debugger_client = Google::Cloud::Debugger::V2::Debugger::Client.new
|
253
231
|
debuggee_id = ''
|
254
232
|
breakpoint_id = ''
|
255
233
|
client_version = ''
|
256
|
-
|
257
|
-
debuggee_id, breakpoint_id,
|
234
|
+
debugger_client.delete_breakpoint(
|
235
|
+
debuggee_id: debuggee_id, breakpoint_id: breakpoint_id,
|
236
|
+
client_version: client_version)
|
258
237
|
```
|
259
238
|
|
260
|
-
See {Google::Cloud::Debugger::V2::Debugger2Client} for details.
|
261
|
-
|
262
239
|
### List Breakpoints
|
263
240
|
|
264
241
|
```ruby
|
265
242
|
require "google/cloud/debugger/v2"
|
266
243
|
|
267
|
-
|
268
|
-
|
269
|
-
Debugger2Client = Google::Cloud::Debugger::V2::Debugger2Client
|
270
|
-
|
271
|
-
debugger2_client = Debugger2Client.new
|
244
|
+
debugger_client = Google::Cloud::Debugger::V2::Debugger::Client.new
|
272
245
|
debuggee_id = ''
|
273
246
|
client_version = ''
|
274
|
-
response =
|
247
|
+
response = debugger_client.list_breakpoints(
|
248
|
+
debuggee_id: debuggee_id, client_version: client_version)
|
275
249
|
```
|
276
250
|
|
277
|
-
See {Google::Cloud::Debugger::V2::Debugger2Client} for details.
|
278
|
-
|
279
251
|
### List Debuggees
|
280
252
|
|
281
253
|
```ruby
|
282
254
|
require "google/cloud/debugger/v2"
|
283
255
|
|
284
|
-
|
285
|
-
|
286
|
-
debugger2_client = Debugger2Client.new
|
256
|
+
debugger_client = Google::Cloud::Debugger::V2::Debugger::Client.new
|
287
257
|
project = ''
|
288
258
|
client_version = ''
|
289
|
-
response =
|
259
|
+
response = debugger_client.list_debuggees(
|
260
|
+
project: project, client_version: client_version)
|
290
261
|
```
|
291
262
|
|
292
|
-
See {Google::Cloud::Debugger::V2::Debugger2Client} for details.
|
293
|
-
|
294
263
|
## Additional information
|
295
264
|
|
296
265
|
Stackdriver Debugger can be configured to use gRPC's logging. To learn more, see
|
@@ -208,25 +208,19 @@ line_trace_callback(rb_event_flag_t event, VALUE data, VALUE obj, ID mid, VALUE
|
|
208
208
|
static VALUE
|
209
209
|
disable_line_trace_for_thread(VALUE thread)
|
210
210
|
{
|
211
|
-
VALUE thread_variables_hash;
|
212
211
|
VALUE line_trace_set;
|
213
|
-
ID locals_id;
|
214
212
|
ID line_trace_thread_id;
|
215
|
-
VALUE line_trace_thread_flag;
|
216
213
|
|
217
|
-
CONST_ID(locals_id, "locals");
|
218
214
|
CONST_ID(line_trace_thread_id, "gcloud_line_trace_set");
|
219
|
-
line_trace_thread_flag = ID2SYM(line_trace_thread_id);
|
220
215
|
|
221
216
|
if (!RTEST(thread)) {
|
222
217
|
thread = rb_thread_current();
|
223
218
|
}
|
224
|
-
|
225
|
-
line_trace_set = rb_hash_aref(thread_variables_hash, line_trace_thread_flag);
|
219
|
+
line_trace_set = rb_ivar_get(thread, line_trace_thread_id);
|
226
220
|
|
227
221
|
if (RTEST(line_trace_set)) {
|
228
222
|
rb_thread_remove_event_hook(thread, line_trace_callback);
|
229
|
-
|
223
|
+
rb_ivar_set(thread, line_trace_thread_id, Qfalse);
|
230
224
|
}
|
231
225
|
|
232
226
|
return Qnil;
|
@@ -241,23 +235,17 @@ static VALUE
|
|
241
235
|
enable_line_trace_for_thread(VALUE self)
|
242
236
|
{
|
243
237
|
VALUE current_thread;
|
244
|
-
VALUE thread_variables_hash;
|
245
238
|
VALUE line_trace_set;
|
246
|
-
ID locals_id;
|
247
239
|
ID line_trace_thread_id;
|
248
|
-
VALUE line_trace_thread_flag;
|
249
240
|
|
250
|
-
CONST_ID(locals_id, "locals");
|
251
241
|
CONST_ID(line_trace_thread_id, "gcloud_line_trace_set");
|
252
|
-
line_trace_thread_flag = ID2SYM(line_trace_thread_id);
|
253
242
|
|
254
243
|
current_thread = rb_thread_current();
|
255
|
-
|
256
|
-
line_trace_set = rb_hash_aref(thread_variables_hash, line_trace_thread_flag);
|
244
|
+
line_trace_set = rb_ivar_get(current_thread, line_trace_thread_id);
|
257
245
|
|
258
246
|
if (!RTEST(line_trace_set)) {
|
259
247
|
rb_thread_add_event_hook(current_thread, line_trace_callback, RUBY_EVENT_LINE, self);
|
260
|
-
|
248
|
+
rb_ivar_set(current_thread, line_trace_thread_id, Qtrue);
|
261
249
|
}
|
262
250
|
|
263
251
|
return Qnil;
|
@@ -331,25 +319,19 @@ return_trace_callback(void *data, rb_trace_arg_t *trace_arg)
|
|
331
319
|
static VALUE
|
332
320
|
disable_return_trace_for_thread(VALUE thread)
|
333
321
|
{
|
334
|
-
VALUE thread_variables_hash;
|
335
322
|
VALUE return_trace_set;
|
336
|
-
ID locals_id;
|
337
323
|
ID return_trace_thread_id;
|
338
|
-
VALUE return_trace_thread_flag;
|
339
324
|
|
340
|
-
CONST_ID(locals_id, "locals");
|
341
325
|
CONST_ID(return_trace_thread_id, "gcloud_return_trace_set");
|
342
|
-
return_trace_thread_flag = ID2SYM(return_trace_thread_id);
|
343
326
|
|
344
327
|
if (!RTEST(thread)) {
|
345
328
|
thread = rb_thread_current();
|
346
329
|
}
|
347
|
-
|
348
|
-
return_trace_set = rb_hash_aref(thread_variables_hash, return_trace_thread_flag);
|
330
|
+
return_trace_set = rb_ivar_get(thread, return_trace_thread_id);
|
349
331
|
|
350
332
|
if (RTEST(return_trace_set)) {
|
351
333
|
rb_thread_remove_event_hook(thread, (rb_event_hook_func_t)return_trace_callback);
|
352
|
-
|
334
|
+
rb_ivar_set(thread, return_trace_thread_id, Qfalse);
|
353
335
|
}
|
354
336
|
|
355
337
|
return Qnil;
|
@@ -364,24 +346,17 @@ static VALUE
|
|
364
346
|
enable_return_trace_for_thread(VALUE self)
|
365
347
|
{
|
366
348
|
VALUE current_thread;
|
367
|
-
VALUE thread_variables_hash;
|
368
349
|
VALUE return_trace_set;
|
369
|
-
|
370
|
-
ID locals_id;
|
371
350
|
ID return_trace_thread_id;
|
372
|
-
VALUE return_trace_thread_flag;
|
373
351
|
|
374
|
-
CONST_ID(locals_id, "locals");
|
375
352
|
CONST_ID(return_trace_thread_id, "gcloud_return_trace_set");
|
376
|
-
return_trace_thread_flag = ID2SYM(return_trace_thread_id);
|
377
353
|
|
378
354
|
current_thread = rb_thread_current();
|
379
|
-
|
380
|
-
return_trace_set = rb_hash_aref(thread_variables_hash, return_trace_thread_flag);
|
355
|
+
return_trace_set = rb_ivar_get(current_thread, return_trace_thread_id);
|
381
356
|
|
382
357
|
if (!RTEST(return_trace_set)) {
|
383
358
|
rb_thread_add_event_hook2(current_thread, (rb_event_hook_func_t)return_trace_callback, RETURN_TRACEPOINT_EVENTS, self, RUBY_EVENT_HOOK_FLAG_RAW_ARG | RUBY_EVENT_HOOK_FLAG_SAFE);
|
384
|
-
|
359
|
+
rb_ivar_set(current_thread, return_trace_thread_id, Qtrue);
|
385
360
|
}
|
386
361
|
|
387
362
|
return Qnil;
|
@@ -48,8 +48,6 @@ module Google
|
|
48
48
|
# * `https://www.googleapis.com/auth/logging.admin`
|
49
49
|
#
|
50
50
|
# @param [Integer] timeout Default timeout to use in requests. Optional.
|
51
|
-
# @param [Hash] client_config A hash of values to override the default
|
52
|
-
# behavior of the API client. Optional.
|
53
51
|
#
|
54
52
|
# @return [Google::Cloud::Debugger::Project]
|
55
53
|
#
|
@@ -68,14 +66,12 @@ module Google
|
|
68
66
|
# platform_scope = "https://www.googleapis.com/auth/cloud-platform"
|
69
67
|
# debugger = gcloud.debugger scope: platform_scope
|
70
68
|
#
|
71
|
-
def debugger service_name: nil, service_version: nil, scope: nil,
|
72
|
-
timeout: nil, client_config: nil
|
69
|
+
def debugger service_name: nil, service_version: nil, scope: nil, timeout: nil
|
73
70
|
Google::Cloud.debugger @project, @keyfile,
|
74
71
|
service_name: service_name,
|
75
72
|
service_version: service_version,
|
76
73
|
scope: scope,
|
77
|
-
timeout: (timeout || @timeout)
|
78
|
-
client_config: client_config
|
74
|
+
timeout: (timeout || @timeout)
|
79
75
|
end
|
80
76
|
|
81
77
|
##
|
@@ -105,8 +101,6 @@ module Google
|
|
105
101
|
# * `https://www.googleapis.com/auth/logging.admin`
|
106
102
|
#
|
107
103
|
# @param [Integer] timeout Default timeout to use in requests. Optional.
|
108
|
-
# @param [Hash] client_config A hash of values to override the default
|
109
|
-
# behavior of the API client. Optional.
|
110
104
|
#
|
111
105
|
# @return [Google::Cloud::Debugger::Project]
|
112
106
|
#
|
@@ -118,15 +112,13 @@ module Google
|
|
118
112
|
# debugger.start
|
119
113
|
#
|
120
114
|
def self.debugger project_id = nil, credentials = nil, service_name: nil,
|
121
|
-
service_version: nil, scope: nil, timeout: nil
|
122
|
-
client_config: nil
|
115
|
+
service_version: nil, scope: nil, timeout: nil
|
123
116
|
require "google/cloud/debugger"
|
124
117
|
Google::Cloud::Debugger.new project_id: project_id,
|
125
118
|
credentials: credentials,
|
126
119
|
service_name: service_name,
|
127
120
|
service_version: service_version,
|
128
|
-
scope: scope, timeout: timeout
|
129
|
-
client_config: client_config
|
121
|
+
scope: scope, timeout: timeout
|
130
122
|
end
|
131
123
|
end
|
132
124
|
end
|
@@ -160,6 +152,13 @@ Google::Cloud.configure.add_config! :debugger do |config|
|
|
160
152
|
default_version = Google::Cloud::Config.deferred do
|
161
153
|
ENV["DEBUGGER_SERVICE_VERSION"]
|
162
154
|
end
|
155
|
+
default_scopes = [
|
156
|
+
"https://www.googleapis.com/auth/cloud-platform",
|
157
|
+
"https://www.googleapis.com/auth/cloud_debugger",
|
158
|
+
"https://www.googleapis.com/auth/logging.admin",
|
159
|
+
"https://www.googleapis.com/auth/logging.read",
|
160
|
+
"https://www.googleapis.com/auth/logging.write"
|
161
|
+
]
|
163
162
|
|
164
163
|
config.add_field! :project_id, default_project, match: String, allow_nil: true
|
165
164
|
config.add_alias! :project, :project_id
|
@@ -173,10 +172,10 @@ Google::Cloud.configure.add_config! :debugger do |config|
|
|
173
172
|
match: String, allow_nil: true
|
174
173
|
config.add_field! :app_root, nil, match: String
|
175
174
|
config.add_field! :root, nil, match: String
|
176
|
-
config.add_field! :scope,
|
175
|
+
config.add_field! :scope, default_scopes, match: [String, Array]
|
176
|
+
config.add_field! :quota_project, nil, match: String
|
177
177
|
config.add_field! :timeout, nil, match: Integer
|
178
|
-
config.add_field! :
|
179
|
-
config.add_field! :endpoint, nil, match: String
|
178
|
+
config.add_field! :endpoint, "clouddebugger.googleapis.com", match: String
|
180
179
|
config.add_field! :allow_mutating_methods, false
|
181
180
|
config.add_field! :evaluation_time_limit, 0.05, match: Numeric
|
182
181
|
config.add_field! :on_error, nil, match: Proc
|