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


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

Re: [patch] Instruction packing with debugging for d10v gas


Hi Matt,

: 2000-11-01  Matthew Hiller  <hiller@redhat.com>
: 
: 	* stabs.c (stabs_generate_asm_lineno): Sets
: 	d10v_generating_lineno_gstab at function start, unsets it at
: 	function end.
: 
: 	* config/tc-d10v.c (flag_no_gstabs_packing): New variable.
: 	(md_longopts): New option --gstabs-no-packing.
: 	(md_show_usage): New option --gstabs-no-packing.
: 	(md_parse_option): New option --gstabs-no-packing.
: 	(d10v_generating_lineno_gstab): New variable.
: 	(d10v_cleanup): Writes pending instruction only if
: 	!d10v_generating_lineno_gstab || flag_no_gstabs_packing.
: 
: 	* config/tc-d10.h (d10v_generating_lineno_gstab): New extern
: 	declaration.

This patch is mostly OK, apart from the changes to stabs.c.

The problem is that we really should try to avoid adding target
specific code to a generic file (such as stabs.c).  I know that there
is already some target specific code in there, but I would prefer to
avoid adding any more.

Thus rather than creating a TC_D10V specific variable and referencing
it from inside stabs_generate_asm_lineno, I believe that you should
either create a generic variable which can be accessed from the d10v
backend, or you should find a way to detect when you are inside
stabs_generate_asm_lineno without having to add any extra code to
stabs.c.

I believe that this detection should be possible.  d10v_cleanup is
being called from the macro tc_frob_label() defined in tc-d10v.h.
This macro is being called from the end of the function colon() in
symbols.c when the stabs symbol is defined.  If you changed the
tc_frob_label macro to pass on the symbol pointer to d10v_cleanup and
then you added code to d10v_cleanup to examine this pointer (if it is
not NULL), and detect when the label is a stabs label (because it
starts with FAKE_LABEL_PREFIX defined in write.h) then you can decide
to avoid flushing the instruction cache.  All of which takes place in
d10v specific files and does not require any modifications to the
generic gas code.

Please could you consider these suggestions and resubmit your patch
with whatever modifications you decide are appropriate.

Cheers
	Nick

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