what is the $cdir and $cwd?

Baurjan Ismagulov ibr@ata.cs.hun.edu.tr
Mon Nov 29 13:56:00 GMT 2004


Hello Gan,

On Sat, Nov 27, 2004 at 05:26:04PM -0800, gan_xiao_jun@yahoo.com wrote:
> Is the $cwd the current working directory of the
> target?

I haven't used $cwd in remote debugging, but I think it should be the
current working directory on the host.


> And the $cdir the directory is in which the source
> file was compiled into object code?

Yes.


> And how the $cdir save to obj files (add -g when
> compile or others flags)?

At least -g seems to do that.


> Sometime even I use -g,
> when I use
> strings file.o
> I also can't find the source file name in the result,
> it that mean the source file name is not contained in
> file.o?

Seems that strings does not scan debugging sections by default; try
"strings -a file.o".


> How can I control the directory saved to obj files as
> absolute path or relative
> path?

Use absolute or relative path at the gcc command line.


With kind regards,
Baurjan.



More information about the Gdb mailing list