This is the mail archive of the gdb-patches@sources.redhat.com 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] Don't clobber info->mach in gdb_print_insn_mips


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



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