Re: directory listing problem

From: Andy Valencia <vandys_at_nospam.org>
Date: Sat Feb 10 2001 - 15:22:20 PST

["Sandro Magi" <naasking@hotmail.com> writes:]

>>If you "cd /vsta" and "ls", do you get what you expected?
>Yep. It correctly lists all files and directories in /vsta so this doesn't
>look like a critical problem/bug. Neither 'ls' nor 'vls' displays all the
>correct entries on '/'.

I don't know if you really want to debug it; personally, I'm curious. If
you do, read on....

Go into /vsta/src/lib, do a "make libc_s.a", then "rm dir.o", edit makefile
to add -g to CFLAGS, then do "make libc_s.a" again. This'll give you a
static libc with -g information for the directory traversal routines.

Now go over to /vsta/src/bin/cmds, do "make ls.o" and then:

        rm -f ls
        gcc -o ls ls.o /vsta/src/lib/libc_s.a

This'll give you an "ls" which uses a static link of libc. More to the
point, it picked up those debug symbols. Now when you do "gdb ls", you can
do "b opendir" or "b readdir". Finally(!) you can do "r /" to run the ls,
and then you can go digging into what the directory traversal routines are
doing as they try to provide "ls" with the entries in the root of the
filesystem. Seems like something funny's going on, and I'm guessing you can
see what it is at the opendir/readdir level.

Andy
Received on Sat Feb 10 15:05:33 2001

This archive was generated by hypermail 2.1.8 : Thu Sep 22 2005 - 15:12:57 PDT