Debugging a C++ program that uses C code.

Discussion in 'C++' started by DaLoverhino, Nov 30, 2006.

  1. DaLoverhino

    DaLoverhino Guest

    Hello. I think I messed up my last post. Sorry about that.

    I have a C++ program made up of two cpp files. I have the following
    makefile:

    stepprog: main.o parse_sql.o
    c++ main.o parse_sql.o -o stepprog

    main.o: main.c IWCallback.h parse_sql.h
    c++ -g -c main.cpp

    parse_sql.o: parse_sql.cpp parse_sql.h
    c++ -g -c parse_sql.cpp

    main.c parse_sql.c IWCallback.h parse_sql.h:


    Now, when I try to set a break point in the top function of
    parse_sql.o, the debugger always complains that this module doesn't
    have any debugger information. main.o has debugger information, so I
    can always set breakpoint in that piece of code.

    Anyways, I'm wondering why this might be so, and the only thing I can
    think of is that parse_sql.c has all code declared as extern "C". Is
    this true? And if so, how do I get around it? Anyone have ideas?

    I'm on solaris 5.8 using the solaris compiler and dbx.

    Thanks.
    DaLoverhino, Nov 30, 2006
    #1
    1. Advertising

  2. DaLoverhino

    Jack Klein Guest

    On 29 Nov 2006 16:03:15 -0800, "DaLoverhino" <>
    wrote in comp.lang.c++:

    > Hello. I think I messed up my last post. Sorry about that.
    >
    > I have a C++ program made up of two cpp files. I have the following
    > makefile:
    >
    > stepprog: main.o parse_sql.o
    > c++ main.o parse_sql.o -o stepprog
    >
    > main.o: main.c IWCallback.h parse_sql.h
    > c++ -g -c main.cpp
    >
    > parse_sql.o: parse_sql.cpp parse_sql.h
    > c++ -g -c parse_sql.cpp
    >
    > main.c parse_sql.c IWCallback.h parse_sql.h:
    >
    >
    > Now, when I try to set a break point in the top function of
    > parse_sql.o, the debugger always complains that this module doesn't
    > have any debugger information. main.o has debugger information, so I
    > can always set breakpoint in that piece of code.
    >
    > Anyways, I'm wondering why this might be so, and the only thing I can
    > think of is that parse_sql.c has all code declared as extern "C". Is
    > this true? And if so, how do I get around it? Anyone have ideas?
    >
    > I'm on solaris 5.8 using the solaris compiler and dbx.


    There is nothing in the C++ language that specifies the workings of
    debuggers or debugging information. This is all specific to your tool
    set, and not a language issue.

    You need to find a group to post in the supports your compiler/OS
    combination, if there is one, or perhaps contact Sun's technical
    support.

    --
    Jack Klein
    Home: http://JK-Technology.Com
    FAQs for
    comp.lang.c http://c-faq.com/
    comp.lang.c++ http://www.parashift.com/c -faq-lite/
    alt.comp.lang.learn.c-c++
    http://www.contrib.andrew.cmu.edu/~ajo/docs/FAQ-acllc.html
    Jack Klein, Nov 30, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Johann Blake
    Replies:
    1
    Views:
    1,188
    Hermit Dave
    Jan 5, 2004
  2. kris
    Replies:
    5
    Views:
    381
    Joachim Schmitz
    Jun 22, 2007
  3. Replies:
    2
    Views:
    315
  4. grbgooglefan
    Replies:
    6
    Views:
    419
    Christian Heimes
    Dec 7, 2007
  5. AAaron123
    Replies:
    3
    Views:
    648
    AAaron123
    Jul 28, 2009
Loading...

Share This Page