Fix gdb_wrapper to work with C++ functions.

Fix two issues associated with spliting instructions that are within
functions whose signatures contain comma and colon characters (e.g.
templates).
Cache two gdb lookups that can be slow for large programs.