#line directive makes gdb crazy ?

Discussion in 'C Programming' started by Pawel, Jan 12, 2007.

  1. Pawel

    Pawel Guest

    Hallo Newsgroup Readers


    I have the following function in the code I am trying to debug:

    /usr/src/redhat/BUILD/ethereal-0.10.14/epan/dissectors/packet-h225.c:
    static int
    dissect_h225_T_h4501SupplementaryService_item(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
    #line 459 "h225.cnf"
    tvbuff_t *h4501_tvb = NULL;

    offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index,
    NO_BOUND, NO_BOUND, &h4501_tvb);

    if (h4501_tvb && tvb_length(h4501_tvb)) {
    call_dissector(h4501_handle, h4501_tvb, pinfo, tree);
    }


    return offset;
    }

    now when I am debugging with gdb some other function that calls the one above, I get error:
    459 h225.cnf: No such file or directory.
    in h225.cnf

    h225.cnf file does not exist

    Have You got idea on how to make gdb work correctly.

    Regards,
    Pawel
    Pawel, Jan 12, 2007
    #1
    1. Advertising

  2. Pawel

    SM Ryan Guest

    # /usr/src/redhat/BUILD/ethereal-0.10.14/epan/dissectors/packet-h225.c:
    # static int
    # dissect_h225_T_h4501SupplementaryService_item(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
    # #line 459 "h225.cnf"

    # now when I am debugging with gdb some other function that calls the one above, I get error:
    # 459 h225.cnf: No such file or directory.
    # in h225.cnf
    #
    # h225.cnf file does not exist
    #
    # Have You got idea on how to make gdb work correctly.

    gdb is working correctly. All it has is the object file and your claim of where it came from. The claim is wrong and must be revised: if you are compiling the source code, you can remove the line number directives before compiling. There may be compiler and/or pre-processor options to do so; you can also write short filter programs to do so.

    --
    SM Ryan http://www.rawbw.com/~wyrmwif/
    A bunch of savages in this town.
    SM Ryan, Jan 13, 2007
    #2
    1. Advertising

  3. Pawel

    Jack Klein Guest

    On Fri, 12 Jan 2007 14:53:18 +0100, Pawel <> wrote in
    comp.lang.c:

    > Hallo Newsgroup Readers
    >
    >
    > I have the following function in the code I am trying to debug:
    >
    > /usr/src/redhat/BUILD/ethereal-0.10.14/epan/dissectors/packet-h225.c:
    > static int
    > dissect_h225_T_h4501SupplementaryService_item(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
    > #line 459 "h225.cnf"
    > tvbuff_t *h4501_tvb = NULL;
    >
    > offset = dissect_per_octet_string(tvb, offset, pinfo, tree, hf_index,
    > NO_BOUND, NO_BOUND, &h4501_tvb);
    >
    > if (h4501_tvb && tvb_length(h4501_tvb)) {
    > call_dissector(h4501_handle, h4501_tvb, pinfo, tree);
    > }
    >
    >
    > return offset;
    > }
    >
    > now when I am debugging with gdb some other function that calls the one above, I get error:
    > 459 h225.cnf: No such file or directory.
    > in h225.cnf
    >
    > h225.cnf file does not exist
    >
    > Have You got idea on how to make gdb work correctly.


    You need to ask this question in a group that supports gdb, perhaps
    one in the gnu.* family. The language itself does not specify how to
    make debuggers work, this is a tool question, not a language one.

    --
    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, Jan 14, 2007
    #3
  4. Pawel wrote:
    >
    > Hallo Newsgroup Readers
    >
    > I have the following function in the code I am trying to debug:
    >
    > /usr/src/redhat/BUILD/ethereal-0.10.14/epan/dissectors/packet-h225.c:
    > static int
    > dissect_h225_T_h4501SupplementaryService_item(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index) {
    > #line 459 "h225.cnf"
    > tvbuff_t *h4501_tvb = NULL;

    [...]
    >
    > now when I am debugging with gdb some other function that calls the one above, I get error:
    > 459 h225.cnf: No such file or directory.
    > in h225.cnf
    >
    > h225.cnf file does not exist
    >
    > Have You got idea on how to make gdb work correctly.


    Yes... Stop lying to it.

    You have told it that the source code came from "h225.cnf" on line
    459, yet that file does not exist.

    For more info, you'll either need to ask in a group that deals with
    gdb, or with Linux kernel stuff. (Assuming that the above is from
    a Linux kernel build.)

    --
    +-------------------------+--------------------+-----------------------+
    | Kenneth J. Brody | www.hvcomputer.com | #include |
    | kenbrody/at\spamcop.net | www.fptech.com | <std_disclaimer.h> |
    +-------------------------+--------------------+-----------------------+
    Don't e-mail me at: <mailto:>
    Kenneth Brody, Jan 15, 2007
    #4
    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. M. Uli Kusterer

    Equivalent to C's #line directive?

    M. Uli Kusterer, Sep 20, 2004, in forum: Java
    Replies:
    5
    Views:
    478
    Daniel Bonniot
    Sep 21, 2004
  2. John

    vi-style command-line editing in gdb

    John, Nov 14, 2003, in forum: C Programming
    Replies:
    2
    Views:
    327
    Tristan Miller
    Nov 14, 2003
  3. Surendra
    Replies:
    0
    Views:
    498
    Surendra
    Mar 23, 2006
  4. seba
    Replies:
    1
    Views:
    1,428
    mlimber
    Mar 22, 2007
  5. Timothy Madden
    Replies:
    1
    Views:
    1,602
    Timothy Madden
    Sep 17, 2009
Loading...

Share This Page