1

I have quite a big source code written in C and would like to generate all possible backtraces of a function. There are tools to obtain similar result during execution of the application, for example: STAT. Instead, I am in need of getting this information with just the source code, like with example some kind of static code analysis.

One can obtain this information manually one function at a time using CSCOPE.

I also came across another thread in here: how can I display all function name from cscope database? that uses CSCOPE to list all functions recursively in all directories. I hope there should be some way to use the CSCOPE command line to automatically retrieve all backtraces.

Chris Petrus
  • 193
  • 1
  • 3
  • 15
  • Why would that be useful? I'm not saying that it couldn't be, but I am not seeing it right now. – 500 - Internal Server Error Nov 15 '19 at 16:37
  • 2
    @500-InternalServerError It can be useful for example, when one needs to enhance an existing code so as to reuse as much code as possible by changing function arguments. Consider the code is being understood by a third person. – Chris Petrus Nov 18 '19 at 07:30

1 Answers1

0

I'm not sure if this does exactly what you want, but https://github.com/ruben2020/codequery can read in cscope databases and do a bunch of manipulations with them so it might get you closer at least.

Evan
  • 6,369
  • 1
  • 29
  • 30