Skip to content

LLDB sos commands don't write output to SBCommandReturnObject #4086

@defufna

Description

@defufna

Description

I had a custom lldb command written in python that calls clrstack on all threads listed by clrthreads. The command stopped working after I updated dotnet-sos to 7.0.410101 (it's still broken on 7.0.430602). The reason why it's broken is that it commands executed with SBCommandInterpreter.HandleCommand do not write their output to lldb.SBCommandReturnObject, I checked both output and error streams of the command and both are empty.

To reproduce this issue, you can use the following lldb command:

script res=lldb.SBCommandReturnObject(); lldb.debugger.GetCommandInterpreter().HandleCommand("clrstack", res);res.GetOutputSize()

The command will print clrstack output on the console and 0 after that, this behavior is same for all sos commands.
If you use a lldb command, for example "bt" the provided snippet will print nothing and return some number greater than 0

Configuration

dotnet --info

.NET SDK:
Version: 7.0.100
Commit: e12b7af219

Runtime Environment:
OS Name: gentoo
OS Version: 2.13
OS Platform: Linux
RID: linux-x64
Base Path: /home/user/.dotnet/sdk/7.0.100/

Host:
Version: 7.0.0
Architecture: x64
Commit: d099f075e4

.NET SDKs installed:
7.0.100 [/home/user/.dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 7.0.0 [/home/user/.dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 7.0.0 [/home/user/.dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
None

Environment variables:
DOTNET_ROOT [/home/user/.dotnet]

global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download

Regression?

Other information

It used to work before I updated, but I can't remember the exact version of dotnet-sos I had, something pretty old, probably 6.*

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions