Fri 19 Sep 2008 05:29:57 PM UTC, original submission:
gdb_question() fails if gdb_command() has been issued and DDD is awaiting reply.
In this case, can_do_gdb_command() is false, and gdb_question() returns immediately with NO_GDB_ANSWER.
This seems to be a subtle bug which for the most part goes unnoticed. One instance in which it is noticeable is this:
If you open an executable file with no symbols (e.g. file /bin/ls) as the first Open command, that file will not appear on the history list.
The explanation seems to be this: After the file has been loaded, the callback extra_completed() is run. Because the file has no symbols, find_some_source() is called. This issues "list main" and various other "list symbol" commands.
Subsequently (in the block starting "if (extra_data->refresh_recent_files)") a ProgramInfo object is created. The constructor for this class executes gdb_question("info files"), which returns NO_GDB_ANSWER because state is not ReadyWithPrompt. Therefore, add_to_recent() is not called.
It seems that gdb_command() is used to execute commands asynchronously, whereas gdb_question() operates synchronously. I believe that it is necessary to ensure all the asynchronous gdb_commands() are completed before proceeding with gdb_question().
|