This is the mail archive of the
ecos-patches@sourceware.org
mailing list for the eCos project.
Re: ecosconfig/cygwin work-around
- From: John Dallaway <jld at ecoscentric dot com>
- To: ecos-patches at ecos dot sourceware dot org
- Date: Tue, 11 Jul 2006 10:56:40 +0100
- Subject: Re: ecosconfig/cygwin work-around
- References: <pnpsgcpjqy.fsf@delenn.bartv.net>
Bart Veer wrote:
> Anyway, this patch causes ecosconfig to throw a C++ exception early
> on. This causes the initialization to happen before any libcdl or Tcl
> code gets to run, and cygwin will still ignore the access to location
> 0x4. Afterwards everything seems to behave normally.
I am attaching a similar patch for the eCos Configuration Tool. The
patch also enables compilation using Cygwin GCC 3.4.4. Checked-in.
John Dallaway
eCosCentric Limited
Index: tools/configtool/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/configtool/ChangeLog,v
retrieving revision 1.62
diff -u -5 -r1.62 ChangeLog
--- tools/configtool/ChangeLog 9 Jul 2005 16:14:57 -0000 1.62
+++ tools/configtool/ChangeLog 11 Jul 2006 09:39:33 -0000
@@ -1,5 +1,10 @@
+2006-07-11 John Dallaway <jld@ecoscentric.com>
+
+ * standalone/wxwin/configtool.cpp: Workaround an exception handling
+ issue with Cygwin 1.5.20.
+
2005-07-09 Bart Veer <bartv@ecoscentric.com>
* common/common/build.cxx: add support for C++ files that use a
.cpp suffix
Index: tools/configtool/standalone/common/ecosconfig.cxx
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/configtool/standalone/common/ecosconfig.cxx,v
retrieving revision 1.14
diff -u -5 -r1.14 ecosconfig.cxx
--- tools/configtool/standalone/common/ecosconfig.cxx 11 Jul 2006 09:36:36 -0000 1.14
+++ tools/configtool/standalone/common/ecosconfig.cxx 11 Jul 2006 09:39:34 -0000
@@ -1,8 +1,9 @@
//####COPYRIGHTBEGIN####
//
// ----------------------------------------------------------------------------
+// Copyright (C) 2004, 2005, 2006 eCosCentric Limited
// Copyright (C) 2003 Bart Veer
// Copyright (C) 2003 John Dallaway
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
//
// This program is part of the eCos host tools.
@@ -50,11 +51,11 @@
#endif
#include "cdl_exec.hxx"
#include "ecosconfig.hxx"
#define TOOL_VERSION "2.net"
-#define TOOL_COPYRIGHT "Copyright (c) 2002 Red Hat, Inc."
+#define TOOL_COPYRIGHT "Copyright (c) 2002 Red Hat, Inc.\nCopyright (c) 2004-2006 eCosCentric Limited"
#define DEFAULT_SAVE_FILE "ecos.ecc"
static char* tool = "ecosconfig";
int main (int argc, char * argv []) {
Index: tools/configtool/standalone/wxwin/configtool.cpp
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/configtool/standalone/wxwin/configtool.cpp,v
retrieving revision 1.19
diff -u -5 -r1.19 configtool.cpp
--- tools/configtool/standalone/wxwin/configtool.cpp 16 Jan 2004 16:51:16 -0000 1.19
+++ tools/configtool/standalone/wxwin/configtool.cpp 11 Jul 2006 09:39:36 -0000
@@ -1,11 +1,11 @@
//####COPYRIGHTBEGIN####
//
// ----------------------------------------------------------------------------
// Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
// Copyright (C) 2003 John Dallaway
-// Copyright (C) 2004 eCosCentric Limited
+// Copyright (C) 2004, 2005, 2006 eCosCentric Limited
//
// This program is part of the eCos host tools.
//
// This program is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the Free
@@ -158,10 +158,17 @@
}
// 'Main program' equivalent: the program execution "starts" here
bool ecApp::OnInit()
{
+// workaround for an exception handling issue with Cygwin 1.5.20
+#ifdef __CYGWIN__
+ try {
+ throw int(42);
+ } catch(...) { };
+#endif
+
wxLog::SetTimestamp(NULL);
wxHelpProvider::Set(new wxSimpleHelpProvider);
//wxHelpProvider::Set(new wxHelpControllerHelpProvider(& m_helpController));
Index: tools/configtool/standalone/wxwin/mainwin.cpp
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/configtool/standalone/wxwin/mainwin.cpp,v
retrieving revision 1.17
diff -u -5 -r1.17 mainwin.cpp
--- tools/configtool/standalone/wxwin/mainwin.cpp 30 Jan 2004 10:26:19 -0000 1.17
+++ tools/configtool/standalone/wxwin/mainwin.cpp 11 Jul 2006 09:39:38 -0000
@@ -1,11 +1,11 @@
//####COPYRIGHTBEGIN####
//
// ----------------------------------------------------------------------------
// Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
// Copyright (C) 2003 John Dallaway
-// Copyright (C) 2004 eCosCentric Limited
+// Copyright (C) 2004, 2005, 2006 eCosCentric Limited
//
// This program is part of the eCos host tools.
//
// This program is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the Free
@@ -550,11 +550,11 @@
void ecMainFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
// ecAboutDialog dialog(this, ecID_ABOUT_DIALOG, _("About eCos Configuration Tool"));
// dialog.ShowModal();
wxString msg;
- msg.Printf("eCos Configuration Tool %s (%s %s)\n\nCopyright (c) Red Hat, Inc. 1998-2002\nCopyright (c) John Dallaway 2003\nCopyright (c) eCosCentric Limited 2004", ecCONFIGURATION_TOOL_VERSION, __DATE__, __TIME__);
+ msg.Printf("eCos Configuration Tool %s (%s %s)\n\nCopyright (c) Red Hat, Inc. 1998-2002\nCopyright (c) John Dallaway 2003\nCopyright (c) eCosCentric Limited 2004-2006", ecCONFIGURATION_TOOL_VERSION, __DATE__, __TIME__);
wxMessageBox(msg, _("About eCos Configuration Tool"), wxICON_INFORMATION | wxOK);
}
void ecMainFrame::OnSize(wxSizeEvent& WXUNUSED(event))
{
Index: tools/ecostest/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/ecostest/ChangeLog,v
retrieving revision 1.16
diff -u -5 -r1.16 ChangeLog
--- tools/ecostest/ChangeLog 11 Apr 2003 12:12:26 -0000 1.16
+++ tools/ecostest/ChangeLog 11 Jul 2006 09:39:40 -0000
@@ -1,5 +1,10 @@
+2006-07-10 John Dallaway <jld@ecoscentric.com>
+
+ * common/eCosTestUtils.cpp, common/eCosTestUtils.h: Tweak function
+ prototypes for GCC 3.4.4.
+
2003-04-11 John Dallaway <jld@ecoscentric.com>
* common/eCosTestPlatform.cpp (CeCosTestPlatform::Load): Return
true since it's not a problem if there are no platforms defined.
Index: tools/ecostest/common/eCosTestUtils.cpp
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/ecostest/common/eCosTestUtils.cpp,v
retrieving revision 1.2
diff -u -5 -r1.2 eCosTestUtils.cpp
--- tools/ecostest/common/eCosTestUtils.cpp 18 Apr 2000 21:51:58 -0000 1.2
+++ tools/ecostest/common/eCosTestUtils.cpp 11 Jul 2006 09:39:40 -0000
@@ -1,9 +1,10 @@
//####COPYRIGHTBEGIN####
//
// ----------------------------------------------------------------------------
// Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
+// Copyright (C) 2006 eCosCentric Limited
//
// This program is part of the eCos host tools.
//
// This program is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the Free
@@ -55,11 +56,11 @@
}
return (0==pszTail)?pszFile:pszTail+1;
}
// File iterator. Gets next file in directory, avoiding _T(".") and _T("..")
-bool CeCosTestUtils::NextFile (void *&pHandle,String &str)
+bool CeCosTestUtils::NextFile (void *pHandle,String &str)
{
#ifdef _WIN32
WIN32_FIND_DATA fd;
while(FindNextFile((HANDLE)pHandle,&fd)){
LPCTSTR pszName=fd.cFileName;
@@ -75,20 +76,20 @@
}
return false;
}
// Start file iteration and return first file.
-bool CeCosTestUtils::StartSearch (void *&pHandle,String &str)
+bool CeCosTestUtils::StartSearch (void *pHandle,String &str)
{
#ifdef _WIN32
WIN32_FIND_DATA fd;
pHandle=(void *)FindFirstFile (_T("*.*"), &fd);
if(INVALID_HANDLE_VALUE==(HANDLE)pHandle){
ERROR(_T("Failed to open dir\n"));
return false;
} else if (fd.cFileName[0]=='.') {
- return NextFile((HANDLE)pHandle,str);
+ return NextFile(pHandle,str);
} else {
str=String(fd.cFileName);
return true;
}
#else // UNIX
@@ -100,11 +101,11 @@
return NextFile(pHandle,str);
#endif
}
// End file iteration
-void CeCosTestUtils::EndSearch (void *&pHandle)
+void CeCosTestUtils::EndSearch (void *pHandle)
{
#ifdef _WIN32
FindClose((HANDLE)pHandle);
#else // UNIX
closedir((DIR *)pHandle);
Index: tools/ecostest/common/eCosTestUtils.h
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/ecostest/common/eCosTestUtils.h,v
retrieving revision 1.2
diff -u -5 -r1.2 eCosTestUtils.h
--- tools/ecostest/common/eCosTestUtils.h 18 Apr 2000 21:51:58 -0000 1.2
+++ tools/ecostest/common/eCosTestUtils.h 11 Jul 2006 09:39:40 -0000
@@ -1,9 +1,10 @@
//####COPYRIGHTBEGIN####
//
// ----------------------------------------------------------------------------
// Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
+// Copyright (C) 2006 eCosCentric Limited
//
// This program is part of the eCos host tools.
//
// This program is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the Free
@@ -63,15 +64,15 @@
static bool Exists (LPCTSTR pszFile);
// And is a file? (as opposed to a directory)
static bool IsFile (LPCTSTR pszFile);
// File iterator. Gets next file in directory, avoiding "." and ".."
- static bool NextFile (void *&pHandle,String &str);
+ static bool NextFile (void *pHandle,String &str);
// Start file iteration and return first file.
- static bool StartSearch (void *&pHandle,String &str);
+ static bool StartSearch (void *pHandle,String &str);
// End file iteration
- static void EndSearch (void *&pHandle);
+ static void EndSearch (void *pHandle);
// Get the file name of a "home directory" file
static const String HomeFile (LPCTSTR pszFile);
protected: