我正在使用 pycparser 来解析 C 代码。我的目标是给定一个 C 代码和一个函数名,列出指定函数中调用的所有函数。
我查看了 pycparser 的文档,但找不到任何专门解决此问题的方法。
我想要与 cscope 相同的功能:
Functions called by this function: ksw_extd2_sse41
File Function Line
0 ksw2_extd2_sse.c ksw_reset_extz 59 ksw_reset_extz(ez);
1 ksw2_extd2_sse.c _mm_set1_epi8 64 zero_ = _mm_set1_epi8(0);
2 ksw2_extd2_sse.c _mm_set1_epi8 65 q_ = _mm_set1_epi8(q);
3 ksw2_extd2_sse.c _mm_set1_epi8 66 q2_ = _mm_set1_epi8(q2);
4 ksw2_extd2_sse.c _mm_set1_epi8 67 qe_ = _mm_set1_epi8(q + e);
5 ksw2_extd2_sse.c _mm_set1_epi8 68 qe2_ = _mm_set1_epi8(q2 + e2);
6 ksw2_extd2_sse.c _mm_set1_epi8 69 sc_mch_ = _mm_set1_epi8(mat[0]);
7 ksw2_extd2_sse.c _mm_set1_epi8 70 sc_mis_ = _mm_set1_epi8(mat[1]);
8 ksw2_extd2_sse.c _mm_set1_epi8 71 sc_N_ = mat[m*m-1] == 0? _mm_set1_epi8(-e2) : _mm_set1_epi8(mat[m*m-1]);
9 ksw2_extd2_sse.c _mm_set1_epi8 72 m1_ = _mm_set1_epi8(m - 1);
a ksw2_extd2_sse.c kcalloc 92 mem = (uint8_t*)kcalloc(km, tlen_ * 8 + qlen_ + 1, 16);
b ksw2_extd2_sse.c memset 97 memset(u, -q - e, tlen_ * 16);
c ksw2_extd2_sse.c memset 98 memset(v, -q - e, tlen_ * 16);
d ksw2_extd2_sse.c memset 99 memset(x, -q - e, tlen_ * 16);
e ksw2_extd2_sse.c memset 100 memset(y, -q - e, tlen_ * 16);
* Lines 1-16 of 278, 263 more - press the space bar to display more *