[tor-commits] [tor/master] Never disable debugger attachment for the unit tests

nickm at torproject.org nickm at torproject.org
Thu Mar 22 14:34:39 UTC 2012


commit fe2b177cfbcdbc2ad851402a9804f9b5f58d93b0
Author: Sebastian Hahn <sebastian at torproject.org>
Date:   Thu Mar 22 12:50:44 2012 +0100

    Never disable debugger attachment for the unit tests
---
 changes/bug5448 |    5 +++++
 src/or/config.c |    4 +++-
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/changes/bug5448 b/changes/bug5448
new file mode 100644
index 0000000..aaf7dc7
--- /dev/null
+++ b/changes/bug5448
@@ -0,0 +1,5 @@
+  o Major bugfixes:
+    - Allow running the unit tests in gdb again. This was accidentally made
+      impossible when the DisableDebuggerAttachment option was introduced.
+      Fixes bug 5448; bugfix on 0.2.3.9-alpha.
+
diff --git a/src/or/config.c b/src/or/config.c
index 0c699b0..3de8426 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -1338,7 +1338,9 @@ options_act(const or_options_t *old_options)
     /* Remember if we already warned about being configured not to disable
      * debugger attachment */
     static int warned_debugger_attach = 0;
-    if (options->DisableDebuggerAttachment && !disabled_debugger_attach) {
+    /* Don't disable debugger attachment when we're running the unit tests. */
+    if (options->DisableDebuggerAttachment && !disabled_debugger_attach &&
+        running_tor) {
       int ok = tor_disable_debugger_attach();
       if (warned_debugger_attach && ok == 1) {
         log_notice(LD_CONFIG, "Disabled attaching debuggers for unprivileged "



More information about the tor-commits mailing list