Closed gturri closed 9 years ago
I just pushed some dependency updates in 39367e4e1b0578eb6ec344f82da984f65b5bae92. Can you try and see if this improves things as far as actually using SDB goes?
I'm not sure what the deal with F# is. Could you maybe try playing with architecture flags and see if that helps?
Thanks for replying so fast!
TL;DR:
Failed to connect to 'test.exe'
errormake check
I removed my local clone and re-started from scratch (on commit 39367e4e1b057).
Since you removed /nologo
from the default flags, I now build successfully with a simple make
.
However, I still have the Failed to connect to 'test.exe'
error when I follow the steps on the README.
On the other hand, please disregard the Fsharp warnings: I'm realizing I get them whenever I use fsc, even though I can actually compile successfully a few HelloWorld. (I didn't noticed it earlier because I just installed fsharp, in order to run those tests).
I still can't run the tests with make check FSHARPC=fsc
, even if I remove the flags --warnaserror
because make
complains that there's no rule to build chk/fs/print.exe.mdb
even though chk/fs/print.exe
has been compiled.
It's because fsc
generates a print.pdb
as a debug file, so I guess I should install the "F# compiler from mono", and that this issue is out of the scope of this bug report.
However, I still have the Failed to connect to 'test.exe' error when I follow the steps on the README.
It sounds like what's happening here is that the wrong command (remote
) is being invoked by r
. Does an explicit run test.exe
work?
It's because fsc generates a print.pdb as a debug file, so I guess I should install the "F# compiler from mono", and that this issue is out of the scope of this bug report.
Yep, if you're building with Mono tools, you'll need the Mono version of fsc
. It's used to build the test programs to be tested under the Mono debugger, so it's important that Mono-compatible debugging info is generated.
An explicit run test.exe
also gives Failed to connect to 'test.exe'
That's... odd. It's definitely invoking the wrong command. I imagine something is going wrong here: https://github.com/mono/sdb/blob/master/src/MultiCommand.cs#L120
Could you try throwing in some Console.WriteLine
s around the command code and try to figure out what's going wrong here? I can't reproduce on non-Windows. :(
What I could find is:
RunCommand
CommandLine.Run
while(!Stop)
loop, and since InferiorExecuting
is true, we go into ResumeEvent.WaitOne()
. That's where we get the Failed to connect to test.exe
message.I hope it helps.
btw, as far as I'm concern, I'm starting to work in a Linux VM, where I can run sdb without problem.
Thanks for proposing this software, and thanks for being so responsive!
OK. Can you try this:
$ SDB_DEBUG=enable sdb
(sdb) cfg s DebugLogging true
(sdb) cfg s LogInternalErrors true
(sdb) cfg s LogRuntimeSpew true
(sdb) r test.exe
[g.turri@FR-9LFLC5J:~/Desktop]$ SDB_DEBUG=enable /c/miscRepos/sdb/sdb/bin/sdb
Welcome to the Mono soft debugger (sdb 1.4.5485.30778)
Type 'help' for a list of commands or 'quit' to exit
(sdb) cfg s DebugLogging true
'DebugLogging' = 'True' (was 'False')
(sdb) cfg s LogInternalErrors true
'LogInternalErrors' = 'True' (was 'False')
(sdb) cfg s LogRuntimeSpew true
'LogRuntimeSpew' = 'True' (was 'False')
(sdb) r test.exe
Failed to connect to 'test.exe'
(sdb) Event: 'TargetExited'
Just for reference, what's the source code for test.exe
?
I copy pasted the test.cs
from your README:
using System;
using System.Diagnostics;
static class Program
{
static void Main()
{
var str = "Foo!";
Foo(str);
}
static void Foo(string str)
{
Console.WriteLine(str);
Bar();
}
static void Bar()
{
Debugger.Break();
}
}
OK, one last thing (hopefully): Can I get the output of cfg list
?
Welcome to the Mono soft debugger (sdb 1.4.5485.30864)
Type 'help' for a list of commands or 'quit' to exit
(sdb) cfg list
'AllowMethodEvaluation' = 'True'
'AllowTargetInvoke' = 'True'
'AllowToStringCalls' = 'True'
'ChunkRawStrings' = 'False'
'ConnectionAttemptInterval' = '500'
'DefaultDatabaseFile' = ''
'DebugLogging' = 'True'
'DisableColors' = 'False'
'EllipsizeStrings' = 'True'
'EllipsizeThreshold' = '100'
'EnableControlC' = 'True'
'EvaluationTimeout' = '1000'
'ExceptionIdentifier' = '$exception'
'FlattenHierarchy' = 'True'
'HexadecimalIntegers' = 'False'
'InputPrompt' = '(sdb)'
'LoadDatabaseAutomatically' = 'False'
'LogInternalErrors' = 'True'
'LogRuntimeSpew' = 'True'
'MaxConnectionAttempts' = '1'
'MemberEvaluationTimeout' = '5000'
'PreferDisassembly' = 'False'
'RuntimePrefix' = '/usr'
'SaveDatabaseAutomatically' = 'False'
'StepOverPropertiesAndOperators' = 'True'
That RuntimePrefix
doesn't look right. It should be set to something along the lines of C:\Program Files (x86)\Mono 3.2.3
. Does that work?
Well done, seems you nailed it!
(sdb) cfg s RuntimePrefix C:\Program Files (x86)\Mono-3.2.3
'RuntimePrefix' = 'C:\Program Files (x86)\Mono-3.2.3' (was '/usr')
(sdb) r test.exe
Inferior process '6148' ('test.exe') started
Event: 'TargetReady'
[Mono] Loaded assembly: c:\Users\g.turri\Desktop\test.exe
[Mono] Loaded assembly: C:\Program Files (x86)\Mono-3.2.3\lib\mono\gac\I18N\4.0.0.0__0738eb9f132ed756\I18N.dll
[Mono] Loaded assembly: C:\Program Files (x86)\Mono-3.2.3\lib\mono\gac\I18N.West\4.0.0.0__0738eb9f132ed756\I18N.West.dll
Foo!
Inferior process '6148' ('test.exe') suspended
#0 [0x00000001] Program.Bar at c:\Users\g.turri\Desktop\test.cs:22
Debugger.Break();
Event: 'TargetStopped'
(sdb) bt
#0 [0x00000001] Program.Bar at c:\Users\g.turri\Desktop\test.cs:22
Debugger.Break();
#1 [0x00000007] Program.Foo at c:\Users\g.turri\Desktop\test.cs:17
Bar();
#2 [0x00000008] Program.Main at c:\Users\g.turri\Desktop\test.cs:10
Foo(str);
Congrats for this remote-debugging!
Yay! I'll close this then. I've opened another issue (#22) for the strange prompt behavior on Windows.
TL;DR:
Too many project files specified
/nologo
from the switches, but it seems I build a corrupted executable since it failsmake check
and outputsFailed to connect to 'test.exe'
whenever I try to use itI'm trying to build sdb on my Windows [1].
If I run
make
just after cloning the repo and the submodules, I getusing msbuild instead, with
make XBUILD=msbuild.exe
yields a similar error:(I get the same error if I run the following commands manually
)
It appears I can bypass this issue if I remove
/nologo
from the switches. I have no idea why it fixes the issue, but runningmake XBUILD_FLAGS='/property:Configuration=net_4_0_Debug /verbosity:quiet'
successfully builds(It might be worth noticing that when it builds
dep/debugger-libs
, it outputs the warning)
However, running the tests (
make check FSHARPC=fsc
) fails, with the errors (which I'm unable to output in English) :and running the test example on the README gives:
[1] : Windows 7, make 3.81, mono 3.3.0, msbuild version 4.0.30319.17929 , Microsoft .NET Framework, version 4.0.30319.18063