Bug 106025 - KDevelop crashes when the name of the Code Completion Database is "C/C++"
Summary: KDevelop crashes when the name of the Code Completion Database is "C/C++"
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (old) (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR crash
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-20 16:09 UTC by Filip Papadopoulos
Modified: 2013-03-31 00:44 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
backtrace (8.52 KB, text/plain)
2005-05-20 16:12 UTC, Filip Papadopoulos
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Papadopoulos 2005-05-20 16:09:07 UTC
Version:           3.2.0 (using KDE 3.4.0 Level "b" , SUSE 9.3)
Compiler:          gcc version 3.3.5 20050117 (prerelease) (SUSE Linux)
OS:                Linux (i686) release 2.6.11.4-20a-default

In my project i did: 
Project Options-> C++ Specific->Code Completion
and i pressed the Add button. I chose "Custom Directory PCS importer" , and i typed "C/C++" (without the quotes) as the Database Name. I chose /usr/include as the dir to parse.
KDevelop crashed. I restarted it and i did the same things but i typed "C_C++" as the DB name and KDevelop worked ok.
So i believe the problem is with the '/'.
Comment 1 Filip Papadopoulos 2005-05-20 16:12:49 UTC
Created attachment 11116 [details]
backtrace
Comment 2 Jens Dagerbo 2005-05-25 10:20:41 UTC
I haven't tested, but it sounds very plausible. IIRC, the name used for the database is simply used as the database file name. '/' will surely break that.
Comment 3 Matt Rogers 2006-07-02 18:56:12 UTC
SVN commit 557193 by mattr:

fix bug 106025. Patch by Bernd Buschinski.
Thanks for the patch!

BUG: 106025
CCMAIL: b.buschinski@web.de



 M  +1 -1      parser.cpp  


--- branches/kdevelop/3.4/lib/cppparser/parser.cpp #557192:557193
@@ -4282,7 +4282,7 @@
 
 bool Parser::parseWinDeclSpec( GroupAST::Node & node )
 {
-    if( lex->lookAhead(0) == Token_identifier && lex->lookAhead(0).text() == "__declspec" && lex->lookAhead(1) == '(' ){
+    if( lex->lookAhead(0) == Token_identifier && lex->lookAhead(0).text() == "__declspec" && lex->lookAhead(1) == '(' && lex->lookAhead(2) != ')'){
 	int start = lex->index();
 	nextToken();
 	nextToken(); // skip '('
Comment 4 Matt Rogers 2006-07-26 02:09:20 UTC
SVN commit 566385 by mattr:

Patch from Bernd Buschinski.

"another tyr to fix bug 106025"

Thanks for the patch!
CCBUG: 106025



 M  +3 -3      ccconfigwidget.cpp  
 M  +1 -1      createpcsdialog.cpp  


--- branches/kdevelop/3.4/languages/cpp/ccconfigwidget.cpp #566384:566385
@@ -160,7 +160,7 @@
 	{
 		Catalog* c = *it;
 		QFileInfo dbInfo( c->dbName() );
-		QCheckListItem* item = new QCheckListItem( advancedOptions, dbInfo.baseName(), QCheckListItem::CheckBox );
+		QCheckListItem* item = new QCheckListItem( advancedOptions, KURL::decode_string( dbInfo.baseName() ), QCheckListItem::CheckBox );
 		item->setOn( c->enabled() );
 
 		m_catalogs[ item ] = c;
@@ -219,7 +219,7 @@
 	QString question = i18n( "Are you sure you want to remove the \"%1\" database?" ).arg( db );
 
 	KStandardDirs *dirs = m_pPart->instance() ->dirs();
-	QString dbName = dirs->saveLocation( "data", "kdevcppsupport/pcs" ) + db + ".db";
+	QString dbName = dirs->saveLocation( "data", "kdevcppsupport/pcs" ) + KURL::encode_string_no_slash( db ) + ".db";
 	
 #if KDE_VERSION >= KDE_MAKE_VERSION(3,3,0)
 
@@ -238,7 +238,7 @@
 void CCConfigWidget::catalogRegistered( Catalog * c )
 {
 	QFileInfo dbInfo( c->dbName() );
-	QCheckListItem* item = new QCheckListItem( advancedOptions, dbInfo.baseName(), QCheckListItem::CheckBox );
+	QCheckListItem* item = new QCheckListItem( advancedOptions, KURL::decode_string( dbInfo.baseName() ), QCheckListItem::CheckBox );
 	item->setOn( c->enabled() );
 
 	m_catalogs[ item ] = c;
--- branches/kdevelop/3.4/languages/cpp/createpcsdialog.cpp #566384:566385
@@ -327,7 +327,7 @@
 
 		KStandardDirs *dirs = m_part->instance() ->dirs();
 
-		QString dbName = dirs->saveLocation( "data", "kdevcppsupport/pcs" ) + filename_edit->text() + ".db";
+		QString dbName = dirs->saveLocation( "data", "kdevcppsupport/pcs" ) + KURL::encode_string_no_slash(filename_edit->text()) + ".db";
 		kdDebug( 9007 ) << "================================> dbName = " << dbName << endl;
 
 		m_part->removeCatalog( dbName );
Comment 5 Aleix Pol 2013-03-31 00:44:46 UTC
Moving all the bugs from the CPP Parser. It was not well defined the difference between it and C++ Language Support and people kept reporting in both places indistinctively