Skip to content

[lldb] python API SBDebugger.GetOutputFileHandle() returns a file handle with the wrong mode for stdout/stderr #122387

Open
@ashgti

Description

@ashgti

It looks like when lldb initializes the default OutputFileHandle and ErrorFileHandle on a new debugger instance it is not setting the handles as writable (mode='w').

Here is a simple python script using the lldb module to illustrate this:

import lldb

dbg = lldb.SBDebugger.Create()

print("output", dbg.GetOutputFileHandle()) #> output <_io.TextIOWrapper name=1 mode='r' encoding='UTF-8'>
print("error", dbg.GetErrorFileHandle()) #> error <_io.TextIOWrapper name=2 mode='r' encoding='UTF-8'>

I think this is happening because:

However, stdout and stderr should be set to mode='w' by default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions