This Frage ist meiner am ähnlichsten, aber es ist ziemlich alt, also frage ich mich, ob sich seitdem etwas geändert hat.Kann Valgrind eine Speicheradresse eines verlorenen Blocks melden (zum Debuggen rekursiver Funktionsaufrufe)?
Der valgrind Ausgang ist für mich:
==29443== 109 (16 direct, 93 indirect) bytes in 2 blocks are definitely lost in loss record 270 of 309
==29443== at 0x4C2B0E0: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==29443== by 0x4F4E8DB: grl::Configuration::Configuration(grl::Configuration const&) (configuration.h:192)
==29443== by 0x4F49973: grl::YAMLConfigurator::load(YAML::Node const&, grl::Configuration*, std::string const&) (configurable.cpp:74)
==29443== by 0x4F499FC: grl::YAMLConfigurator::load(YAML::Node const&, grl::Configuration*, std::string const&) (configurable.cpp:75)
==29443== by 0x4F499FC: grl::YAMLConfigurator::load(YAML::Node const&, grl::Configuration*, std::string const&) (configurable.cpp:75)
==29443== by 0x4F499FC: grl::YAMLConfigurator::load(YAML::Node const&, grl::Configuration*, std::string const&) (configurable.cpp:75)
==29443== by 0x40C78E: grl::YAMLConfigurator::load(std::string, grl::Configuration*, std::string const&) (configurable.h:321)
==29443== by 0x40B897: main (deployer.cpp:180)
Programm wird beim Start konfiguriert mit rekursiven Aufrufen von YAML-Datei zu lesen und alle erforderlichen Parameter in einer Karte als ein Paar (name, allocated address)
speichern. Ich kann diese Paare ausdrucken. Wenn Valgrind mir also eine Adresse mit verlorenen Werten mitteilen könnte, könnte ich einen Namen eines Parameters bekommen und prüfen, warum er nicht freigegeben wurde.
Wenn die Funktionalität nicht möglich ist, was kann ich sonst noch verwenden?