Skip to content
This repository was archived by the owner on Nov 11, 2024. It is now read-only.

Commit 65ba7bc

Browse files
author
Alex Rønne Petersen
committed
Add a RuntimeExecutable configuration element.
1 parent 1a3b959 commit 65ba7bc

File tree

4 files changed

+31
-13
lines changed

4 files changed

+31
-13
lines changed

README.md

+10-3
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ to package SDB releases.
6868
Additionally, `MODE` can be set to `Debug` (default) or `Release` to indicate
6969
the kind of build desired.
7070

71-
Finally, `MONO_PREFIX` can be set to tell the test runner which Mono executable
72-
should be used. See the description of `RuntimePrefix` further down for more
73-
information.
71+
Finally, `MONO_PREFIX` and `MONO_BINARY` can be set to tell the test runner
72+
which Mono executable should be used. See the description of `RuntimePrefix`
73+
and `RuntimeExecutable` further down for more information.
7474

7575
## Usage
7676

@@ -189,6 +189,13 @@ will want to set it to something like `C:\Program Files (x86)\Mono-3.0.10`.
189189
Or if you have Mono in some other directory, you might set it to e.g.
190190
`/opt/mono`.
191191

192+
The `RuntimeExecutable` element is another way to specify which Mono executable
193+
to use. If `RuntimePrefix` is empty, then `RuntimeExecutable` is taken as the
194+
full path to the Mono executable. If both elements are non-empty, they are
195+
combined as `Path.Combine(RuntimePrefix, "bin", RuntimeExecutable)`. This
196+
configuration element is useful for switching between `mono32` and `mono64` on
197+
OS X in particular.
198+
192199
You may want to set `DisableColors` to `true` if you don't want the fancy ANSI
193200
color codes that SDB emits.
194201

chk/check.fs

+5-2
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,16 @@ let runTest () =
8181
for _ in 1 .. 3 do
8282
recv proc |> ignore
8383

84-
// Set the `RuntimePrefix` to `MONO_PREFIX` as
85-
// specified in the `Makefile`.
84+
// Set runtime location options from the `Makefile`.
8685
let prefix = Environment.GetEnvironmentVariable("MONO_PREFIX")
86+
let exec = Environment.GetEnvironmentVariable("MONO_BINARY")
8787

8888
send proc ("config set RuntimePrefix " + prefix)
8989
recv proc |> ignore
9090

91+
send proc ("config set RuntimeExecutable " + exec)
92+
recv proc |> ignore
93+
9194
let mutable ex = null
9295

9396
try

src/Configuration.cs

+6
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ public sealed class Configuration
7979

8080
public bool PreferDisassembly { get; set; }
8181

82+
public string RuntimeExecutable { get; set; }
83+
8284
public string RuntimePrefix { get; set; }
8385

8486
public bool SaveDatabaseAutomatically { get; set; }
@@ -157,6 +159,9 @@ public static bool Read()
157159

158160
if (Current.DefaultDatabaseFile == null)
159161
Current.DefaultDatabaseFile = string.Empty;
162+
163+
if (Current.RuntimeExecutable == null)
164+
Current.RuntimeExecutable = string.Empty;
160165
}
161166
}
162167
catch (Exception ex)
@@ -198,6 +203,7 @@ public static void Defaults()
198203
Current.MaxConnectionAttempts = 1;
199204
Current.MemberEvaluationTimeout = 5000;
200205
Current.RuntimePrefix = "/usr";
206+
Current.RuntimeExecutable = string.Empty;
201207
Current.StepOverPropertiesAndOperators = true;
202208

203209
var defs = Current.Extra.Select(kvp => Tuple.Create(kvp.Key, kvp.Value.Item1, kvp.Value.Item2));

src/Debugger.cs

+10-8
Original file line numberDiff line numberDiff line change
@@ -410,17 +410,19 @@ public static void Run(FileInfo file)
410410
_debuggeeKilled = false;
411411
_kind = SessionKind.Launched;
412412

413-
var info = new SoftDebuggerStartInfo(Configuration.Current.RuntimePrefix,
414-
new Dictionary<string, string>(EnvironmentVariables))
413+
var args = new SoftDebuggerLaunchArgs(Configuration.Current.RuntimePrefix,
414+
new Dictionary<string, string>(EnvironmentVariables))
415+
{
416+
MonoExecutableFileName = Configuration.Current.RuntimeExecutable,
417+
MaxConnectionAttempts = Configuration.Current.MaxConnectionAttempts,
418+
TimeBetweenConnectionAttempts = Configuration.Current.ConnectionAttemptInterval
419+
};
420+
421+
var info = new SoftDebuggerStartInfo(args)
415422
{
416423
Command = file.FullName,
417424
Arguments = Arguments,
418-
WorkingDirectory = WorkingDirectory,
419-
StartArgs =
420-
{
421-
MaxConnectionAttempts = Configuration.Current.MaxConnectionAttempts,
422-
TimeBetweenConnectionAttempts = Configuration.Current.ConnectionAttemptInterval
423-
}
425+
WorkingDirectory = WorkingDirectory
424426
};
425427

426428
// We need to ignore `SIGINT` while we start the inferior

0 commit comments

Comments
 (0)