[PATCH] Don't clobber info->mach in gdb_print_insn_mips

Andrew Cagney ac131313@redhat.com
Mon Jun 23 21:40:00 GMT 2003


> info->mach field being clobbered by gdb_print_insn_mips.  The attached
>> > patch fixes it, though I'm not sure if this is the correct solution.
> 
>> 
>> What happens if info->mach is never set?  gdb_disassemble_info should 
>> have already set it correctly.
> 
> 
> Yes, gdb_disassemble_info sets it correctly, and then gdb_print_insn_mips
> clobbers it back to zero.  Here is a typescript showing the order that
> various functions are called.
> 
> Without my patch, gdb_disassemble_info sets it to a correct value,
> gdb_print_insn_mips clobbers it back to zero, and then eventually
> choose_arch_by_number gets called with mach==0 (my typescript shows
> 10611501, the expected value for my port, since I have my patch
> installed).  Since choose_arch_by_number then returns zero,
> the code in set_default_mips_dis_options that sets mips_isa
> never gets executed:

So you're ok if I delete that bit of gdb_print_insn_mips?

Andrew




More information about the Gdb-patches mailing list