Re: Productivity in programming of C++ programmers
From: Siemel Naran (SiemelNaran_at_REMOVE.att.net)
Date: 08/14/04
- Next message: Steven T. Hatton: "I finally figured it out! namespaces and the ODR"
- Previous message: Michael Sgier: "SDL_Main or WinMain@16 error"
- In reply to: lilburne: "Re: Productivity in programming of C++ programmers"
- Next in thread: lilburne: "Re: Productivity in programming of C++ programmers"
- Reply: lilburne: "Re: Productivity in programming of C++ programmers"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 14 Aug 2004 21:40:48 GMT
"lilburne" <lilburne@godzilla.net> wrote in message
news:2o79obF7ph62U1@uni-berlin.de...
> Siemel Naran wrote:
> >>Hmmm! Can you set a breakpoint or just step in?
> >
> > Both, at least on Borland 6! I just tried to set a breakpoint. I put
> > breakpoints in non-template functions. My file structure is: source
code in
> > src\libname\file.cpp, and the headers are include\libname\various.hpp.
Put
> > a breakpoint in any of the various files in the include directory, and
the
> > debugger will hit the breakpoint. Thinking about it, I think that in
debug
> > build the compiler makes all functions non-inline, so of course you
should
> > be able to step through it. Presumably if you debug the release .exe or
> > .lib or .dll, stepping through individual assembly instructions, you
won't
> > hit the breakpoint because if the code is really inline it won't be in
the
> > .exe. Anyway, I don't have the bandwidth to test this.
>
> Probably some weirdness in the linker too to make it work
> across libraries.
I think the reason is that I compiled my library parse.lib in debug mode
into a debug lib file. Then I compiled my example.exe, and linked against
the debug parse.lib file, and I was therefore able to put breakpoints in the
inline function. Had I linked against the release parse.lib file, that
would probably not have been the case.
In the past, I found that creating a release parse.lib file, then compiling
example.exe in debug mode and linking against the release parse.lib file
caused my program to mysteriously crash at runtime. The reason I think is
that the class headers of the parse library define STL member variables,
like std::string, std::deque, etc. The parse.lib compiled in release mode
links against the release STL files, performs various compiler
optimizations, etc. My example.cpp includes the same headers, but compiles
in debug mode, so it does not do various optimizations, assumes that the
parse.lib file will link against the debug STL files, etc. So if both
parse.lib and example.exe are compiled in release mode, or both in debug
mode, then it works fine.
When I get more time, I'm going to use the pointer to implementation idea,
and define a nested struct Imp, and define it with all the STL member
variables in the cpp file. This might allow me to compile and run a debug
example.exe linked against a debug parse.lib.
- Next message: Steven T. Hatton: "I finally figured it out! namespaces and the ODR"
- Previous message: Michael Sgier: "SDL_Main or WinMain@16 error"
- In reply to: lilburne: "Re: Productivity in programming of C++ programmers"
- Next in thread: lilburne: "Re: Productivity in programming of C++ programmers"
- Reply: lilburne: "Re: Productivity in programming of C++ programmers"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|