diff -Nru codeblocks-20.03svn12487~ubuntu16.04/codeblocks.plist codeblocks-20.03svn12516~ubuntu16.04/codeblocks.plist --- codeblocks-20.03svn12487~ubuntu16.04/codeblocks.plist 2021-07-09 23:19:29.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/codeblocks.plist 2021-08-28 20:59:29.000000000 +0000 @@ -25,7 +25,7 @@ CFBundleGetInfoString CodeBlocks version 20.03, (c) 2004-2020 Code::Blocks CFBundleLongVersionString - CodeBlocks version 20.03 SVN revision 12487, (c) 2004-2020 Code::Blocks + CodeBlocks version 20.03 SVN revision 12516, (c) 2004-2020 Code::Blocks NSHumanReadableCopyright Copyright 2004-2020, The Code::Blocks Team CFBundleIdentifier diff -Nru codeblocks-20.03svn12487~ubuntu16.04/codeblocks.spec codeblocks-20.03svn12516~ubuntu16.04/codeblocks.spec --- codeblocks-20.03svn12487~ubuntu16.04/codeblocks.spec 2021-07-09 23:19:29.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/codeblocks.spec 2021-08-28 20:59:29.000000000 +0000 @@ -1,4 +1,4 @@ -%define _svnrev 12487 +%define _svnrev 12516 %define req_wxgtk 2.8.0 %define _redhat %(if [ -f /etc/redhat-release ]; then echo 1; else echo 0; fi) %define _mandrake %(if [ -f /etc/mandrake-release ]; then echo 1; else echo 0; fi) @@ -61,7 +61,7 @@ Group: Development/Tools License: GPLv3+ URL: http://www.codeblocks.org/ -Source: %{name}-20.03svn12487.tar.bz2 +Source: %{name}-20.03svn12516.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot Requires: %{name}-libs%{?_isa} = %{version} Requires: xterm @@ -221,7 +221,7 @@ %prep -%setup -q -n codeblocks-20.03svn12487 +%setup -q -n codeblocks-20.03svn12516 %{?suse_update_libdir:%{suse_update_libdir}} %{?suse_update_config:%{suse_update_config -f}} diff -Nru codeblocks-20.03svn12487~ubuntu16.04/codeblocks.spec.fedora codeblocks-20.03svn12516~ubuntu16.04/codeblocks.spec.fedora --- codeblocks-20.03svn12487~ubuntu16.04/codeblocks.spec.fedora 2021-07-09 23:19:29.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/codeblocks.spec.fedora 2021-08-28 20:59:29.000000000 +0000 @@ -1,4 +1,4 @@ -%global svnrev 12487 +%global svnrev 12516 Name: codeblocks Version: 20.03.svn.%{svnrev} @@ -6,7 +6,7 @@ Summary: An open source, cross platform, free C++ IDE License: GPLv3+ URL: http://www.codeblocks.org/ -Source0: %{name}-20.03svn12487.tar.bz2 +Source0: %{name}-20.03svn12516.tar.bz2 BuildRequires: libtool BuildRequires: wxGTK-devel @@ -90,7 +90,7 @@ %prep -%setup -q -n %{name}-20.03svn12487 +%setup -q -n %{name}-20.03svn12516 ./bootstrap diff -Nru codeblocks-20.03svn12487~ubuntu16.04/configure codeblocks-20.03svn12516~ubuntu16.04/configure --- codeblocks-20.03svn12487~ubuntu16.04/configure 2021-07-09 23:19:29.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/configure 2021-08-28 20:59:29.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for codeblocks 20.03svn12487. +# Generated by GNU Autoconf 2.69 for codeblocks 20.03svn12516. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -587,8 +587,8 @@ # Identity of this package. PACKAGE_NAME='codeblocks' PACKAGE_TARNAME='codeblocks' -PACKAGE_VERSION='20.03svn12487' -PACKAGE_STRING='codeblocks 20.03svn12487' +PACKAGE_VERSION='20.03svn12516' +PACKAGE_STRING='codeblocks 20.03svn12516' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1636,7 +1636,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures codeblocks 20.03svn12487 to adapt to many kinds of systems. +\`configure' configures codeblocks 20.03svn12516 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1712,7 +1712,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of codeblocks 20.03svn12487:";; + short | recursive ) echo "Configuration of codeblocks 20.03svn12516:";; esac cat <<\_ACEOF @@ -1917,7 +1917,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -codeblocks configure 20.03svn12487 +codeblocks configure 20.03svn12516 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2457,7 +2457,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by codeblocks $as_me 20.03svn12487, which was +It was created by codeblocks $as_me 20.03svn12516, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3656,7 +3656,7 @@ # Define the identity of the package. PACKAGE='codeblocks' - VERSION='20.03svn12487' + VERSION='20.03svn12516' cat >>confdefs.h <<_ACEOF @@ -24853,11 +24853,11 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: Configuring Code::Blocks..." >&5 $as_echo "$as_me: Configuring Code::Blocks..." >&6;} -{ $as_echo "$as_me:${as_lineno-$LINENO}: SVN revision 20.03svn12487 (2021-07-07 17:47:29)" >&5 -$as_echo "$as_me: SVN revision 20.03svn12487 (2021-07-07 17:47:29)" >&6;} -REVISION=12487 +{ $as_echo "$as_me:${as_lineno-$LINENO}: SVN revision 20.03svn12516 (2021-08-15 16:35:46)" >&5 +$as_echo "$as_me: SVN revision 20.03svn12516 (2021-08-15 16:35:46)" >&6;} +REVISION=12516 -DATE="2021-07-07 17:47:29" +DATE="2021-08-15 16:35:46" if test "x${target_vendor}" = "xapple"; then @@ -26160,7 +26160,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by codeblocks $as_me 20.03svn12487, which was +This file was extended by codeblocks $as_me 20.03svn12516, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -26226,7 +26226,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -codeblocks config.status 20.03svn12487 +codeblocks config.status 20.03svn12516 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -Nru codeblocks-20.03svn12487~ubuntu16.04/debian/changelog codeblocks-20.03svn12516~ubuntu16.04/debian/changelog --- codeblocks-20.03svn12487~ubuntu16.04/debian/changelog 2021-07-09 23:19:29.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/debian/changelog 2021-08-28 20:59:29.000000000 +0000 @@ -1,8 +1,8 @@ -codeblocks (20.03svn12487~ubuntu16.04) xenial; urgency=medium +codeblocks (20.03svn12516~ubuntu16.04) xenial; urgency=medium * New svn revision - -- Teodor Petrov Sat, 10 Jul 2021 02:19:29 +0300 + -- Teodor Petrov Sat, 28 Aug 2021 23:59:29 +0300 codeblocks (20.03svn12027) unstable; urgency=medium diff -Nru codeblocks-20.03svn12487~ubuntu16.04/debian/changelog.original codeblocks-20.03svn12516~ubuntu16.04/debian/changelog.original --- codeblocks-20.03svn12487~ubuntu16.04/debian/changelog.original 2021-07-09 23:19:29.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/debian/changelog.original 2021-08-28 20:59:29.000000000 +0000 @@ -1,8 +1,8 @@ -codeblocks (20.03svn12487) UNRELEASED; urgency=medium +codeblocks (20.03svn12516) UNRELEASED; urgency=medium * New svn revision - -- Teodor Petrov Sat, 10 Jul 2021 02:19:29 +0300 + -- Teodor Petrov Sat, 28 Aug 2021 23:59:29 +0300 codeblocks (20.03svn12027) unstable; urgency=medium diff -Nru codeblocks-20.03svn12487~ubuntu16.04/revision.m4 codeblocks-20.03svn12516~ubuntu16.04/revision.m4 --- codeblocks-20.03svn12487~ubuntu16.04/revision.m4 2021-07-09 23:19:29.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/revision.m4 2021-08-28 20:59:29.000000000 +0000 @@ -1,3 +1,3 @@ -m4_define([SVN_REV], 12487) -m4_define([SVN_REVISION], 20.03svn12487) -m4_define([SVN_DATE], 2021-07-07 17:47:29) +m4_define([SVN_REV], 12516) +m4_define([SVN_REVISION], 20.03svn12516) +m4_define([SVN_DATE], 2021-08-15 16:35:46) diff -Nru codeblocks-20.03svn12487~ubuntu16.04/src/CodeBlocks_wx30-unix.cbp codeblocks-20.03svn12516~ubuntu16.04/src/CodeBlocks_wx30-unix.cbp --- codeblocks-20.03svn12487~ubuntu16.04/src/CodeBlocks_wx30-unix.cbp 2021-05-12 18:03:26.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/src/CodeBlocks_wx30-unix.cbp 2021-08-28 20:59:15.000000000 +0000 @@ -567,6 +567,9 @@ + + @@ -2121,6 +2124,9 @@ + + diff -Nru codeblocks-20.03svn12487~ubuntu16.04/src/CodeBlocks_wx31_64.cbp codeblocks-20.03svn12516~ubuntu16.04/src/CodeBlocks_wx31_64.cbp --- codeblocks-20.03svn12487~ubuntu16.04/src/CodeBlocks_wx31_64.cbp 2021-05-12 18:03:25.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/src/CodeBlocks_wx31_64.cbp 2021-08-28 20:59:15.000000000 +0000 @@ -779,6 +779,9 @@ + + @@ -2331,6 +2334,9 @@ + + diff -Nru codeblocks-20.03svn12487~ubuntu16.04/src/CodeBlocks_wx31.cbp codeblocks-20.03svn12516~ubuntu16.04/src/CodeBlocks_wx31.cbp --- codeblocks-20.03svn12487~ubuntu16.04/src/CodeBlocks_wx31.cbp 2021-05-12 18:03:25.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/src/CodeBlocks_wx31.cbp 2021-08-28 20:59:15.000000000 +0000 @@ -778,6 +778,9 @@ + + @@ -2332,6 +2335,9 @@ + + diff -Nru codeblocks-20.03svn12487~ubuntu16.04/src/include/autorevision.h codeblocks-20.03svn12516~ubuntu16.04/src/include/autorevision.h --- codeblocks-20.03svn12487~ubuntu16.04/src/include/autorevision.h 2021-07-09 23:19:29.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/src/include/autorevision.h 2021-08-28 20:59:29.000000000 +0000 @@ -1,4 +1,4 @@ -/*12487*/ +/*12516*/ //don't include this header, only configmanager-revision.cpp should do this. #ifndef AUTOREVISION_H #define AUTOREVISION_H @@ -8,9 +8,9 @@ namespace autorevision { - const unsigned int svn_revision = 12487; - const wxString svnRevision(_T("12487")); - const wxString svnDate(_T("2021-07-07 17:47:29")); + const unsigned int svn_revision = 12516; + const wxString svnRevision(_T("12516")); + const wxString svnDate(_T("2021-08-15 16:35:46")); } diff -Nru codeblocks-20.03svn12487~ubuntu16.04/src/include/cbplugin.h codeblocks-20.03svn12516~ubuntu16.04/src/include/cbplugin.h --- codeblocks-20.03svn12487~ubuntu16.04/src/include/cbplugin.h 2021-07-04 10:20:31.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/src/include/cbplugin.h 2021-08-28 20:59:15.000000000 +0000 @@ -37,7 +37,7 @@ // this is the plugins SDK version number // it will change when the SDK interface breaks #define PLUGIN_SDK_VERSION_MAJOR 2 -#define PLUGIN_SDK_VERSION_MINOR 11 +#define PLUGIN_SDK_VERSION_MINOR 14 #define PLUGIN_SDK_VERSION_RELEASE 0 // class decls diff -Nru codeblocks-20.03svn12487~ubuntu16.04/src/include/cygwin.h codeblocks-20.03svn12516~ubuntu16.04/src/include/cygwin.h --- codeblocks-20.03svn12487~ubuntu16.04/src/include/cygwin.h 1970-01-01 00:00:00.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/src/include/cygwin.h 2021-08-28 20:59:15.000000000 +0000 @@ -0,0 +1,15 @@ +/* + * This file is part of the Code::Blocks IDE and licensed under the GNU Lesser General Public License, version 3 + * http://www.gnu.org/licenses/lgpl-3.0.html + */ +#ifndef CODEBLOCKS_SDK_CYGWIN_H +#define CODEBLOCKS_SDK_CYGWIN_H + +#include "settings.h" + +extern DLLIMPORT bool cbIsDetectedCygwinCompiler(void); +extern DLLIMPORT wxString cbGetCygwinCompilerPathRoot(void); +extern DLLIMPORT void cbGetWindowsPathFromCygwinPath(wxString& path); +extern DLLIMPORT void cbGetCygwinPathFromWindowsPath(wxString& path); + +#endif // CODEBLOCKS_SDK_CYGWIN_H diff -Nru codeblocks-20.03svn12487~ubuntu16.04/src/include/macrosmanager.h codeblocks-20.03svn12516~ubuntu16.04/src/include/macrosmanager.h --- codeblocks-20.03svn12487~ubuntu16.04/src/include/macrosmanager.h 2021-05-12 18:03:25.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/src/include/macrosmanager.h 2021-08-28 20:59:15.000000000 +0000 @@ -71,12 +71,13 @@ wxRegEx m_RE_To83Path; wxRegEx m_RE_RemoveQuotes; UserVariableManager *m_UserVarMan; - + bool m_Valid; private: MacrosManager(); ~MacrosManager() override; wxString EvalCondition(const wxString& cond, const wxString& true_clause, const wxString& false_clause, const ProjectBuildTarget* target); int MatchBrace(const wxString& buffer, int index); + bool CompileRegexes(); }; #endif // MACROSMANAGER_H diff -Nru codeblocks-20.03svn12487~ubuntu16.04/src/include/Makefile.am codeblocks-20.03svn12516~ubuntu16.04/src/include/Makefile.am --- codeblocks-20.03svn12487~ubuntu16.04/src/include/Makefile.am 2021-05-12 18:03:23.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/src/include/Makefile.am 2021-08-28 20:59:15.000000000 +0000 @@ -58,6 +58,7 @@ configuretoolsdlg.h \ confirmreplacedlg.h \ crc32.h \ + cygwin.h \ debuggermanager.h \ editarrayfiledlg.h \ editarrayorderdlg.h \ diff -Nru codeblocks-20.03svn12487~ubuntu16.04/src/include/Makefile.in codeblocks-20.03svn12516~ubuntu16.04/src/include/Makefile.in --- codeblocks-20.03svn12487~ubuntu16.04/src/include/Makefile.in 2021-07-09 23:19:29.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/src/include/Makefile.in 2021-08-28 20:59:29.000000000 +0000 @@ -514,6 +514,7 @@ configuretoolsdlg.h \ confirmreplacedlg.h \ crc32.h \ + cygwin.h \ debuggermanager.h \ editarrayfiledlg.h \ editarrayorderdlg.h \ diff -Nru codeblocks-20.03svn12487~ubuntu16.04/src/include/pipedprocess.h codeblocks-20.03svn12516~ubuntu16.04/src/include/pipedprocess.h --- codeblocks-20.03svn12487~ubuntu16.04/src/include/pipedprocess.h 2021-05-12 18:03:23.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/src/include/pipedprocess.h 2021-08-28 20:59:15.000000000 +0000 @@ -23,7 +23,7 @@ bool pipe = true, const wxString& dir = wxEmptyString, int index = -1); // class destructor ~PipedProcess() override; - virtual int Launch(const wxString& cmd, unsigned int pollingInterval = 100); + virtual int Launch(const wxString& cmd, int flags); virtual void SendString(const wxString& text); virtual bool HasInput(); virtual int GetPid(){ return m_Pid; } diff -Nru codeblocks-20.03svn12487~ubuntu16.04/src/include/scripting/bindings/sc_utils.h codeblocks-20.03svn12516~ubuntu16.04/src/include/scripting/bindings/sc_utils.h --- codeblocks-20.03svn12487~ubuntu16.04/src/include/scripting/bindings/sc_utils.h 2021-06-20 14:42:50.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/src/include/scripting/bindings/sc_utils.h 2021-08-28 20:59:15.000000000 +0000 @@ -520,10 +520,7 @@ return true; } - int ErrorMessage() - { - return sq_throwerror(m_vm, m_errorMessage); - } + DLLIMPORT int ErrorMessage(); HSQUIRRELVM GetVM() { return m_vm; } diff -Nru codeblocks-20.03svn12487~ubuntu16.04/src/plugins/astyle/dlgformattersettings.cpp codeblocks-20.03svn12516~ubuntu16.04/src/plugins/astyle/dlgformattersettings.cpp --- codeblocks-20.03svn12487~ubuntu16.04/src/plugins/astyle/dlgformattersettings.cpp 2021-05-12 18:04:34.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/src/plugins/astyle/dlgformattersettings.cpp 2021-08-28 20:59:15.000000000 +0000 @@ -2,8 +2,8 @@ * This file is part of the Code::Blocks IDE and licensed under the GNU General Public License, version 3 * http://www.gnu.org/licenses/gpl-3.0.html * - * $Revision: 11266 $ - * $Id: dlgformattersettings.cpp 11266 2018-01-15 17:54:23Z jenslody $ + * $Revision: 12490 $ + * $Id: dlgformattersettings.cpp 12490 2021-08-05 23:50:23Z fuscated $ * $HeadURL: https://svn.code.sf.net/p/codeblocks/code/trunk/src/plugins/astyle/dlgformattersettings.cpp $ */ @@ -13,6 +13,7 @@ #include #include #include +#include #include DlgFormatterSettings::DlgFormatterSettings(wxWindow *dlg) : diff -Nru codeblocks-20.03svn12487~ubuntu16.04/src/plugins/compilergcc/compilerCYGWIN.cpp codeblocks-20.03svn12516~ubuntu16.04/src/plugins/compilergcc/compilerCYGWIN.cpp --- codeblocks-20.03svn12487~ubuntu16.04/src/plugins/compilergcc/compilerCYGWIN.cpp 2021-05-12 18:03:59.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/src/plugins/compilergcc/compilerCYGWIN.cpp 2021-08-28 20:59:15.000000000 +0000 @@ -2,16 +2,15 @@ * This file is part of the Code::Blocks IDE and licensed under the GNU General Public License, version 3 * http://www.gnu.org/licenses/gpl-3.0.html * - * $Revision: 8649 $ - * $Id: compilerCYGWIN.cpp 8649 2012-12-12 19:18:18Z mortenmacfly $ + * $Revision: 12503 $ + * $Id: compilerCYGWIN.cpp 12503 2021-08-14 15:07:36Z fuscated $ * $HeadURL: https://svn.code.sf.net/p/codeblocks/code/trunk/src/plugins/compilergcc/compilerCYGWIN.cpp $ */ +#include + #include "compilerCYGWIN.h" -#include -#ifdef __WXMSW__ - #include -#endif // __WXMSW__ +#include "cygwin.h" CompilerCYGWIN::CompilerCYGWIN() : CompilerMINGW(_("Cygwin GCC"), _T("cygwin")) @@ -31,55 +30,13 @@ AutoDetectResult CompilerCYGWIN::AutoDetectInstallationDir() { - AutoDetectResult ret = adrGuessed; - m_MasterPath = _T("C:\\Cygwin"); // just a guess - wxString tempMasterPath(m_MasterPath); - bool validInstallationDir = false; - - // look in registry for Cygwin - -#ifdef __WXMSW__ - wxRegKey key; // defaults to HKCR - key.SetName(_T("HKEY_LOCAL_MACHINE\\Software\\Cygwin\\setup")); - if (key.Exists() && key.Open(wxRegKey::Read)) - { - // found CygWin version 1.7 or newer; read it - key.QueryValue(_T("rootdir"), tempMasterPath); - if (wxDirExists(tempMasterPath + wxFILE_SEP_PATH + _T("bin"))) - validInstallationDir = true; - } - if (!validInstallationDir) + if (platform::windows && cbIsDetectedCygwinCompiler()) { - key.SetName(_T("HKEY_LOCAL_MACHINE\\Software\\Cygnus Solutions\\Cygwin\\mounts v2\\/")); - if (key.Exists() && key.Open(wxRegKey::Read)) - { - // found CygWin version 1.5 or older; read it - key.QueryValue(_T("native"), tempMasterPath); - if ( wxDirExists(tempMasterPath + wxFILE_SEP_PATH + _T("bin")) ) - validInstallationDir = true; - } + m_MasterPath = cbGetCygwinCompilerPathRoot(); + return adrDetected; } -#endif // __WXMSW__ - - if (!validInstallationDir) - return ret; - - wxString cProgramDir = tempMasterPath + wxFILE_SEP_PATH + _T("bin") + wxFILE_SEP_PATH; - wxString cProgramFullname = cProgramDir + m_Programs.C; - if ( !wxFileExists(cProgramFullname) ) - return ret; - - wxFile pfFile(cProgramFullname); - if ( !pfFile.IsOpened() ) - return ret; - - char buffer[10] = {0}; - pfFile.Read(buffer,10); - if (memcmp("!", buffer, 10) != 0) + else { - m_MasterPath = tempMasterPath; - ret = adrDetected; + return adrGuessed; } - - return ret; } diff -Nru codeblocks-20.03svn12487~ubuntu16.04/src/plugins/compilergcc/compilergcc.cpp codeblocks-20.03svn12516~ubuntu16.04/src/plugins/compilergcc/compilergcc.cpp --- codeblocks-20.03svn12487~ubuntu16.04/src/plugins/compilergcc/compilergcc.cpp 2021-07-04 10:20:31.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/src/plugins/compilergcc/compilergcc.cpp 2021-08-28 20:59:15.000000000 +0000 @@ -2,8 +2,8 @@ * This file is part of the Code::Blocks IDE and licensed under the GNU General Public License, version 3 * http://www.gnu.org/licenses/gpl-3.0.html * - * $Revision: 12482 $ - * $Id: compilergcc.cpp 12482 2021-07-01 21:43:46Z bluehazzard $ + * $Revision: 12516 $ + * $Id: compilergcc.cpp 12516 2021-08-15 16:35:46Z bluehazzard $ * $HeadURL: https://svn.code.sf.net/p/codeblocks/code/trunk/src/plugins/compilergcc/compilergcc.cpp $ */ @@ -1359,7 +1359,7 @@ if (cmd->isRun) { pipe = false; // no need to pipe output channels... - flags |= wxEXEC_NOHIDE; + flags |= wxEXEC_SHOW_CONSOLE; dir = m_CdRun; // setup dynamic linker path @@ -1393,7 +1393,7 @@ process.OutputFile = (cmd->isLink && cmd->target) ? cmd->target->GetOutputFilename() : wxString(wxEmptyString); process.pProcess = new PipedProcess(&(process.pProcess), this, idGCCProcess, pipe, dir, procIndex); - process.PID = wxExecute(cmd->command, flags, process.pProcess); + process.PID = process.pProcess->Launch(cmd->command, flags); if (!process.PID) { wxString err = wxString::Format(_("Execution of '%s' in '%s' failed."), diff -Nru codeblocks-20.03svn12487~ubuntu16.04/src/plugins/contrib/regex_testbed/regexdlg.cpp codeblocks-20.03svn12516~ubuntu16.04/src/plugins/contrib/regex_testbed/regexdlg.cpp --- codeblocks-20.03svn12487~ubuntu16.04/src/plugins/contrib/regex_testbed/regexdlg.cpp 2021-05-12 18:03:55.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/src/plugins/contrib/regex_testbed/regexdlg.cpp 2021-08-28 20:59:15.000000000 +0000 @@ -2,8 +2,8 @@ * This file is part of the Code::Blocks IDE and licensed under the GNU General Public License, version 3 * http://www.gnu.org/licenses/gpl-3.0.html * - * $Revision: 10293 $ - * $Id: regexdlg.cpp 10293 2015-05-15 10:58:52Z jenslody $ + * $Revision: 12510 $ + * $Id: regexdlg.cpp 12510 2021-08-15 11:51:08Z fuscated $ * $HeadURL: https://svn.code.sf.net/p/codeblocks/code/trunk/src/plugins/contrib/regex_testbed/regexdlg.cpp $ */ @@ -26,8 +26,6 @@ //*) BEGIN_EVENT_TABLE(RegExDlg,wxScrollingDialog) - EVT_INIT_DIALOG(RegExDlg::OnInit) - EVT_UPDATE_UI(-1, RegExDlg::OnUpdateUI) END_EVENT_TABLE() RegExDlg::VisibleDialogs RegExDlg::m_visible_dialogs; @@ -43,6 +41,12 @@ m_newlines = (wxCheckBox*)FindWindow(XRCID("ID_NEWLINES")); m_text = (wxTextCtrl*)FindWindow(XRCID("ID_TEXT")); m_output = (wxHtmlWindow*)FindWindow(XRCID("ID_OUT")); + + Connect(XRCID("ID_REGEX"),wxEVT_COMMAND_TEXT_UPDATED,(wxObjectEventFunction)&RegExDlg::OnValueChanged); + Connect(XRCID("ID_LIBRARY"),wxEVT_COMMAND_CHOICE_SELECTED,(wxObjectEventFunction)&RegExDlg::OnValueChanged); + Connect(XRCID("ID_NOCASE"),wxEVT_COMMAND_CHECKBOX_CLICKED,(wxObjectEventFunction)&RegExDlg::OnValueChanged); + Connect(XRCID("ID_NEWLINES"),wxEVT_COMMAND_CHECKBOX_CLICKED,(wxObjectEventFunction)&RegExDlg::OnValueChanged); + Connect(XRCID("ID_TEXT"),wxEVT_COMMAND_TEXT_UPDATED,(wxObjectEventFunction)&RegExDlg::OnValueChanged); //*) assert(m_regex); @@ -55,6 +59,10 @@ m_text->MoveAfterInTabOrder(m_quoted); +#if wxCHECK_VERSION(3, 1, 6) + m_library->Delete(1); // v3.1.6 made wxRE_ADVANCED a synonym of wxRE_EXTENDED, so delete it +#endif + m_library->SetSelection(0); m_output->SetBorders(0); m_quoted->SetEditable(false); @@ -99,7 +107,7 @@ } } -void RegExDlg::OnUpdateUI(wxUpdateUIEvent& /*event*/) +void RegExDlg::OnValueChanged(cb_unused wxCommandEvent& event) { static wxString regex; static wxString text; @@ -116,14 +124,14 @@ // cannot scroll the text (windows and linux). // - if ( regex == m_regex->GetValue() && + if (regex == m_regex->GetValue() && text == m_text->GetValue() && nocase == m_nocase->GetValue() && newlines == m_newlines->GetValue() && library == m_library->GetSelection()) - { - return; - } + { + return; + } regex = m_regex->GetValue(); text = m_text->GetValue(); @@ -158,48 +166,29 @@ m_output->SetPage(s); } - -void RegExDlg::RunBenchmark(wxCommandEvent& /*event*/) -{ -} - - void RegExDlg::EndModal(int retCode) { wxScrollingDialog::EndModal(retCode); } -void RegExDlg::OnInit(wxInitDialogEvent& /*event*/) -{ -} - -void RegExDlg::OnRegExItemActivated(wxListEvent& /*event*/) -{ - // -} - - wxArrayString RegExDlg::GetBuiltinMatches(const wxString& text) { wxArrayString ret; +#if wxCHECK_VERSION(3, 1, 6) + // wxRE_ADVANCED is a synonym of wxRE_EXTENDED, so it has been deleted from the choice + int flags = m_library->GetSelection() ? wxRE_BASIC : wxRE_EXTENDED; +#else int flags = m_library->GetSelection(); +#endif - if (text.IsEmpty() || flags > 2) // should not be - return ret; + if (m_newlines->IsChecked()) + flags |= wxRE_NEWLINE; - flags |= m_newlines->IsChecked() ? wxRE_NEWLINE : 0; - flags |= m_nocase->IsChecked() ? wxRE_ICASE : 0; + if (m_nocase->IsChecked()) + flags |= wxRE_ICASE; - if (m_wxre.Compile(m_regex->GetValue(), flags)) - { - m_regex->SetForegroundColour(wxNullColour); - m_regex->SetBackgroundColour(wxNullColour); - m_regex->GetParent()->Refresh(); - if (!m_wxre.Matches(text)) - return ret; - } - else + if (!m_wxre.Compile(m_regex->GetValue(), flags)) { m_regex->SetForegroundColour(*wxWHITE); m_regex->SetBackgroundColour(*wxRED); @@ -207,26 +196,16 @@ return ret; } - for(size_t i = 0; i < m_wxre.GetMatchCount(); ++i) - if (!m_wxre.GetMatch(text, i).IsEmpty()) - ret.Add(m_wxre.GetMatch(text, i)); - - return ret; -} - -wxArrayString RegExDlg::GetPregMatches(const wxString& /*text*/) -{ - wxArrayString ret; + m_regex->SetForegroundColour(wxNullColour); + m_regex->SetBackgroundColour(wxNullColour); + m_regex->GetParent()->Refresh(); -// const char *error; -// int erroffset; -// int flags = 0; -// flags |= m_nocase->IsChecked() ? PCRE_CASELESS : 0; -// flags |= m_newlines->IsChecked() ? PCRE_DOTALL : 0; -// pcre *reg = pcre_compile(text.mb_str(), flags, &error, &erroffset, 0); + if (!text.empty() && m_wxre.Matches(text)) + { + const size_t count = m_wxre.GetMatchCount(); + for (size_t i = 0; i < count; ++i) + ret.Add(m_wxre.GetMatch(text, i)); + } return ret; } - - - diff -Nru codeblocks-20.03svn12487~ubuntu16.04/src/plugins/contrib/regex_testbed/regexdlg.h codeblocks-20.03svn12516~ubuntu16.04/src/plugins/contrib/regex_testbed/regexdlg.h --- codeblocks-20.03svn12487~ubuntu16.04/src/plugins/contrib/regex_testbed/regexdlg.h 2021-05-12 18:03:55.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/src/plugins/contrib/regex_testbed/regexdlg.h 2021-08-28 20:59:15.000000000 +0000 @@ -10,11 +10,11 @@ #include //(*Headers(RegExDlg) -#include #include "scrollingdialog.h" -#include +#include #include #include +#include //*) #include @@ -43,27 +43,23 @@ protected: //(*Handlers(RegExDlg) - void RunBenchmark(wxCommandEvent& event); - void OnInit(wxInitDialogEvent& event); - void OnRegExItemActivated(wxListEvent& event); - void OnUpdateUI(wxUpdateUIEvent& event); void OnClose(wxCloseEvent& event); + void OnValueChanged(wxCommandEvent& event); //*) private: wxArrayString GetBuiltinMatches(const wxString& text); - wxArrayString GetPregMatches(const wxString& text); //(*Declarations(RegExDlg) + wxCheckBox* m_newlines; wxCheckBox* m_nocase; + wxChoice* m_library; wxHtmlWindow* m_output; - wxTextCtrl* m_text; wxTextCtrl* m_quoted; wxTextCtrl* m_regex; - wxCheckBox* m_newlines; - wxChoice* m_library; + wxTextCtrl* m_text; //*) wxRegEx m_wxre; diff -Nru codeblocks-20.03svn12487~ubuntu16.04/src/plugins/contrib/regex_testbed/RegExTestbed.cpp codeblocks-20.03svn12516~ubuntu16.04/src/plugins/contrib/regex_testbed/RegExTestbed.cpp --- codeblocks-20.03svn12487~ubuntu16.04/src/plugins/contrib/regex_testbed/RegExTestbed.cpp 2021-05-12 18:03:55.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/src/plugins/contrib/regex_testbed/RegExTestbed.cpp 2021-08-28 20:59:15.000000000 +0000 @@ -2,8 +2,8 @@ * This file is part of the Code::Blocks IDE and licensed under the GNU General Public License, version 3 * http://www.gnu.org/licenses/gpl-3.0.html * - * $Revision: 7593 $ - * $Id: RegExTestbed.cpp 7593 2011-11-13 19:04:12Z mortenmacfly $ + * $Revision: 12509 $ + * $Id: RegExTestbed.cpp 12509 2021-08-15 11:51:05Z fuscated $ * $HeadURL: https://svn.code.sf.net/p/codeblocks/code/trunk/src/plugins/contrib/regex_testbed/RegExTestbed.cpp $ */ @@ -65,7 +65,7 @@ { try { - RegExDlg *dlg = new RegExDlg(0, -1); + RegExDlg *dlg = new RegExDlg(Manager::Get()->GetAppWindow(), -1); PlaceWindow(dlg); dlg->Show(); } diff -Nru codeblocks-20.03svn12487~ubuntu16.04/src/plugins/contrib/regex_testbed/wxsmith/RegExDlg.wxs codeblocks-20.03svn12516~ubuntu16.04/src/plugins/contrib/regex_testbed/wxsmith/RegExDlg.wxs --- codeblocks-20.03svn12487~ubuntu16.04/src/plugins/contrib/regex_testbed/wxsmith/RegExDlg.wxs 2021-05-12 18:03:55.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/src/plugins/contrib/regex_testbed/wxsmith/RegExDlg.wxs 2021-08-28 20:59:15.000000000 +0000 @@ -3,14 +3,24 @@ - + + + - - - + + + + + + + + + - + + + diff -Nru codeblocks-20.03svn12487~ubuntu16.04/src/plugins/contrib/rndgen/rndgen.cpp codeblocks-20.03svn12516~ubuntu16.04/src/plugins/contrib/rndgen/rndgen.cpp --- codeblocks-20.03svn12487~ubuntu16.04/src/plugins/contrib/rndgen/rndgen.cpp 2021-05-12 18:03:55.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/src/plugins/contrib/rndgen/rndgen.cpp 2021-08-28 20:59:15.000000000 +0000 @@ -12,7 +12,7 @@ namespace { - PluginRegistrant reg(_T("rndgen")); + PluginRegistrant reg("rndgen"); } void RndGen::OnAttach() @@ -25,20 +25,19 @@ cbEditor* ed = (cbEditor*) event.GetEditor(); cbStyledTextCtrl* ctrl = ed->GetControl(); - if (ctrl->GetText().Contains(_T("RANDGEN:")) == false) + if (ctrl->GetText().Contains("RANDGEN:") == false) return; const int Pos = ctrl->GetCurrentPos(); - ctrl->SetUndoCollection(false); + ctrl->BeginUndoAction(); - wxRegEx int_re(_T("([0-9]+)\\ *;?\\ */\\*(\\ *RANDGEN:INT\\((.*))\\*/")); -// wxRegEx alnum_re(_T("\\\"([^\"]+)\\\"\\ *;?\\ */\\*(\\ *RANDGEN:ALNUM\\((.*))\\*/")); - wxRegEx alnum_re(_T("\\\"([^\\\"]+)\\\"\\ *;?\\ */\\*(\\ *RANDGEN:(ALNUM|DIGITS|CHARS|UPPERCHARS|LOWERCHARS)\\((.*))\\*/")); + wxRegEx int_re("([0-9]+) *;? *\\/\\* *RANDGEN:INT\\((.+)\\) *\\*\\/"); + wxCHECK_RET(int_re.IsValid(), "Invalid regex (int_re) in rndgen plugin"); - const wxString Chars(_T("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")); - - assert(alnum_re.IsValid() && int_re.IsValid()); + wxRegEx alnum_re("\"([^\"]+)\" *;? *\\/\\* *RANDGEN:(ALNUM|DIGITS|CHARS|UPPERCHARS|LOWERCHARS)\\((.*)\\) *\\*\\/"); + wxCHECK_RET(alnum_re.IsValid(), "Invalid regex (alnum_re) in rndgen plugin"); + const wxString Chars("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"); const unsigned int n = ctrl->GetLineCount(); for (unsigned int i = 0; i < n; ++i) { @@ -53,9 +52,9 @@ { const wxString Search(int_re.GetMatch(s, 1)); long Arg; - int_re.GetMatch(s, 3).ToLong(&Arg); + int_re.GetMatch(s, 2).ToLong(&Arg); wxString Replace; - Replace.Printf(_T("%u"), RandGen() % (Arg+1)); + Replace.Printf("%lu", static_cast(RandGen() % (Arg+1))); s.Replace(Search, Replace, false); ctrl->SetTargetStart(a); @@ -65,31 +64,31 @@ else if (alnum_re.Matches(s)) { const wxString Search(alnum_re.GetMatch(s, 1)); - const wxString What(alnum_re.GetMatch(s, 3)); + const wxString What(alnum_re.GetMatch(s, 2)); long Arg; - alnum_re.GetMatch(s, 4).ToLong(&Arg); + alnum_re.GetMatch(s, 3).ToLong(&Arg); wxString Replace; - if (What == _T("ALNUM")) + if (What == "ALNUM") { for (int j = 0; j < Arg; ++j) Replace += Chars[RandGen() % Chars.length()]; } - else if (What == _T("DIGITS")) + else if (What == "DIGITS") { for (int j = 0; j < Arg; ++j) Replace += Chars[RandGen() % 10]; } - else if (What == _T("CHARS")) + else if (What == "CHARS") { for (int j = 0; j < Arg; ++j) Replace += Chars[10+ RandGen() % (Chars.length() - 10)]; } - else if (What == _T("UPPERCHARS")) + else if (What == "UPPERCHARS") { for (int j = 0; j < Arg; ++j) Replace += Chars[36 + RandGen() % 26]; } - else if(What == _T("LOWERCHARS")) + else if (What == "LOWERCHARS") { for (int j = 0; j < Arg; ++j) Replace += Chars[10 + RandGen() % 26]; @@ -103,6 +102,7 @@ } } - ctrl->SetUndoCollection(true); + ctrl->EndUndoAction(); ctrl->SetCurrentPos(Pos); + ctrl->SelectNone(); } diff -Nru codeblocks-20.03svn12487~ubuntu16.04/src/plugins/debuggergdb/debuggergdb.cpp codeblocks-20.03svn12516~ubuntu16.04/src/plugins/debuggergdb/debuggergdb.cpp --- codeblocks-20.03svn12487~ubuntu16.04/src/plugins/debuggergdb/debuggergdb.cpp 2021-07-09 23:19:18.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/src/plugins/debuggergdb/debuggergdb.cpp 2021-08-28 20:59:15.000000000 +0000 @@ -2,8 +2,8 @@ * This file is part of the Code::Blocks IDE and licensed under the GNU General Public License, version 3 * http://www.gnu.org/licenses/gpl-3.0.html * - * $Revision: 12484 $ - * $Id: debuggergdb.cpp 12484 2021-07-04 21:19:35Z fuscated $ + * $Revision: 12503 $ + * $Id: debuggergdb.cpp 12503 2021-08-14 15:07:36Z fuscated $ * $HeadURL: https://svn.code.sf.net/p/codeblocks/code/trunk/src/plugins/debuggergdb/debuggergdb.cpp $ */ @@ -95,8 +95,6 @@ CMD_RUNNINGTHREADS }; -const wxString g_EscapeChar = wxChar(26); - namespace { long idMenuInfoFrame = wxNewId(); diff -Nru codeblocks-20.03svn12487~ubuntu16.04/src/plugins/debuggergdb/debuggergdb.h codeblocks-20.03svn12516~ubuntu16.04/src/plugins/debuggergdb/debuggergdb.h --- codeblocks-20.03svn12487~ubuntu16.04/src/plugins/debuggergdb/debuggergdb.h 2021-05-12 18:04:27.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/src/plugins/debuggergdb/debuggergdb.h 2021-08-28 20:59:15.000000000 +0000 @@ -19,8 +19,6 @@ #include "debuggerstate.h" #include "debugger_defs.h" -extern const wxString g_EscapeChar; - class cbProject; class TiXmlElement; class DebuggerDriver; diff -Nru codeblocks-20.03svn12487~ubuntu16.04/src/plugins/debuggergdb/gdb_driver.cpp codeblocks-20.03svn12516~ubuntu16.04/src/plugins/debuggergdb/gdb_driver.cpp --- codeblocks-20.03svn12487~ubuntu16.04/src/plugins/debuggergdb/gdb_driver.cpp 2021-05-12 18:04:30.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/src/plugins/debuggergdb/gdb_driver.cpp 2021-08-28 20:59:15.000000000 +0000 @@ -2,8 +2,8 @@ * This file is part of the Code::Blocks IDE and licensed under the GNU General Public License, version 3 * http://www.gnu.org/licenses/gpl-3.0.html * - * $Revision: 12212 $ - * $Id: gdb_driver.cpp 12212 2020-10-17 22:50:28Z fuscated $ + * $Revision: 12503 $ + * $Id: gdb_driver.cpp 12503 2021-08-14 15:07:36Z fuscated $ * $HeadURL: https://svn.code.sf.net/p/codeblocks/code/trunk/src/plugins/debuggergdb/gdb_driver.cpp $ */ @@ -12,17 +12,14 @@ #include "gdb_commands.h" #include "debuggeroptionsdlg.h" #include "debuggerstate.h" + #include -#include -#include #include +#include #include #include - -#ifdef __WXMSW__ -// for Registry detection of Cygwin -#include "wx/msw/wrapwin.h" // Wraps windows.h -#endif +#include +#include // the ">>>>>>" is a hack: sometimes, especially when watching uninitialized char* // some random control codes in the stream (like 'delete') will mess-up our prompt and the debugger @@ -79,7 +76,6 @@ GDB_driver::GDB_driver(DebuggerGDB* plugin) : DebuggerDriver(plugin), - m_CygwinPresent(false), m_BreakOnEntry(false), m_ManualBreakOnEntry(false), m_IsStarted(false), @@ -91,6 +87,9 @@ //ctor m_needsUpdate = false; m_forceUpdate = false; + + if (platform::windows) + m_CygwinPresent = cbIsDetectedCygwinCompiler(); } GDB_driver::~GDB_driver() @@ -107,7 +106,17 @@ cmd << _T(" -fullname"); // report full-path filenames when breaking cmd << _T(" -quiet"); // don't display version on startup cmd << wxT(" ") << userArguments; - cmd << _T(" -args ") << debuggee; + + wxString actualDebuggee; + if (platform::windows && m_CygwinPresent) + { + actualDebuggee = debuggee; + cbGetCygwinPathFromWindowsPath(actualDebuggee); + } + else + actualDebuggee = debuggee; + + cmd << _T(" -args ") << actualDebuggee; return cmd; } @@ -133,10 +142,6 @@ { // default initialization - // for the possibility that the program to be debugged is compiled under Cygwin - if (platform::windows) - DetectCygwinMount(); - // make sure we 're using the prompt that we know and trust ;) QueueCommand(new DebuggerCmd(this, wxString("set prompt ") + FULL_GDB_PROMPT)); @@ -242,121 +247,12 @@ } } -// Cygwin check code -#ifdef __WXMSW__ - -enum{ BUFSIZE = 64 }; - -// routines to handle cygwin compiled programs on a Windows compiled C::B IDE -void GDB_driver::DetectCygwinMount(void) -{ - LONG lRegistryAPIresult; - HKEY hKey_CU; - HKEY hKey_LM; - TCHAR szCygwinRoot[BUFSIZE]; - DWORD dwBufLen=BUFSIZE*sizeof(TCHAR); - - // checking if cygwin mounts are present under HKCU - lRegistryAPIresult = RegOpenKeyEx( HKEY_CURRENT_USER, - TEXT("Software\\Cygnus Solutions\\Cygwin\\mounts v2"), - 0, KEY_QUERY_VALUE, &hKey_CU ); - if ( lRegistryAPIresult == ERROR_SUCCESS ) - { - // try to readback cygwin root (might not exist!) - lRegistryAPIresult = RegQueryValueEx( hKey_CU, TEXT("cygdrive prefix"), NULL, NULL, - (LPBYTE) szCygwinRoot, &dwBufLen); - } - - // lRegistryAPIresult can be erroneous for two reasons: - // 1.) Cygwin entry is not present (could not be opened) in HKCU - // 2.) "cygdrive prefix" is not present (could not be read) in HKCU - if ( lRegistryAPIresult != ERROR_SUCCESS ) - { - // Now check if probably present under HKLM - lRegistryAPIresult = RegOpenKeyEx( HKEY_LOCAL_MACHINE, - TEXT("SOFTWARE\\Cygnus Solutions\\Cygwin\\mounts v2"), - 0, KEY_QUERY_VALUE, &hKey_LM ); - if ( lRegistryAPIresult != ERROR_SUCCESS ) - { - // cygwin definitely not installed - m_CygwinPresent = false; - return; - } - - // try to readback cygwin root (now it really should exist here) - lRegistryAPIresult = RegQueryValueEx( hKey_LM, TEXT("cygdrive prefix"), NULL, NULL, - (LPBYTE) szCygwinRoot, &dwBufLen); - } - - // handle a possible query error - if ( (lRegistryAPIresult != ERROR_SUCCESS) || (dwBufLen > BUFSIZE*sizeof(TCHAR)) ) - { - // bit of an assumption, but we won't be able to find the root without it - m_CygwinPresent = false; - return; - } - - // close opened keys - RegCloseKey( hKey_CU ); // ignore key close errors - RegCloseKey( hKey_LM ); // ignore key close errors - - m_CygwinPresent = true; // if we end up here all was OK - m_CygdrivePrefix = (szCygwinRoot); // convert to wxString type for later use -} - -void GDB_driver::CorrectCygwinPath(wxString& path) -{ - unsigned int i=0, EscCount=0; - - // preserve any escape characters at start of path - this is true for - // breakpoints - value is 2, but made dynamic for safety as we - // are only checking for the CDprefix not any furthur correctness - if (path.GetChar(0)==g_EscapeChar) - { - while ( (iLog(wxString::Format(_T("file: %s, line: %s"), file.c_str(), lineStr.c_str())); long line; lineStr.ToLong(&line); @@ -996,7 +890,7 @@ } // cursor change - else if (lines[i].StartsWith(g_EscapeChar)) // ->-> + else if (!lines[i].empty() && lines[i][0] == wxUniChar(26)) // ->-> { // breakpoint, e.g. // C:/Devel/tmp/test_console_dbg/tmp/main.cpp:14:171:beg:0x401428 @@ -1018,6 +912,7 @@ } else { + bool isFileUpdated = false; // other break info, e.g. // 0x7c9507a8 in ntdll!KiIntSystemCall () from C:\WINDOWS\system32\ntdll.dll wxRegEx* re = 0; @@ -1035,6 +930,7 @@ m_Cursor.line = -1; m_Cursor.changed = true; m_needsUpdate = true; + isFileUpdated = true; } else if ( reThreadSwitch2.Matches(lines[i]) ) { @@ -1045,6 +941,7 @@ m_Cursor.line = -1; m_Cursor.changed = true; m_needsUpdate = true; + isFileUpdated = true; } else if (reBreak3.Matches(lines[i]) ) { @@ -1073,6 +970,9 @@ m_Cursor.changed = true; m_needsUpdate = true; } + + if (isFileUpdated && platform::windows && m_CygwinPresent) + cbGetWindowsPathFromCygwinPath(m_Cursor.file); } } buffer.Clear(); @@ -1123,11 +1023,13 @@ if (platform::windows) { m_Cursor.file = reBreak_in.GetMatch(line, 1) + reBreak_in.GetMatch(line, 2); + if (m_CygwinPresent) + cbGetWindowsPathFromCygwinPath(m_Cursor.file); } else { - // For debuging of usual linux application 'GetMatch(line, 1)' is empty. - // While for debuging of application under wine the name of the disk is useless. + // For debugging of usual linux application 'GetMatch(line, 1)' is empty. + // While for debugging of application under wine the name of the disk is useless. m_Cursor.file = reBreak_in.GetMatch( line, 2); } diff -Nru codeblocks-20.03svn12487~ubuntu16.04/src/plugins/debuggergdb/gdb_driver.h codeblocks-20.03svn12516~ubuntu16.04/src/plugins/debuggergdb/gdb_driver.h --- codeblocks-20.03svn12487~ubuntu16.04/src/plugins/debuggergdb/gdb_driver.h 2021-05-12 18:04:30.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/src/plugins/debuggergdb/gdb_driver.h 2021-08-28 20:59:15.000000000 +0000 @@ -78,12 +78,7 @@ private: void HandleMainBreakPoint(const wxRegEx& reBreak, wxString line); - // win/Cygwin platform checking - void DetectCygwinMount(void); - void CorrectCygwinPath(wxString& path); - bool m_CygwinPresent; - wxString m_CygdrivePrefix; // Seems to be intended to allow step before program has started. // Was always false. HC changed to take value from DebuggerGDB::m_BreakOnEntry. diff -Nru codeblocks-20.03svn12487~ubuntu16.04/src/plugins/debuggergdb/parsewatchvalue.cpp codeblocks-20.03svn12516~ubuntu16.04/src/plugins/debuggergdb/parsewatchvalue.cpp --- codeblocks-20.03svn12487~ubuntu16.04/src/plugins/debuggergdb/parsewatchvalue.cpp 2021-05-12 18:04:31.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/src/plugins/debuggergdb/parsewatchvalue.cpp 2021-08-28 20:59:15.000000000 +0000 @@ -2,8 +2,8 @@ * This file is part of the Code::Blocks IDE and licensed under the GNU General Public License, version 3 * http://www.gnu.org/licenses/gpl-3.0.html * - * $Revision: 11633 $ - * $Id: parsewatchvalue.cpp 11633 2019-04-20 16:56:13Z fuscated $ + * $Revision: 12515 $ + * $Id: parsewatchvalue.cpp 12515 2021-08-15 11:51:22Z fuscated $ * $HeadURL: https://svn.code.sf.net/p/codeblocks/code/trunk/src/plugins/debuggergdb/parsewatchvalue.cpp $ */ @@ -333,7 +333,7 @@ } wxRegEx regexRepeatedChar(wxT(".+[ \\t]()$")); -wxRegEx regexFortranArray(wxT("^\\([0-9,]+)$")); +wxRegEx regexFortranArray(wxT("^\\([0-9,]+\\)$")); inline bool ParseGDBWatchValue(cb::shared_ptr watch, wxString const &value, int &start, int length) { diff -Nru codeblocks-20.03svn12487~ubuntu16.04/src/sdk/cbplugin.cpp codeblocks-20.03svn12516~ubuntu16.04/src/sdk/cbplugin.cpp --- codeblocks-20.03svn12487~ubuntu16.04/src/sdk/cbplugin.cpp 2021-05-12 18:04:38.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/src/sdk/cbplugin.cpp 2021-08-28 20:59:15.000000000 +0000 @@ -2,8 +2,8 @@ * This file is part of the Code::Blocks IDE and licensed under the GNU Lesser General Public License, version 3 * http://www.gnu.org/licenses/lgpl-3.0.html * - * $Revision: 12326 $ - * $Id: cbplugin.cpp 12326 2021-05-07 22:23:31Z bluehazzard $ + * $Revision: 12489 $ + * $Id: cbplugin.cpp 12489 2021-08-05 23:50:20Z fuscated $ * $HeadURL: https://svn.code.sf.net/p/codeblocks/code/trunk/src/sdk/cbplugin.cpp $ */ @@ -178,13 +178,13 @@ { cbEditor* ed = Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor(); if (!ed) - return wxEmptyString; + return wxString(); cbStyledTextCtrl* stc = ed->GetControl(); if (!stc) - return wxEmptyString; + return wxString(); wxString selected_text = stc->GetSelectedText(); - if (selected_text != wxEmptyString) + if (!selected_text.empty()) { selected_text.Trim(true); selected_text.Trim(false); @@ -203,11 +203,11 @@ int endPos = stc->GetSelectionEnd(); int mousePos = stc->PositionFromPointClose(mousePosition->x, mousePosition->y); if (mousePos == wxSCI_INVALID_POSITION) - return wxEmptyString; + return wxString(); else if (startPos <= mousePos && mousePos <= endPos) return selected_text; else - return wxEmptyString; + return wxString(); } else return selected_text; diff -Nru codeblocks-20.03svn12487~ubuntu16.04/src/sdk/cygwin.cpp codeblocks-20.03svn12516~ubuntu16.04/src/sdk/cygwin.cpp --- codeblocks-20.03svn12487~ubuntu16.04/src/sdk/cygwin.cpp 1970-01-01 00:00:00.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/src/sdk/cygwin.cpp 2021-08-28 20:59:15.000000000 +0000 @@ -0,0 +1,249 @@ +/* + * This file is part of the Code::Blocks IDE and licensed under the GNU Lesser General Public License, version 3 + * http://www.gnu.org/licenses/lgpl-3.0.html + * + * $Revision$ + * $Id$ + * $HeadURL$ + */ + +#include "sdk_precomp.h" + +#ifndef CB_PRECOMP + #include + #include "cbproject.h" + #include "compilerfactory.h" + #include "logmanager.h" + #include +#endif + +#if defined(__WXMSW__) + #include +#endif // defined(__WXMSW__) + +#include "cygwin.h" + +// Keep a cache of all file paths converted from +// Cygwin path into native path. Only applicable if under Windows and using Cygwin! +static std::map g_WindowsFileCache; +static std::map g_CygwinFileCache; + +static bool g_CygwinPresent = false; // Assume not found until Cygwin has been found +static wxString g_CygwinCompilerPathRoot; // Assume no directory until Cygwin has been found + +wxString cbGetCygwinCompilerPathRoot(void) +{ + if (g_CygwinPresent == false) + g_CygwinPresent = cbIsDetectedCygwinCompiler(); + return g_CygwinCompilerPathRoot; +} + +// Routine find if Windows Cygwin compiler has been installed on the PC +bool cbIsDetectedCygwinCompiler(void) +{ + if (!platform::windows) + return false; + + LogManager *pMsg = Manager::Get()->GetLogManager(); + + // can only debug projects or attach to processes + ProjectManager *prjMan = Manager::Get()->GetProjectManager(); + cbProject *pProject = prjMan->GetActiveProject(); + + if (pProject && prjMan->IsProjectStillOpen(pProject)) + { + ProjectBuildTarget *ActiveBuildTarget = nullptr; + + wxString sActiveBuildTarget = pProject->GetActiveBuildTarget(); + ActiveBuildTarget = pProject->GetBuildTarget(sActiveBuildTarget); + + wxString compilerID; + pMsg->DebugLog(wxString::Format("sActiveBuildTarget : %s", sActiveBuildTarget)); + if (ActiveBuildTarget) + { + pMsg->DebugLog(wxString::Format("ActiveBuildTarget->GetTitle() : %s", + ActiveBuildTarget->GetTitle())); + compilerID = ActiveBuildTarget->GetCompilerID(); + if (!compilerID.IsSameAs("cygwin")) + { + pMsg->DebugLog("ActiveBuildTarget->GetCompilerID().IsSameAs(cygwin) is FALSE!"); + g_CygwinCompilerPathRoot = wxString(); + return false; + } + } + else + { + pMsg->DebugLog(wxString::Format("pProject->GetTitle() : %s", pProject->GetTitle())); + compilerID = pProject->GetCompilerID(); + if (!compilerID.IsSameAs("cygwin")) + { + pMsg->DebugLog("pProject->GetCompilerID().IsSameAs(cygwin) is FALSE!"); + g_CygwinCompilerPathRoot = wxString(); + return false; + } + } + + // find the target's compiler (to see which debugger to use) + Compiler *actualCompiler = CompilerFactory::GetCompiler(compilerID); + if (!actualCompiler) + { + pMsg->DebugLog("Could not find actual CygWin compiler!!!"); + g_CygwinCompilerPathRoot = wxString(); + return false; + } + } + + // See compilerCYGWIN.CPP AutoDetectResult CompilerCYGWIN::AutoDetectInstallationDir() as this is very similar!!! + // + // Windows 10 x64 with Cygwin installed after 2010 have the following registry entry (or HKEY_CURRENT_USER): + // [HKEY_LOCAL_MACHINE\SOFTWARE\Cygwin\setup] + // "rootdir"="C:\\cygwin64" + // + // See + // https://github.com/mirror/newlib-cygwin/blob/30782f7de4936bbc4c2e666cbaf587039c895fd3/winsup/utils/path.cc + // for RegQueryValueExW (...) + + bool present = false; // Assume not found as starting point + +#if defined(__WXMSW__) + wxString masterPath("C:\\cygwin64"); + wxRegKey key; // defaults to HKCR + key.SetName("HKEY_LOCAL_MACHINE\\Software\\Cygwin\\setup"); + if (key.Exists() && key.Open(wxRegKey::Read)) + { + // found CygWin version 1.7 or newer; read it + key.QueryValue("rootdir", masterPath); + if (wxDirExists(masterPath + wxFILE_SEP_PATH + "bin")) + present = true; + } + if (!present) + { + key.SetName("HKEY_LOCAL_MACHINE\\Software\\Cygnus Solutions\\Cygwin\\mounts v2\\/"); + if (key.Exists() && key.Open(wxRegKey::Read)) + { + // found CygWin version 1.5 or older; read it + key.QueryValue("native", masterPath); + if (wxDirExists(masterPath + wxFILE_SEP_PATH + "bin")) + present = true; + } + } + + // Found registry keys or the default path is valid + if (present || wxDirExists(masterPath + wxFILE_SEP_PATH + "bin")) + { + present = true; // Set to true in case no registry found, but default directory exists. + g_CygwinCompilerPathRoot = masterPath; // convert to wxString type for later use + } + else + { + g_CygwinCompilerPathRoot = wxString(); + } +#else + g_CygwinCompilerPathRoot = wxString(); +#endif // defined(__WXMSW__) + + return present; +} + +static wxString GetCygwinPath(const wxString& path, bool windowsPath) +{ + std::map &fileCache = (windowsPath ? g_WindowsFileCache : g_CygwinFileCache); + + // Check if we already have the file cached before + std::map::const_iterator it = fileCache.find(path); + if (it != fileCache.end()) + return it->second; + + wxString resultPath = path; + + // File Examples + // "C:\cygwin64\usr\include\ctype.h" + // "/cygdrive/C/cygwin64/usr/include/ctype.h" + // "C:\\cygwin64\\usr\\src\\debug\\zziplib-0.13.68-1\\zzip\\file.c"; + // The following use cygpath.exe to resolve the true Windows path: + // "/usr/src/debug/zziplib-0.13.68-1/zzip/file.c"; + // "/lib/...." + // "/usr/local/bin" + // "/usr/bin" + // "/usr/sbin" + // "/bin" + // "/sbin" + // other "/..." + + + // As we are under Windows we check 'resultPath' to see if it starts with '/cygdrive' and + // if it does then process the path as a cygwin path. + // But if the path does not then check if the path/file exists and if it does then use it, + // otherwise we check if it is a cygwin path starting with '/' and if it is then we call cygpath.exe + // if we have not already seen the path and if we have not then later we add the path to the cache + if ((resultPath.StartsWith("/cygdrive/")) || (resultPath.StartsWith("\\cygdrive\\"))) + { + // Needed if debugging a Cygwin build app in codeblocks. Convert GDB cygwin filename to mingw filename!!!! + // /cygdrive/x/... to c:/... + resultPath = wxString::Format("%c:%s", path[10], path.Mid(11)); + } + else + { + // Check if path or file exists on the disk + if (((!wxDirExists(resultPath)) && (!wxFileName::FileExists(resultPath))) || !windowsPath) + { + // Double check that starts with a forward slash "/" and if it is + // then assume it is a special Cygwin path that cygpath.exe can resolve + // to a valid Windows path. + if (resultPath.StartsWith("/") || !windowsPath) + { + // file attribute also contains cygwin path + wxString cygwinConvertCMD = g_CygwinCompilerPathRoot + "\\bin\\cygpath.exe"; + if (wxFileName::FileExists(cygwinConvertCMD)) + { + cygwinConvertCMD.Trim().Trim(false); + // we got a conversion command from the user, use it + if (windowsPath) + cygwinConvertCMD.Append(" -w "); + else + cygwinConvertCMD.Append(" -u "); + cygwinConvertCMD.Append(resultPath); + + wxArrayString cmdOutput; + const long resExecute = wxExecute("cmd /c " + cygwinConvertCMD, cmdOutput, + wxEXEC_SYNC, nullptr); + if ((resExecute== 0) && (!cmdOutput.IsEmpty())) + { + cmdOutput.Item(0).Trim().Trim(false); + const wxString &outputPath = cmdOutput.Item(0); + + // Check if path or file exists on the disk + if ((wxDirExists(outputPath)) || (wxFileName::FileExists(outputPath))) + resultPath = outputPath; + else if (!windowsPath) + resultPath = outputPath; + } + else + { + const wxString msg = wxString::Format("cygwinConvertCMD error: %d", + resExecute); + Manager::Get()->GetLogManager()->DebugLog(msg); + } + } + } + } + } + + if (windowsPath) + { + // Convert Unix filenames to Windows + resultPath.Replace("/", "\\"); + } + + fileCache.insert(std::map::value_type(path, resultPath)); + return resultPath; +} + +void cbGetWindowsPathFromCygwinPath(wxString& path) +{ + path = GetCygwinPath(path, true); +} +void cbGetCygwinPathFromWindowsPath(wxString& path) +{ + path = GetCygwinPath(path, false); +} diff -Nru codeblocks-20.03svn12487~ubuntu16.04/src/sdk/macrosmanager.cpp codeblocks-20.03svn12516~ubuntu16.04/src/sdk/macrosmanager.cpp --- codeblocks-20.03svn12487~ubuntu16.04/src/sdk/macrosmanager.cpp 2021-05-12 18:04:38.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/src/sdk/macrosmanager.cpp 2021-08-28 20:59:15.000000000 +0000 @@ -2,8 +2,8 @@ * This file is part of the Code::Blocks IDE and licensed under the GNU Lesser General Public License, version 3 * http://www.gnu.org/licenses/lgpl-3.0.html * - * $Revision: 12333 $ - * $Id: macrosmanager.cpp 12333 2021-05-09 12:44:13Z fuscated $ + * $Revision: 12514 $ + * $Id: macrosmanager.cpp 12514 2021-08-15 11:51:19Z fuscated $ * $HeadURL: https://svn.code.sf.net/p/codeblocks/code/trunk/src/sdk/macrosmanager.cpp $ */ @@ -46,6 +46,8 @@ MacrosManager::MacrosManager() { + m_Valid = CompileRegexes(); + assert(m_Valid); Reset(); } @@ -80,32 +82,43 @@ m_Plugins = UnixFilename(ConfigManager::GetPluginsFolder()); m_DataPath = UnixFilename(ConfigManager::GetDataFolder()); ClearProjectKeys(); - m_RE_Unix.Compile(_T("([^$]|^)(\\$[({]?(#?[A-Za-z_0-9.]+)[)} /\\]?)"), wxRE_EXTENDED | wxRE_NEWLINE); - m_RE_DOS.Compile(_T("([^%]|^)(%(#?[A-Za-z_0-9.]+)%)"), wxRE_EXTENDED | wxRE_NEWLINE); - m_RE_IfSp.Compile(_T("(([^=!<>]+)[ ]*(=|==|!=|>|<|>=|<=)[ ]*([^=!<>]+))"), wxRE_EXTENDED | wxRE_NEWLINE); - m_RE_Script.Compile(_T("(\\[\\[(.*)\\]\\])"), wxRE_EXTENDED | wxRE_NEWLINE); - m_RE_ToAbsolutePath.Compile(_T("\\$TO_ABSOLUTE_PATH{([^}]*)}"), -#ifndef __WXMAC__ - wxRE_ADVANCED); -#else - wxRE_EXTENDED); -#endif - m_RE_To83Path.Compile(_T("\\$TO_83_PATH{([^}]*)}"), -#ifndef __WXMAC__ - wxRE_ADVANCED); -#else - wxRE_EXTENDED); -#endif - m_RE_RemoveQuotes.Compile(_T("\\$REMOVE_QUOTES{([^}]*)}"), + m_UserVarMan = Manager::Get()->GetUserVariableManager(); + srand(time(nullptr)); +} + +bool MacrosManager::CompileRegexes() +{ + m_RE_Unix.Compile(_T("([^$]|^)(\\$[({]?(#?[A-Za-z_0-9.]+)[\\)} /\\\\]?)"), + wxRE_EXTENDED | wxRE_NEWLINE); + wxCHECK_MSG(m_RE_Unix.IsValid(), false, "Invalid regex (m_RE_Unix) in macros manager"); + + m_RE_DOS.Compile(_T("([^%]|^)(%(#?[A-Za-z_0-9.]+)%)"), wxRE_EXTENDED | wxRE_NEWLINE); + wxCHECK_MSG(m_RE_DOS.IsValid(), false, "Invalid regex (m_RE_DOS) in macros manager"); + + m_RE_IfSp.Compile(_T("(([^=!<>]+)[ ]*(=|==|!=|>|<|>=|<=)[ ]*([^=!<>]+))"), + wxRE_EXTENDED | wxRE_NEWLINE); + wxCHECK_MSG(m_RE_IfSp.IsValid(), false, "Invalid regex (m_RE_IfSp) in macros manager"); + + m_RE_Script.Compile(_T("(\\[\\[(.*)\\]\\])"), wxRE_EXTENDED | wxRE_NEWLINE); + wxCHECK_MSG(m_RE_Script.IsValid(), false, "Invalid regex (m_RE_Script) in macros manager"); + #ifndef __WXMAC__ - wxRE_ADVANCED); + const int flagsForMac = wxRE_ADVANCED; #else - wxRE_EXTENDED); + const int flagsForMac = wxRE_EXTENDED; #endif - m_UserVarMan = Manager::Get()->GetUserVariableManager(); - srand(time(nullptr)); - assert(m_RE_Unix.IsValid()); - assert(m_RE_DOS.IsValid()); + + m_RE_ToAbsolutePath.Compile(_T("\\$TO_ABSOLUTE_PATH{([^}]*)}"), flagsForMac); + wxCHECK_MSG(m_RE_ToAbsolutePath.IsValid(), false, + "Invalid regex (m_RE_ToAbsolutePath) in macros manager"); + + m_RE_To83Path.Compile(_T("\\$TO_83_PATH{([^}]*)}"), flagsForMac); + wxCHECK_MSG(m_RE_To83Path.IsValid(), false, "Invalid regex (m_RE_To83Path) in macros manager"); + + m_RE_RemoveQuotes.Compile(_T("\\$REMOVE_QUOTES{([^}]*)}"), flagsForMac); + wxCHECK_MSG(m_RE_RemoveQuotes.IsValid(), false, + "Invalid regex (m_RE_RemoveQuotes) in macros manager"); + return true; } void MacrosManager::ClearProjectKeys() @@ -177,7 +190,7 @@ m_Macros[_T("WORKSPACEDIRECTORY")] = m_WorkspaceDir; } -wxString GetSelectedText() +static wxString GetSelectedText() { cbEditor* ed = Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor(); if (ed) @@ -457,9 +470,9 @@ * \return wxString The string between parentheses or wxEmptyString if an error occurred * */ -wxString ExtractStringBetweenParentheses(const wxString& input, size_t& pos, const wxChar& openSymbol, const wxChar& closeSymbol) +static wxString ExtractStringBetweenParentheses(const wxString& input, size_t& pos, + const wxChar& openSymbol, const wxChar& closeSymbol) { - if (pos == wxString::npos || pos >= input.size()) return wxEmptyString; @@ -521,7 +534,8 @@ * This function will parse the input string starting at position _pos_ and extracting CONDITION, TRUE_CLAUSE and FALSE_CLAUSE * The variable _pos_ will point to after the last closing parentheses of the if expression */ -wxString ParseIfCondition(const wxString& input, size_t& pos, wxString& condition, wxString& trueCode, wxString& falseCode) +static wxString ParseIfCondition(const wxString& input, size_t& pos, wxString& condition, + wxString& trueCode, wxString& falseCode) { const size_t start = pos; condition = ExtractStringBetweenParentheses(input, pos, '(', ')'); @@ -532,10 +546,16 @@ return ret; } -void MacrosManager::ReplaceMacros(wxString& buffer, const ProjectBuildTarget* target, bool subrequest) +void MacrosManager::ReplaceMacros(wxString& buffer, const ProjectBuildTarget* target, + bool subrequest) { if (buffer.IsEmpty()) return; + if (!m_Valid) + { + buffer = ""; + return; + } static const wxString delim(_T("$%[")); if ( buffer.find_first_of(delim) == wxString::npos ) diff -Nru codeblocks-20.03svn12487~ubuntu16.04/src/sdk/Makefile.am codeblocks-20.03svn12516~ubuntu16.04/src/sdk/Makefile.am --- codeblocks-20.03svn12487~ubuntu16.04/src/sdk/Makefile.am 2021-05-12 18:04:38.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/src/sdk/Makefile.am 2021-08-28 20:59:15.000000000 +0000 @@ -56,6 +56,7 @@ configuretoolsdlg.cpp \ confirmreplacedlg.cpp \ crc32.cpp \ + cygwin.cpp \ debuggermanager.cpp \ editarrayfiledlg.cpp \ editarrayorderdlg.cpp \ diff -Nru codeblocks-20.03svn12487~ubuntu16.04/src/sdk/Makefile.in codeblocks-20.03svn12516~ubuntu16.04/src/sdk/Makefile.in --- codeblocks-20.03svn12487~ubuntu16.04/src/sdk/Makefile.in 2021-07-09 23:19:29.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/src/sdk/Makefile.in 2021-08-28 20:59:29.000000000 +0000 @@ -150,7 +150,7 @@ compilerfactory.lo compileroptions.lo compiletargetbase.lo \ configmanager-revision.lo configmanager.lo \ configurationpanel.lo configuretoolsdlg.lo \ - confirmreplacedlg.lo crc32.lo debuggermanager.lo \ + confirmreplacedlg.lo crc32.lo cygwin.lo debuggermanager.lo \ editarrayfiledlg.lo editarrayorderdlg.lo editarraystringdlg.lo \ editor_hooks.lo editor_utils.lo editorbase.lo \ editorcolourset.lo editorlexerloader.lo editormanager.lo \ @@ -605,6 +605,7 @@ configuretoolsdlg.cpp \ confirmreplacedlg.cpp \ crc32.cpp \ + cygwin.cpp \ debuggermanager.cpp \ editarrayfiledlg.cpp \ editarrayorderdlg.cpp \ @@ -925,6 +926,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/configuretoolsdlg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/confirmreplacedlg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crc32.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cygwin.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debuggermanager.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/editarrayfiledlg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/editarrayorderdlg.Plo@am__quote@ diff -Nru codeblocks-20.03svn12487~ubuntu16.04/src/sdk/pipedprocess.cpp codeblocks-20.03svn12516~ubuntu16.04/src/sdk/pipedprocess.cpp --- codeblocks-20.03svn12487~ubuntu16.04/src/sdk/pipedprocess.cpp 2021-05-12 18:04:41.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/src/sdk/pipedprocess.cpp 2021-08-28 20:59:15.000000000 +0000 @@ -2,8 +2,8 @@ * This file is part of the Code::Blocks IDE and licensed under the GNU Lesser General Public License, version 3 * http://www.gnu.org/licenses/lgpl-3.0.html * - * $Revision: 12208 $ - * $Id: pipedprocess.cpp 12208 2020-10-04 20:42:14Z d_anselmi $ + * $Revision: 12516 $ + * $Id: pipedprocess.cpp 12516 2021-08-15 16:35:46Z bluehazzard $ * $HeadURL: https://svn.code.sf.net/p/codeblocks/code/trunk/src/sdk/pipedprocess.cpp $ */ @@ -123,23 +123,24 @@ wxSetWorkingDirectory(unixDir); if (pipe) Redirect(); + + m_timerPollProcess.SetOwner(this, idTimerPollProcess); } // class destructor PipedProcess::~PipedProcess() { - // insert your code here + if (m_timerPollProcess.IsRunning()) + m_timerPollProcess.Stop(); } -int PipedProcess::Launch(const wxString& cmd, cb_unused unsigned int pollingInterval) +int PipedProcess::Launch(const wxString& cmd, int flags) { m_Stopped = false; - m_Pid = wxExecute(cmd, wxEXEC_ASYNC | wxEXEC_MAKE_GROUP_LEADER, this); + m_Pid = wxExecute(cmd, flags, this); if (m_Pid) - { -// m_timerPollProcess.SetOwner(this, idTimerPollProcess); -// m_timerPollProcess.Start(pollingInterval); - } + m_timerPollProcess.Start(1000); + return m_Pid; } diff -Nru codeblocks-20.03svn12487~ubuntu16.04/src/sdk/scripting/bindings/sc_utils.cpp codeblocks-20.03svn12516~ubuntu16.04/src/sdk/scripting/bindings/sc_utils.cpp --- codeblocks-20.03svn12487~ubuntu16.04/src/sdk/scripting/bindings/sc_utils.cpp 2021-05-12 18:04:38.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/src/sdk/scripting/bindings/sc_utils.cpp 2021-08-28 20:59:15.000000000 +0000 @@ -23,7 +23,111 @@ return "unknown value"; } -DLLIMPORT void PrintStack(HSQUIRRELVM vm, const char *title, SQInteger oldTop) +std::string MakeStringFromSquirrelValue(HSQUIRRELVM vm, const int stackIdx) +{ + std::string line; + switch (sq_gettype(vm, stackIdx)) + { + case OT_NULL: + line+="Null"; + break; + + case OT_INTEGER: + { + SQInteger value; + sq_getinteger(vm, stackIdx, &value); + line+=std::to_string(value); + line+="; Integer"; + break; + } + case OT_FLOAT: + { + SQFloat value; + sq_getfloat(vm, stackIdx, &value); + line+=std::to_string(value); + line+="; Float"; + break; + } + case OT_BOOL: + { + SQBool value; + sq_getbool(vm, stackIdx, &value); + line+=(value ? "True" : "False"); + line+="; Bool"; + break; + } + case OT_STRING: + { + const SQChar *value; + sq_getstring(vm, stackIdx, &value); + if (value != nullptr) + { + line+="'"; + line+=value; + } + else + line+="'"; + line+="'; String"; + break; + } + case OT_TABLE: + { + const void *ptr; + //sq_getvoidptr(vm, stackIdx, &ptr); + ptr = (void*)0x01020304; + line+=GetItemString(vm, stackIdx); + line+="; Table"; + break; + } + case OT_ARRAY: + { + const void *ptr; + //sq_getvoidptr(vm, stackIdx, &ptr); + ptr = (void*)0x01020304; + line+=GetItemString(vm, stackIdx); + line+="; Array"; + break; + } + case OT_USERDATA: + line+="UserData"; + break; + case OT_CLOSURE: + line+="Closure"; + break; + case OT_NATIVECLOSURE: + line+="NativeClosure"; + break; + case OT_GENERATOR: + line+="Generator"; + break; + case OT_USERPOINTER: + line+="UserPointer"; + break; + case OT_THREAD: + line+="Thread"; + break; + case OT_FUNCPROTO: + line+="FuncProto"; + break; + case OT_CLASS: + line+="Class"; + break; + case OT_INSTANCE: + { + line+=GetItemString(vm, stackIdx); + line+="; Instance"; + break; + } + case OT_WEAKREF: + line+="WeakRef"; + break; + default: + line+=""; + } + return line; +} + +void PrintStack(HSQUIRRELVM vm, const char *title, SQInteger oldTop) { SQInteger top = sq_gettop(vm); printf("debug: stack [%s] top=%lld oldTop=%lld\n", title, (long long)top, (long long)oldTop); @@ -35,114 +139,16 @@ line+=std::to_string(top-ii); line+=":"; line+=std::to_string(-1-ii); - line+="]: type="; + line+="]: "; const SQInteger stackIdx=-1-ii; - - switch (sq_gettype(vm, stackIdx)) - { - case OT_NULL: - line+="Null"; - break; - - case OT_INTEGER: - { - line+="Integer="; - SQInteger value; - sq_getinteger(vm, stackIdx, &value); - line+=std::to_string(value); - break; - } - case OT_FLOAT: - { - line+="Float "; - SQFloat value; - sq_getfloat(vm, stackIdx, &value); - line+=std::to_string(value); - break; - } - case OT_BOOL: - { - line+="Bool "; - SQBool value; - sq_getbool(vm, stackIdx, &value); - line+=(value ? "True" : "False"); - break; - } - case OT_STRING: - { - line+="String '"; - const SQChar *value; - sq_getstring(vm, stackIdx, &value); - if (value != nullptr) - { - line+=value; - line+="'"; - } - else - line+="'"; - break; - } - case OT_TABLE: - { - line+="Table "; - const void *ptr; - //sq_getvoidptr(vm, stackIdx, &ptr); - ptr = (void*)0x01020304; - line+=GetItemString(vm, stackIdx); - break; - } - case OT_ARRAY: - { - line+="Array "; - const void *ptr; - //sq_getvoidptr(vm, stackIdx, &ptr); - ptr = (void*)0x01020304; - line+=GetItemString(vm, stackIdx); - break; - } - case OT_USERDATA: - line+="UserData"; - break; - case OT_CLOSURE: - line+="Closure"; - break; - case OT_NATIVECLOSURE: - line+="NativeClosure"; - break; - case OT_GENERATOR: - line+="Generator"; - break; - case OT_USERPOINTER: - line+="UserPointer"; - break; - case OT_THREAD: - line+="Thread"; - break; - case OT_FUNCPROTO: - line+="FuncProto"; - break; - case OT_CLASS: - line+="Class"; - break; - case OT_INSTANCE: - { - line+="Instance "; - line+=GetItemString(vm, stackIdx); - break; - } - case OT_WEAKREF: - line+="WeakRef"; - break; - default: line+=""; - } - + line+=MakeStringFromSquirrelValue(vm, stackIdx); puts(line.c_str()); } puts(""); } -DLLIMPORT wxString ExtractLastSquirrelError(HSQUIRRELVM vm, bool canBeEmpty) +wxString ExtractLastSquirrelError(HSQUIRRELVM vm, bool canBeEmpty) { const SQChar *s; sq_getlasterror(vm); @@ -156,7 +162,7 @@ return errorMsg; } -DLLIMPORT void PrintSquirrelToWxString(wxString& msg, const SQChar* s, va_list& vl) +void PrintSquirrelToWxString(wxString& msg, const SQChar* s, va_list& vl) { SQChar localBuffer[2048]; @@ -189,4 +195,43 @@ } } +int ExtractParamsBase::ErrorMessage() +{ + wxString fullMessage(m_errorMessage); + fullMessage += "\n\nCALLSTACK:\n"; + + SQInteger level = 0; + SQStackInfos si; + while (SQ_SUCCEEDED(sq_stackinfos(m_vm, level, &si))) + { + const wxString fn(si.funcname ? si.funcname : _SC("unknown")); + const wxString src(si.source ? si.source : _SC("unknown")); + + fullMessage += wxString::Format("%d: Function '%s' at %s:%d\n", int(level), fn, src, int(si.line)); + + { + // Extract the arguments for the function. Arguments for native closures/functions + // cannot be extracted using this API. + wxString args; + const SQChar *name = nullptr; + SQInteger seq = 0; + while ((name = sq_getlocal(m_vm, level, seq)) != nullptr) + { + seq++; + args += " "; + args += name; + args += ": "; + args += MakeStringFromSquirrelValue(m_vm, -1); + args += "\n"; + sq_pop(m_vm, 1); + } + fullMessage += args; + } + level++; + } + + const wxScopedCharBuffer &utf8Buffer = fullMessage.utf8_str(); + return sq_throwerror(m_vm, utf8Buffer.data()); +} + } // namespace ScriptBindings diff -Nru codeblocks-20.03svn12487~ubuntu16.04/src/sdk/scripting/bindings/sc_wxtypes.cpp codeblocks-20.03svn12516~ubuntu16.04/src/sdk/scripting/bindings/sc_wxtypes.cpp --- codeblocks-20.03svn12487~ubuntu16.04/src/sdk/scripting/bindings/sc_wxtypes.cpp 2021-06-20 14:42:50.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/src/sdk/scripting/bindings/sc_wxtypes.cpp 2021-08-28 20:59:15.000000000 +0000 @@ -2,8 +2,8 @@ * This file is part of the Code::Blocks IDE and licensed under the GNU Lesser General Public License, version 3 * http://www.gnu.org/licenses/lgpl-3.0.html * - * $Revision: 12450 $ - * $Id: sc_wxtypes.cpp 12450 2021-05-18 22:43:09Z fuscated $ + * $Revision: 12491 $ + * $Id: sc_wxtypes.cpp 12491 2021-08-05 23:50:26Z fuscated $ * $HeadURL: https://svn.code.sf.net/p/codeblocks/code/trunk/src/sdk/scripting/bindings/sc_wxtypes.cpp $ */ @@ -751,6 +751,15 @@ return 1; } +SQInteger wxArrayString_GetCount(HSQUIRRELVM v) +{ + ExtractParams1 extractor(v); + if (!extractor.Process("wxArrayString_GetCount")) + return extractor.ErrorMessage(); + sq_pushinteger(v, extractor.p0->GetCount()); + return 1; +} + SQInteger wxArrayString_Item(HSQUIRRELVM v) { ExtractParams2 extractor(v); @@ -1116,9 +1125,7 @@ BindMethod(v, _SC("Add"), wxArrayString_Add, _SC("wxArrayString::Add")); BindMethod(v, _SC("Clear"), wxArrayString_Clear, _SC("wxArrayString::Clear")); BindMethod(v, _SC("Index"), wxArrayString_Index, _SC("wxArrayString::Index")); - BindMethod(v, _SC("GetCount"), - NoParamGetterInt, - _SC("wxArrayString::GetCount")); + BindMethod(v, _SC("GetCount"), wxArrayString_GetCount, _SC("wxArrayString::GetCount")); BindMethod(v, _SC("Item"), wxArrayString_Item, _SC("wxArrayString::Item")); BindMethod(v, _SC("SetItem"), wxArrayString_SetItem, _SC("wxArrayString::SetItem")); diff -Nru codeblocks-20.03svn12487~ubuntu16.04/src/src/app.cpp codeblocks-20.03svn12516~ubuntu16.04/src/src/app.cpp --- codeblocks-20.03svn12487~ubuntu16.04/src/src/app.cpp 2021-06-20 14:42:50.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/src/src/app.cpp 2021-08-28 20:59:15.000000000 +0000 @@ -2,8 +2,8 @@ * This file is part of the Code::Blocks IDE and licensed under the GNU General Public License, version 3 * http://www.gnu.org/licenses/gpl-3.0.html * - * $Revision: 12452 $ - * $Id: app.cpp 12452 2021-05-23 09:00:44Z fuscated $ + * $Revision: 12508 $ + * $Id: app.cpp 12508 2021-08-15 11:51:02Z fuscated $ * $HeadURL: https://svn.code.sf.net/p/codeblocks/code/trunk/src/src/app.cpp $ */ @@ -68,6 +68,7 @@ #ifdef __WXMSW__ #include "exchndl.h" // Crash handler DLL -> includes windows.h, therefore #include // ...include this header file on the NEXT LINE (wxWidgets docs say so) + #include #endif #ifndef __WXMAC__ @@ -595,7 +596,7 @@ wxLog::EnableLogging(true); - SetAppName(_T("codeblocks")); + SetAppName("codeblocks"); s_Loading = true; m_pBatchBuildDialog = nullptr; @@ -631,9 +632,9 @@ Manager::SetToolbarHandler(toolbarAddonHandler); - Manager::Get()->GetLogManager()->Log(F(wxT("Starting ") + appglobals::AppName + wxT(" ") + - appglobals::AppActualVersionVerb + wxT(" ") + - appglobals::AppBuildTimestamp)); + LogManager *log = Manager::Get()->GetLogManager(); + log->Log(wxString::Format(_("Starting %s %s %s"), appglobals::AppName, + appglobals::AppActualVersionVerb, appglobals::AppBuildTimestamp)); try { @@ -667,38 +668,40 @@ InitLocale(); - if (m_DDE && !m_Batch && Manager::Get()->GetConfigManager(_T("app"))->ReadBool(_T("/environment/use_ipc"), true)) + ConfigManager *appCfg = Manager::Get()->GetConfigManager("app"); + if (m_DDE && !m_Batch && appCfg->ReadBool("/environment/use_ipc", true)) { // Create a new client DDEClient *client = new DDEClient; DDEConnection* connection = nullptr; wxLogNull ln; // own error checking implemented -> avoid debug warnings - connection = (DDEConnection *)client->MakeConnection(_T("localhost"), F(DDE_SERVICE, wxGetUserId().wx_str()), DDE_TOPIC); - + connection = (DDEConnection *)client->MakeConnection("localhost", + wxString::Format(DDE_SERVICE, + wxGetUserId()), + DDE_TOPIC); if (connection) { // don't eval here just forward the whole command line to the other instance wxString cmdLine; for (int i = 1 ; i < argc; ++i) - cmdLine += wxString(argv[i]) + _T(' '); + cmdLine += wxString(argv[i]) + ' '; if (!cmdLine.IsEmpty()) { // escape openings and closings so it is easily possible to find the end on the rx side - cmdLine.Replace(_T("("), _T("\\(")); - cmdLine.Replace(_T(")"), _T("\\)")); + cmdLine.Replace("(", "\\("); + cmdLine.Replace(")", "\\)"); connection->Execute("[CmdLine({" + cmdLine + "})CWD({" + wxGetCwd() + "})]"); } // On Linux, C::B has to be raised explicitly if it's wanted - if (Manager::Get()->GetConfigManager(_T("app"))->ReadBool(_T("/environment/raise_via_ipc"), true)) - connection->Execute(_T("[Raise]")); + if (appCfg->ReadBool("/environment/raise_via_ipc", true)) + connection->Execute("[Raise]"); connection->Disconnect(); delete connection; delete client; - LogManager *log = Manager::Get()->GetLogManager(); - log->Log(wxT("Ending application because another instance has been detected!")); + log->Log("Ending application because another instance has been detected!"); // return false to end the application return false; @@ -714,10 +717,10 @@ } m_pSingleInstance = nullptr; - if ( Manager::Get()->GetConfigManager(_T("app"))->ReadBool(_T("/environment/single_instance"), true) - && !parser.Found(_T("multiple-instance")) ) + if (appCfg->ReadBool("/environment/single_instance", true) + && !parser.Found("multiple-instance")) { - const wxString name = wxString::Format(_T("Code::Blocks-%s"), wxGetUserId().wx_str()); + const wxString name = wxString::Format("Code::Blocks-%s", wxGetUserId()); m_pSingleInstance = new wxSingleInstanceChecker(name, ConfigManager::GetTempFolder()); if (m_pSingleInstance->IsAnotherRunning()) @@ -725,7 +728,7 @@ /* NOTE: Due to a recent change in logging code, this visual warning got disabled. So the wxLogError() has been changed to a cbMessageBox(). */ cbMessageBox(_("Another program instance is already running.\nCode::Blocks is currently configured to only allow one running instance.\n\nYou can access this Setting under the menu item 'Environment'."), - _T("Code::Blocks"), wxOK | wxICON_ERROR); + "Code::Blocks", wxOK | wxICON_ERROR); return false; } } @@ -733,7 +736,7 @@ // Splash screen moved to this place, otherwise it would be short visible, even if we only pass filenames via DDE/IPC // we also don't need it, if only a single instance is allowed Splash splash(!m_Batch && m_Script.IsEmpty() && m_Splash && - Manager::Get()->GetConfigManager(_T("app"))->ReadBool(_T("/environment/show_splash"), true)); + appCfg->ReadBool("/environment/show_splash", true)); InitDebugConsole(); Manager::SetBatchBuild(m_Batch || !m_Script.IsEmpty()); @@ -742,25 +745,23 @@ frame = InitFrame(); m_Frame = frame; -#if wxCHECK_VERSION(3, 0, 0) { const double scalingFactor = frame->GetContentScaleFactor(); const double actualScalingFactor = cbGetActualContentScaleFactor(*frame); - LogManager *log = Manager::Get()->GetLogManager(); - log->Log(wxString::Format(wxT("Initial scaling factor is %.3f (actual: %.3f)"), + log->Log(wxString::Format("Initial scaling factor is %.3f (actual: %.3f)", scalingFactor, actualScalingFactor)); } -#endif // wxCHECK_VERSION(3, 0, 0) // plugins loaded -> check command line arguments again delete wxMessageOutput::Set(new wxMessageOutputBest); // warn about unknown options - if ( ParseCmdLine(m_Frame) == 0 ) + if (ParseCmdLine(m_Frame) == 0) { - if (Manager::Get()->GetConfigManager(_T("app"))->ReadBool(_T("/environment/blank_workspace"), true) == false) + if (appCfg->ReadBool("/environment/blank_workspace", true) == false) Manager::Get()->GetProjectManager()->LoadWorkspace(); } - if (m_SafeMode) wxLog::EnableLogging(true); // re-enable logging in safe-mode + if (m_SafeMode) + wxLog::EnableLogging(true); // re-enable logging in safe-mode if (m_Batch) { @@ -799,7 +800,8 @@ CheckVersion(); // run startup script - const wxString startup = ConfigManager::LocateDataFile(_T("startup.script"), sdScriptsUser | sdScriptsGlobal); + const wxString startup = ConfigManager::LocateDataFile("startup.script", + sdScriptsUser | sdScriptsGlobal); if (!startup.empty()) { ScriptingManager *scriptMgr = Manager::Get()->GetScriptingManager(); @@ -841,11 +843,11 @@ } catch (const char* message) { - wxSafeShowMessage(_T("Exception"), cbC2U(message)); + wxSafeShowMessage("Exception", cbC2U(message)); } catch (...) { - wxSafeShowMessage(_T("Exception"), _T("Unknown exception was raised. The application will terminate immediately...")); + wxSafeShowMessage("Exception", "Unknown exception was raised. The application will terminate immediately..."); } // if we reached here, return error return false; diff -Nru codeblocks-20.03svn12487~ubuntu16.04/src/src/associations.cpp codeblocks-20.03svn12516~ubuntu16.04/src/src/associations.cpp --- codeblocks-20.03svn12487~ubuntu16.04/src/src/associations.cpp 2021-05-12 18:04:52.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/src/src/associations.cpp 2021-08-28 20:59:15.000000000 +0000 @@ -2,8 +2,8 @@ * This file is part of the Code::Blocks IDE and licensed under the GNU General Public License, version 3 * http://www.gnu.org/licenses/gpl-3.0.html * - * $Revision: 12309 $ - * $Id: associations.cpp 12309 2021-03-19 21:13:33Z fuscated $ + * $Revision: 12508 $ + * $Id: associations.cpp 12508 2021-08-15 11:51:02Z fuscated $ * $HeadURL: https://svn.code.sf.net/p/codeblocks/code/trunk/src/src/associations.cpp $ */ @@ -19,6 +19,11 @@ #include #include + #ifdef __WXMSW__ + #include + #include // for SHChangeNotify() +#endif + const Associations::Assoc knownTypes[] = { /* diff -Nru codeblocks-20.03svn12487~ubuntu16.04/src/src/associations.h codeblocks-20.03svn12516~ubuntu16.04/src/src/associations.h --- codeblocks-20.03svn12487~ubuntu16.04/src/src/associations.h 2021-05-12 18:05:13.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/src/src/associations.h 2021-08-28 20:59:15.000000000 +0000 @@ -7,25 +7,18 @@ #define ASSOCIATIONS_H #include "scrollingdialog.h" -#include -#include + #ifdef __WXMSW__ - #include - #include // for SHChangeNotify() - #ifdef __CBDEBUG__ - #include - #include - #endif - #define DDE_SERVICE _T("CODEBLOCKS") + #define DDE_SERVICE "CODEBLOCKS" #else - #define DDE_SERVICE _T("/tmp/CODEBLOCKS%s.socket") + #define DDE_SERVICE "/tmp/CODEBLOCKS%s.socket" #endif -#define DDE_TOPIC _T("CodeBlocksDDEServer") -#include +#define DDE_TOPIC "CodeBlocksDDEServer" class wxCheckListBox; -class wxWindow; class wxCommandEvent; +class wxString; +class wxWindow; namespace Associations { diff -Nru codeblocks-20.03svn12487~ubuntu16.04/src/src/debugger_interface_creator.cpp codeblocks-20.03svn12516~ubuntu16.04/src/src/debugger_interface_creator.cpp --- codeblocks-20.03svn12487~ubuntu16.04/src/src/debugger_interface_creator.cpp 2021-05-12 18:05:13.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/src/src/debugger_interface_creator.cpp 2021-08-28 20:59:15.000000000 +0000 @@ -206,10 +206,7 @@ return false; else { - m_tooltip = new ValueTooltip(watch, Manager::Get()->GetAppWindow()); -#ifndef __WXMAC__ - m_tooltip->Position(pt, wxSize(0, 0)); -#endif + m_tooltip = new ValueTooltip(watch, Manager::Get()->GetAppWindow(), pt); // hide any other tooltips EditorBase *base = Manager::Get()->GetEditorManager()->GetActiveEditor(); cbEditor *ed = base && base->IsBuiltinEditor() ? static_cast(base) : nullptr; diff -Nru codeblocks-20.03svn12487~ubuntu16.04/src/src/environmentsettingsdlg.cpp codeblocks-20.03svn12516~ubuntu16.04/src/src/environmentsettingsdlg.cpp --- codeblocks-20.03svn12487~ubuntu16.04/src/src/environmentsettingsdlg.cpp 2021-05-12 18:05:12.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/src/src/environmentsettingsdlg.cpp 2021-08-28 20:59:15.000000000 +0000 @@ -2,8 +2,8 @@ * This file is part of the Code::Blocks IDE and licensed under the GNU General Public License, version 3 * http://www.gnu.org/licenses/gpl-3.0.html * - * $Revision: 12240 $ - * $Id: environmentsettingsdlg.cpp 12240 2020-11-23 18:14:58Z fuscated $ + * $Revision: 12488 $ + * $Id: environmentsettingsdlg.cpp 12488 2021-08-03 21:11:59Z bluehazzard $ * $HeadURL: https://svn.code.sf.net/p/codeblocks/code/trunk/src/src/environmentsettingsdlg.cpp $ */ @@ -154,9 +154,9 @@ { if (!platform::macosx && !platform::darwin) { - combo->Append(wxT("gnome-terminal -t $TITLE -x ")); + combo->Append(wxT("gnome-terminal --wait -t $TITLE -x ")); combo->Append(wxT("konsole -e ")); - combo->Append(wxT("xfce4-terminal -T $TITLE -x ")); + combo->Append(wxT("xfce4-terminal --disable-server -T $TITLE -x ")); combo->Append(wxT("terminology -M -T $TITLE -e ")); } wxString terminal = cfg->Read(wxT("/console_terminal"), DEFAULT_CONSOLE_TERM); Binary files /tmp/tmpv1yhqrn0/8rNjfg6efX/codeblocks-20.03svn12487~ubuntu16.04/src/src/resources/resources.zip and /tmp/tmpv1yhqrn0/Fx7MnHre4q/codeblocks-20.03svn12516~ubuntu16.04/src/src/resources/resources.zip differ Binary files /tmp/tmpv1yhqrn0/8rNjfg6efX/codeblocks-20.03svn12487~ubuntu16.04/src/src/resources/start_here.zip and /tmp/tmpv1yhqrn0/Fx7MnHre4q/codeblocks-20.03svn12516~ubuntu16.04/src/src/resources/start_here.zip differ diff -Nru codeblocks-20.03svn12487~ubuntu16.04/src/src/watchesdlg.cpp codeblocks-20.03svn12516~ubuntu16.04/src/src/watchesdlg.cpp --- codeblocks-20.03svn12487~ubuntu16.04/src/src/watchesdlg.cpp 2021-05-12 18:05:11.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/src/src/watchesdlg.cpp 2021-08-28 20:59:15.000000000 +0000 @@ -2,8 +2,8 @@ * This file is part of the Code::Blocks IDE and licensed under the GNU General Public License, version 3 * http://www.gnu.org/licenses/gpl-3.0.html * - * $Revision: 12208 $ - * $Id: watchesdlg.cpp 12208 2020-10-04 20:42:14Z d_anselmi $ + * $Revision: 12502 $ + * $Id: watchesdlg.cpp 12502 2021-08-14 14:37:01Z fuscated $ * $HeadURL: https://svn.code.sf.net/p/codeblocks/code/trunk/src/src/watchesdlg.cpp $ */ @@ -27,8 +27,9 @@ #include #include -#include +#include #include +#include #include "watchesdlg.h" @@ -72,10 +73,6 @@ EVT_MENU(idMenuUpdate, WatchesDlg::OnMenuUpdate) END_EVENT_TABLE() -#if wxCHECK_VERSION(3, 0, 0) -typedef wxString wxPG_CONST_WXCHAR_PTR; -#endif - struct WatchesDlg::WatchItemPredicate { WatchItemPredicate(cb::shared_ptr watch) : m_watch(watch) {} @@ -93,7 +90,7 @@ DECLARE_DYNAMIC_CLASS(cbDummyEditor) public: cbDummyEditor() {} - wxPG_CONST_WXCHAR_PTR GetName() const override + wxString GetName() const override { return wxT("cbDummyEditor"); } @@ -129,7 +126,7 @@ { DECLARE_DYNAMIC_CLASS(cbTextCtrlAndButtonTooltipEditor) public: - wxPG_CONST_WXCHAR_PTR GetName() const override + wxString GetName() const override { return wxT("cbTextCtrlAndButtonTooltipEditor"); } @@ -298,7 +295,8 @@ } } - static void WatchToString(wxString &result, const cbWatch &watch, const wxString &indent = wxEmptyString) + static void WatchToString(wxString &result, const cbWatch &watch, + const wxString &indent = wxEmptyString) { wxString sym, value; watch.GetSymbol(sym); @@ -395,24 +393,10 @@ SetSizer(bs); if (!watchesPropertyEditor) - { -#if wxCHECK_VERSION(3, 0, 0) watchesPropertyEditor = wxPropertyGrid::RegisterEditorClass(new cbTextCtrlAndButtonTooltipEditor, true); -#else - watchesPropertyEditor = wxPropertyGrid::RegisterEditorClass(new cbTextCtrlAndButtonTooltipEditor, - wxT("cbTextCtrlAndButtonTooltipEditor"), - true); -#endif - } if (!watchesDummyEditor) - { -#if wxCHECK_VERSION(3, 0, 0) watchesDummyEditor = wxPropertyGrid::RegisterEditorClass(new cbDummyEditor, true); -#else - watchesDummyEditor = wxPropertyGrid::RegisterEditorClass(new cbDummyEditor, wxT("cbDummyEditor"), true); -#endif - } m_grid->SetColumnProportion(0, 40); m_grid->SetColumnProportion(1, 40); @@ -434,7 +418,7 @@ new Functor(this, &WatchesDlg::OnDebuggerUpdated)); } -inline void AppendChildren(wxPropertyGrid &grid, wxPGProperty &property, cbWatch &watch, +static void AppendChildren(wxPropertyGrid &grid, wxPGProperty &property, cbWatch &watch, bool readonly, const wxColour &changedColour) { for(int ii = 0; ii < watch.GetChildCount(); ++ii) @@ -462,19 +446,14 @@ WatchRawDialog::UpdateValue(static_cast(prop)); } else - { -#if wxCHECK_VERSION(3, 0, 0) grid.SetPropertyColoursToDefault(prop); -#else - grid.SetPropertyColourToDefault(prop); -#endif - } AppendChildren(grid, *prop, *child.get(), readonly, changedColour); } } -inline void UpdateWatch(wxPropertyGrid *grid, wxPGProperty *property, cb::shared_ptr watch, bool readonly) +static void UpdateWatch(wxPropertyGrid *grid, wxPGProperty *property, cb::shared_ptr watch, + bool readonly) { if (!property) return; @@ -490,13 +469,7 @@ if (watch->IsChanged()) grid->SetPropertyTextColour(property, changedColour); else - { -#if wxCHECK_VERSION(3, 0, 0) grid->SetPropertyColoursToDefault(property); -#else - grid->SetPropertyColourToDefault(property); -#endif - } grid->SetPropertyAttribute(property, wxT("Units"), type); if (value.empty()) grid->SetPropertyHelpString(property, wxEmptyString); @@ -523,7 +496,7 @@ WatchRawDialog::UpdateValue(static_cast(property)); } -inline void SetValue(WatchesProperty *prop) +static void SetValue(WatchesProperty *prop) { if (prop) { @@ -1089,19 +1062,15 @@ EVT_TIMER(idTooltipTimer, ValueTooltip::OnTimer) END_EVENT_TABLE() -inline wxPGProperty* GetRealRoot(wxPropertyGrid *grid) +static wxPGProperty* GetRealRoot(wxPropertyGrid *grid) { wxPGProperty *property = grid->GetRoot(); return property ? grid->GetFirstChild(property) : nullptr; } -inline void GetColumnWidths(wxClientDC &dc, wxPropertyGrid *grid, wxPGProperty *root, int width[3]) +static void GetColumnWidths(wxClientDC &dc, wxPropertyGrid *grid, wxPGProperty *root, int width[3]) { -#if wxCHECK_VERSION(3, 0, 0) wxPropertyGridPageState *state = grid->GetState(); -#else - wxPropertyGridState *state = grid->GetState(); -#endif width[0] = width[1] = width[2] = 0; int minWidths[3] = { state->GetColumnMinWidth(0), @@ -1134,14 +1103,15 @@ width[2] = std::max(width[2], minWidths[2]); } -inline void GetColumnWidths(wxPropertyGrid *grid, wxPGProperty *root, int width[3]) +static void GetColumnWidths(wxPropertyGrid *grid, wxPGProperty *root, int width[3]) { wxClientDC dc(grid); dc.SetFont(grid->GetFont()); GetColumnWidths(dc, grid, root, width); } -inline void SetMinSize(wxPropertyGrid *grid) +static void GridSetMinSize(wxPropertyGrid *grid, const wxPoint &position, + const wxRect &displayClientRect) { wxPGProperty *p = GetRealRoot(grid); wxPGProperty *first = grid->wxPropertyGridInterface::GetFirst(wxPG_ITERATE_ALL); @@ -1156,29 +1126,54 @@ int width[3]; GetColumnWidths(grid, grid->GetRoot(), width); + // Add a bit of breathing room to prevent the appearance of a horizontal scroll for short + // expressions - example "int a=5;". + // This more of a workaround, a proper fix would require a thorough investigation of the + // wxPropGrid code, but I don't have the time at the moment. + width[0] += 10; + width[1] += 10; + width[2] += 10; + rect.width = std::accumulate(width, width+3, 0); - int minWidth = (wxSystemSettings::GetMetric(wxSYS_SCREEN_X, grid->GetParent())*3)/2; - int minHeight = (wxSystemSettings::GetMetric(wxSYS_SCREEN_Y, grid->GetParent())*3)/2; + const int minWidth = (wxSystemSettings::GetMetric(wxSYS_SCREEN_X, grid->GetParent())*3)/2; + const int minHeight = (wxSystemSettings::GetMetric(wxSYS_SCREEN_Y, grid->GetParent())*3)/2; + + const wxSize fullSize(std::min(minWidth, rect.width), std::min(minHeight, height)); + wxSize size = fullSize; + int virtualWidth = -1; + + // We have a display rect, so we can use it to make sure the window fits inside it. + if (displayClientRect.GetSize().x > 0) + { + const wxSize sizeClipped = wxRect(position, size).Intersect(displayClientRect).GetSize(); + if (size != sizeClipped) + { + virtualWidth = size.x; + size = sizeClipped; + } + } -#if wxCHECK_VERSION(3, 0, 0) - wxSize size(std::min(minWidth, rect.width), std::min(minHeight, height)); -#else - wxSize size(std::min(minWidth, rect.width + grid->GetMarginWidth()), std::min(minHeight, height)); -#endif grid->SetMinSize(size); int proportions[3]; - proportions[0] = static_cast(floor((double)width[0]/size.x*100.0+0.5)); - proportions[1] = static_cast(floor((double)width[1]/size.x*100.0+0.5)); + proportions[0] = static_cast(floor(((double)width[0]/fullSize.x)*100.0+0.5)); + proportions[1] = static_cast(floor(((double)width[1]/fullSize.x)*100.0+0.5)); proportions[2]= std::max(100 - proportions[0] - proportions[1], 0); grid->SetColumnProportion(0, proportions[0]); grid->SetColumnProportion(1, proportions[1]); grid->SetColumnProportion(2, proportions[2]); grid->ResetColumnSizes(true); + + // This enables the horizontal scroll. Unfortunately the last column is still placed on the left + // so manual resizing of the value column is required if the sum of the max-widths of the + // columns makes the window to be too big and so it doesn't fit on the screen, so we've shrunk + // it. + grid->SetVirtualWidth(virtualWidth); } -ValueTooltip::ValueTooltip(const cb::shared_ptr &watch, wxWindow *parent) : +ValueTooltip::ValueTooltip(const cb::shared_ptr &watch, wxWindow *parent, + const wxPoint &screenPosition) : #ifndef __WXMAC__ wxPopupWindow(parent, wxBORDER_NONE|wxWANTS_CHARS), #else @@ -1188,8 +1183,8 @@ m_outsideCount(0), m_watch(watch) { - m_panel = new wxScrolledWindow(this, wxID_ANY, wxDefaultPosition, wxSize(200, 200)); - m_grid = new wxPropertyGrid(m_panel, idTooltipGrid, wxDefaultPosition, wxSize(400,400), wxPG_SPLITTER_AUTO_CENTER); + m_grid = new wxPropertyGrid(this, idTooltipGrid, wxDefaultPosition, wxSize(200, 200), + wxPG_SPLITTER_AUTO_CENTER); long extraStyles = 0; #if wxCHECK_VERSION(3, 0, 3) @@ -1210,19 +1205,41 @@ m_watch->GetValue(value); wxPGProperty *root = m_grid->Append(new WatchesProperty(symbol, value, m_watch, true)); m_watch->MarkAsChangedRecursive(false); - ::UpdateWatch(m_grid, root, m_watch, true); - ::SetMinSize(m_grid); + // If we leave the watch expanded and the user decides to collapse the root, the window refuses + // to shrink. + // This makes the min size to be as large as a single non-expanded property. + // Later we'll expand. + const bool oldExpanded = m_watch->IsExpanded(); + if (oldExpanded) + m_watch->Expand(false); + ::UpdateWatch(m_grid, root, m_watch, true); m_sizer = new wxBoxSizer( wxVERTICAL ); m_sizer->Add(m_grid, 0, wxALL | wxEXPAND, 0); - m_panel->SetAutoLayout(true); - m_panel->SetSizer(m_sizer); - m_sizer->Fit(m_panel); - m_sizer->Fit(this); + // Apply the calculated min size. + const int idx = wxDisplay::GetFromWindow(parent); + wxDisplay display(idx != wxNOT_FOUND ? idx : 0); + GridSetMinSize(m_grid, screenPosition, display.GetClientArea()); + SetSizer(m_sizer); + + // Expand here after the min size calculation is done. + if (oldExpanded) + { + m_watch->Expand(true); + //m_grid->Refresh(); + m_grid->Expand(root); + UpdateSizeAndFit(parent, screenPosition); + } + else + Fit(); m_timer.Start(100); + +#ifndef __WXMAC__ + Position(screenPosition, wxSize(0, 0)); +#endif } ValueTooltip::~ValueTooltip() @@ -1235,7 +1252,7 @@ m_watch->MarkAsChangedRecursive(false); ::UpdateWatch(m_grid, GetRealRoot(m_grid), m_watch, true); m_grid->Refresh(); - Fit(); + UpdateSizeAndFit(this, GetScreenPosition()); } void ValueTooltip::ClearWatch() @@ -1261,13 +1278,12 @@ ClearWatch(); } -void ValueTooltip::Fit() +void ValueTooltip::UpdateSizeAndFit(wxWindow *usedToGetDisplay, const wxPoint &screenPosition) { - ::SetMinSize(m_grid); - m_sizer->Fit(m_panel); - wxPoint pos = GetScreenPosition(); - wxSize size = m_panel->GetScreenRect().GetSize(); - SetSize(pos.x, pos.y, size.x, size.y); + const int idx = wxDisplay::GetFromWindow(usedToGetDisplay); + wxDisplay display(idx != wxNOT_FOUND ? idx : 0); + GridSetMinSize(m_grid, screenPosition, display.GetClientArea()); + Fit(); } void ValueTooltip::OnCollapse(wxPropertyGridEvent &event) @@ -1278,7 +1294,7 @@ cbDebuggerPlugin *plugin = Manager::Get()->GetDebuggerManager()->GetActiveDebugger(); if (plugin) plugin->CollapseWatch(prop->GetWatch()); - Fit(); + UpdateSizeAndFit(this, GetScreenPosition()); } void ValueTooltip::OnExpand(wxPropertyGridEvent &event) @@ -1289,7 +1305,7 @@ cbDebuggerPlugin *plugin = Manager::Get()->GetDebuggerManager()->GetActiveDebugger(); if (plugin) plugin->ExpandWatch(prop->GetWatch()); - Fit(); + UpdateSizeAndFit(this, GetScreenPosition()); } void ValueTooltip::OnTimer(cb_unused wxTimerEvent &event) diff -Nru codeblocks-20.03svn12487~ubuntu16.04/src/src/watchesdlg.h codeblocks-20.03svn12516~ubuntu16.04/src/src/watchesdlg.h --- codeblocks-20.03svn12487~ubuntu16.04/src/src/watchesdlg.h 2021-05-12 18:05:11.000000000 +0000 +++ codeblocks-20.03svn12516~ubuntu16.04/src/src/watchesdlg.h 2021-08-28 20:59:15.000000000 +0000 @@ -85,7 +85,8 @@ #endif { public: - ValueTooltip(const cb::shared_ptr &watch, wxWindow *parent); + ValueTooltip(const cb::shared_ptr &watch, wxWindow *parent, + const wxPoint &screenPosition); ~ValueTooltip(); void Dismiss(); @@ -93,7 +94,7 @@ protected: virtual void OnDismiss(); private: - void Fit() override; + void UpdateSizeAndFit(wxWindow *usedToGetDisplay, const wxPoint &screenPosition); void ClearWatch(); private: @@ -103,7 +104,6 @@ private: wxPropertyGrid *m_grid; wxBoxSizer *m_sizer; - wxPanel *m_panel; wxTimer m_timer; int m_outsideCount;