bug-gdb
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

$(PWD)/.gdbinit


From: trevor
Subject: $(PWD)/.gdbinit
Date: Sun, 8 Jul 2001 14:59:45 -0400

hi again,

as i was tromping around in the gdb code i found something else that
was sort of funny that i thought i'd bring to your attention.

there is a bit of logic that will allow a '.gdbinit' file in the
current directory to be executed, but only if it is different than
the one found in the user's $HOME. however the test condition for the
'if()' statement isn't quite strong enough because it will try to
execute the '.gdbinit' file in the current directory even if such a
file doesn't exist!

the fact that there is no such file passes the test that the
(non-existant) one in the current directory is different than the one
in the user's $HOME directory.

around line 647 of $(gdb-5.0)/gdb/main.c you'll find the call to
'catch_command_errors()' which is what starts processing the
'$(PWD)/.gdbinit' file. if you change the third parameter from '0' to
'!batch' and watch the output of gdb you'll see that it tries to
processes '.gdbinit' but can't find any such file.

it's really not such a big deal. i can add more checks and provide a
'diff' if anyone's interested (i haven't done anything about this one
yet).

interested?

best regards,
        trevor

ps. sorry about the mangling thing again, see my previous email

-- 
http://home.ica.net/~vjbtlw/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]