This is the mail archive of the gdb@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]

Disassembler: Query about 'membership' field in the 'mips_opcode structure'


I am trying to disassemble some instructions (clo,...) under target
'mipsisa32-elf', which are not disassembling properly. In doing so, I
have gone through the source in 'mips.h', 'mips-dis.c' and 'mips-opc.c'
files.

Following are the some of my observations:

1) There is a list of architecture choices maintained in a structure
array ('mips-dis.c').

		const struct mips_arch_choice mips_arch_choices[]

initialized to 

......
  { "r4000",	1, bfd_mach_mips4000, CPU_R4000, ISA_MIPS3,
    mips_cp0_names_numeric, NULL, 0, mips_hwr_names_numeric }
.....

{ "mips32",	1, bfd_mach_mipsisa32, CPU_MIPS32,
    ISA_MIPS32 | INSN_MIPS16,
    mips_cp0_names_mips3264,
    mips_cp0sel_names_mips3264, ARRAY_SIZE (mips_cp0sel_names_mips3264),
    mips_hwr_names_numeric },


2) This array is used by a function 'choose_arch_by_number(mach)' in the
same file to make the choice, depending on the value of 'mach'

3) Latter I found that the 'mach' is getting its value from 

		"current_gdbarch->bfd_arch_info->mach"
The value is 4000. This value remains to be same irrespective of the
architectures.

4) Because of this value I able to disassemble only ISA_MIPS3 set
instruction.

5) How do I disassemble ISA_MIPS32 instructions?

6) How do I change my current architecture as "mips32"?

7) Instructions getting disassembled based on 'membership' parameter.
There are some macro like I1,I2,I3, I32,.... I have tried I32, but still
it is not working.

Do we need to do any configuration changes?

Thanks 
Monika.



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