When connecting to a certain target, gdb issues a warning about the
target description:
(gdb) target remote localhost:7947
Remote debugging using localhost:7947
warning: Architecture rejected target-supplied description
If you then kill the inferior and change the exec-file, this will
happen:
(gdb) file bar
Architecture of file not recognized.
After this, debugging doesn't work very well.
What happens here is that, despite the warning,
target_find_description records the downloaded description in the
target_desc_info. Then the "file" command ends up calling
set_gdbarch_from_file, which uses that description.
It seems to me that, because the architecture rejected the
description, it should not be used. That is what this patch
implements.
info.target_desc = tdesc_info->tdesc;
if (!gdbarch_update_p (info))
- warning (_("Architecture rejected target-supplied description"));
+ {
+ warning (_("Architecture rejected target-supplied description"));
+ tdesc_info->tdesc = nullptr;
+ }
else
{
struct tdesc_arch_data *data;