This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


> -----Original Message-----
> From: Pedro Alves [mailto:palves@redhat.com]
> Sent: Thursday, February 28, 2013 04:33 PM

Thanks for your feedback.

> 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.
Yes. Sorry for not being clear about the cause.

> I wondered if other similar places expand the tilde early
> or just before file open [...]
I found at least one another case:

% gdb -batch \~/gdb/tests/main  # or --exec=~/gdb/tests/main
~/gdb/tests/main: No such file or directory.

Whereas:
% gdb -batch --symbols=\~/gdb/tests/main
Succeeds.

Seems like gdb relies on the shell to expand its executable name.

As an alternative approach I can expand tilde in exec_file_attach
which is what symbol_file_add and core_file_command do.

 -Sanimir
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]