C++ Weekly - Ep 453 - Valgrind + GDB Together!

Поділитися
Вставка
  • Опубліковано 5 лис 2024

КОМЕНТАРІ • 18

  • @alexandrapetlanovahajkova2628
    @alexandrapetlanovahajkova2628 День тому +14

    Hi Jason, thank you for mentioning my work! I'm usually not getting any feedback from my blog posts and sometimes I'm wondering if it makes sense to write them at all. I'm going to have another article published soon, it's about improvements in file descriptors tracking in Valgrind. Everyone is welcome to comment on my blog posts, so I know what's actually interesting for the audience.

    • @vberthiaume
      @vberthiaume 17 годин тому

      Got a link to the blog?

    • @paulfloyd9258
      @paulfloyd9258 14 годин тому

      @@vberthiaume Yes. UA-cam auto deleted my first reply. Search for "redhat valgrind blog gdb close cooperation". Alexandra also wrote an excellent article, search for "Debug memory errors with Valgrind and GDB".

    • @paulfloyd9258
      @paulfloyd9258 4 години тому

      @@vberthiaume Search for "Valgrind and GDB in close cooperation"

    • @paulfloyd9258
      @paulfloyd9258 4 години тому

      @@vberthiaume And also ua-cam.com/video/1VubqWmloZU/v-deo.html

  • @markminch1906
    @markminch1906 День тому +9

    Honestly, I would love a large UA-cam series of just different valgrind features, and another on exploring the features of gdb from the command line

  • @Ash-qp2yw
    @Ash-qp2yw День тому +6

    Oh, this looks really useful! I'd love to see another video on the aformentioned reverse debugging in gdb too

  • @tarun1105
    @tarun1105 18 годин тому

    Its quite intresting. While exploring i found that there are literally so less of information about cpp memory management or debugging tools like gdb. Mostly their are basic stuffs only. Thnx for this.

  • @milasudril
    @milasudril День тому +2

    I have used it, and found it quite useful.

  • @sonulohani
    @sonulohani День тому +3

    Nice tutorial

  • @alexandrebustico9691
    @alexandrebustico9691 14 годин тому

    I suppose valgrind + gdb could not work together for remote debugging MCU embedded program running on bare platform ?

  • @fghdfghdfghdfg
    @fghdfghdfghdfg День тому +1

    I might suggest it is pronounced val-grind like coffee-grind, and no haven't grined since writing this 😁. Regardless, great video!

  • @topticktom
    @topticktom День тому +23

    can you stop making videos so I can catch up? I'm 35 years behind in c++ topics.

  • @err6910
    @err6910 День тому +1

    For your simple use case like here, wouldn't it be just simpler to launch valgrind with --db-attach=yes option?

    • @paulfloyd9258
      @paulfloyd9258 14 годин тому

      Sometimes two terminals is better (e.g., when the test exe generates a lot of output). We need to work with gdb to make this a bit easier.
      You can simplify the startup if you put the following in your .gdbinit file
      define set-program-name
      set logging file tmp.gdb
      set logging overwrite on
      set logging redirect on
      set logging enabled on
      python print(f"set $programname = \"{gdb.current_progspace().filename}\"")
      set logging enabled off
      set logging redirect off
      set logging overwrite off
      source tmp.gdb
      end
      define start_vg
      set-program-name
      eval "set remote exec-file %s", $programname
      show remote exec-file
      set sysroot /
      target extended-remote | vgdb --multi --vargs -q
      start
      end
      Then you can do something like
      $ gdb test_exe
      (gdb) start_vg
      and then you are in gdb connected to Valgrind.

  • @j7gy8b
    @j7gy8b День тому +1

    Yes! This is an undeservedly obscure feature of valgrind. And it's scriptable just like regular old gdb. If I may plug my own CppCon video: ua-cam.com/video/ck_jCH_G7pA/v-deo.html

    • @paulfloyd9258
      @paulfloyd9258 14 годин тому

      It is now scripted in Python (thanks to Philippe Waroquiers). Would it be possible for us to integrate your ppl, script?