This is the mail archive of the cgen@sources.redhat.com mailing list for the CGEN project.


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

[RFA] Provide cgen_disn and cgen_fields in disassemble_info


Nick Duffek writes:
 > I posted this patch to binutils some days ago, but I've since been
 > informed that this is the preferred forum for posting cgen-related opcodes
 > patches.

I dunno if I buy that.  [I don't really care, I'm just worried that next time
I'll say ok to another dis-asm.h patch and binutils or gdb will complain. :-)]

This patch is fine with me (I think it's great to start using cgen
elsewhere - wanna pick up my assembler-for-gdb patch and try to get it in?)

 > I've found this useful for parsing prologue and other instructions in GDB.
 > I find it easier and more maintainable than the usual approach of
 > peppering GDB skip_prologue() functions with hard-coded bit offsets and
 > lengths.

Yep.

At one point I had wondered about machine generating a header that would
contain everything you'd need to use in this kind of context, but never
pursued it further.  I think such a header would be generally useful.

 > Index: include/dis-asm.h
 > ===================================================================
 > diff -up include/dis-asm.h include/dis-asm.h
 > --- include/dis-asm.h	Mon Jul 16 14:24:47 2001
 > +++ include/dis-asm.h	Mon Jul 16 14:24:39 2001
 > @@ -47,6 +47,11 @@ enum dis_insn_type {
 >    dis_dref2			/* Two data references in instruction */
 >  };
 >  
 > +/* Forward declarations.  */
 > +
 > +struct cgen_insn;
 > +struct cgen_fields;
 > +

Nit: technically speaking, I don't think these forward decls are necessary.
But leave them in if you like.


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