Skip to content
This repository has been archived by the owner on Nov 11, 2024. It is now read-only.

Stdout in sdb plugin #71

Discussion options

You must be logged in to vote

Hello again! I'm callmekohei!

So, I can do it!

Thank you (^_^)/


( code )

namespace Mono.Debugger.Client.Commands

#r "/usr/local/lib/sdb/sdb.exe"
#r "/usr/local/lib/sdb/Mono.Debugging.dll"
#r "/usr/local/lib/sdb/Mono.Debugging.Soft.dll"

open Mono.Debugger.Client
open Mono.Debugging.Client

open System
open System.IO

module Foo =

    let gatherOutput f args =

        try
            // Switch MemoryStream
            let ms = new MemoryStream()
            let sw = new StreamWriter(ms)
            let tw = TextWriter.Synchronized(sw)
            sw.AutoFlush <- true
            Console.SetOut(tw)

            f args

            // read data from MemoryStream
            let sr = new

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by alexrp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant
Converted from issue

This discussion was converted from issue #48 on June 12, 2021 09:16.