[anjuta] symbol-db: fixed get_scope_chain ().



commit fa49fd76f3df1196baac1a0fdfcd50bd52481dd6
Author: Massimo Corà <mcora src gnome org>
Date:   Sat Jan 9 03:28:11 2010 +0100

    symbol-db: fixed get_scope_chain ().
    
    Now the filename parameter is used to detect just the first scope. The others
    are searched with a NULL file (i.e. doing a wider search).

 plugins/symbol-db/symbol-db-engine-queries.c |   12 ++++++------
 plugins/symbol-db/symbol-db-engine-queries.h |    5 ++++-
 2 files changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/plugins/symbol-db/symbol-db-engine-queries.c b/plugins/symbol-db/symbol-db-engine-queries.c
index 3ee58d8..9fb1dba 100644
--- a/plugins/symbol-db/symbol-db-engine-queries.c
+++ b/plugins/symbol-db/symbol-db-engine-queries.c
@@ -2154,8 +2154,7 @@ symbol_db_engine_get_scope_chain_by_file_line (SymbolDBEngine *dbe,
     								SymExtraInfo sym_info)
 {
 	SymbolDBEngineIterator *iter, *res_iter;	
-	SymbolDBEngineIteratorNode *node;
-	gchar *db_file;
+	SymbolDBEngineIteratorNode *node;	
 	gint symbol_id;
 	
 	g_return_val_if_fail (dbe != NULL, NULL);
@@ -2172,11 +2171,12 @@ symbol_db_engine_get_scope_chain_by_file_line (SymbolDBEngine *dbe,
 
 	node = SYMBOL_DB_ENGINE_ITERATOR_NODE (iter);
 	symbol_id = symbol_db_engine_iterator_node_get_symbol_id (node);
-	db_file = symbol_db_util_get_file_db_path (dbe, full_local_file_path);
+
+	/* note the NULL: we don't want to limit the search to that db file.
+	 * It must be project-wide or some scopes may be left out.
+	 */
+	res_iter = symbol_db_engine_get_scope_chain (dbe, symbol_id, NULL, sym_info);	   
 	
-	res_iter = symbol_db_engine_get_scope_chain (dbe, symbol_id, db_file, sym_info);
-	    
-	g_free (db_file);
 	return res_iter;
 }
 
diff --git a/plugins/symbol-db/symbol-db-engine-queries.h b/plugins/symbol-db/symbol-db-engine-queries.h
index b5e538b..76894e5 100644
--- a/plugins/symbol-db/symbol-db-engine-queries.h
+++ b/plugins/symbol-db/symbol-db-engine-queries.h
@@ -211,7 +211,8 @@ symbol_db_engine_get_parent_scope_id_by_symbol_id (SymbolDBEngine *dbe,
  * It includes the calls to symbol_db_engine_get_parent_scope_id_by_symbol_id () and
  * symbol_db_engine_get_symbol_info_by_id (). It's a sort of facade.
  * @param scoped_symbol_id Symbol you want to know the parent of.
- * @param db_file db-relative filename path. eg. /src/foo.c Can be NULL.
+ * @param db_file db-relative filename path. eg. /src/foo.c. Can be NULL for a
+ * wider search (i.e. not just limited to that file).
  * @return NULL on error or if nothing is found as parent.
  */
 SymbolDBEngineIterator *
@@ -237,6 +238,8 @@ symbol_db_engine_get_parent_scope_by_symbol_id (SymbolDBEngine *dbe,
  * 
  * the returned iterator'll contain symbols in this order: foo_func, FooKlass, FooBase.
  *
+ * @param db_file db-relative filename path. eg. /src/foo.c. Can be NULL for a
+ * wider search (i.e. not just limited to that file).
  * @return NULL on error or if scope isn't found.
  */
 SymbolDBEngineIterator *



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]