Configuring Eclipse CDT for valgrind + gdb

How can I debug the launch of valgrind using gdb in Eclipse?

I run the program like this:

Terminal A:

valgrind vgdb=yes --vgdb-error=0 ./a.out

He can debug it from another terminal, for example like this:

Terminal B:

gdb ./a.out
target remote |vgdb

But I cannot get this to work in Eclipse ... So, I want to do graphically in Eclipse what I can do through the command line in terminal B.

I tried many ways to configure debug configurations in Eclipse, but I can't get it to work.

The closest I got was through "C ++ Attach to Application", in which I downloaded the customized .gdbinit according to this post at the end: https://www.eclipse.org/forums/index.php/t/681832/

valgrind ( ), Eclipse , , gdb.

, : https://bugs.eclipse.org/bugs/show_bug.cgi?id=269687 http://www.eclipse.org/forums/index.php/t/354700/,

Eclipse 4.5.1 (Mars.1)

:

progress- , , :

1) "C/C++ Application" .gdbinit:

file /path/to/a.out
target remote | /usr/bin/vgdb
set sysroot /
define run

, "file" gdbinit. , Eclipse , / ( ...). " " .

, /, .

2) "C++ Attach to Application" .gdbinit . , ; valgrind. , Eclipse. gdb "break file.cpp: line".

, ?

+5
1

, Ubuntu/Eclipse:

:

" ":

  • : Example Starter
  • : /usr/bin/valgrind
  • : --vgdb=full --vgdb-error=0 --leak-check=full -v./MyProg.elf argument1...

GDB

gdb_vgdb_init:

target remote | /usr/bin/vgdb
set sysroot /
define run

  • : C/C++ Application
  • : Example Debugger
  • C/C++ : MyProg.elf
  • → :
  • → GDB: /path/to/gdb_vgdb_init

Launch Group

Launch Group :

  1. Example Starter ( )
  2. C/C++ Example Debugger ( )

Launch Group. Launchgroup . GDB .

+1

All Articles