a debugging question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • a_linux_user

    a debugging question

    I have compiled a program with -g option with gcc, but I am almost
    unable to debug it. For most variables, it does not allow me to print
    their values while debugging. Could someone tell me what compile
    options I have to use or how I should call gdb (if any special flags I
    have to use). I have used gdb a lot a few years ago, and I never had
    this problem.
    It is a small program so today I used the time tested method of
    debugging - add lots of print statements - but I hope someone will
    suggest a better way.
    Thanks.
  • red floyd

    #2
    Re: a debugging question

    a_linux_user wrote:
    I have compiled a program with -g option with gcc, but I am almost
    unable to debug it. For most variables, it does not allow me to print
    their values while debugging. Could someone tell me what compile
    options I have to use or how I should call gdb (if any special flags I
    have to use). I have used gdb a lot a few years ago, and I never had
    this problem.
    Not here, but the people in gnu.g++.help should be able to.

    Comment

    • Victor Bazarov

      #3
      Re: a debugging question

      a_linux_user wrote:
      I have compiled a program with -g option with gcc, but I am almost
      unable to debug it. For most variables, it does not allow me to print
      their values while debugging. Could someone tell me what compile
      options I have to use or how I should call gdb (if any special flags I
      have to use). I have used gdb a lot a few years ago, and I never had
      this problem.
      Yes, somebody in the newsgroup 'gnu.gcc.help' could.
      It is a small program so today I used the time tested method of
      debugging - add lots of print statements - but I hope someone will
      suggest a better way.
      Somebody in the compiler newsgroup probably will, if you ask.

      V
      --
      Please remove capital 'A's when replying by e-mail
      I do not respond to top-posted replies, please don't ask

      Comment

      • a_linux_user

        #4
        Re: a debugging question

        Sorry about posting it here.

        On Sep 30, 8:36 pm, Victor Bazarov <v.Abaza...@com Acast.netwrote:
        a_linux_user wrote:
        I have compiled a program with -g option with gcc, but I am almost
        unable to debug it. For most variables, it does not allow me to print
        their values while debugging. Could someone tell me what compile
        options I have to use or how I should call gdb (if any special flags I
        have to use). I have used gdb a lot a few years ago, and I never had
        this problem.
        >
        Yes, somebody in the newsgroup 'gnu.gcc.help' could.
        >
        It is a small program so today I used the time tested method of
        debugging - add lots of print statements - but I hope someone will
        suggest a better way.
        >
        Somebody in the compiler newsgroup probably will, if you ask.
        >
        V
        --
        Please remove capital 'A's when replying by e-mail
        I do not respond to top-posted replies, please don't ask

        Comment

        Working...