56e5c1ff3d20ac80b02c714854b77683180e6e9d
[smatch.git] / smatch_data / db / smdb_param_buf_size.sh
blob56e5c1ff3d20ac80b02c714854b77683180e6e9d
1 #!/bin/bash
3 usage()
5 echo "Usage $0 <function>"
6 exit 1
9 PARAM=$2
10 TYPE=2
12 get_function_pointers()
14 local func=$1
16 OLD_IFS=$IFS
17 IFS="
19 ptrs=$(echo "select distinct ptr from function_ptr where function = '$func';" | sqlite3 smatch_db.sqlite)
20 for ptr in $ptrs ; do
21 if [ "$PARAM" = "" ] ; then
22 echo "select * from caller_info where function = '$ptr' and type='$TYPE';" | sqlite3 smatch_db.sqlite
23 else
24 echo "select * from caller_info where function = '$ptr' and type='$TYPE' and parameter='$PARAM';" | sqlite3 smatch_db.sqlite
26 done
27 IFS=$OLD_IFS
30 func=$1
32 if [ "$func" = "" ] ; then
33 usage
36 if [ "$PARAM" = "" ] ; then
37 echo "select * from caller_info where function = '$func' and type='$TYPE';" | sqlite3 smatch_db.sqlite
38 else
39 echo "select * from caller_info where function = '$func' and type='$TYPE' and parameter='$PARAM';" | sqlite3 smatch_db.sqlite
41 get_function_pointers $func