Integrating Ralf's rebase into setup.exe

Charles Wilson cwilson@ece.gatech.edu
Thu Jan 2 18:58:00 GMT 2003


Ralf Habacker wrote:
> You have gotten me just between finishing the things. I was interrupted a little
> after written the last mail, so 10 minutes later is was mostly fixed.

Lucky me. <g>

>>5) is the 'bindimage.cc' file used at all?
>>
> 
> it is used in rebind_main.cc.

You mean it *should* be used in rebind_main.cc. It's not listed in 
Makefile.in as one of the dependencies for REBIND_FILES, nor is it a 
member of LIBFILES.

Of course, rebind_main doesn't call BindImage or BindImageEx.  It does 
have a commented-out call to dll.rebind() -- but 
LinkedObjectFile::rebind() doesn't call BindImage() or BindImageEx 
either -- LinkedObjectFile::rebind() does all of the work itself.

Looks like the factorization isn't quite complete...work in progress, right?

Anyway, here's my remaining patches.  With two exceptions (Makefile and 
rebase_main.cc (main)), these are basically removing all printf calls 
and stdio.h, in favor of cout, cerr, and stream manipulators.

Anything that was printf() became std::cout, fprintf(stderr,) became 
cerr.  However, there are still some "design" issues that I didn't touch:

1) some that go to stdout probably should be stderr, and vice versa.
2) some are guarded by 'if (debug)' and probably should be 'if (some 
library call that returns the value of debug for this instance)' -- but 
I didn't really check the lexical scope.  These may be fine.
3) some aren't even guarded at all, and should be.
4) Then there's that whole exceptions vs. print-an-error-message from 
within the library deal.

The point is, ALL console output is now C++, cout/cerr style (before, it 
was half C++, half printf)

--Chuck


2002-01-02  Charles Wilson  <cwilson@ece.gatech.edu>

	* Makefile.in: add bindimage.o to LIBFILES
	change ar flags for creating static library
	* bindimage.cc: include imagehelper.h
	* objectfile.cc: remove dependency on stdio.h, use
	iostream and iomanip instead.
	(ObjectFile::ObjectFile): use std::cout instead of
	printf, std::cerr instead of fprintf(stderr,...)
	(LinkedObjectFile::rebind): ditto.
	(LinkedObjectFile:LinkedObjectFile): ditto.
	(LinkedObjectFile::PrintDependencie): ditto.
	(LinkedObjectFile::unbind): ditto.
	(main): ditto.
	* objectfilelist.cc: remove dependency on stdio.h, use
	iostream instead.
	(main): use std::cout instead of
	printf, std::cerr instead of fprintf(stderr,...)
	* rebase_main.cc: remove dependency on stdio.h
	(main): don't call GetLastError() twice, use stored
	value in aStatus2.  Call strerror() for a more informative
	message.
	* rebind_main.cc: remove dependency on stdio.h
	(Usage): use std::cout instead of printf, std::cerr
	instead of fprintf(stderr,...)
	* sections.cc: remove dependency on stdio.h, use
	iostream and iomanip instead.
	(Section::print): use std::cout instead of printf, std::cerr
	instead of fprintf(stderr,...)
	(Exports::Exports): ditto.
	(Exports::dump): ditto.
	(Imports::Imports): ditto.
	(Imports::dump): ditto.
	(Relocations::check): ditto.
	(Relocations::fix): ditto.
	(Relocations::relocate): ditto.
	* unbind_main (Usage): ditto.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: rebase_06c.patch
URL: <http://cygwin.com/pipermail/cygwin-apps/attachments/20030102/b4b7b258/attachment.ksh>


More information about the Cygwin-apps mailing list