Skip to content
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

breakpoint not breaking #1464

Closed
mrj001 opened this issue Aug 21, 2020 · 6 comments
Closed

breakpoint not breaking #1464

mrj001 opened this issue Aug 21, 2020 · 6 comments
Assignees
Milestone

Comments

@mrj001
Copy link

mrj001 commented Aug 21, 2020

Expected results: stop at breakpoint.
Actual results: program ran to completion without stopping

How to reproduce. I got the syntax for the bpmd command from dotnet/runtime#10438.

$ mkdir NoBreak
$ cd NoBreak
$ dotnet new solution
The template "Solution File" was created successfully.
$ dotnet new Console -n Hello
The template "Console Application" was created successfully.

Processing post-creation actions...
Running 'dotnet restore' on Hello/Hello.csproj...
Determining projects to restore...
Restored /Users/mj/Documents/develop/diagnostics.issues/NoBreak/Hello/Hello.csproj (in 137 ms).
Restore succeeded.

$ dotnet sln NoBreak.sln add Hello/Hello.csproj
Project Hello/Hello.csproj added to the solution.
$ dotnet build
Microsoft (R) Build Engine version 16.7.0-preview-20360-03+188921e2f for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

Determining projects to restore...
All projects are up-to-date for restore.
You are using a preview version of .NET. See: https://aka.ms/dotnet-core-preview
Hello -> /Users/mj/Documents/develop/diagnostics.issues/NoBreak/Hello/bin/Debug/net5.0/Hello.dll

Build succeeded.
0 Warning(s)
0 Error(s)

Time Elapsed 00:00:05.93
$ lldb dotnet
Added Microsoft public symbol server
(lldb) target create "dotnet"
Current executable set to 'dotnet' (x86_64).
(lldb) process launch -s -- run -p Hello
Process 47821 stopped

  • thread WIP: repo consolidation scouting kick-off - make clr build locally on Windows runtime#1, stop reason = signal SIGSTOP
    frame #0: 0x0000000100017000 dyld_dyld_start dyld_dyld_start:
    -> 0x100017000 <+0>: popq %rdi
    0x100017001 <+1>: pushq $0x0
    0x100017003 <+3>: movq %rsp, %rbp
    0x100017006 <+6>: andq $-0x10, %rsp
    Target 0: (dotnet) stopped.
    Process 47821 launched: '/Users/mj/Documents/develop/runtime/.dotnet/dotnet' (x86_64)
    (lldb) bpmd Hello.dll Hello.Program.Main
    (lldb) continue
    Process 47821 resuming
    1 location added to breakpoint 1
    Hello World!
    Process 47821 exited with status = 0 (0x00000000)
    (lldb) quit

Here is my dotnet --info output:

.NET SDK (reflecting any global.json):
Version: 5.0.100-preview.8.20362.3
Commit: a5c8f426c2

Runtime Environment:
OS Name: Mac OS X
OS Version: 10.15
OS Platform: Darwin
RID: osx.10.15-x64
Base Path: /Users/mj/Documents/develop/runtime/.dotnet/sdk/5.0.100-preview.8.20362.3/

Host (useful for support):
Version: 5.0.0-preview.8.20361.2
Commit: f37dd6fc85

.NET SDKs installed:
5.0.100-preview.8.20362.3 [/Users/mj/Documents/develop/runtime/.dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 5.0.0-preview.8.20360.11 [/Users/mj/Documents/develop/runtime/.dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 5.0.0-preview.8.20361.2 [/Users/mj/Documents/develop/runtime/.dotnet/shared/Microsoft.NETCore.App]

To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download

@Dotnet-GitSync-Bot
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@hoyosjs
Copy link
Member

hoyosjs commented Aug 21, 2020

Since this is a SOS command, I'm transferring this.

cc: @mikem8361

@hoyosjs hoyosjs transferred this issue from dotnet/runtime Aug 21, 2020
@mikem8361 mikem8361 self-assigned this Aug 21, 2020
@mikem8361 mikem8361 added this to the 5.0 milestone Aug 21, 2020
@mikem8361
Copy link
Member

The problem is how you are launching dotnet/Hello. Using process launch -s -- run -p Hello launches another instance of dotnet which is what lldb is debugging. What you want is to launch Hello directly: process launch -s -- /Users/mikem/builds/NoBreak/Hello/bin/Debug/net5.0/Hello.dll without using the run subcommand. Your breakpoint on Main should work.

@mikem8361
Copy link
Member

Are you still having problems? Can I close this issue?

@mrj001
Copy link
Author

mrj001 commented Sep 24, 2020

Yes. This worked. This is not obvious. I expected to run it the same way I would from the command line in the project folder. i.e. by running the project rather than the dll directly.

Is there some documentation I missed? Otherwise, it's ok to close the issue.

@mikem8361
Copy link
Member

It doesn't mention this explicitly but this doc has some info on dotnet run limitations: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-run

@ghost ghost locked as resolved and limited conversation to collaborators Jun 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants