Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] Compiling under MSVC 6.0 - simple Q, clear cut A ?

From: Brian Vandenberg <brian@xxxxxxxxx>
Date: Sun, 03 Dec 2006 08:45:26 -0700
Sleepless,

The steps provided earlier by another responder work great in vs6. If you're using vs7 or vs8 to debug you'll likely have trouble.

1) Open the .c file within your dev env.
2) Start debugging.
3) Once wireshark is loaded (and all DLLs for dissectors have been loaded dynamically), break into wireshark, add your breakpoint, then resume execution. 4) Cause the code you want to break into to execute. It should break just fine.

-Brian

Sleep Less wrote:
Thanks for everyone's tips. I'm still stuck. PDB files do exist (we're talking about the dissectors.lib segement since it aggregates the dissectors). When I implement Douglas's method the breakpoints are not reached, and Wireshark reports that the relevant dissector had a problem.


*/Douglas Pratley <Douglas.pratley@xxxxxxxxxx>/* wrote:

    It�s the .pdb files that it needs � they should have been created
    when the file was compiled. Is this a dynamically loaded plugin,
    or a statically linked object? MSVC 6 can be a bit rubbish at
    putting breakpoints in dynamically loaded code.
    If you have MSCV 7.0 installed, you could try debugging under that
    � it seems to be a lot smarter about breakpoints (still build
    using MSVC 6.0; the debug symbols are compatible).
    Alternatively, there is a gratuitous hack that you can try if
    nothing else works.
    At the head of the file you want to stop in, put:
    #define _DEBUG
    #include <crtdbg.h>
    Where you want to stop, put:
    _CrtDbgBreak();
    Compile it up (if this fails, then I�d give up on this idea � it
    works for me in TShark where I tried it), then run in the debugger.
    This will trigger a Win32 assert, and drop you into the debugger.
    Obviously, don�t leave this in release code!
    ------------------------------------------------------------------------
    *From:* wireshark-dev-bounces@xxxxxxxxxxxxx
    [mailto:wireshark-dev-bounces@xxxxxxxxxxxxx] *On Behalf Of *Sleep Less
    *Sent:* 01 December 2006 11:55
    *To:* Developer support list for Wireshark
    *Subject:* Re: [Wireshark-dev] Compiling under MSVC 6.0 - simple
    Q,clear cut A ?
    Well not quite - the compiler still disables breakpoint in the
    dissector, as it fails to see
    the (symbolic) connection. Methinks you need .bsc files for that,
    which MSVC generates when you compile from the IDE, but apprently
    nmake does not.
    any ideas?

    */Douglas Pratley <Douglas.pratley@xxxxxxxxxx>/* wrote:

        ------------------------------------------------------------------------
        *From:* wireshark-dev-bounces@xxxxxxxxxxxxx
        [mailto:wireshark-dev-bounces@xxxxxxxxxxxxx] *On Behalf Of
        *Sleep Less
        *Sent:* 01 December 2006 11:42
        *To:* Developer support list for Wireshark
        *Subject:* Re: [Wireshark-dev] Compiling under MSVC 6.0 -
        simple Q,clear cut A ?
        Thanks. Done all the wiki recommendations. I can now
        single/step debug main.c,
        but as you can imagine, my interest lies deep in one of the
        dissectors - e.g. packet-h263.c etc. How to I get to the
        situation I can single step through those?
        thanks

        */Douglas Pratley <Douglas.pratley@xxxxxxxxxx>/* wrote:

            [Apologies if this message appears twice - I am having
            some trouble persuading exchange to be consistent about
            which SMTP address it uses for outgoing email, and my
            first try bounced as a non-menber]
            The wiki tips page has a couple of useful sections on
            debugging and setting up browse info for MSVC.
            http://wiki.wireshark.org/Development/Tips
            I�ve also done it by creating a dummy static library
            project and using Wireshark as the �program� under the
            debug settings (useful for putting a breakpoint in
            start-up code).
            Cheers
            Doug
            ------------------------------------------------------------------------
            *From:* wireshark-dev-bounces@xxxxxxxxxxxxx
            [mailto:wireshark-dev-bounces@xxxxxxxxxxxxx] *On Behalf Of
            *Sleep Less
            *Sent:* 01 December 2006 10:36
            *To:* Developer support list for Wireshark
            *Subject:* Re: [Wireshark-dev] Compiling under MSVC 6.0 -
            simple Q,clear cut A ?
            Hi,
            thanks for the willingness to assist.
            I did one thing : created an empty directory
            c:\wireshark-win32-libs
            and then ran the nmake -f makefile.nmake all
            with no further problems whatsoever.
            Since my install was a "clean" one (no previous wireshark
            builds etc.)
            I guess this may happen to others as well.
            If I may, one other short Q - the manual does not specify
            how I can use the MSVC IDE
            to debug wireshark, which was my main reason for building it.
            Is there a way to do that?
            thanks


            */Anders Broman <a.broman@xxxxxxxxx>/* wrote:

                Hi,
                What version are you trying to build?
                What does the line
                DOWNLOAD_PREFIX
                In the file tools/win32-setup.sh say?
                BR
                Anders

                ________________________________________
                Fr�n: wireshark-dev-bounces@xxxxxxxxxxxxx
                [mailto:wireshark-dev-bounces@xxxxxxxxxxxxx] F�r Sleep
                Less
                Skickat: den 1 december 2006 09:43
                Till: Developer support list for Wireshark
                �mne: Re: [Wireshark-dev] Compiling under MSVC 6.0 -
                simple Q,clear cut A ?

                Hi,
                I have faithfully followed the Cygwin/packages
                installation, done the
                distclean and verify_tools stages. At the setup stage
                I get an error at the
                glib part:
                bash tools\win32-setup.sh --appverify cl link nmake bash
                bison flex env grep /usr/bin/find perl env python sed
                unzip wget
                Checking for required applications:
                cl: /cygdrive/d/PROGRA~1/MICROS~1/VC98/BIN/cl
                link: /cygdrive/d/PROGRA~1/MICROS~1/VC98/BIN/link
                nmake: /cygdrive/d/PROGRA~1/MICROS~1/VC98/BIN/nmake
                bash: /usr/bin/bash
                bison: /usr/bin/bison
                flex: /usr/bin/flex
                env: /usr/bin/env
                grep: /usr/bin/grep
                /usr/bin/find: /usr/bin/find
                perl: /usr/bin/perl
                env: /usr/bin/env
                python: /cygdrive/c/ibmtools/python22/python
                sed: /usr/bin/sed
                unzip: /usr/bin/unzip
                wget: /usr/bin/wget
                ****** glib-2.6.6.zip ******
                No HTTP proxy specified (http_proxy and HTTP_PROXY are
                empty).
                Downloading gtk2.6/glib-2.6.6.zip into , installing
                into glib

                ERROR: Can't find glib
                So while I fully believe it "cleanly" works for many,
                obviously there is
                something missing in the manual.
                Any tips would be much appreciated.
                Thanks

                Anders Broman wrote:
                Hi,
                And note that Wireshark can't be built "without the
                other tools"
                on any system.
                BR
                Anders

                -----Ursprungligt meddelande-----
                Fr�n: wireshark-dev-bounces@xxxxxxxxxxxxx
                [mailto:wireshark-dev-bounces@xxxxxxxxxxxxx] F�r Jaap
                Keuter
                Skickat: den 30 november 2006 22:16
                Till: Developer support list for Wireshark
                �mne: Re: [Wireshark-dev] Compiling under MSVC 6.0 -
                simple Q, clear cut A ?

                Hi,

                Just faithfully follow the developer guides guidelines
                on setting up your
                development environment, including cygwin and its
                tools, as well gathering
                the libraries.

                Tried it a couple of times, never failed on me.

                Thanx,
                Jaap

                On Thu, 30 Nov 2006, Sleep Less wrote:

                > Hi All,
                > from Andre Martin's recent (Nov 2) posting it is not
                clear to me if
                Wireshark
                > can be indeed compiled under MSVC 6.0 in a hassle
                free manner?
                > The developers doc is really partial, e.g on page 24
                section 2.6.2 the
                nmake example
                > seems to give an example of a failure, not of the
                correct usage.
                > Also instruction on how to run wireshark on MSVC6
                debugger (2.5.3) are
                missing.
                > So I'd be most appreciative on anyone who has done it
                can give a short
                description of what it involves.
                > Initial system is assumed to be a "clean" MSVC 6.0,
                no other tools,
                Windows XP SP2.
                > thanks,
                > Haim
                >
                >
                > ---------------------------------
                > Access over 1 million songs - Yahoo! Music Unlimited.

                _______________________________________________
                Wireshark-dev mailing list
                Wireshark-dev@xxxxxxxxxxxxx
                http://www.wireshark.org/mailman/listinfo/wireshark-dev

                _______________________________________________
                Wireshark-dev mailing list
                Wireshark-dev@xxxxxxxxxxxxx
                http://www.wireshark.org/mailman/listinfo/wireshark-dev


                ________________________________________
                Everyone is raving about the all-new Yahoo! Mail beta.

                _______________________________________________
                Wireshark-dev mailing list
                Wireshark-dev@xxxxxxxxxxxxx
                http://www.wireshark.org/mailman/listinfo/wireshark-dev

            ------------------------------------------------------------------------
            Want to start your own business? Learn how on Yahoo! Small
            Business.
            <http://us.rd.yahoo.com/evt=41244/*http:/smallbusiness.yahoo.com/r-index>



            This message should be regarded as confidential. If you
            have received this email in error please notify the sender
            and destroy it immediately.
            Statements of intent shall only become binding when
            confirmed in hard copy by an authorised signatory. The
            contents of this email may relate to dealings with other
            companies within the Detica Group plc group of companies.

            Detica Limited is registered in England under No: 1337451.

            Registered offices: Surrey Research Park, Guildford,
            Surrey, GU2 7YP, England.

            _______________________________________________
            Wireshark-dev mailing list
            Wireshark-dev@xxxxxxxxxxxxx
            http://www.wireshark.org/mailman/listinfo/wireshark-dev

        ------------------------------------------------------------------------
        Check out the all-new Yahoo! Mail beta
        <http://us.rd.yahoo.com/evt=43257/*http:/advision.webevents.yahoo.com/mailbeta>
        - Fire up a more powerful email and get things done faster.

    _______________________________________________
    Wireshark-dev mailing list
    Wireshark-dev@xxxxxxxxxxxxx
    http://www.wireshark.org/mailman/listinfo/wireshark-dev
    ------------------------------------------------------------------------
    Cheap Talk? Check out
    <http://us.rd.yahoo.com/mail_us/taglines/postman8/*http:/us.rd.yahoo.com/evt=39663/*http:/voice.yahoo.com>
    Yahoo! Messenger's low PC-to-Phone call rates.
    _______________________________________________
    Wireshark-dev mailing list
    Wireshark-dev@xxxxxxxxxxxxx
    http://www.wireshark.org/mailman/listinfo/wireshark-dev


------------------------------------------------------------------------
Access over 1 million songs - Yahoo! Music Unlimited. <http://pa.yahoo.com/*http://us.rd.yahoo.com/evt=36035/*http://music.yahoo.com/unlimited/>
------------------------------------------------------------------------

_______________________________________________
Wireshark-dev mailing list
Wireshark-dev@xxxxxxxxxxxxx
http://www.wireshark.org/mailman/listinfo/wireshark-dev