Mail Archives: djgpp/2000/08/20/01:56:43
> Reply-To: "ObiGuan Kenobi" <jgfw AT iname DOT com>
> From: "ObiGuan Kenobi" <jgfw AT iname DOT com>
> >
> > Unfortunately, I don't have access to Windows/ME to debug this.
> > Please consider running the program stubify.exe (that's where the
> > message comes from) under a debugger and stepping into `rename' to see
> > what exactly fails there.
>
> Could you please tell me on the steps how to do this. I am not that
> familiar with debuggers. Tried to use GDB, but I have no idea how to specify
> to stop at rename.
The way to tell GDB to stop at rename is "break rename". (I suggest a
quick glance at the GDB manual, and also the built-in "help" command
could help ;-).
However, to debug this efficiently, you will need to rebuild
stubify.exe so that it has the debugging code for the library
functions as well. To this end, you should do the following:
- Download v2/djlsr203.zip and extract the following files from it:
src/stub/stubify.c
src/libc/ansi/stdio/rename.c
src/libc/ansi/stdio/_rename.c
src/libc/ansi/stdio/remove.c
- Put all those files together on a single file and call that file
stubify.c.
- Compile that file like this:
gcc -Wall -O -g -o stubify.exe stubify.c
- Run this debugging version of stubify.exe under GDB, like this:
gdb stubify.exe
break rename
run foo
where `foo' is the name of the program you tried to link when you
saw the original error message which started this thread.
PLEASE NOTE: `foo' must be a raw COFF image, not a .exe program!
It should be a file without an extension, and you should be able
to find it in the directory where you were linking that program.
I suggest to copy `foo' into the same directory where you have the
debugging version of stubify.exe with stubify.c and all the other
source files, and run GDB from there.
- Once stubify.exe stops at entry to `rename', you can single-step
it by typing "next" (or "n" for short), and see what source line
causes the problem. You can examine variables with a command like
this:
print varname
where "varname" is the name of a variable (acually, it can be any
valid C expression that includes variable names, operators, and
even function calls).
To step into a function call, use "step" instead of "next".
Good luck, and thanks for working on this!
- Raw text -