Menu

how to debug threads with gdb

Help
Anonymous
2001-02-04
2001-02-05
  • Anonymous

    Anonymous - 2001-02-04

    hi, i'd like to debug a program with multiple threads created with commonc++.
    but after creating those threads gdb does not show them. i can only view and manipulate the main thread.
    how do i debug other threads??
    thanks in advance
    pilux

     
    • Anonymous

      Anonymous - 2001-02-05

      I use a combination of four things:

      * ddd and gdb. My gdb came with RedHat 6.2 and seems to be thread aware. Asking it for a version it simply prints out "GNU gdb 19991004". If your gdb isn't thread aware, there seem to be a few patches around - you can search with google for them. But I think the current gdb should have thread support.
      * a patched kernel, using the patch mentioned at http://www.uwsg.iu.edu/hypermail/linux/kernel/0003.1/1539.html. This patch causes the kernel to dump the core of the causing process instead of the main process.
      * many, many asserts and trace outputs
      * the dmalloc debugging library, available at http://dmalloc.com. This library kepps track of memory leaks, invalid allocation/freeing operations and so on and it is able to handle multi-threaded applications.

      With this four tools, I was able to analyze and debug my applications pretty fast.

      Good luck

      Stefan

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.