Debugging output du...
 
Notifications
Clear all

Debugging output during development?

11 Posts
7 Users
0 Reactions
5,445 Views
Posts: 899
Topic starter
(@sallz0r)
Prominent Member
Joined: 18 years ago
[#4187]

Hi All,

Quick question -- does anyone know how I can use some sort of console output for debugging purposes while developing a output plugin for Vixen? I'd like to see what it thinks it's outputting, vs. what it should be....

I'm so used to writing command line apps I get a bit lost when there's no console (per se!) to write output to when vixen's run. 🙂

Thanks!
Michael


10 Replies
A Marchini
Posts: 426
(@a-marchini)
Reputable Member
Joined: 19 years ago
sallz0r wrote:Hi All,

Quick question -- does anyone know how I can use some sort of console output for debugging purposes while developing a output plugin for Vixen? I'd like to see what it thinks it's outputting, vs. what it should be....

I'm so used to writing command line apps I get a bit lost when there's no console (per se!) to write output to when vixen's run. 🙂

Thanks!
Michael

Actually, I believe there is a way to output to console by initiating the program from the command line. I don't know how to do it but I am sure there is a way.

This link may give some starting search points http://bytes.com/forum/thread214030.html

I believe that you can compile a plugin inside the development environment in such a way that you can debug it while it calls itself from vixen. At least you used to be able to do this with DLLs. It has been a while.

Probably the easiest thing to do at this point would be to get an instance of a file class and dump binary data into a file while the program executes.

Try searching these posts a little. I think there was a discussion on debugging.

Tony M.


Reply
teberle
Posts: 641
(@teberle)
Honorable Member
Joined: 19 years ago

Sallzor,

Are you comfortable using the IDE and stepping through the source code line by line? If so I can write up a quick how to on debug the pluggin dll while running vixen.

Tony


Reply
Posts: 899
Topic starter
(@sallz0r)
Prominent Member
Joined: 18 years ago
teberle wrote:Are you comfortable using the IDE and stepping through the source code line by line? If so I can write up a quick how to on debug the pluggin dll while running vixen.

I've actually managed to fix my problem, so I don't need debugging output anymore -- however, if it's a relatively quick and easy explanation it would be good to know how to do something like that in future. 🙂 (if it's too much hassle, though, don't worry about it).

(I've stepped through stuff before, but only standalone apps... the bit I don't get is how I integrate this DLL with vixen (when it's being run inside the IDE/debugger)... or do I have to run all of vixen itself inside the IDE somehow? hrm, didn't think of that previously...)

Thanks for your help! 🙂

Cheers,
Michael


Reply
A Marchini
Posts: 426
(@a-marchini)
Reputable Member
Joined: 19 years ago
sallz0r wrote: (if it's too much hassle, though, don't worry about it).

Thanks for your help! 🙂

Cheers,
Michael

No no... don't let him of so easy... we need this for posterity..
oh...he's gone...

Well at least you got your plugin working... now on to the next challenge!

Tony M.


Reply
Posts: 464
(@holtm)
Honorable Member
Joined: 19 years ago

I use an output file.
In the define section:

 #if TEXTDEBUG
        private TextWriter textFile;
    #endif

In the Startup method

#if TEXTDEBUG
        textFile = new StreamWriter("RenardAddr2.txt");
#endif

In the Protocol1EventAddr method

#if TEXTDEBUG
                for(int i = 0; i<10;i++)
               {
                textFile.Write(//something//]);
                textFile.WriteLine("");
                }
                textFile.WriteLine("-");
#endif

In the Shutdown method


#if TEXTDEBUG
        textFile.Close();
#endif

Then if I want to put the output into a file I add "TEXTDEBUG" to the Conditional compilation symbols under the build tab of the Project Properties.

The files can get huge fast, so be sure to limit the sequence.


Reply
Posts: 899
Topic starter
(@sallz0r)
Prominent Member
Joined: 18 years ago
holtm wrote:I use an output file.

...

The files can get huge fast, so be sure to limit the sequence.

Aha, cool, thanks for that -- that's really useful. I'll file that one away for future.... 🙂

Cheers,
Michael


Reply
Posts: 11
(@novicaine)
Active Member
Joined: 18 years ago

I just went through this last night trying to debug things (using Microsoft Visual Studio 2005)

It's actually pretty easy.

In your plugin (using C# as an example), put this line at the top of your file:

using System.Diagnostics;

Then use functions like:

Debug.Write( "Something happened!
" );

Then in the project settings, under "Start Action", select "Start External Program" and select your installed Vixen. For me it was:

C:\Program Files\Vixen\Vixen.exe

And make sure you change the project settings so the output folder is your Vixen's plugin folder. For me:

Project settings, Build tab/Output/Output Path = C:\Program Files\Vixen\Plugins\

Then in Visual Studio, just hit "Start Debugging (F5)" and it will launch Vixen and your DLL will spew your .Write lines to the lower output window in Developer Studio. And get this: You can even set breakpoints and such! Nice....

Enjoy!


Reply
A Marchini
Posts: 426
(@a-marchini)
Reputable Member
Joined: 19 years ago
Novicaine wrote:I just went through this last night trying to debug things (using Microsoft Visual Studio 2005)

It's actually pretty easy.

In your plugin (using C# as an example), put this line at the top of your file:
Enjoy!

This is an excellent outline of good information. I hope it helps a lot of people out there. Including me!
Tony M.


Reply
JonathonReinhart
Posts: 133
(@jonathonreinhart)
Estimable Member
Joined: 18 years ago

One thing that may also be useful, is com0com. I use this all the time for all my serial port programming projects. com0com < http://com0com.sourceforge.net/ > allows you to create two virtual COM ports, and "wire" them together. One of which you can then write your serial data to, and the other you can open in a terminal (I prefer Hercules < http://www.hw-group.com/products/hercules/index_en.html >). Then you can see exactly what data your software is spitting out.


Reply
Page 1 / 2
Share: