summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-06-28 14:22:30 (GMT)
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-06-28 14:22:30 (GMT)
commitdea470cca449120adc70592d2e934afd79c89c06 (patch)
tree75df6799bb135d5cad46662d121e9aa2de83d5a2 /main.c
parent480c602bdc9ad15c40e093bd1acf9776e3ade5de (diff)
debug environment variable refined.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'main.c')
-rw-r--r--main.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/main.c b/main.c
index 80a155f..82144b7 100644
--- a/main.c
+++ b/main.c
@@ -29,9 +29,21 @@ objcdummyfunction(void)
int
main(int argc, char **argv, char **envp)
{
-#ifdef RUBY_GC_STRESS
+#ifdef RUBY_DEBUG_ENV
RUBY_EXTERN int gc_stress;
- gc_stress = getenv("RUBY_GC_STRESS") != NULL;
+ RUBY_EXTERN int enable_coredump;
+ char *str;
+ str = getenv("RUBY_DEBUG");
+ if (str) {
+ for (str = strtok(str, ","); str; str = strtok(NULL, ",")) {
+ if (strcmp(str, "gc_stress") == 0)
+ gc_stress = 1;
+ else if (strcmp(str, "core") == 0)
+ enable_coredump = 1;
+ else
+ fprintf(stderr, "unexpected debug option: %s\n", str);
+ }
+ }
#endif
#ifdef _WIN32
NtInitialize(&argc, &argv);