Skip to content

Commit c91de31

Browse files
committed
Extract configuration section to docs/configuration.md
1 parent d161699 commit c91de31

File tree

5 files changed

+105
-98
lines changed

5 files changed

+105
-98
lines changed

README.md

Lines changed: 1 addition & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -430,74 +430,7 @@ Here's a [Google sheet](https://docs.google.com/spreadsheets/d/1TlmmUDsvwK4sSIyo
430430
431431
# Configuration
432432
433-
You can configure the debugger's behavior with the `config` command and environment variables.
434-
435-
Every configuration has a corresponding environment variable, for example:
436-
437-
```
438-
config set log_level INFO # RUBY_DEBUG_LOG_LEVEL=INFO
439-
config set no_color true # RUBY_DEBUG_NO_COLOR=true
440-
```
441-
442-
443-
444-
- UI
445-
- `RUBY_DEBUG_LOG_LEVEL` (`log_level`): Log level same as Logger (default: WARN)
446-
- `RUBY_DEBUG_SHOW_SRC_LINES` (`show_src_lines`): Show n lines source code on breakpoint (default: 10)
447-
- `RUBY_DEBUG_SHOW_FRAMES` (`show_frames`): Show n frames on breakpoint (default: 2)
448-
- `RUBY_DEBUG_USE_SHORT_PATH` (`use_short_path`): Show shorten PATH (like $(Gem)/foo.rb) (default: false)
449-
- `RUBY_DEBUG_NO_COLOR` (`no_color`): Do not use colorize (default: false)
450-
- `RUBY_DEBUG_NO_SIGINT_HOOK` (`no_sigint_hook`): Do not suspend on SIGINT (default: false)
451-
- `RUBY_DEBUG_NO_RELINE` (`no_reline`): Do not use Reline library (default: false)
452-
- `RUBY_DEBUG_NO_HINT` (`no_hint`): Do not show the hint on the REPL (default: false)
453-
454-
- CONTROL
455-
- `RUBY_DEBUG_SKIP_PATH` (`skip_path`): Skip showing/entering frames for given paths
456-
- `RUBY_DEBUG_SKIP_NOSRC` (`skip_nosrc`): Skip on no source code lines (default: false)
457-
- `RUBY_DEBUG_KEEP_ALLOC_SITE` (`keep_alloc_site`): Keep allocation site and p, pp shows it (default: false)
458-
- `RUBY_DEBUG_POSTMORTEM` (`postmortem`): Enable postmortem debug (default: false)
459-
- `RUBY_DEBUG_FORK_MODE` (`fork_mode`): Control which process activates a debugger after fork (both/parent/child) (default: both)
460-
- `RUBY_DEBUG_SIGDUMP_SIG` (`sigdump_sig`): Sigdump signal (default: false)
461-
462-
- BOOT
463-
- `RUBY_DEBUG_NONSTOP` (`nonstop`): Nonstop mode (default: false)
464-
- `RUBY_DEBUG_STOP_AT_LOAD` (`stop_at_load`): Stop at just loading location (default: false)
465-
- `RUBY_DEBUG_INIT_SCRIPT` (`init_script`): debug command script path loaded at first stop
466-
- `RUBY_DEBUG_COMMANDS` (`commands`): debug commands invoked at first stop. commands should be separated by ';;'
467-
- `RUBY_DEBUG_NO_RC` (`no_rc`): ignore loading ~/.rdbgrc(.rb) (default: false)
468-
- `RUBY_DEBUG_HISTORY_FILE` (`history_file`): history file (default: ~/.rdbg_history)
469-
- `RUBY_DEBUG_SAVE_HISTORY` (`save_history`): maximum save history lines (default: 10000)
470-
471-
- REMOTE
472-
- `RUBY_DEBUG_PORT` (`port`): TCP/IP remote debugging: port
473-
- `RUBY_DEBUG_HOST` (`host`): TCP/IP remote debugging: host (default: 127.0.0.1)
474-
- `RUBY_DEBUG_SOCK_PATH` (`sock_path`): UNIX Domain Socket remote debugging: socket path
475-
- `RUBY_DEBUG_SOCK_DIR` (`sock_dir`): UNIX Domain Socket remote debugging: socket directory
476-
- `RUBY_DEBUG_LOCAL_FS_MAP` (`local_fs_map`): Specify local fs map
477-
- `RUBY_DEBUG_SKIP_BP` (`skip_bp`): Skip breakpoints if no clients are attached (default: false)
478-
- `RUBY_DEBUG_COOKIE` (`cookie`): Cookie for negotiation
479-
- `RUBY_DEBUG_OPEN_FRONTEND` (`open_frontend`): frontend used by open command (vscode, chrome, default: rdbg).
480-
- `RUBY_DEBUG_CHROME_PATH` (`chrome_path`): Platform dependent path of Chrome (For more information, See [here](https://github.com/ruby/debug/pull/334/files#diff-5fc3d0a901379a95bc111b86cf0090b03f857edfd0b99a0c1537e26735698453R55-R64))
481-
482-
- OBSOLETE
483-
- `RUBY_DEBUG_PARENT_ON_FORK` (`parent_on_fork`): Keep debugging parent process on fork (default: false)
484-
485-
## Initialization scripts
486-
487-
If you want to run certain commands or set configurations for every debugging session automatically, you can put them into the `~/.rdbgrc` file.
488-
489-
If you want to run additional initial scripts, you can also,
490-
491-
- Use `RUBY_DEBUG_INIT_SCRIPT` environment variable can specify the initial script file.
492-
- Specify the initial script with `rdbg -x initial_script`.
493-
494-
Initial scripts are useful to write your favorite configurations. For example,
495-
496-
```
497-
config set use_short_path true # Use $(Gem)/gem_content to replace the absolute path of gem files
498-
```
499-
500-
Finally, you can also write the initial script in Ruby with the file name `~/.rdbgrc.rb`.
433+
See the [configuration guide](/docs/configuration.md) for more information.
501434
502435
## rdbg command help
503436

Rakefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ file 'README.md' => ['lib/debug/session.rb', 'lib/debug/config.rb',
1818
require_relative 'lib/debug/session'
1919
require 'erb'
2020
File.write 'README.md', ERB.new(File.read('misc/README.md.erb')).result
21+
File.write 'docs/configuration.md', ERB.new(File.read('misc/configuration.md.erb')).result
2122
puts 'README.md is updated.'
2223
end
2324

docs/configuration.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Configuration
2+
3+
You can configure the debugger's behavior with the `config` command and environment variables.
4+
5+
Every configuration has a corresponding environment variable, for example:
6+
7+
```
8+
config set log_level INFO # RUBY_DEBUG_LOG_LEVEL=INFO
9+
config set no_color true # RUBY_DEBUG_NO_COLOR=true
10+
```
11+
12+
13+
14+
- UI
15+
- `RUBY_DEBUG_LOG_LEVEL` (`log_level`): Log level same as Logger (default: WARN)
16+
- `RUBY_DEBUG_SHOW_SRC_LINES` (`show_src_lines`): Show n lines source code on breakpoint (default: 10)
17+
- `RUBY_DEBUG_SHOW_FRAMES` (`show_frames`): Show n frames on breakpoint (default: 2)
18+
- `RUBY_DEBUG_USE_SHORT_PATH` (`use_short_path`): Show shorten PATH (like $(Gem)/foo.rb) (default: false)
19+
- `RUBY_DEBUG_NO_COLOR` (`no_color`): Do not use colorize (default: false)
20+
- `RUBY_DEBUG_NO_SIGINT_HOOK` (`no_sigint_hook`): Do not suspend on SIGINT (default: false)
21+
- `RUBY_DEBUG_NO_RELINE` (`no_reline`): Do not use Reline library (default: false)
22+
- `RUBY_DEBUG_NO_HINT` (`no_hint`): Do not show the hint on the REPL (default: false)
23+
24+
- CONTROL
25+
- `RUBY_DEBUG_SKIP_PATH` (`skip_path`): Skip showing/entering frames for given paths
26+
- `RUBY_DEBUG_SKIP_NOSRC` (`skip_nosrc`): Skip on no source code lines (default: false)
27+
- `RUBY_DEBUG_KEEP_ALLOC_SITE` (`keep_alloc_site`): Keep allocation site and p, pp shows it (default: false)
28+
- `RUBY_DEBUG_POSTMORTEM` (`postmortem`): Enable postmortem debug (default: false)
29+
- `RUBY_DEBUG_FORK_MODE` (`fork_mode`): Control which process activates a debugger after fork (both/parent/child) (default: both)
30+
- `RUBY_DEBUG_SIGDUMP_SIG` (`sigdump_sig`): Sigdump signal (default: false)
31+
32+
- BOOT
33+
- `RUBY_DEBUG_NONSTOP` (`nonstop`): Nonstop mode (default: false)
34+
- `RUBY_DEBUG_STOP_AT_LOAD` (`stop_at_load`): Stop at just loading location (default: false)
35+
- `RUBY_DEBUG_INIT_SCRIPT` (`init_script`): debug command script path loaded at first stop
36+
- `RUBY_DEBUG_COMMANDS` (`commands`): debug commands invoked at first stop. commands should be separated by ';;'
37+
- `RUBY_DEBUG_NO_RC` (`no_rc`): ignore loading ~/.rdbgrc(.rb) (default: false)
38+
- `RUBY_DEBUG_HISTORY_FILE` (`history_file`): history file (default: ~/.rdbg_history)
39+
- `RUBY_DEBUG_SAVE_HISTORY` (`save_history`): maximum save history lines (default: 10000)
40+
41+
- REMOTE
42+
- `RUBY_DEBUG_PORT` (`port`): TCP/IP remote debugging: port
43+
- `RUBY_DEBUG_HOST` (`host`): TCP/IP remote debugging: host (default: 127.0.0.1)
44+
- `RUBY_DEBUG_SOCK_PATH` (`sock_path`): UNIX Domain Socket remote debugging: socket path
45+
- `RUBY_DEBUG_SOCK_DIR` (`sock_dir`): UNIX Domain Socket remote debugging: socket directory
46+
- `RUBY_DEBUG_LOCAL_FS_MAP` (`local_fs_map`): Specify local fs map
47+
- `RUBY_DEBUG_SKIP_BP` (`skip_bp`): Skip breakpoints if no clients are attached (default: false)
48+
- `RUBY_DEBUG_COOKIE` (`cookie`): Cookie for negotiation
49+
- `RUBY_DEBUG_OPEN_FRONTEND` (`open_frontend`): frontend used by open command (vscode, chrome, default: rdbg).
50+
- `RUBY_DEBUG_CHROME_PATH` (`chrome_path`): Platform dependent path of Chrome (For more information, See [here](https://github.com/ruby/debug/pull/334/files#diff-5fc3d0a901379a95bc111b86cf0090b03f857edfd0b99a0c1537e26735698453R55-R64))
51+
52+
- OBSOLETE
53+
- `RUBY_DEBUG_PARENT_ON_FORK` (`parent_on_fork`): Keep debugging parent process on fork (default: false)
54+
55+
## Initialization scripts
56+
57+
If you want to run certain commands or set configurations for every debugging session automatically, you can put them into the `~/.rdbgrc` file.
58+
59+
If you want to run additional initial scripts, you can also,
60+
61+
- Use `RUBY_DEBUG_INIT_SCRIPT` environment variable can specify the initial script file.
62+
- Specify the initial script with `rdbg -x initial_script`.
63+
64+
Initial scripts are useful to write your favorite configurations. For example,
65+
66+
```
67+
config set use_short_path true # Use $(Gem)/gem_content to replace the absolute path of gem files
68+
```
69+
70+
Finally, you can also write the initial script in Ruby with the file name `~/.rdbgrc.rb`.

misc/README.md.erb

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -213,36 +213,7 @@ Here's a [Google sheet](https://docs.google.com/spreadsheets/d/1TlmmUDsvwK4sSIyo
213213

214214
# Configuration
215215

216-
You can configure the debugger's behavior with the `config` command and environment variables.
217-
218-
Every configuration has a corresponding environment variable, for example:
219-
220-
```
221-
config set log_level INFO # RUBY_DEBUG_LOG_LEVEL=INFO
222-
config set no_color true # RUBY_DEBUG_NO_COLOR=true
223-
```
224-
225-
<% cat = nil; DEBUGGER__::CONFIG_SET.each do |key, (env, desc, _, default)| %>
226-
<% /\A(\w+): (.+)/ =~ desc; if cat != $1; cat = 1 %>
227-
- <%= $1 %>
228-
<% cat = $1; end %> - `<%= env %>` (`<%= key %>`): <%= default ? "#{$2} (default: #{default})" : $2 %><% end %>
229-
230-
## Initialization scripts
231-
232-
If you want to run certain commands or set configurations for every debugging session automatically, you can put them into the `~/.rdbgrc` file.
233-
234-
If you want to run additional initial scripts, you can also,
235-
236-
- Use `RUBY_DEBUG_INIT_SCRIPT` environment variable can specify the initial script file.
237-
- Specify the initial script with `rdbg -x initial_script`.
238-
239-
Initial scripts are useful to write your favorite configurations. For example,
240-
241-
```
242-
config set use_short_path true # Use $(Gem)/gem_content to replace the absolute path of gem files
243-
```
244-
245-
Finally, you can also write the initial script in Ruby with the file name `~/.rdbgrc.rb`.
216+
See the [configuration guide](/docs/configuration.md) for more information.
246217

247218
## rdbg command help
248219

misc/configuration.md.erb

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Configuration
2+
3+
You can configure the debugger's behavior with the `config` command and environment variables.
4+
5+
Every configuration has a corresponding environment variable, for example:
6+
7+
```
8+
config set log_level INFO # RUBY_DEBUG_LOG_LEVEL=INFO
9+
config set no_color true # RUBY_DEBUG_NO_COLOR=true
10+
```
11+
12+
<% cat = nil; DEBUGGER__::CONFIG_SET.each do |key, (env, desc, _, default)| %>
13+
<% /\A(\w+): (.+)/ =~ desc; if cat != $1; cat = 1 %>
14+
- <%= $1 %>
15+
<% cat = $1; end %> - `<%= env %>` (`<%= key %>`): <%= default ? "#{$2} (default: #{default})" : $2 %><% end %>
16+
17+
## Initialization scripts
18+
19+
If you want to run certain commands or set configurations for every debugging session automatically, you can put them into the `~/.rdbgrc` file.
20+
21+
If you want to run additional initial scripts, you can also,
22+
23+
- Use `RUBY_DEBUG_INIT_SCRIPT` environment variable can specify the initial script file.
24+
- Specify the initial script with `rdbg -x initial_script`.
25+
26+
Initial scripts are useful to write your favorite configurations. For example,
27+
28+
```
29+
config set use_short_path true # Use $(Gem)/gem_content to replace the absolute path of gem files
30+
```
31+
32+
Finally, you can also write the initial script in Ruby with the file name `~/.rdbgrc.rb`.

0 commit comments

Comments
 (0)