Loading ...
Sorry, an error occurred while loading the content.

gdb tips wanted.

Expand Messages
  • Srinivas Rao. M Hamse
    Hi, I am a user of gdb. Is there a usergroup on the net where the users keep sharing about different shortcuts/tips/scripts for gdb debugger ? I wish to know
    Message 1 of 4 , Feb 21, 2006
    • 0 Attachment
      Hi,
      I am a user of gdb. Is there a usergroup on the net where the users
      keep sharing about different shortcuts/tips/scripts for gdb debugger ?
      I wish to know certain things about gdb such as:
      1. How to put a data breakpoints.
      2. How to keep certain breakpoints saved across multiple sessions of
      gdb. i.e, even if i exit from gdb prompt, the break points should be
      re-appear(again set) in my next debugging session of a given
      applicatoin which i am debugging.

      is there a site similar to (www.vim.org) where user have rated the
      different tips for gdb ?

      Thanks,
      Srinivas.
    • Kiran Kumar Immidi
      ... Look for watchpoints; ... Not sure how to save, but if you have a set of gdb commands which serve to insert the break points, you can list them in a file,
      Message 2 of 4 , Feb 22, 2006
      • 0 Attachment
        --- "Srinivas Rao. M Hamse"
        <iamspl_xxx@...> wrote:

        > 1. How to put a data breakpoints.

        Look for watchpoints;

        > 2. How to keep certain breakpoints saved across
        > multiple sessions of
        > gdb. i.e, even if i exit from gdb prompt, the break
        > points should be
        > re-appear(again set) in my next debugging session of
        > a given
        > applicatoin which i am debugging.

        Not sure how to save, but if you have a set of gdb
        commands which serve to insert the break points, you
        can list them in a file, one per line, and you can
        "source" it in gdb;

        Regards,
        Kiran Kumar Immidi

        __________________________________________________
        Do You Yahoo!?
        Tired of spam? Yahoo! Mail has the best spam protection around
        http://mail.yahoo.com
      • Ranjit Mathew
        ... One thing I would heartily recommend is that you take a few minutes to read through the GDB manual using either info gcc or online:
        Message 3 of 4 , Feb 22, 2006
        • 0 Attachment
          --- In linux-bangalore-programming@yahoogroups.com, "Srinivas Rao. M
          Hamse" <iamspl_xxx@...> wrote:
          >
          > I am a user of gdb. Is there a usergroup on the net where the users
          > keep sharing about different shortcuts/tips/scripts for gdb debugger ?

          One thing I would heartily recommend is that you take
          a few minutes to read through the GDB manual using
          either "info gcc" or online:

          http://sources.redhat.com/gdb/current/onlinedocs/gdb.html

          GDB is a rather powerful debugger and most people
          do not even know what they are missing when they
          use GDB.


          > 1. How to put a data breakpoints.

          I presume you mean to find out when a variable
          changes value. In that case, watchpoints are
          what you want:

          http://sources.redhat.com/gdb/current/onlinedocs/gdb_6.html#SEC34

          You can use conditional breakpoints:

          http://sources.redhat.com/gdb/current/onlinedocs/gdb_6.html#SEC38

          to limit when the debugger interrupts your programme.

          These features can be very useful to determine the
          cause of data corruption in languages like C/C++.


          > 2. How to keep certain breakpoints saved across multiple sessions of
          > gdb. i.e, even if i exit from gdb prompt, the break points should be
          > re-appear(again set) in my next debugging session of a given
          > applicatoin which i am debugging.

          You can use command files:

          http://sources.redhat.com/gdb/current/onlinedocs/gdb_21.html#SEC230

          or have a ".gdbinit" file in your working directory that
          is automatically read in by GDB. For example, the GCC developers
          use such an initialisation file for helping with debugging
          GCC:

          http://gcc.gnu.org/viewcvs/trunk/gcc/gdbinit.in?view=markup&rev=110281

          HTH,
          Ranjit.
        • Mayank Rungta
          ... To add to that you can find the following quick reference card useful - http://refcards.com/refcards/gdb/index.html. There are several other good ref cards
          Message 4 of 4 , Feb 22, 2006
          • 0 Attachment
            Ranjit Mathew wrote:

            >One thing I would heartily recommend is that you take
            >a few minutes to read through the GDB manual using
            >either "info gcc" or online:
            >
            > http://sources.redhat.com/gdb/current/onlinedocs/gdb.html



            To add to that you can find the following quick reference card useful -
            http://refcards.com/refcards/gdb/index.html.

            There are several other good ref cards at -
            http://refcards.com/refcards/index.html

            Have fun,
            Mynk.


            [Non-text portions of this message have been removed]
          Your message has been successfully submitted and would be delivered to recipients shortly.