Comments (14)
I should have suggested this to start with, but if you check what the pre-processor emits in debug mode, you'll see the expected code path is actually getting compiled:
g++ -DDEBUG --std=c++17 -Wpedantic -Wall -g -DSCI_OWNREGEX \
-I../../scintilla/include -I../../lexilla/include -I../src \
-I../src/ScintillaComponent -I../src/TinyXml -I../src/TinyXml/tinyXmlA \
-I../src/MISC/Common -I../src//MISC/PluginsManager -I../src/MISC/Process \
-I../src/WinControls/AboutDlg -I../src/WinControls -I../src/WinControls/AnsiCharPanel \
-I../src/WinControls/ContextMenu -I../src/WinControls/ColourPicker \
-I../src/WinControls/TabBar -I../src/WinControls//ImageListSet \
-I../src/WinControls/StaticDialog -I../src/WinControls/shortcut \
-I../src/WinControls/ToolBar -I../src/json -I../../boostregex \
-E ../src/WinControls/PluginsAdmin/pluginsAdmin.cpp > pluginsAdmin.pre.processed.cpp
That leaves the question of why GDB appeared to be stepping into the release code path in your screen capture. đ€
from npppluginlist.
Sorry I didn't spot it above.
from npppluginlist.
It looks like the issue is that a debug build of gcc does not count as a debug version :-(
from npppluginlist.
It looks like the issue is that a debug build of gcc does not count as a debug version :-(
Did you define _DEBUG
for the GCC compiler, the way the VC++ project file does for MSVC?
nppPluginList/vcxproj/nppPluginList.vcxproj
Line 160 in 567f7b8
Other relevant info:
-
what compiler, linker flags are you using?
-
32- or 64-bit? I believe MinGW will decorate functions with the
@n
suffix in 32-bit mode unless you pass--kill-at
to the linker
from npppluginlist.
Thank you for your interest in my problem.
It looks like gcc wants to see an environment variable called DEBUG with some value, so I defined DEBUG=1 and it creates a debug build. The file is > 100MB and I can use gdb to see the symbols.
For the build process I followed the instructions on how to build with gcc.
I opened a git-bash, exported DEBUG=1 and ran mingw32-make.
Don't be confused by the name, it still sees that I'm on x64 and builds a 64bit executable.
But you are right that DEBUG is not passed to the build. In the makefile would be a
CPP_DEFINE += DEBUG
but this is commented and if I comment it out then the build fails.
Probably the reason why it is commented.
from npppluginlist.
Sorry to ask another silly question, but did you also try editing the pl.x64.json
manifest under src
and recompiling nppPluginList.dll? Ordinarily the list is embedded as a resource string:
Lines 33 to 37 in 567f7b8
To be honest, I wasn't aware you could edit an external manifest and have it dynamically loaded by the module đ
from npppluginlist.
Don't be sorry - I'm grateful for any help I get.
No, I didn't, I followed the instruction from the manual ... hmm ... maybe that's one way to make it work.
I'll give it a try. Thank you very much. :-)
from npppluginlist.
Thank you for all the testing and research you do.
I have not used the VERBOSE environment variable before and yes, that makes it even more confusing ... we should assume it has DEBUG defined ... but I don't see the pre-processing step being done for me.
These are the only two instances of pluginsAdmin.cpp that I see, and I don't see any line with -E
at all.
I do see a couple of lines starting with g++ -DDEBUG ...
but not for pluginsAdmin.
from npppluginlist.
Btw ... I'm using g++.exe (MinGW-W64 x86_64-posix-seh, built by Brecht Sanders) 11.2.0
I think, that is the one you use as well, correct?
from npppluginlist.
Maybe you want to check:
https://github.com/chcg/notepad-plus-plus/blob/master/PowerEditor/gcc/makefile#L63
unclear why it is commented out.
from npppluginlist.
Thanks - I tried that already, with the result that the compilation fails. I assume that is why it is commented.
from npppluginlist.
I tried that already, with the result that the compilation fails.
In fact, it fails at exactly the code path you want: the call to PluginsAdminDlg::initFromJson()
:
../src/WinControls/PluginsAdmin/pluginsAdmin.cpp: In member function 'bool PluginsAdminDlg::initFromJson()':
../src/WinControls/PluginsAdmin/pluginsAdmin.cpp:709:55: error: no matching function for call to 'std::basic_ifstream<char>::basic_ifstream(generic_string&)'
709 | ifstream nppPluginListJson(_pluginListFullPath);
| ^
In file included from ../src/WinControls/PluginsAdmin/pluginsAdmin.cpp:20:
c:\winlibs-mingw-msvcrt\current\include\c++\11.2.0\fstream:584:9: note: candidate: 'template<class _Path, class _Require> std::basic_ifstream<_CharT, _Traits>::basic_ifstream(const _Path&, std::ios_base::openmode) [with _Path = _Path; _Require = _Require; _CharT = char; _Traits = std::char_traits<char>]'
584 | basic_ifstream(const _Path& __s,
| ^~~~~~~~~~~~~~
c:\winlibs-mingw-msvcrt\current\include\c++\11.2.0\fstream:584:9: note: template argument deduction/substitution failed:
c:\winlibs-mingw-msvcrt\current\include\c++\11.2.0\fstream:583:32: error: 'class std::__cxx11::basic_string<wchar_t>' has no member named 'make_preferred'
583 | template<typename _Path, typename _Require = _If_fs_path<_Path>>
| ^~~~~~~~
c:\winlibs-mingw-msvcrt\current\include\c++\11.2.0\fstream:592:7: note: candidate: 'std::basic_ifstream<_CharT, _Traits>::basic_ifstream(std::basic_ifstream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits<char>]'
592 | basic_ifstream(basic_ifstream&& __rhs)
| ^~~~~~~~~~~~~~
c:\winlibs-mingw-msvcrt\current\include\c++\11.2.0\fstream:592:39: note: no known conversion for argument 1 from 'generic_string' {aka 'std::__cxx11::basic_string<wchar_t>'} to 'std::basic_ifstream<char>&&'
592 | basic_ifstream(basic_ifstream&& __rhs)
| ~~~~~~~~~~~~~~~~~^~~~~
c:\winlibs-mingw-msvcrt\current\include\c++\11.2.0\fstream:567:7: note: candidate: 'std::basic_ifstream<_CharT, _Traits>::basic_ifstream(const string&, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::string = std::__cxx11::basic_string<char>; std::ios_base::openmode = std::ios_base::openmode]'
567 | basic_ifstream(const std::string& __s,
| ^~~~~~~~~~~~~~
c:\winlibs-mingw-msvcrt\current\include\c++\11.2.0\fstream:567:41: note: no known conversion for argument 1 from 'generic_string' {aka 'std::__cxx11::basic_string<wchar_t>'} to 'const string&' {aka 'const std::__cxx11::basic_string<char>&'}
567 | basic_ifstream(const std::string& __s,
| ~~~~~~~~~~~~~~~~~~~^~~
c:\winlibs-mingw-msvcrt\current\include\c++\11.2.0\fstream:549:7: note: candidate: 'std::basic_ifstream<_CharT, _Traits>::basic_ifstream(const wchar_t*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::ios_base::openmode]'
549 | basic_ifstream(const wchar_t* __s,
| ^~~~~~~~~~~~~~
c:\winlibs-mingw-msvcrt\current\include\c++\11.2.0\fstream:549:37: note: no known conversion for argument 1 from 'generic_string' {aka 'std::__cxx11::basic_string<wchar_t>'} to 'const wchar_t*'
549 | basic_ifstream(const wchar_t* __s,
| ~~~~~~~~~~~~~~~^~~
c:\winlibs-mingw-msvcrt\current\include\c++\11.2.0\fstream:534:7: note: candidate: 'std::basic_ifstream<_CharT, _Traits>::basic_ifstream(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits<char>; std::ios_base::openmode = std::ios_base::openmode]'
534 | basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in)
| ^~~~~~~~~~~~~~
c:\winlibs-mingw-msvcrt\current\include\c++\11.2.0\fstream:534:34: note: no known conversion for argument 1 from 'generic_string' {aka 'std::__cxx11::basic_string<wchar_t>'} to 'const char*'
534 | basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in)
| ~~~~~~~~~~~~^~~
c:\winlibs-mingw-msvcrt\current\include\c++\11.2.0\fstream:523:7: note: candidate: 'std::basic_ifstream<_CharT, _Traits>::basic_ifstream() [with _CharT = char; _Traits = std::char_traits<char>]'
523 | basic_ifstream() : __istream_type(), _M_filebuf()
| ^~~~~~~~~~~~~~
c:\winlibs-mingw-msvcrt\current\include\c++\11.2.0\fstream:523:7: note: candidate expects 0 arguments, 1 provided
mingw32-make[1]: *** [makefile:239: bin.x86_64-debug.build/WinControls/PluginsAdmin/pluginsAdmin.o] Error 1
mingw32-make[1]: *** Waiting for unfinished jobs....
Looks like an issue with MinGW's support of the C++17 standard.
As it currently makes debug builds impossible, there will definitely be a patch against N++ when this gets figured out.
from npppluginlist.
@Ekopalypse, does it work better like this?
diff --git a/PowerEditor/gcc/makefile b/PowerEditor/gcc/makefile
index 4f0ce59f..c97ced4d 100644
--- a/PowerEditor/gcc/makefile
+++ b/PowerEditor/gcc/makefile
@@ -60,7 +60,7 @@ else
BUILD_TYPE := debug
BUILD_SUFFIX := -debug
CXXFLAGS += -Og -g -Wall -Wpedantic -Wconversion-null
-#CPP_DEFINE += DEBUG
+CPP_DEFINE += DEBUG
endif
#
diff --git a/PowerEditor/src/WinControls/PluginsAdmin/pluginsAdmin.cpp b/PowerEditor/src/WinControls/PluginsAdmin/pluginsAdmin.cpp
index 8a091ad1..34f52373 100644
--- a/PowerEditor/src/WinControls/PluginsAdmin/pluginsAdmin.cpp
+++ b/PowerEditor/src/WinControls/PluginsAdmin/pluginsAdmin.cpp
@@ -706,7 +706,11 @@ bool PluginsAdminDlg::initFromJson()
#ifdef DEBUG // if not debug, then it's release
// load from nppPluginList.json instead of nppPluginList.dll
+#ifdef __MINGW32__
+ ifstream nppPluginListJson(_pluginListFullPath.c_str());
+#else
ifstream nppPluginListJson(_pluginListFullPath);
+#endif
nppPluginListJson >> j;
#else //RELEASE
0001-Fix-GCC-Debug-build.diff.txt
from npppluginlist.
Brilliant, YES, this works!!
Thank you very much.
Don't be confused by the "build time", it still shows yesterday's date because I replaced the existing exe with the newly created exe.
from npppluginlist.
Related Issues (20)
- SelectToClipboard Plugin Update HOT 1
- TextFX in plugin list HOT 1
- DocMonitor plugin HOT 1
- Dark Theme Mode pulled from GitHub? HOT 3
- Checksum pattern throws `re.error` with Python 3.11
- Missing plugin HOT 2
- TextFX plugin update HOT 1
- doc/plugin_list Markdown table syntax compatibility - empty line missing before tables HOT 2
- Can't open Notepad++ ver. 8.5.1 HOT 2
- Ndjson support ? HOT 3
- Compare Plugin redirects to the ComparePlus Plugin HOT 1
- NppQrCode pulled from GitHub?
- Adding GZ viewer? HOT 3
- notepad++ æ°çèœćŠćźç°..... HOT 1
- CSVLint Plug-in crashing HOT 2
- Add Opera browser to "view as" list. HOT 1
- Task List URL not up to date? HOT 1
- Permanently in overtype mode, regardless of what the editor says HOT 1
- How to pre-install plugins HOT 1
- WinGup fails to download Preview HTML (still) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
đ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. đđđ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google â€ïž Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from npppluginlist.