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: [RFA] MIPS DWARF2 CFI support


On Mon, Jun 07, 2004 at 08:49:08PM -0700, Martin M. Hunt wrote:

This is really kevinb's work, with some minor tweaks.  I've tested this
on over 50 multilib combinations and it looks goood.

2004-05-26 Kevin Buettner:

	* dwarf2-frame.c (execute_cfa_program): Fix typo in which the
	alignment was being added to the offset instead of multiplied.

	* dwarf2-frame.c (struct comp_unit): Add new field ``signed_addr_p''.
	(encoding_for_size): Add new parameter ``signed_addr_p''.  Adjust
	all callers.  Add code for handling signed encodings.
	(dwarf2_build_frame_info): Initialize ``unit.signed_addr_p''.

* dwarf2-frame.c (dwarf2_build_frame_info): Set unit.addr_size.

	* config/mips/tm-mips.h (SP_REGNUM): Delete define.
	* mips-tdep.h (MIPS_SP_REGNUM): Define.
	* mips-tdep.c (mips_gdbarch_init): Set SP_REGNUM via call
	to set_gdbarch_sp_regnum().  Use cooked register number.
	(SP_REGNUM): Replace all occurrences with MIPS_SP_REGNUM.

	* mips-tdep.c (mips_gdbarch_init): Set PC_REGNUM (via
	call to set_gdbarch_pc_regnum()) to cooked register number.

	* mips-tdep.c (dwarf2-frame.h): Include.
	(mips_gdbarch_init): Enable DWARF2 CFI support.


I've got three objections:
  - This is a whole lot of changes.  Please submit them independently,
    with some sort of attempt at explanation.

(Yes please, the SP_REGNUM looked to be an easy one to split out and the bulk of the change).


-  unit.addr_size = objfile->obfd->arch_info->bits_per_address / 8;
+  unit.addr_size = TYPE_LENGTH (builtin_type_void_data_ptr);
+  unit.signed_addr_p = bfd_get_sign_extend_vma (unit.abfd);


  - This is wrong; please don't introduce dependencies on GDB's type
    system in dwarf2-frame.c.  I imagine what's there isn't right
    either because arch_info is completely unreliable on MIPS.  There
    is already a dwarf64_p where this is used; is that right?

    Actually, this sounds like a problem in the dwarf3 draft that
    someone (maybe Jim?) brought up on the dwarf2 list a few weeks ago.
    Jim, do you remember?

And somewhat theoretical:
  - I'd really rather not enable dwarf2 unwinding for MIPS until
    someone makes a go at fixing the MIPS prologue unwinder.  Either
    that or rip it out; because after this patch it will get almost
    zero coverage in the testsuite.  This is an ongoing problem.
    I know that the existing prologue unwinder is broken at the
    beginning of functions and in a number of other situations.

I don't think delaying CFI until the prologue unwinder is working is reasonable. However, what would help is the addition of a new more specialized stub-unwinder (see hppa and s390) (perhaphs later we can return to cleaning up the existing prologue unwinder). Patches for the former (the stub unwinder) more than welcome.


Andrew



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