Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: oBFusCATed on September 29, 2019, 02:27:46 pm

Title: Contrib plugins fail to run/debug
Post by: oBFusCATed on September 29, 2019, 02:27:46 pm
Am I the only one that cannot run or debug contrib plugins from the CodeBlocks_wx30-unix.workspace or CodeBlocks-unix.workspace?
I think this worked in the past, but I might be wrong. Currently every plugin fails to start, because it cannot find the resources.

And I have to use a patch like:
Code
@@ -6,15 +6,16 @@
  <Option pch_mode="2" />
  <Option compiler="gcc" />
  <Build>
  <Target title="default">
  <Option output="../../../devel30/share/codeblocks/plugins/AutoVersioning" prefix_auto="1" extension_auto="1" />
+ <Option working_dir="../../../devel30/" />
  <Option object_output="../../../.objs30/plugins/contrib/AutoVersioning" />
  <Option type="3" />
  <Option compiler="gcc" />
  <Option parameters="--debug-log --multiple-instance -ns -ni -p debug" />
- <Option host_application="../../../devel30/codeblocks" />
+ <Option host_application="./codeblocks" />
  <Option run_host_application_in_terminal="0" />
  <Compiler>
  <Add option="$(#CB_RELEASE_TYPE)" />
  <Add option="`$(WX_CONFIG) --cflags`" />
  <Add option="-fPIC" />

I've tried an old version and it had the same problem.
I've tried to revert my recent commit related to the relative paths to the resources and it failed without it.

Am I remembering wrong and this never worked or something broke recently?
Title: Re: Contrib plugins fail to run/debug
Post by: BlueHazzard on September 29, 2019, 08:27:29 pm
(i am going to ask the obvious) Have you run the update scipts?
For me on windows this works as expected:
1) Open Workspace
2) Select (for example) wxSmith
3) Build and run
Title: Re: Contrib plugins fail to run/debug
Post by: oBFusCATed on September 29, 2019, 09:25:54 pm
(i am going to ask the obvious) Have you run the update scipts?
Update scripts matter only the first type and obviously I've run them if the provided patch has a chance to work at all. :)

What version are you running as a host cb? Which workspace are you using?
Title: Re: Contrib plugins fail to run/debug
Post by: BlueHazzard on September 29, 2019, 10:20:57 pm
Quote
What version are you running as a host cb
last trunk before your commits today

Quote
Which workspace are you using?
wx31_64
Title: Re: Contrib plugins fail to run/debug
Post by: osdt on September 29, 2019, 11:44:09 pm
... Currently every plugin fails to start, because it cannot find the resources. ...

It's not reproducible here on Ubuntu 18.04. Using a clean build of CodeBlocks_wx30-unix.workspace (svn trunk), ran ./update30, I'm able to run/debug any plugin even with the newly compiled ./output30/codeblocks executable.
Title: Re: Contrib plugins fail to run/debug
Post by: oBFusCATed on September 30, 2019, 12:54:23 am
To be clear what I do is:
1. Open the workspace
2. Set the plugin project as active
3. Select Build -> Run or Debug -> Start

Do these work for you?
Title: Re: Contrib plugins fail to run/debug
Post by: osdt on September 30, 2019, 01:08:30 am
Yes it does, flawlessly.
Title: Re: Contrib plugins fail to run/debug
Post by: oBFusCATed on September 30, 2019, 01:18:48 am
What version of C::B are you using to open the workspace?
Title: Re: Contrib plugins fail to run/debug
Post by: osdt on September 30, 2019, 08:29:41 pm
What version of C::B are you using to open the workspace?

I've used svn #11825, slightly modified for my personal usecase.

To check if current trunk (#11866) works, I did simply run "./output30/run.sh CodeBlocks_wx30-unix.workspace", set 'AutoVersioning' as the active project, hit run and/or debug. It works as expected. The debug-log below shows #11866 (./output30) debugging #11866 (./devel30):
Code
Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
default
Adding source dir: /share/daten/c/osdt/codeblocks/gitsvn/src/plugins/contrib/AutoVersioning/
Adding source dir: /share/daten/c/osdt/codeblocks/gitsvn/src/plugins/contrib/AutoVersioning/
Adding file: ../../../devel30/codeblocks
Changing directory to: /share/daten/c/osdt/codeblocks/gitsvn/src/plugins/contrib/AutoVersioning/.
Set variable: LD_LIBRARY_PATH=.:/share/daten/c/osdt/codeblocks/gitsvn/src/devel30:/usr/lib/x86_64-linux-gnu:/share/daten/c/osdt/codeblocks/gitsvn/src/output30:
Starting debugger: /usr/bin/gdb -nx -fullname -quiet  -args ../../../devel30/codeblocks
Setting SHELL to '/bin/sh'
done
Setting breakpoints
Debugger name and version: GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git
No source file named /share/daten/c/osdt/codeblocks/gitsvn/src/plugins/contrib/AutoVersioning/AutoVersioning.cpp.
Haltepunkt 2 ("/share/daten/c/osdt/codeblocks/gitsvn/src/plugins/contrib/AutoVersioning/AutoVersioning.cpp:68") anstehend.
Child process PID: 11977
At /share/daten/c/osdt/codeblocks/gitsvn/src/plugins/contrib/AutoVersioning/AutoVersioning.cpp:69
Continuing...
Title: Re: Contrib plugins fail to run/debug
Post by: oBFusCATed on July 26, 2020, 07:49:37 pm
It turned out that the code in prefix.cpp doesn't work on my os.
I've removed it and replaced it with wx calls.

Anyone willing to test it on something different than modern Gentoo Linux?
Here is the branch https://github.com/obfuscated/codeblocks_sf/tree/experiments/prefix

p.s. I'll test it soon on macOS.
Title: Re: Contrib plugins fail to run/debug
Post by: BlueHazzard on July 27, 2020, 05:43:14 pm
This only affects linux?
Title: Re: Contrib plugins fail to run/debug
Post by: oBFusCATed on July 27, 2020, 08:38:29 pm
Everything non-windows. If you can test if stdpaths work on windows I'll be happy to remove this ifdef, too.

The --prefix feature seems to be non-windows only, too and this is strange.