none
How can I debug code with more than 65535 lines?

    Question

  • Hello everybody!

    I have source code with more than 65535 lines. It's generated C code from a precompiler so I am not able to split the code into several sections. In Visual C++ i cannot set breakpoints on lines beyond 65535. If I step into a function which begins on such a line (say line n) Visual C++ debugger shows me the line n-65535. I can step through, see the variables but I'm looking always at the wrong code. Anybody can help me? Im I the only person on earth who wants to debug code with more than 65535 lines?

    Thanks a lot for any help!

    stoeffu
    Friday, October 19, 2007 1:12 PM

Answers

  • Hi stoeffu,

     

    We do know about this problem and unfortunately there is nothing you can do to make it work better, no workaround. It might get fixed in a future version of Visual Studio.

     

    Thanks, Laura

    Friday, October 19, 2007 7:06 PM
    Moderator

All replies

  •  

    See it's not a good idea to Debug a huge code line by line . Assume if at client side you get some error so how will you come to know where the error arise so in the all big project people generaly follow the concept of logfile . A logFile is a Simple text File how to use a LoGFile. here is a Small idea.

     

     

    assume Some Addition Function . use exception handling inside your code .  Make a Seperate Class for Performing calculation on File like inserting the Error value in append mode in your File.Create a Object of your LogFile assume it's name is logFile

    Code Block

    void Add(int a,int b)

    {

       try

       {

             int c =a+b; // assume if some error occur then catch the error

       }

      catch(...)

      {

         //write is a Function which takes few parameter like error ,Functionname etc

        // Now write the all value in a File

     

    logFile.Write(::GetLastError(),"Add");

      }

    }

     

     

     

    by the above way you easily can trace out your error.

     

    Thanx

    Friday, October 19, 2007 4:05 PM
  • I am moving this thread to the debugger forum because the Visual C++ compiler can (easily) handle this number of lines in a file and it can create the correct debug information (we can handle up to 0x00FFFFFF lines) it is the debugger that has the problem.
    Friday, October 19, 2007 4:21 PM
    Moderator
  • Hi stoeffu,

     

    We do know about this problem and unfortunately there is nothing you can do to make it work better, no workaround. It might get fixed in a future version of Visual Studio.

     

    Thanks, Laura

    Friday, October 19, 2007 7:06 PM
    Moderator
  •  Hi,

    Out of curiosity (I ran into this issue recently, attempting to step through the amalgamated SQLite source with VS2008) will the debugger use the full 24-bit line information in Visual Studio 2010?

    Thanks,
    Mark.
    Thursday, November 06, 2008 4:09 PM
  • Well this is completely crahp-tacular. I'm using sqlite.c (http://www.sqlite.org) which has over 65,536 source code lines.

    Stop adding new features to Visual Studio and make whats already in there work right, darnit!!!
    Sunday, March 29, 2009 12:05 PM
  •  Hi,

    What about this limitation in the Visual Studio 2010?

    Thanks,
    Ion.
    Thursday, December 10, 2009 11:47 AM
  • This is a little weak.  16-bit indices really? Fortunately, I can split my module, I just would have expected better.

    "stoeffu" - I LOWELLED.
    Thursday, December 17, 2009 7:12 PM
  • Just to "pile on"...

    I am also trying to debug the sqlite amalgamation (v3.6.23) that has ~107,000 lines.  It compiles ok, but don't try to step through it in the VS2008 debugger.   Come on, Microsoft, sixteen bits?  What is this 2010 or 1990?

    Try extra hard to extract a fixed version date from the debugger team.

     

    Friday, March 26, 2010 3:06 PM
  • Hi Laura!

    More than 3 years are gone since my post. Do you know, whether this problem is fixed in VS2010?

     

    Thanks for a reply - stoeffu

    Tuesday, February 01, 2011 3:31 PM
  • VS2010 SP1 (Express edition) - of course nothing changed, still 16bit line numbering in debugging... (It have failed also with SQLite AMALGAMATION)
    Tuesday, September 13, 2011 6:48 PM