10 my $db = DBI
->connect("dbi:SQLite:$db_file", "", "", {AutoCommit
=> 0});
12 $db->do("PRAGMA cache_size = 800000");
13 $db->do("PRAGMA journal_mode = OFF");
14 $db->do("PRAGMA count_changes = OFF");
15 $db->do("PRAGMA temp_store = MEMORY");
16 $db->do("PRAGMA locking = EXCLUSIVE");
18 my ($update, $sth, $fn_ptr, $ptr_to_ptr, $count);
20 $update = $db->prepare_cached('UPDATE function_ptr set searchable = 1 where ptr = ?');
21 $sth = $db->prepare('select distinct(ptr) from function_ptr;');
24 while ($fn_ptr = $sth->fetchrow_array()) {
26 # following a pointer to pointer chain is too complicated for now
27 $ptr_to_ptr = $db->selectrow_array("select function from function_ptr where ptr = '$fn_ptr' and function like '% %';");
31 $ptr_to_ptr = $db->selectrow_array("select function from function_ptr where ptr = '$fn_ptr' and function like '%[]';");
36 $count = $db->selectrow_array("select count(*) from return_states join function_ptr where return_states.function == function_ptr.function and ptr = '$fn_ptr';");
37 # if there are too many states then bail
41 # if there are no states at all then don't bother recording
46 $update->execute($fn_ptr);