NO

Author Topic: variable value detection under Wine  (Read 6411 times)

Ran

  • Guest
variable value detection under Wine
« on: April 27, 2013, 06:20:52 PM »
Hello,

I use Pelle's C (ver 7) in Ubuntu under Wine, but when i want to see
the value of a variable with the fprint.... then I end the program and
everything closes down and I can't see the results of the variables.
Help anyone ???

Greetings,
Ran 

Offline Stefan Pendl

  • Global Moderator
  • Member
  • *****
  • Posts: 582
    • Homepage
Re: variable value detection under Wine
« Reply #1 on: April 29, 2013, 08:22:33 AM »
Since this is working on pure Windows you will have to report the issue to the WINE development.

Anything that works on regular Windows and not under WINE is a WINE issue.
---
Stefan

Proud member of the UltraDefrag Development Team

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2091
Re: variable value detection under Wine
« Reply #2 on: April 29, 2013, 02:15:05 PM »
Use OutputDebugString() with debugger.
May the source be with you

Ran

  • Guest
Re: variable value detection under Wine
« Reply #3 on: April 30, 2013, 08:24:52 AM »
Thanks a lot.... I will try the OutputDebugString() and report to Wine.

Greetings,

Ran

czerny

  • Guest
Re: variable value detection under Wine
« Reply #4 on: May 07, 2013, 08:14:58 PM »
Use OutputDebugString() with debugger.
I have tried to collect some infos to OutputDebugString.
Theres is a little helper function on this site: http://unixwiz.net/techtips/outputdebugstring.html
May be anyone can tell me why the crlf in this function is usefull.
I have attached a little test project.

If one would like to use that in release mode, use DebugView (http://technet.microsoft.com/en-us/sysinternals/bb896647).

Ran

  • Guest
Re: variable value detection under Wine
« Reply #5 on: May 09, 2013, 05:13:37 PM »
czerny,

Thanks, but I did find that i can see the variables with Pelle's C in this way:

When I run the Ide and there is a "fprint...." inside the code then Pelle's Ide closes and
shows me nothing.
So I use the Ide to program and execute.....
Then I go to the exe file of the program that Pelle's ide has produced and run the program
from there. Well when the program closes here it shows the black window for a second
so that I can read the variables.

I also did use (years ago) Visual C 6.0 with the Vs6sp6 pack and it works fine too !!!!
But for C I use Pelle's C because I got big problems with the runtime dll's from VC.
When people got a Visual Basic program on their PC, my runtime dll didn't work
anymore because the Microsoft dll's are not compatible with each-other.
So then I moved (had to) to Pelle's C.

Greetings,
Ran 

czerny

  • Guest
Re: variable value detection under Wine
« Reply #6 on: May 09, 2013, 08:07:38 PM »
Thanks, but I did find that i can see the variables with Pelle's C in this way:
Sorry, I don't understand.
Does it work or does it not work for you?

czerny

  • Guest
Re: variable value detection under Wine
« Reply #7 on: May 09, 2013, 08:09:50 PM »
When I run the Ide and there is a "fprint...." inside the code then Pelle's Ide closes and
shows me nothing.
What do you use? fprintf or printf?

Can you provide a little example?

Ran

  • Guest
Re: variable value detection under Wine
« Reply #8 on: May 11, 2013, 08:35:18 AM »
Czerny,
Yes I works, but not running the execute from the Ide,
only from the stand alone exe that is made by the Ide.
example:
printf ("Decimals yl : %d\n", yl);

And in main I have:
#include <stdio.h>
#include <io.h>

Greetings,
Fred

Ran

  • Guest
Re: variable value detection under Wine
« Reply #9 on: May 11, 2013, 08:40:13 AM »
Czerny,

i program under Wine (ubuntu) with SDL and Opengl.
It works fine.
And is workable.
But when I want to distribute a program I go to
Win 7 (second OS on laptop) and do a Rebuid and make a exe.

Greetings,
Fred

Ran

  • Guest
Re: variable value detection under Wine
« Reply #10 on: May 11, 2013, 09:29:38 AM »
Thanks timovjl,

But with SDL and Opengl I work under a console window and not windows.
But yes I could use it and include windows.h.

Greetings and thanks,
Ran

migf1

  • Guest
Re: variable value detection under Wine
« Reply #11 on: May 16, 2013, 11:10:04 AM »
Does this by any chance have anything to do with simply adding something like...

Code: [Select]
system("pause");
just before you exit your program?

That will only work on Windows platforms and it's rather heavy, but you can easily code a simple cross-platform alternative (macro or function) behaving somewhat similarly...

Code: [Select]
...
void pressENTER( void )
{
    int c;

    printf( "press ENTER... ");
    fflush( stdout );
    while ( '\n' != (c=getchar()) && EOF != c )
        ;    /* void */
}
...
int main( void )
{
    ...
    if ( error ) {
        puts( "*** error" );
        pressENTER();
    }
    ...
}

« Last Edit: May 16, 2013, 11:11:46 AM by migf1 »

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2091
Re: variable value detection under Wine
« Reply #12 on: May 16, 2013, 05:31:15 PM »
...
Then I go to the exe file of the program that Pelle's ide has produced and run the program
from there. Well when the program closes here it shows the black window for a second
so that I can read the variables.
...
With mouse right click in wine console select options not to close window after program ends.
May the source be with you

Ran

  • Guest
Re: variable value detection under Wine
« Reply #13 on: May 19, 2013, 08:00:20 AM »
Yes, timovjl that was the one I was looking for......
Thanks a lot, it works fine.....
Now I have the time to read every variable....

Greetings,
Ran

Ran

  • Guest
Re: variable value detection under Wine
« Reply #14 on: May 19, 2013, 08:18:17 AM »
And thank you too, of course migf1....