[CUWiN-Dev] tiny research project: cuwin debuggability

Bill Comisky bcomisky at pobox.com
Mon Jun 13 20:07:25 CDT 2005


On Mon, 13 Jun 2005, David Young wrote:

> I need help with a little research project.
>
> I would like for mkstaboot to routinely pack the CUWiN sources and objects
> into staboot-cuwin-src-$(date).tgz and staboot-cuwin-objs-$(date).tgz.
> If we store these with our releases and our images/upgrades under test,
> then it's easy for us to interpret crashdumps and such that come "from
> the field."
>
> There's a catch: gcc -g is loading absolute paths into the object files.
> That makes it hard to figure out what's going on in a core file that
> was compiled w/ sources in, say, /u1/luser/cuwin/src/, when you have
> extracted the archived sources in /h3/dyoung/cuw/trunk/src/.
>
> Will someone help me out by figuring out how to put relative paths
> (./src/) instead of absolute paths (/u1/luser/cuwin/src/) into the
> object files?  Maybe gcc lets us do that; maybe we can "patch up" the
> object files after compilation.  Maybe we can trick gdb into ignoring
> the first N components of an absolute path.  If you can figure this out,
> it will be a big help.
>

Would the gdb 'directory' command (or -d from command line) work for you?
http://www.rons.net.cn/htp/gdb/gdb_8.html#SEC53

It will search directories you specify for the source files before it uses 
the directory listed in the object file.  It looks like you would have to 
list all the subdirectories instead of just the parent directory.  I'm 
not sure what happens if there are source files with the same name in 
different subdirectories, probably uses the first one it finds.

bill

--
Bill Comisky
bcomisky at pobox.com


More information about the CU-Wireless-Dev mailing list