Search code examples
macosfirefoxprofilingvalgrindeclipse-cdt

Generating the callgraph of mozilla-central- Error running Valgrind: Launch failed. Binary not found


I have downloaded mozilla-central (Nightly) and built it and I am able to open the project in Eclipse CPP and run the application.

My goal is to have access to the call graph of one use-case scenario in Firefox. For instance, I would like to run the application and for the scenario "How to clear my history" on Firefox, I want to take all 3 steps that are mentioned here.

This is done while a profiler is enabled. Then, I need to analyze the call graph to see what parts of the source code are touched when the scenario was being executed.

My current roadblock is the profiler! When I want to use Valgrind I get an error saying failed to launch, the binary was not found. When I open the project in Eclipse I get an error saying searching for binaries Gecko has encountered a problem. Also, Xcode Instruments was not useful for the task that I am working on.

I just need to parse the source code and analyze how certain scenarios are implemented. I need a profiler (something like Xdebug for PHP) that gives me all the method calls (and their related source code files).

I am working on a Mac and the OS is Sierra Version 10.13.6.


Solution

  • I get the same error as you on Linux. My guess is that the Eclipse project would need some additional configuration for this to work, such as defining a launch configuration in Project Properties | Run/Debug Settings.

    However, taking a step back, note that Firefox has its own built-in profiler which is likely to give more useful information than any third-party profiler. I would suggest giving that a try.