Skip to content

Instantly share code, notes, and snippets.

@bchretien
Created February 20, 2014 10:52
Show Gist options
  • Save bchretien/9111119 to your computer and use it in GitHub Desktop.
Save bchretien/9111119 to your computer and use it in GitHub Desktop.
#!/bin/sh
# First argument: library folder (e.g. /opt/ros/hydro/lib)
# Second argument: mangled symbol (e.g. _ZN14openni_wrapper12OpenNIDevice15getSerialNumberEv)
for lib in $(find $1 -name \*.so) ; do
res=`nm -D $lib | grep $2 | grep -v " U "`
if [ ! -z "$res" ]; then
echo "$lib: $res"
fi
done
@po1
Copy link

po1 commented Feb 20, 2014

You can also parse the $LD_LIBRARY_PATH to make the first argument optional

@bchretien
Copy link
Author

@po1: checking the whole $LD_LIBRARY_PATH would be overkill for ROS symbols (this was made for someone with troubles on http://answers.ros.org).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment