New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Debugging simple console app on windows.... #92
Comments
Not sure what kind of instruction you need for binaries... all you need is unzip it in folder you like and execute Might be interested for you: |
@viewizard I figured as much and got it to work. Still, it would be nice to have a couple of lines somewhere in the readme file to explain it to novice users. If you like I'd be more than happy to add that in for you. I'm having a bit of trouble getting it to run for a simple console app in C# though. I tried something like this:
Then |
I believe, you should use |
@viewizard OK... I had no idea executables were just wrappers around the DLLs. That's very good to know. I have several DLLs for my simple Console app:
Which one should I use for |
After this command: netcoredbg --interpreter=cli -- dotnet .\longest_common_prefix\bin\Debug\net6.0\longest_common_prefix.dll simply type |
@viewizard and @gbalykov Thank you for your help. It is getting a bit clearer. Unfortunately I still can't get it to work. Here's a couple of attempts. In the fourth attempt I am trying to follow the recommendations provided in the walkthrough more or less exactly: First attempt
Second attempt
Third attempt
Fourth attempt
In all cases, after I press enter on |
If you start |
The output for
I'm happy to share the source code, it's just a dummy example in
With the following project file:
|
I can confirm, this looks like some issue in CLI:
in the same time MI/GDB works as it should:
You could use MI/GDB for now, we don't have docs for this protocol, but you could see all implemented commands in sources: |
@viewizard what's the difference between the MI/GDB and CLI? What advantages does the CLI have which MI/GDB doesn't? Also it's quite surprising that the CLI is "broken" for pretty much the simplest possible C# application, namely a console app. One might wonder whether the CLI really works at all? Does it work for other .NET templates? Sorry, I'm not trying to undermine your work but just trying to understand what I'm missing here... |
@viewizard Also, I just gave MI/GDB a try. It's very cryptic and difficult to read... also is there a way to print out the value of just one variable? |
MI/GDB aimed for parce by computer, for GUI/plugin usage, CLI aimed for humans.
This is OK :-), this looks like some code was added in CLI protocol, but not tested well or even don't work from the beginning. Note, initially we have only VSCode and MI/GDB protocols support.
|
Any pointers on how to fix this so Windows users can also use the CLI? |
in case you need static field:
in case you need some class/struct (
We will investigate this issue, have no idea what is wrong for now, so, no ideas how to fix this. |
@awa5114 looks like I found issue, during Win x86 support and code refactoring I lost
|
@viewizard I've CCed you on a separate discussion here. Please take a look because @tommcdon makes an interesting point about the I added your proposed patch to my personal fork and I'm now trying to rebuild. I go into the
This seems to work but I don't really see the resulting binaries anywhere, namely:
So then I tried the following from within the
I'm not terribly familiar with CMake. How do I rebuild the code such that I can use the (patched) binaries? Where can I find the binaries in my local repo? |
We know about this upcoming changes in runtime 7.0, but it still in development. For now, we use (netcoredbg build script download it) .Net SDK 6.0 during build process and we use dbgshim from it. This will be revised after runtime 7.0 release.
Try
in this case you will see |
This is correct behaviour, since you setup breakpoint before process start (and PDB loaded). But as soon as you have it started (
and after that you have break at this breakpoint:
Hmm, have no idea why you don't see sources, this should be investigated first.
You can't print |
That's a little bit disappointing, one would think that indexing a list was pretty basic functionality. Perhaps |
@awa5114 CLI was introduced only in the end of 2021 and not all scenarios are possible now. We've made indexing for primitive types, but indexing in objects are more complex we have to find proper overlapped method and invoke it. Now you can examine such values by calling |
Eval for |
@viewizard I just gave |
We already have it in upstream code - netcoredbg/src/utils/iosystem_win32.cpp Line 529 in 19a1c4c
Initial Windows terminal related issue should be fixed by 29c44a2 in Jul 18, 2022 .You mean, you can't start CLI in Windows terminal again? |
I downloaded the most recent binaries today and I can't debug as shown below:
It just exits out again without breaking... This happens on all terminals, not just Windows Terminal. |
Which version of windows do you use? Can you try to run netcoredbg tests? See more details at https://github.com/Samsung/netcoredbg/blob/master/test-suite/README.md
|
Hmm... just tested latest release build on Windows x64 with fresh "dotnet new console" project:
works just fine... |
@viewizard not for me it doesn't
Here's the version info for the
|
@amine-aboufirass you seem to be using very old version, try the latest one https://github.com/Samsung/netcoredbg/releases/tag/3.0.0-1006 |
Yes I just tried and it worked, thanks,. |
Closing this. If you have any more questions, please reopen |
Ok, yeah it does work but it's weird because |
@amine-aboufirass did you add special line to csproj file? See https://github.com/Samsung/netcoredbg/blob/master/docs/cli.md#preparing-debug-information |
I'm interested in giving this debugger a try but it looks like there are only instructions for building the code from source. Would be nice if there were instructions for just installing using the binaries for a given release.
The text was updated successfully, but these errors were encountered: