소스 검색

Debugging... switch to desktop

Yentl Van Tendeloo 7 년 전
부모
커밋
e602fc4172
5개의 변경된 파일12개의 추가작업 그리고 6개의 파일을 삭제
  1. 1 4
      bootstrap/constructors.alc
  2. 3 1
      bootstrap/modelling.alc
  3. 4 0
      kernel/modelverse_kernel/main.py
  4. 3 0
      state/modelverse_state/main.py
  5. 1 1
      wrappers/modelverse_SCCD.py

+ 1 - 4
bootstrap/constructors.alc

@@ -76,6 +76,7 @@ Element function construct_function_list(list : Element):
 	create_al_link(model, "funcdef_body", main_function, first_element, "body")
 	create_al_link(model, "funcdef_body", main_function, first_element, "body")
 	create_al_link(model, "Statement_next", result["end"], prev_element, "next")
 	create_al_link(model, "Statement_next", result["end"], prev_element, "next")
 	instantiate_link(model, "initial_funcdef", "", instantiate_node(model, "Initial", ""), main_function)
 	instantiate_link(model, "initial_funcdef", "", instantiate_node(model, "Initial", ""), main_function)
+	log("Got body of main: " + cast_value(model["model"][main_function]["body"]))
 	
 	
 	log("Created model!")
 	log("Created model!")
 	return model!
 	return model!
@@ -181,11 +182,7 @@ String function construct_funcdef(model : Element, list : Element, mutable : Boo
 
 
 	while (counter < nrParams):
 	while (counter < nrParams):
 		param = instantiate_node(model, "Element", "")
 		param = instantiate_node(model, "Element", "")
-		log("Adding parameter: " + string_get(arg_names_decl, counter))
-		log(" func " + func)
-		log(" params " + params)
 		create_al_link(model, "param_dict_link", params, param, string_get(arg_names_decl, counter))
 		create_al_link(model, "param_dict_link", params, param, string_get(arg_names_decl, counter))
-		log("After append: " + set_to_string(dict_keys(model["model"][params])))
 		dict_add_fast(variable_map, list_pop_final(list), param)
 		dict_add_fast(variable_map, list_pop_final(list), param)
 		// Output each parameter in turn
 		// Output each parameter in turn
 		counter = counter + 1
 		counter = counter + 1

+ 3 - 1
bootstrap/modelling.alc

@@ -469,6 +469,7 @@ Element function get_func_AL_model(al_model : Element):
 	Element initial_function
 	Element initial_function
 
 
 	// Find the initial function
 	// Find the initial function
+	log("Fetching initial function...")
 	initial_function = allInstances(al_model, "Initial")
 	initial_function = allInstances(al_model, "Initial")
 
 
 	if (set_len(initial_function) == 0):
 	if (set_len(initial_function) == 0):
@@ -478,7 +479,8 @@ Element function get_func_AL_model(al_model : Element):
 		log("Too many functions to execute in this model!")
 		log("Too many functions to execute in this model!")
 		return read_root()!
 		return read_root()!
 	else:
 	else:
-		return al_model["model"][set_pop(allAssociationDestinations(al_model, set_pop(initial_function), "initial_funcdef"))]!
+		initial_function = set_pop(initial_function)
+		return al_model["model"][set_pop(allAssociationDestinations(al_model, initial_function, "initial_funcdef"))]!
 
 
 Element function trim_AL_constructors(list : Element):
 Element function trim_AL_constructors(list : Element):
 	Integer length
 	Integer length

+ 4 - 0
kernel/modelverse_kernel/main.py

@@ -124,6 +124,10 @@ class ModelverseKernel(object):
             if self.phase_v == "finish":
             if self.phase_v == "finish":
                 gen = self.helper_init(task_root)
                 gen = self.helper_init(task_root)
             elif self.inst is None:
             elif self.inst is None:
+                print("No instruction pointer found...")
+                print(locals())
+                print("Phase: " + str(self.phase_v))
+                print("Debug: " + str(self.debug_info[taskname]))
                 raise Exception("Instruction pointer could not be found!")
                 raise Exception("Instruction pointer could not be found!")
             elif isinstance(self.phase_v, string_types):
             elif isinstance(self.phase_v, string_types):
                 if self.phase_v == "init" and self.jit.is_jittable_entry_point(self.inst):
                 if self.phase_v == "init" and self.jit.is_jittable_entry_point(self.inst):

+ 3 - 0
state/modelverse_state/main.py

@@ -175,6 +175,9 @@ class ModelverseState(object):
         return self.free_id - 1
         return self.free_id - 1
 
 
     def create_dict(self, source, data, destination):
     def create_dict(self, source, data, destination):
+        if destination is None:
+            print("Assign None for " + str(locals()))
+            print("Previous value: " + str(self.values.get(self.cache.get(source, {}).get(data, None), None)))
         if source not in self.nodes and source not in self.edges:
         if source not in self.nodes and source not in self.edges:
             return None
             return None
         elif destination not in self.nodes and destination not in self.edges:
         elif destination not in self.nodes and destination not in self.edges:

+ 1 - 1
wrappers/modelverse_SCCD.py

@@ -1,7 +1,7 @@
 """
 """
 Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
 Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
 
 
-Date:   Tue Apr  3 17:25:38 2018
+Date:   Wed Apr  4 07:32:12 2018
 
 
 Model author: Yentl Van Tendeloo
 Model author: Yentl Van Tendeloo
 Model name:   MvK Server
 Model name:   MvK Server