Apollo: How to use gdb for debug in apollo?

Created on 3 Jul 2018  路  8Comments  路  Source: ApolloAuto/apollo

Can you provide a tutorial/example how to use gdb to debug in apollo? the log file method is helpful but not convenient enough for debugging (eg debug memory leak..)

For example: can you show how to debug planning module use gdb?

Thank you all.

Documents Others Question

All 8 comments

Apollo is made up some submodules. These modules are built in bazel-bin/modules// . You could use gdb to debug them. For example, You want to debug perception, you could use command as following.
gdb bazel-bin/modules/perception/perception

You could try this method. And please feel free to let me know if you have any other problem.

@muleisheng thanks for the input.. @lesun90 Please let me know if you try it.. Even I am looking for the same approach ..

Hi,

I still dont not clear what to do.
I try gdb bazel-bin/modules/perception/perception

and get apollo_app.cc:59] perception Init failed: PERCEPTION when I run in gdb

Hi
perception may need some input params, for example, some configuration data (or files). I will check this issue by reviewing code. If any progress , I will let you know.

I suggest search for some tutorials on gdb for details.

Here is steps for debugging perception.

  1. use following command to start debug perception
    gdb bazel-bin/modules/perception/perception
  2. set args for perception by using 'set args', here is a sample.
    set args --flagfile=/apollo/modules/perception/conf/perception_lowcost.conf --stderrthreshold=3 --use_navigation_mode

You could try this method. It may solve your issue

Hi,
I have tried this method but when I go into gdb bazel-bin/modules/perception/perception.
set args --flagfile=/apollo/modules/perception/conf/perception_lowcost.conf --stderrthreshold=3 --use_navigation_mode
It is still not work.
The error message is can not open shared object file.
Thank you.

@muleisheng @fanghaos2014
Hi fang, have you done with that issue, debugging the perception module ?
I also want to debug the perception module with VScode. And I wonder the above problem was that user have to feed some required data for running perception module like playing ROS bag.
Can anyone give me some guide? Thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chilihua picture chilihua  路  3Comments

YaoQii picture YaoQii  路  3Comments

freeclouds picture freeclouds  路  3Comments

BenBaek picture BenBaek  路  3Comments

chasingw picture chasingw  路  3Comments