Hi Tom, Ulrich and community members,


>execing gdb seems problematic, for instance with a cross build gdb won't
>be the same host architecture as this test program.

>Is it not possible to start gdb, change its directory, and then remove
>the working directory from the .exp file?

The reason I could not do it in a simple .exp file is AIX is protecting the current working
directory when I try to delete.  It says the requested resource is busy.

So, I had to write a C code the fork () and child will delete the current working directory to mimic another terminal deleting the current working directory.

Then from the parent exec gdb with a binary having dwarf symbols to reproduce the crash.

For example:

bash-5.3# mkdir gdb_test
bash-5.3# cd gdb_test
bash-5.3# pwd
/tmp/gdb_test
bash-5.3# 
bash-5.3# rm -rf ../*
rm: cannot remove '../gdb_test': The requested resource is busy.

bash-5.3# 

This is the issue. We need to find a way to mimic someone deleting the cwd from another terminal in one test case. In the .exp file from what I know we cannot find a way to delete the current working directory and still start GDB from the deleted directory. Let me know if I am wrong here.

Thanks and regards,
Aditya.