[PATCH] add-inferior: expand tilde in -exec FILENAME argument

Pedro Alves palves@redhat.com
Thu Feb 28 15:54:00 GMT 2013


Thanks.

On 02/28/2013 02:48 PM, Sanimir Agovic wrote:
> I could not come up with a solid testcase, hints are welcome.

Not sure either.

I assume this fixes:

(gdb) add-inferior -exec ~/gdb/tests/main
Added inferior 2
~/gdb/tests/main: No such file or directory.

even though the file does exist.

I wondered if other similar places expand the tilde early
or just before file open, and confirmed that at least "file"
and "info files" have expanded the tilde before any visible
strings is shown:

(gdb) file ~/gdb/tests/main
Load new symbol table from "/home/pedro/gdb/tests/main"? (y or n)

(gdb) info files
Symbols from "/home/pedro/gdb/tests/main".
Local exec file:
        `/home/pedro/gdb/tests/main', file type elf64-x86-64.

> 2013-02-28  Sanimir Agovic  <sanimir.agovic@intel.com>
> 
> 	* inferior.c: Include "readline/readline.h".
> 	(add_inferior_command): Tilde expand filename.

OK.

Thanks again for the patch.

-- 
Pedro Alves



More information about the Gdb-patches mailing list