callgraph_t::nodeinfo_t *callgraph_t::get_info(int nid) { nodeinfo_t *ret = NULL; do { // returned cached name int_funcinfo_map_t::iterator it = cached_funcs.find(nid); if ( it != cached_funcs.end() ) { ret = &it->second; break; } // node does not exist? int_ea_map_t::const_iterator it_ea = node2ea.find(nid); if ( it_ea == node2ea.end() ) break; citem_t *pfn = it_ea->second; if ( pfn == NULL ) break; nodeinfo_t fi; // get name char buf[MAXSTR]; if(get_node_label(nid, buf, MAXSTR)) fi.name = buf; else fi.name = "?unknown"; // get color if(pfn == highlighted) // highlight element with current cursor position fi.color = 2000; else fi.color = 1; #define CL_DARKBLUE ((0 )+ (0 <<8)+ (128<<16)) if (pfn->op == cit_expr) fi.color = CL_DARKBLUE; #define CL_BLUE ((0 )+ (0 <<8)+ (255<<16)) if (pfn->op == cit_block) fi.color = CL_BLUE; fi.ea = pfn->ea; it = cached_funcs.insert(cached_funcs.end(), std::make_pair(nid, fi)); ret = &it->second; } while ( false ); return ret; }
callgraph_t::nodeinfo_t *callgraph_t::get_info(int nid) { nodeinfo_t *ret = NULL; do { // returned cached name int_funcinfo_map_t::iterator it = cached_funcs.find(nid); if ( it != cached_funcs.end() ) { ret = &it->second; break; } // node does not exist? int_ea_map_t::const_iterator it_ea = node2ea.find(nid); if ( it_ea == node2ea.end() ) break; citem_t *pfn = it_ea->second; if ( pfn == NULL ) break; nodeinfo_t fi; // get name char buf[MAXSTR]; if(get_node_label(nid, buf, MAXSTR)) fi.name = buf; else fi.name = "?"; // get color if(pfn == highlighted) fi.color = 2000; else fi.color = 1;//bgcolors.prolog_color;//calc_bg_color(pfn->startEA); //fi.ea = pfn->startEA; fi.ea = 0; it = cached_funcs.insert(cached_funcs.end(), std::make_pair(nid, fi)); ret = &it->second; } while ( false ); return ret; }
/** * Function to print details of the object. * Call accessor functions to obtain private details of the object * and print their content/values. * @param - None. * @return - Nothing. */ void string_node::print_node() const { cout << "Node ID:::" << get_node_ID() << "==" << endl; cout << "Node Label:::" << get_node_label() << "==" << endl; }