简体   繁体   中英

How can I know which file called the function? cpp

I'm trying to understand a program(Moveit.) connected with many other files, The program runs fine without any problem. but I want to know which function(from a different directory) calls the function I'm interested in, Since there are so many directories and functions of the same name. I can't just simply track them easily, So far. I've just tracked the caller function by manually opening all other files? Can I know how to track down the caller function(or file)?

For example, I've attached a code below that which caller function and file location I want to know.

bool ompl_interface::ModelBasedPlanningContext::solve(planning_interface::MotionPlanResponse& res) {   ...   }

Thank you guys. The program I've been using(ROS Moveit.) had a built-in gdb debugger and I could find the log file which showed all the directories,cpp file launched. This might not be applied to all for sure, but below is just an example of the location of the log file for my case.

~/.ros/log/cf90466c-a51d-11ec-b5e0-7085c253edd4/rosout.log

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM