Author Topic: C::B & Uniwin  (Read 25308 times)

Offline Rigel

  • Multiple posting newcomer
  • *
  • Posts: 12
C::B & Uniwin
« on: November 21, 2006, 11:09:24 am »
How to make it work in nightly?

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: C::B & Uniwin
« Reply #1 on: November 21, 2006, 11:40:25 am »
Hi !

not very explicit...

Dje

Offline Rigel

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: C::B & Uniwin
« Reply #2 on: November 21, 2006, 11:45:27 am »
C::B doing something weird. Creates temporary file, deletes original source file and renames temporary to original file name. This confuses Uniwin...

Is there any other way to remote compiling and debugging?

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: C::B & Uniwin
« Reply #3 on: November 21, 2006, 12:13:43 pm »
C::B doing something weird.

No, it does something that keeps your files safe in the event of a failure during saving. If you think that's weird, I 'll pass...
Be patient!
This bug will be fixed soon...

Offline Rigel

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: C::B & Uniwin
« Reply #4 on: November 21, 2006, 12:15:37 pm »
How can I turn this off?

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: C::B & Uniwin
« Reply #5 on: November 21, 2006, 01:16:37 pm »
You cannot turn it off. (You could modify the sources, but I won't help on this because it is madness).
This is a feature that ensures that no matter what happens, you never lose all your data (even if you pull the plug while saving files). As such, it cannot and should not be turned off.

Also, it should do something different: it creates a temporary file, writes to it, renames the old file, renames the temporary file, and deletes the old file after a grace period.

The behaviour that you describe is what wxTempFile does, but we don't use that any more, unless we have forgotten to change it somewhere. It is unsafe because it can delete both files under certain (although unlikely) conditions.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Rigel

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: C::B & Uniwin
« Reply #6 on: November 21, 2006, 01:26:00 pm »
It seems Uniwin support totally broken.

No integrated remote develop in C::B...

But there is some scripting way to implement it...

I trying to do it with batch files, but stuck with setting enviroment variables right before build commands. Trying to "set REMOTE=bla.blabla.com" in Project>Build options>Commands>Pre-build steps fails to execute. Why?

Also there is trouble with backslashes. C::B forcefully replaces slashes with backslashes in Project>Build options>Directories>Compiler.
How can I avoid it?

PS: OS Windows
« Last Edit: November 21, 2006, 01:34:30 pm by Rigel »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: C::B & Uniwin
« Reply #7 on: November 21, 2006, 08:00:07 pm »
I trying to do it with batch files, but stuck with setting enviroment variables right before build commands. Trying to "set REMOTE=bla.blabla.com" in Project>Build options>Commands>Pre-build steps fails to execute. Why?
...because the set is issued in another context?! ;-)
Anyway: There is a plugin that does the job for such purposes: EnvVars (Environment variables plugin) - there you can setup/change environment variables in the focus of C::B and it's sub-processes.
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Rigel

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: C::B & Uniwin
« Reply #8 on: November 21, 2006, 08:49:07 pm »
I know about this plugin, but it useless for me because in current case i need to set diffrent enviroment variables for each target...

I currently developing client-server crossplatform application. Nightly's broken uniwin compatiblity completely confuses me... Rolled back to 08.11.2006 nightly...
« Last Edit: November 21, 2006, 08:55:32 pm by Rigel »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: C::B & Uniwin
« Reply #9 on: November 21, 2006, 09:13:30 pm »
I currently developing client-server crossplatform application. Nightly's broken uniwin compatiblity completely confuses me... Rolled back to 08.11.2006 nightly...
Ok, so we can make a deal: You explain to me how to attach uniwin to C::B (which I will then transfer into a WiKi article) and I'll look into it. It shouldn't be too hard to compare the sources of Now08 with the ones of today to track down that issue...
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Rigel

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: C::B & Uniwin
« Reply #10 on: November 21, 2006, 09:39:15 pm »
Hmm... Uniwin looks for changes in specified directory and syncronizes with remote directory through sftp. Since C::B uses complex saving method, I don't think it is easy to make it compatible with Uniwin without breaking current save method. Tomorrow I will try to add *.tmp mask to sync files in Uniwin. I think this can help... I will report this.

Update: Adding *.tmp to sync files mask didn't help...
« Last Edit: November 21, 2006, 10:00:08 pm by Rigel »

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: C::B & Uniwin
« Reply #11 on: November 21, 2006, 09:43:47 pm »
I think that way of saving files is already in CB way longer then 8nov2006. I remember that someone once posted that uniwin works with CB (search the forum), so it seems the problem might be something else.
Help Morton back track since when it did not work anymore so he can have a look at the code.
[EDIT] : http://forums.codeblocks.org/index.php?topic=2378
« Last Edit: November 21, 2006, 09:46:48 pm by killerbot »

Offline Rigel

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: C::B & Uniwin
« Reply #12 on: November 21, 2006, 09:57:25 pm »
Yes, 08.11 nightly saves this way too. Uniwin catches file changes sometimes. i don't know why "sometimes", but it helps me somehow )

Thats why I looking forward at Enviroment Variables settings per target (or help how to set them at pre-build commands) and slashes\backslashes issue (maybe its nice to add option to switch replacement on/off?)...

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: C::B & Uniwin
« Reply #13 on: November 21, 2006, 10:12:40 pm »
Thats why I looking forward at Enviroment Variables settings per target [...]
I guess I'm still missing something here: You said previously that you would like to pass specific variables per-target. Why don't you use user variables for this as they should get replaced also for the commands?! Thus in the command write something like:
Code
call_my_batch.bat $MyUserVar
And setup the user variable for this target e.g. as "123.234.123.234"...
Then inside the batch file you can do with it whatever you want, e.g.
Code
@echo off
echo The command line provided is: %1.
the_app.exe "%1"
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Rigel

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: C::B & Uniwin
« Reply #14 on: November 22, 2006, 06:43:31 am »
OK, I got you idea. Tried out and it works!

What about backslashes? How can I avoid replacement?

Offline Rigel

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: C::B & Uniwin
« Reply #15 on: November 22, 2006, 07:35:39 am »
Here is some kind tutorial to make it work on Windows 5.0 and later:

You will need PuTTY package. You can get it here.

Compiler batch files
Code
@echo off
set SELF=%~n0
set LOGIN=%1
shift
set REMOTE=%1
shift
set SRCDIR=%1
shift

:next
if "%1" == "" goto end
        set PARAMS=%PARAMS% %1
        shift
        goto next
:end

set PARAMS=%PARAMS:\=/%

c:\bin\putty\plink.exe -C -batch -l %LOGIN% %REMOTE% cd %SRCDIR%; %SELF% %PARAMS%

At C::B you need to make copy of "GNU GCC Compiler" and name it "Remote GNU GCC Compiler".
Go to Settings>Compiler and Debugger>Remote GNU GCC Compiler>Other>Advanced and add
Code
$(login) $(remote) $(srcdir)
to each profile after first variable.
At C::B in Build options you need to set custom variables login, remote, srcdir for targets.
« Last Edit: November 22, 2006, 08:26:12 am by Rigel »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: C::B & Uniwin
« Reply #16 on: November 22, 2006, 04:07:06 pm »
Here is some kind tutorial to make it work on Windows 5.0 and later:
Very nice! Thanks! :D ...and luckily it worked. ;-)
I'll now try to do the same and then place an article into the WiKi.
With regards, Morten.

Edit: There it goes: What version of Uniwin are you using? It seems there are two - the (outdated?!) sourceforge.net and a commercial one...?!
« Last Edit: November 22, 2006, 04:11:06 pm by MortenMacFly »
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Rigel

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: C::B & Uniwin
« Reply #17 on: November 23, 2006, 06:50:22 am »
I was using sf.net's version of uniwin.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: C::B & Uniwin
« Reply #18 on: December 06, 2006, 01:57:26 pm »
I have updated C::B to work with compilers that expect forward slashes as path separators so it is now much easier to setup Uniwin with C::B.

Full documentation can be found here. Enjoy :).
« Last Edit: December 06, 2006, 02:18:42 pm by mandrav »
Be patient!
This bug will be fixed soon...

Offline Rigel

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: C::B & Uniwin
« Reply #19 on: December 06, 2006, 02:15:58 pm »
Thanks alot =)

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: C::B & Uniwin
« Reply #20 on: December 06, 2006, 02:41:54 pm »
I have updated C::B to work with compilers that expect forward slashes as path separators so it is now much easier to setup Uniwin with C::B.
That is sooooo great! :D I struggled around with the setup but actually were facing exactly this problem. I was wondering anyway how somebody already could use uniwin...?! Nice stuff... will try immediately because this could be really of help at work...
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: C::B & Uniwin
« Reply #21 on: December 07, 2006, 11:38:20 am »
Another update, regarding debugging through Uniwin.

The good news is that it works :).
The bad news is that a small patch is needed for Uniwin's proxy gdb.exe.
Attached to this message you can find the patched gdb.exe which you should copy in Uniwin's folder, replacing the existing one. And you also need C::B revision 3350 and up ;).

[attachment deleted by admin]
Be patient!
This bug will be fixed soon...

wbest116

  • Guest
Re: C::B & Uniwin
« Reply #22 on: January 02, 2007, 01:13:04 pm »
Thanks for update about forward slashes, but I have confused yet because of mismatch of correted file.

For example...

If I modify a file "test.cpp" and save modified file in C::B then "test.cpp" is removed in linux because I set Uniwin's option "Operations on deleting" to "always deleted".

but "not delete" option gives occation to remain "test.cpp.backup" in linux and "test.cpp" does not exist.

Here is the Uniwin's log:
  File Name Changed:C:/work/test.cpp to: C:/work/test.cpp.backup
    => mv /home/test.cpp /home/test.cpp.backup
  File Name Changed:C:/work/test.cpp.cbTemp to: C:/work/test.cpp
    => mv /home/test.cpp.cbTemp /home/test.cpp
  local: C:/work/test.cpp
            ==>  remote:  /home/test.cpp
  File Removed: C:/work/test.cpp.backup
            ==> rm -fr /home/test.cpp.backup

Here is the Linux's .bash_history:
  mv "/home/test.cpp" "/home/test.cpp.backup"
  mv "/home/test.cpp.cbTemp" "/home/test.cpp"

More confused is mismatch result with two logs.

It is not for use gdb.exe just for modify a file which does not pass by compile course.

Thanks.
« Last Edit: January 03, 2007, 01:02:27 am by wbest116 »

tfoell

  • Guest
Re: C::B & Uniwin
« Reply #23 on: March 17, 2008, 10:36:20 am »
I will use uniwin for a new project.
CodeBlocks run under winxp and i will debug/compile on a ubuntu machine.
1. Uniwin is running ! Test button for ssh and sftp is working.
2. But if i change a file on the winxp via CodeBlocks this file is renamed on the remote ubuntu from main.c to main.c.backup ???????
If i use Visual Studion instead of CodeBlocks it seem to work !

But i will use CodeBlocks !
Any Idea ?

3. Is there another way to do remote debugging ?

tobias

seanhoo

  • Guest
Re: C::B & Uniwin
« Reply #24 on: April 29, 2009, 05:25:05 pm »
I will use uniwin for a new project.
CodeBlocks run under winxp and i will debug/compile on a ubuntu machine.
1. Uniwin is running ! Test button for ssh and sftp is working.
2. But if i change a file on the winxp via CodeBlocks this file is renamed on the remote ubuntu from main.c to main.c.backup ???????
If i use Visual Studion instead of CodeBlocks it seem to work !

But i will use CodeBlocks !
Any Idea ?

3. Is there another way to do remote debugging ?


tobias



no answer YET?

Offline ZooLoo

  • Single posting newcomer
  • *
  • Posts: 8
Re: C::B & Uniwin
« Reply #25 on: April 19, 2011, 09:19:54 am »
Hi

I'm using private key to logon the remote host (putty ppk file).
The question is what to do with all the stuff in this case?

Uniwin doesn't have settings to setup the private key file instead of "login/password"
Here is always place for Ы.

Offline Rigel

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: C::B & Uniwin
« Reply #26 on: April 23, 2011, 10:20:18 am »
Hi

I'm using private key to logon the remote host (putty ppk file).
The question is what to do with all the stuff in this case?

Uniwin doesn't have settings to setup the private key file instead of "login/password"
Just load *.ppk into your pagent

Offline ZooLoo

  • Single posting newcomer
  • *
  • Posts: 8
Re: C::B & Uniwin
« Reply #27 on: April 23, 2011, 01:18:14 pm »
Thaks Rigel I'll try this...
Here is always place for Ы.