diff options
author | Jim Ingham <jingham@apple.com> | 2014-02-25 19:57:47 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2014-02-25 19:57:47 +0000 |
commit | 5689a217e303bc4fbba514cbe0491ac44b7081ef (patch) | |
tree | 45d336e3615bd046f098edf288f2d12257616ed0 /lldb/tools/debugserver/source | |
parent | 3f49c890bfa483333ba089acf6b41362ce2aa9fb (diff) | |
download | bcm5719-llvm-5689a217e303bc4fbba514cbe0491ac44b7081ef.tar.gz bcm5719-llvm-5689a217e303bc4fbba514cbe0491ac44b7081ef.zip |
Switch debugserver to detach on error by default, and change the flag to kill-on-error.
Also fix the bug where lldb prints: "Got a connection and launched debugserver" rather
than the name of the process it actually launched.
llvm-svn: 202189
Diffstat (limited to 'lldb/tools/debugserver/source')
-rw-r--r-- | lldb/tools/debugserver/source/debugserver.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lldb/tools/debugserver/source/debugserver.cpp b/lldb/tools/debugserver/source/debugserver.cpp index 5ff580b2b01..4fb5077b2ba 100644 --- a/lldb/tools/debugserver/source/debugserver.cpp +++ b/lldb/tools/debugserver/source/debugserver.cpp @@ -63,7 +63,7 @@ static nub_launch_flavor_t g_launch_flavor = eLaunchFlavorDefault; int g_disable_aslr = 0; int g_isatty = 0; -bool g_detach_on_error = false; +bool g_detach_on_error = true; #define RNBLogSTDOUT(fmt, ...) do { if (g_isatty) { fprintf(stdout, fmt, ## __VA_ARGS__); } else { _DNBLog(0, fmt, ## __VA_ARGS__); } } while (0) #define RNBLogSTDERR(fmt, ...) do { if (g_isatty) { fprintf(stderr, fmt, ## __VA_ARGS__); } else { _DNBLog(0, fmt, ## __VA_ARGS__); } } while (0) @@ -831,7 +831,7 @@ static struct option g_long_options[] = { "attach", required_argument, NULL, 'a' }, { "arch", required_argument, NULL, 'A' }, { "debug", no_argument, NULL, 'g' }, - { "detach-on-error", no_argument, NULL, 'e' }, + { "kill-on-error", no_argument, NULL, 'K' }, { "verbose", no_argument, NULL, 'v' }, { "lockdown", no_argument, &g_lockdown_opt, 1 }, // short option "-k" { "applist", no_argument, &g_applist_opt, 1 }, // short option "-t" @@ -1030,8 +1030,8 @@ main (int argc, char *argv[]) } break; - case 'e': - g_detach_on_error = true; + case 'K': + g_detach_on_error = false; case 'W': if (optarg && optarg[0]) @@ -1536,7 +1536,12 @@ main (int argc, char *argv[]) } if (mode != eRNBRunLoopModeExit) - RNBLogSTDOUT ("Got a connection, launched process %s.\n", argv_sub_zero); + { + const char *proc_name = "<unknown>"; + if (ctx.ArgumentCount() > 0) + proc_name = ctx.ArgumentAtIndex(0); + RNBLogSTDOUT ("Got a connection, launched process %s (pid = %d).\n", proc_name, ctx.ProcessID()); + } } else { |