Skip to content
This repository was archived by the owner on Feb 20, 2024. It is now read-only.

Allow hosted application for all targets. #22

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

WinterMute
Copy link

This patch allows running any target with a hosted application which allows developers to use run to, for example, launch the target binary in an emulator or send it to an embedded target. This also solves the issue in https://forums.codeblocks.org/index.php/topic,19390.new.html

The second commit simply allows environment variables to be used in the hosted application and execution parameters strings which I find useful.

Is there some issue with the forums now? I keep getting database errors while trying to even browse unless I constantly clear cookies. It says to contact an administrator but doesn't seem to provide a means to contact one. I have other patches I'd like to upstream but they need some more discussion & advice.

@obfuscated
Copy link
Owner

Is there some issue with the forums now? I keep getting database errors while trying to even browse unless I constantly clear cookies. It says to contact an administrator but doesn't seem to provide a means to contact one. I have other patches I'd like to upstream but they need some more discussion & advice.

Yes, there is some problem with IPv6 in SMF. If you disable it locally it should work better/without these problems.

@@ -2019,42 +2019,39 @@ int CompilerGCC::Run(ProjectBuildTarget* target)
}

if ( target->GetTargetType() == ttDynamicLib
|| target->GetTargetType() == ttStaticLib )
|| target->GetTargetType() == ttStaticLib
|| target->GetTargetType() == ttCommandsOnly )
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not repeat the call to GetTargetType. Store it in a variable.

Manager::Get()->GetMacrosManager()->ReplaceMacros(command, target);
Manager::Get()->GetMacrosManager()->ReplaceEnvVars(command);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bluehazzard recently removed this call. Why do you need it back?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use different host applications for testing the same target fairly often - i.e. running the target in an emulator on my build system, sending the target over network to physical hardware or sometimes even passing through a tool that flashes the physical device & then runs the code that way. I find it convenient to set the appropriate host via an environment variable per session and have the hosted application set to, for instance, $HOSTAPP. This also means that different build machines and developers can share the same project file, use the host application most convenient for them and not interfere with each other in source control.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this this new added line necessary? According to @bluehazzard this is not the case and only the first line is enough to get the desired behaviour. He removed this line very recently.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll check, this PR has been hanging around for eons &I only just started playing around with code::blocks again.

// each shell execution must be enclosed to "":
// xterm -T X -e /bin/sh -c "/usr/bin/cb_console_runner X"
// here is last \"
if (commandIsQuoted) command << strQUOTE;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Place this on new line please.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean the body of the if, like this?

if (commandIsQuoted)
     command << strQUOTE;

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this was the way it was written before your change. It makes debugging easier, because you can put a breakpoint on the body of the if.

@WinterMute
Copy link
Author

Yes, there is some problem with IPv6 in SMF. If you disable it locally it should work better/without these problems.

Aweome, that fixed it. Thanks! :)

bluehazzard added a commit to bluehazzard/codeblocks_sf that referenced this pull request Jul 3, 2021
…use this will interfere with hide log pane (fix ticket obfuscated#22)

git-svn-id: https://svn.code.sf.net/p/codeblocks/code/trunk@12326 2a5c6006-c6dd-42ca-98ab-0921f2732cef
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants