The Wayback Machine - https://web.archive.org/web/20200915031229/https://github.com/cs01/gdbgui/issues/344
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot debug googletest unit test programs: 'Function "main" not defined' #344

Open
ElectricRCAircraftGuy opened this issue Aug 12, 2020 · 3 comments

Comments

@ElectricRCAircraftGuy
Copy link

@ElectricRCAircraftGuy ElectricRCAircraftGuy commented Aug 12, 2020

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Build a unit test where you are utilizing the googletest library for performing unit tests on your code.
  2. Launch gdbgui from inside the root dir of your project containing your source code.
  3. In gdbgui, add an absolute path to your built unit test executable and click the "Load Binary" button.
  4. The gdb window says Function "main" not defined.

Expected behavior

I expected the source code to show up in gdbgui, and to be able to debug the program. Even if I manually use the gdb command file /my/path/to/executable inside gdbgui and then try to run it, it won't work in gdbgui. But, in plain old gdb in the terminal, I can run and debug the whole thing just fine.

Screenshots
image

Please complete the following information:

  • OS: Ubuntu 18.04
  • gdbgui version (gdbgui -v): 0.13.2.1
  • gdb version (gdb -v): GNU gdb (Ubuntu 8.1-0ubuntu3.2) 8.1.0.20180409-git
  • browser [e.g. chrome, safari]: chrome
  • python packages (pip freeze):

Additional context
NA

@ElectricRCAircraftGuy ElectricRCAircraftGuy changed the title Cannot debug googletest programs: 'Function "main" not defined' Cannot debug googletest unit test programs: 'Function "main" not defined' Aug 12, 2020
@cs01
Copy link
Owner

@cs01 cs01 commented Aug 30, 2020

Did you ever get this working?

@cs01
Copy link
Owner

@cs01 cs01 commented Aug 30, 2020

I just gave it a shot and it worked fine. Maybe the main function was missing in your compiled executable, or symbols weren't available due to compiler flags.
image

@cs01
Copy link
Owner

@cs01 cs01 commented Aug 30, 2020

Maybe you need to compile with -lgtest_main?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.