* configtool : x86_64 compil and segfault
@ 2009-09-24 20:43 Paul Chavent
2009-09-25 7:42 ` John Dallaway
0 siblings, 1 reply; 2+ messages in thread
From: Paul Chavent @ 2009-09-24 20:43 UTC (permalink / raw)
To: ecos-patches
[-- Attachment #1: Type: text/plain, Size: 179 bytes --]
Hi.
Here is a patch for compiling on x86_64 (slackware64 13).
Moreover I had a segfault due to a too short path.
So i submit for discussion these two patches.
Regards.
Paul.
[-- Attachment #2: host-64_bits.patch --]
[-- Type: text/plain, Size: 10418 bytes --]
Index: tools/Utils/common/eCosSerial.cpp
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/Utils/common/eCosSerial.cpp,v
retrieving revision 1.3
diff -u -5 -r1.3 eCosSerial.cpp
--- tools/Utils/common/eCosSerial.cpp 29 Jan 2009 17:47:49 -0000 1.3
+++ tools/Utils/common/eCosSerial.cpp 24 Sep 2009 20:28:31 -0000
@@ -155,11 +155,11 @@
HANDLE hCom=::CreateFile(pszPort,GENERIC_READ|GENERIC_WRITE, 0,NULL,OPEN_EXISTING,0,NULL);
SaveError();
if (INVALID_HANDLE_VALUE==hCom) {
ERROR(_T("Failed to open port %s - %s\n"),pszPort,(LPCTSTR)ErrString());
} else {
- m_pHandle=(void *)hCom;
+ m_pHandle=(int)hCom;
if(ApplySettings()){
Flush();
rc=true;
} else {
Close();
@@ -353,11 +353,11 @@
int fd = open(pszPort,O_RDWR|O_NONBLOCK);
if (-1==fd) {
ERROR(_T("Failed to open port %s\n"),pszPort);
return false;
} else {
- m_pHandle=(void *)fd;
+ m_pHandle=fd;
if(ApplySettings()){
rc=true;
} else {
Close();
ERROR(_T("Failed to apply settings.\n"));
Index: tools/Utils/common/eCosSerial.h
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/Utils/common/eCosSerial.h,v
retrieving revision 1.3
diff -u -5 -r1.3 eCosSerial.h
--- tools/Utils/common/eCosSerial.h 29 Jan 2009 17:47:49 -0000 1.3
+++ tools/Utils/common/eCosSerial.h 24 Sep 2009 20:28:31 -0000
@@ -121,11 +121,11 @@
m_nErr=errno;
#endif
}
// Line characteristics:
- void *m_pHandle;
+ int m_pHandle;
int m_nDataBits;
StopBitsType m_nStopBits;
bool m_bXONXOFFFlowControl;
bool m_bRTSCTSFlowControl;
bool m_bDSRDTRFlowControl;
Index: tools/Utils/common/eCosSocket.cpp
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/Utils/common/eCosSocket.cpp,v
retrieving revision 1.3
diff -u -5 -r1.3 eCosSocket.cpp
--- tools/Utils/common/eCosSocket.cpp 29 Jan 2009 17:47:49 -0000 1.3
+++ tools/Utils/common/eCosSocket.cpp 24 Sep 2009 20:28:32 -0000
@@ -94,28 +94,28 @@
CeCosSocket::CeCosSocket ():
m_nDefaultTimeout(10*1000),
m_nSock(-1),
m_nClient(0)
{
- VTRACE(_T("Create socket instance %08x\n"),(unsigned int)this);
+ VTRACE(_T("Create socket instance %p\n"),this);
}
CeCosSocket::CeCosSocket (int sock /*result of previous call of Listen*/, bool *pbStop):
m_nDefaultTimeout(10*1000),
m_nSock(-1),
m_nClient(0)
{
- VTRACE(_T("Create socket instance %08x\n"),(unsigned int)this);
+ VTRACE(_T("Create socket instance %p\n"),this);
Accept(sock,pbStop);
}
CeCosSocket::CeCosSocket (LPCTSTR pszHostPort,Duration dTimeout):
m_nDefaultTimeout(10*1000),
m_nSock(-1),
m_nClient(0)
{
- VTRACE(_T("Create socket instance %08x\n"),(unsigned int)this);
+ VTRACE(_T("Create socket instance %p\n"),this);
Connect(pszHostPort,dTimeout);
}
bool CeCosSocket::Accept(int sock /*result of previous call of Listen*/, bool *pbStop)
{
@@ -310,11 +310,11 @@
// Graceful socket closedown
CeCosSocket::~CeCosSocket()
{
Close();
- VTRACE(_T("Delete socket instance %08x\n"),(unsigned int)this);
+ VTRACE(_T("Delete socket instance %p\n"),this);
}
bool CeCosSocket::CloseSocket(int &sock)
{
bool rc=false;
Index: tools/Utils/common/eCosTrace.cpp
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/Utils/common/eCosTrace.cpp,v
retrieving revision 1.3
diff -u -5 -r1.3 eCosTrace.cpp
--- tools/Utils/common/eCosTrace.cpp 29 Jan 2009 17:47:49 -0000 1.3
+++ tools/Utils/common/eCosTrace.cpp 24 Sep 2009 20:28:32 -0000
@@ -59,11 +59,11 @@
if(f){
if(!OutInfo.strFilename.empty()){
fclose(OutInfo.f);
}
if(nVerbosity>=TRACE_LEVEL_TRACE){
- _ftprintf(stderr,_T("Output -> %s (%08x)\n"),pszFilename,(unsigned int)f);
+ _ftprintf(stderr,_T("Output -> %s (%p)\n"),pszFilename,f);
}
OutInfo.f=f;
OutInfo.strFilename=pszFilename;
SetOutput(StreamInfoFunc,&OutInfo);
}
Index: tools/configtool/standalone/wxwin/packagesdlg.cpp
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/configtool/standalone/wxwin/packagesdlg.cpp,v
retrieving revision 1.8
diff -u -5 -r1.8 packagesdlg.cpp
--- tools/configtool/standalone/wxwin/packagesdlg.cpp 29 Jan 2009 17:47:50 -0000 1.8
+++ tools/configtool/standalone/wxwin/packagesdlg.cpp 24 Sep 2009 20:28:33 -0000
@@ -502,14 +502,14 @@
{
wxString str = selectionsStrings[i];
// Remove
int toDelete = from -> FindString(str);
- int itemIndex = -1;
+ long int itemIndex = -1;
if (toDelete > -1)
{
- itemIndex = (int) from -> GetClientData(toDelete);
+ itemIndex = (long int) (from -> GetClientData(toDelete));
from -> Delete(toDelete);
}
wxASSERT (itemIndex > -1);
@@ -684,11 +684,11 @@
{
// set the package version to that specified in the version combo box
wxString str = versionChoice->GetString(nIndex);
// itemIndex is the index into the list of item names. It gets stored with all the listbox items.
- int itemIndex = (int) pListBox->GetClientData((*selected)[nIndex]);
+ long int itemIndex = (long int) (pListBox->GetClientData((*selected)[nIndex]));
m_currentVersions[(size_t)itemIndex] = str;
}
}
void ecPackagesDialog::OnClearKeywords(wxCommandEvent& event)
@@ -983,11 +983,11 @@
// retrieve the first package alias
wxString strPackageAlias = pListBox->GetString ((*selections)[nIndex]);
// retrieve the dialog item array index for use in
// comparing current version strings
- const int nVersionIndex = (int) pListBox->GetClientData ((*selections)[nIndex]);
+ const long int nVersionIndex = (long int) (pListBox->GetClientData ((*selections)[nIndex]));
// retrieve the installed version array
//TRACE (_T("Retrieving versions for '%s'\n"), strPackageAlias);
const std::vector<std::string>& versions = pDoc->GetCdlPkgData ()->get_package_versions (ecUtils::UnicodeToStdStr (pDoc->GetPackageName (strPackageAlias)));
Index: tools/configtool/standalone/wxwin/propertywin.cpp
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/configtool/standalone/wxwin/propertywin.cpp,v
retrieving revision 1.4
diff -u -5 -r1.4 propertywin.cpp
--- tools/configtool/standalone/wxwin/propertywin.cpp 16 Feb 2009 09:17:42 -0000 1.4
+++ tools/configtool/standalone/wxwin/propertywin.cpp 24 Sep 2009 20:28:33 -0000
@@ -269,11 +269,11 @@
wxString strPropertyArgs;
const std::vector<std::string> & argv = prop->get_argv ();
void *p;
p = (void*) map.Delete(strName);
- p=(void *)((int)p+1);
+ p= (void *)((long int)p + 1);
map.Put(strName, (wxObject*) p);
std::vector<std::string>::const_iterator argv_i;
for (argv_i = argv.begin (); argv_i != argv.end (); argv_i++){ // for each property argument...
if (argv_i != argv.begin ()){ // ...except the first (the property name)
@@ -284,11 +284,11 @@
strPropertyArgs += strArg; // add the argument to the string
strPropertyArgs += wxT (" "); // separate arguments by a space character
}
}
// the list control appears to display a maximum of 256 characters
- int nIndex=SetItem(strName, strPropertyArgs, GetItemCount(), (int)p);
+ int nIndex=SetItem(strName, strPropertyArgs, GetItemCount(), (long int)p);
SetItemData(nIndex, (long) prop);
// display the exclamation icon if the property is in a conflicts list
bool bConflictItem =
// PropertyInConflictsList (* property_i, config->get_structural_conflicts ()) || ignore for now
Index: tools/ecostest/common/TestResource.cpp
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/ecostest/common/TestResource.cpp,v
retrieving revision 1.3
diff -u -5 -r1.3 TestResource.cpp
--- tools/ecostest/common/TestResource.cpp 29 Jan 2009 17:47:50 -0000 1.3
+++ tools/ecostest/common/TestResource.cpp 24 Sep 2009 20:28:34 -0000
@@ -55,18 +55,18 @@
m_strPort(pszDownloadPort),
m_bLocked(false),
m_Target(target)
{
CeCosSocket::ParseHostPort(pszHostPort,m_strHost,m_nPort);
- VTRACE(_T("@@@ Created resource %08x %s\n"),(unsigned int)this,(LPCTSTR)Image());
+ VTRACE(_T("@@@ Created resource %p %s\n"),this,(LPCTSTR)Image());
Chain();
}
CTestResource::~CTestResource()
{
ENTERCRITICAL;
- VTRACE(_T("@@@ Destroy resource %08x %s\n"),this,(LPCTSTR)Image());
+ VTRACE(_T("@@@ Destroy resource %p %s\n"),this,(LPCTSTR)Image());
if(m_pPrevInstance || m_pNextInstance){
nCount--;
}
if(pFirstInstance==this){
pFirstInstance=m_pNextInstance;
Index: tools/ecostest/common/eCosTestDownloadFilter.cpp
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/ecostest/common/eCosTestDownloadFilter.cpp,v
retrieving revision 1.16
diff -u -5 -r1.16 eCosTestDownloadFilter.cpp
--- tools/ecostest/common/eCosTestDownloadFilter.cpp 29 Jan 2009 17:47:50 -0000 1.16
+++ tools/ecostest/common/eCosTestDownloadFilter.cpp 24 Sep 2009 20:28:34 -0000
@@ -286,11 +286,11 @@
/* Send it over and over until we get a positive ack. */
int resend = 1;
const unsigned char* write_ptr = (const unsigned char*) buf2.Data();
- int write_len = (int)p-(int)buf2.Data();
+ long int write_len = (long int)p-(long int)buf2.Data();
while (resend)
{
unsigned int __written;
Trace("Sending bytes for %p-%p\n", dl_address, dl_address+i);
[-- Attachment #3: host-path_max.patch --]
[-- Type: text/plain, Size: 907 bytes --]
Index: tools/ecostest/common/eCosTestPlatform.cpp
===================================================================
RCS file: /cvs/ecos/ecos/host/tools/ecostest/common/eCosTestPlatform.cpp,v
retrieving revision 1.7
diff -u -5 -r1.7 eCosTestPlatform.cpp
--- tools/ecostest/common/eCosTestPlatform.cpp 29 Jan 2009 17:47:50 -0000 1.7
+++ tools/ecostest/common/eCosTestPlatform.cpp 24 Sep 2009 20:28:34 -0000
@@ -56,11 +56,11 @@
bool CeCosTestPlatform::LoadFromDir(LPCTSTR pszDir)
{
bool rc=true;
TRACE(_T("CeCosTestPlatform::LoadFromDir %s\n"),pszDir);
// Find all the files in directory pszDir and load from each of them
- TCHAR szOrigDir[256];
+ TCHAR szOrigDir[PATH_MAX];
_tgetcwd(szOrigDir,sizeof szOrigDir-1);
if(0==_tchdir(pszDir)){
String strFile;
void *pHandle;
for(bool b=CeCosTestUtils::StartSearch(pHandle,strFile);b;b=CeCosTestUtils::NextFile(pHandle,strFile)){
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: configtool : x86_64 compil and segfault
2009-09-24 20:43 configtool : x86_64 compil and segfault Paul Chavent
@ 2009-09-25 7:42 ` John Dallaway
0 siblings, 0 replies; 2+ messages in thread
From: John Dallaway @ 2009-09-25 7:42 UTC (permalink / raw)
To: Paul Chavent; +Cc: ecos-patches
Hi Paul
Paul Chavent wrote:
> Here is a patch for compiling on x86_64 (slackware64 13).
>
> Moreover I had a segfault due to a too short path.
>
> So i submit for discussion these two patches.
Thank you for the patches.
I will fix the path length issue.
There are quite a few changes in host-64_bits.patch, so a copyright
assignment would be required for their incorporation into the eCos
repository. Ref:
http://ecos.sourceware.org/assign.html
Are you able to make an assignment to the FSF?
John Dallaway
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-09-25 7:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-24 20:43 configtool : x86_64 compil and segfault Paul Chavent
2009-09-25 7:42 ` John Dallaway
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).