From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1093 invoked by alias); 12 Feb 2010 13:07:08 -0000 Received: (qmail 1074 invoked by uid 22791); 12 Feb 2010 13:07:03 -0000 X-SWARE-Spam-Status: No, hits=-0.6 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from smtpedge.outnet.ch (HELO smtpedge.outnet.ch) (80.67.146.10) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 12 Feb 2010 13:06:58 +0000 Received: from tkssrexhcu01.outnet.ch (172.17.220.45) by smtpedge.outnet.ch (10.1.1.155) with Microsoft SMTP Server (TLS) id 8.1.375.2; Fri, 12 Feb 2010 14:06:29 +0100 Received: from TKSSREX01.outnet.ch ([10.10.10.1]) by tkssrexhcu01.outnet.ch ([172.17.220.45]) with mapi; Fri, 12 Feb 2010 14:06:34 +0100 From: Simon Maurer To: "ecos-devel@ecos.sourceware.org" Date: Fri, 12 Feb 2010 13:07:00 -0000 Subject: ConfigTool Message-ID: Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact ecos-devel-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: ecos-devel-owner@ecos.sourceware.org X-SW-Source: 2010-02/txt/msg00007.txt.bz2 Hi folks, Our Apparatus Framework Configtool (http://apfw.sourceforge.net/) is based = on the eCos Configtool. Thanks a lot for this great tool. For the next rele= ase we have merged the new sources of the the eCos configtool to our versio= n and fixed some bugs, which crashed the application. However, this is the= patch which includes the bugfixes for the eCos Configtool (wxWidgets versi= on). This patch changes the behavior of the path handling, so be careful. I= build the Configtool with cygwin 1.7 on Windows 7. Maybe some future patches will follow. kind regards, Simon Maurer Index: host/tools/configtool/common/common/build.cxx =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- host/tools/configtool/common/common/build.cxx (revision = 1819) +++ host/tools/configtool/common/common/build.cxx (revision 183= 1) @@ -92,7 +92,7 @@ } return output; } - +/* #if defined(_WIN32) || defined(__CYGWIN__) // convert a filepath into a vector of path components static void path_to_vector (std::string input, std::vector &= output) { @@ -150,19 +150,21 @@ return input; #endif } - +*/ // convert a DOS filepath to a Cygwin filepath std::string cygpath (const std::string input) { #if defined(_WIN32) || defined(__CYGWIN__) - // remove spaces from the DOS filepath - const std::string path =3D nospace_path (input); - std::string output; + // remove spaces from the DOS filepath + //const std::string path =3D nospace_path (input); + /* all strings which are used in build.cxx coming from ecUtils::Native= ToPosixPath. This function rmoves spaces in the path. + Makefile doesn't work with paths containing spaces*/ + std::string output; - // convert the DOS filepath to Cygwin notation using Cygwin = if available + + //std::string strCygdrive("/cygdrive"); + std::string strCygdrive("/"); #if defined(__CYGWIN__) && (ECOS_USE_CYGDRIVE =3D=3D 0) - char buffer [MAX_PATH + 1]; - cygwin_conv_to_posix_path (path.c_str (), buffer); - output =3D buffer; + output =3D input; #else #if ECOS_USE_CYGDRIVE =3D=3D 1 @@ -201,19 +203,23 @@ RegCloseKey(hKey); } #endif - strCygdrive =3D strCygdrive + "/"; + //strCygdrive =3D strCygdrive + "/"; - for (unsigned int n =3D 0; n < path.size (); n++) { // for e= ach char - if ((1 =3D=3D n) && (':' =3D=3D path [n])) {= // if a DOS logical drive letter is present - output =3D strCygdrive + (con= st char) tolower(path [0]); // convert to Cygwin notation - } else { - output +=3D ('\\' =3D=3D path= [n]) ? '/' : path [n]; // convert backslash to slash - } - } + for (unsigned int n =3D 0; n < input.size (); n++) { // for each char + if ((1 =3D=3D n) && (':' =3D=3D input [n])) { // if a DOS logical = drive letter is present + output =3D strCygdrive + output; // convert to Cygwin notation + } else { + output +=3D ('\\' =3D=3D input [n]) ? '/' : input [n]; // conv= ert backslash to slash + } + } #elif ECOS_USE_CYGDRIVE =3D=3D 2 // Convert to c:/foo/bar notation - for (unsigned int n =3D 0; n < path.size (); n++) { // for e= ach char - output +=3D ('\\' =3D=3D path= [n]) ? '/' : path [n]; // convert backslash to slash + + char buffer[PATH_MAX]; + cygwin_conv_to_win32_path(input.c_str(), buffer); + + for (unsigned int n =3D 0; n < sizeof(buffer) && buffer[n] !=3D '\0'; = n++) { // for each char + output +=3D ('\\' =3D=3D buffer [n]) ? '/' : buffer [n]; // conver= t backslash to slash } #elif ECOS_USE_CYGDRIVE =3D=3D 3 // Convert to /ecos-x notation, assuming that this mount point will be= created @@ -221,39 +227,36 @@ std::string output1; - if (path.size() > 1 && path[1] =3D=3D ':') - { + if (input.size() > 1 && input[1] =3D=3D ':') { output1 =3D "/ecos-"; - output1 +=3D tolower(path[0]); + output1 +=3D tolower(input[0]); output1 +=3D "/"; // Append the rest of the path - if (path.size() > 2) - { + if (input.size() > 2) { unsigned int n =3D 2; unsigned int i; - if (path[n] =3D=3D '\\' || path[n] =3D=3D '/') + if (input[n] =3D=3D '\\' || input[n] =3D=3D '/') n ++; - for (i =3D n; i < path.size(); i++) - output1 +=3D path[i]; + for (i =3D n; i < input.size(); i++) + output1 +=3D input[i]; } - } - else - output1 =3D path; + } else + output1 =3D input; for (unsigned int n =3D 0; n < output1.size (); n++) { // for each char output +=3D ('\\' =3D=3D output1 [n]) ? '/' : output1 [n]; = // convert backslash to slash } #else - for (unsigned int n =3D 0; n < path.size (); n++) { // for e= ach char - if ((1 =3D=3D n) && (':' =3D=3D path [n])) {= // if a DOS logical drive letter is present - output =3D "//" + output; // = convert to Cygwin notation - } else { - output +=3D ('\\' =3D=3D path= [n]) ? '/' : path [n]; // convert backslash to slash - } - } + for (unsigned int n =3D 0; n < input.size (); n++) { // for each char + if ((1 =3D=3D n) && (':' =3D=3D input [n])) { // if a DOS logical = drive letter is present + output =3D "//" + output; // convert to Cygwin notation + } else { + output +=3D ('\\' =3D=3D input [n]) ? '/' : input [n]; // conv= ert backslash to slash + } + } #endif // ECOS_USE_CYGDRIVE #endif Index: host/tools/configtool/standalone/wxwin/configtooldoc.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- host/tools/configtool/standalone/wxwin/configtooldoc.cpp (r= evision 1819) +++ host/tools/configtool/standalone/wxwin/configtooldoc.cpp (revi= sion 1831) @@ -1158,11 +1158,11 @@ delete pItem; } else if (bNowLoaded) {// if the package should be loaded const wxString strVersion(dlg.GetVersion (strPackageName)); - if (bPreviouslyLoaded) { // if the package is already load= ed + if (bPreviouslyLoaded && (m_items.Find(pItem) !=3D NULL)) = { // if the package is already loaded CdlTransactionCallback::set_callback_fn (NULL); // avo= id value refresh attempts during load/unload bChanged|=3DpItem->ChangeVersion(strVersion); CdlTransactionCallback::set_callback_fn (CdlTransactio= nHandler); // restore value refresh - } else { + } else if (!bPreviouslyLoaded) { // the package was not loaded but should now be loaded //TRACE (_T("Loading package %s\n"), strMacroName); try Index: host/tools/configtool/standalone/wxwin/ecutils.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- host/tools/configtool/standalone/wxwin/ecutils.cpp (revision= 1819) +++ host/tools/configtool/standalone/wxwin/ecutils.cpp (revision 18= 31) @@ -55,6 +55,7 @@ #include "ecutils.h" #include "wx/listctrl.h" #include "wx/stream.h" +#include "wx/vector.h" #include // for DBL_DIG macro #include @@ -258,6 +259,56 @@ } #endif +#if defined(__CYGWIN__) +WX_DECLARE_VECTOR(wxString, StringVector); + +// convert a filepath into a vector of path components +static void path_to_vector (wxString input, StringVector & output) { + wxString component; + output.clear (); + + for (unsigned int n =3D 0; n < input.size (); n++) { // for e= ach char in the path + if (('/' =3D=3D input [n]) || ('\\' =3D=3D in= put [n])) { // if char is a directory separator + output.push_back (component); = // add path component to output vector + component.erase (); // clear p= ath component string + } else { // char is not a separator + component +=3D input [n]; // a= dd char to path component string + } + } + output.push_back (component); // add final path component to = output vector +} + +// eliminate spaces from a DOS filepath by substituting the +// short form of path components containing spaces +wxString nospace_path (const wxString input) { + // split the path into a vector of path components + StringVector long_path_vector; + path_to_vector (input, long_path_vector); + + // convert the path to its short form and split + // the result into a vector of path components + char buffer [MAX_PATH + 1]; + GetShortPathNameA (input.c_str (), buffer, sizeof (buffer)); + StringVector short_path_vector; + path_to_vector (buffer, short_path_vector); + + // append the short or long form of each path component to the output = string as appropriate + wxString output; + for (unsigned int n =3D 0; n < long_path_vector.size (); n++) { // for= each component of the path + if ((long_path_vector [n].Find (' ') !=3D wxNOT_FOUND) && (n < sho= rt_path_vector.size ())) { // if there is a space in the path component + output +=3D short_path_vector [n]; // add the short form of th= e path component + } else { // there is no space in the path component + output +=3D long_path_vector [n]; // add the long form of the = path component + } + output +=3D '\\'; // add a directory separator + } + output.resize (output.size () - 1); // remove the trailing separator + + return output; +} +#endif + + const wxString ecUtils::NativeToPosixPath(const wxString & native) { #ifdef __CYGWIN__ @@ -266,7 +317,8 @@ else { wxString posix; - cygwin_conv_to_posix_path(native.c_str(), posix.GetWriteBuf(PATH_M= AX + 1)); + posix =3D nospace_path (native); // replace any directories contai= ning spaces with the short path variant + cygwin_conv_to_posix_path(posix.c_str(), posix.GetWriteBuf(PATH_MA= X + 1)); posix.UngetWriteBuf(); return posix; } Index: host/tools/configtool/standalone/wxwin/configitem.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- host/tools/configtool/standalone/wxwin/configitem.cpp (revision 1819) +++ host/tools/configtool/standalone/wxwin/configitem.cpp (revision 1831) @@ -714,33 +714,19 @@ wxGetApp().GetTreeCtrl()->Delete(GetTreeItem()); -#if wxCHECK_VERSION(2, 6, 0) wxNode* node =3D pDoc->GetItems().GetFirst(); while (node) { ecConfigItem* item =3D wxDynamicCast(node->GetData(), ecConfigItem= ); - if (package =3D=3D item->GetOwnerPackage() && item !=3D this) - { - item->SetTreeItem(wxTreeItemId()); // Make sure we can't attem= pt to paint it - item->SetCdlItem(NULL); // Make sure we can't access stale data - delete item; // Delete the item itself - } + //delete item removes itself from the list; =3D> node points to a = deallocated memmory node =3D node->GetNext(); - } -#else - wxNode* node =3D pDoc->GetItems().First(); - while (node) - { - ecConfigItem* item =3D wxDynamicCast(node->Data(), ecConfigItem); if (package =3D=3D item->GetOwnerPackage() && item !=3D this) { - item->SetTreeItem(wxTreeItemId()); // Make sure we can't attem= pt to paint it + //item->SetTreeItem(wxTreeItemId()); // Make sure we can't att= empt to paint it item->SetCdlItem(NULL); // Make sure we can't access stale data delete item; // Delete the item itself } - node =3D node->Next(); } -#endif const wxString strMacroName(GetMacro()); //TRACE (wxT("Unloading package %s\n"), strMacroName); Index: host/tools/configtool/standalone/wxwin/aboutdlg.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- host/tools/configtool/standalone/wxwin/aboutdlg.h (revision = 1819) +++ host/tools/configtool/standalone/wxwin/aboutdlg.h (revision 183= 1) @@ -74,7 +74,7 @@ * that's already been destroyed) */ -class WXDLLEXPORT ecSplashScreen: public wxSplashScreen +class ecSplashScreen: public wxSplashScreen { public: ecSplashScreen(const wxBitmap& bitmap, long splashStyle, int milliseco= nds, wxWindow* parent, wxWindowID id, const wxPoint& pos =3D wxDefaultPosit= ion, const wxSize& size =3D wxDefaultSize, long style =3D wxSIMPLE_BORDER|w= xFRAME_FLOAT_ON_PARENT); Index: host/tools/configtool/standalone/wxwin/makefile.gnu =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- host/tools/configtool/standalone/wxwin/makefile.gnu (revision 181= 9) +++ host/tools/configtool/standalone/wxwin/makefile.gnu (revision 1831) @@ -45,30 +45,49 @@ CTBUILDDIR=3D$(shell pwd) ECOSSRCDIR=3D$(INSTALLDIR)/src CTDIR=3D$(ECOSSRCDIR)/tools/configtool/standalone/wxwin + +ifneq (,$(findstring CYGWIN, $(shell uname))) TCLDIR=3DTCLDIR_use_system +else + TCLDIRINC=3D/usr/include/tcl + TCLDIRLIB=3D/usr/lib +endif + USEEXPERIMENTALCODE=3D1 -EXTRACPPFLAGS=3D\ +ifneq (,$(findstring CYGWIN, $(shell uname))) + EXTRACPPFLAGS=3D-I$(TCLDIR)/include +else + EXTRACPPFLAGS=3D-I$(TCLDIRINC) +endif + +EXTRACPPFLAGS+=3D \ -I$(TCLDIR)/include \ -I$(INSTALLDIR)/include \ -I$(ECOSSRCDIR)/tools/configtool/common/common \ -I$(ECOSSRCDIR)/tools/Utils/common \ -I$(ECOSSRCDIR)/tools/ecostest/common \ -DecUSE_EXPERIMENTAL_CODE=3D$(USEEXPERIMENTALCODE) -EXTRALDFLAGS=3D-L$(TCLDIR)/lib -L$(INSTALLDIR)/lib -lcdl -lcyginfra -ltcl + +ifneq (,$(findstring CYGWIN, $(shell uname))) + EXTRALDFLAGS=3D-L$(TCLDIR)/lib -L$(INSTALLDIR)/lib -lcdl -ltcl +else + EXTRALDFLAGS=3D-L$(TCLDIRLIB) -L$(INSTALLDIR)/lib -lcdl -ltcl +endif + ifneq (,$(findstring CYGWIN, $(shell uname))) PROGRAM=3Dconfigtool.exe - CPPFLAGS=3D`$(WXDIR)/bin/wx-config --cppflags` -D_WIN32 -D__WIN32__ -DST= RICT -D__USE_W32_SOCKETS - LDFLAGS=3D`$(WXDIR)/bin/wx-config --libs std,gizmos` -lshlwapi -Wl,--sub= system,windows + CPPFLAGS=3D`$(WXDIR)/wx-config --static=3Dyes --cppflags` -D_WIN32 -D__W= IN32__ -DSTRICT -D__USE_W32_SOCKETS + LDFLAGS=3D`$(WXDIR)/wx-config --static=3Dyes --libs std,gizmos` -lwsock3= 2 -lcyginfra -lshlwapi -Wl,--subsystem,windows EXTRAOBJECTS=3D$(CTBUILDDIR)/configtoolres.o - RCFLAGS=3D`$(WXDIR)/bin/wx-config --cppflags` + RCFLAGS=3D`$(WXDIR)/wx-config --static=3Dyes --cppflags` else PROGRAM=3Dconfigtool - CPPFLAGS=3D`$(WXDIR)/bin/wx-config --cppflags` - LDFLAGS=3D`$(WXDIR)/bin/wx-config --libs std,gizmos` + CPPFLAGS=3D`$(WXDIR)/wx-config --cppflags` + LDFLAGS=3D`$(WXDIR)/wx-config --libs std,gizmos` EXTRAOBJECTS=3D - RCFLAGS=3D`$(WXDIR)/bin/wx-config --cppflags` + RCFLAGS=3D`$(WXDIR)/wx-config --cppflags` endif ifeq "$(DEBUG)" "" Index: host/tools/configtool/standalone/wxwin/configtree.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- host/tools/configtool/standalone/wxwin/configtree.cpp (revision 1819) +++ host/tools/configtool/standalone/wxwin/configtree.cpp (revision 1831) @@ -699,8 +699,8 @@ wxString msg; msg.Printf("Popping at %d x %d", pt.x, pt.y); wxLogDebug(msg); - - wxGetApp().GetHelpController().DisplayTextPopup(item->GetDescripti= on(), wxGetMousePosition()); + if(wxGetApp().HasHelpController()) + wxGetApp().GetHelpController().DisplayTextPopup(item->GetDescr= iption(), wxGetMousePosition()); } else event.Skip(); Index: host/tools/ecostest/common/eCosTestPlatform.cpp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- host/tools/ecostest/common/eCosTestPlatform.cpp (revision 18= 19) +++ host/tools/ecostest/common/eCosTestPlatform.cpp (revision 1831) @@ -30,6 +30,9 @@ #include "eCosTestUtils.h" #include "eCosTrace.h" +#include + + std::vector CeCosTestPlatform::arPlatforms; const CeCosTestPlatform *CeCosTestPlatform::Get(LPCTSTR psz)