reinstate DBX_REGISTER_NUMBER for x86-vxworks

Olivier Hainque hainque@adacore.com
Fri Sep 24 20:38:00 GMT 2010


Hello,

The definition of DBX_REGISTER_NUMBER for ix86-vxworks used to be
in i386/sysv4.h. A configuration reorg from

  http://gcc.gnu.org/ml/gcc-patches/2007-04/msg00578.html

changed that, with:

	(i[4567]86-wrs-vxworks, i[4567]86-wrs-vxworksae): Add svr4.h
	after elfos.h.  Remove i386/sysv4.h and add i386/vx-common.h.

We still have this today, and the correct definition of
DBX_REGISTER_NUMBER disappeared along the way.

This is visible e.g. as

        .cfi_def_cfa_register 6

directives on about every compilation, where we'd expect 5 instead of 6
and have gdb very unhappy.

This patch reinstates the original definition, as advertised by the
common svr4h:

<< /* The numbers used to denote specific machine registers in the System V
      Release 4 DWARF debugging information are quite likely to be totally
      different from the numbers used in BSD stabs debugging information
      for the same kind of target machine.  Thus, we undefine the macro
      DBX_REGISTER_NUMBER here as an extra inducement to get people to
      provide proper machine-specific definitions of DBX_REGISTER_NUMBER
      (which is also used to provide DWARF registers numbers in dwarfout.c)
      in their tm.h files which include this file.  */

   #undef DBX_REGISTER_NUMBER
>>

Tested by rebuilding and checking that the emitted cfa register is as
expected after the change.

OK ?

Thanks in advance,

Olivier

2010-09-24  Olivier Hainque  <hainque@adacore.com>

	* config/i386/vx-common.h (DBX_REGISTER_NUMBER): Reinstate.



-------------- next part --------------
*** /tmp/mNJCWT_vx-common.h	Fri Sep 24 17:47:51 2010
--- gcc/config/i386/vx-common.h	Fri Sep 24 17:47:36 2010
*************** along with GCC; see the file COPYING3.
*** 24,26 ****
--- 24,32 ----
  
  #define SUBTARGET_RETURN_IN_MEMORY(TYPE, FNTYPE) \
  	ix86_solaris_return_in_memory (TYPE, FNTYPE)
+ 
+ /* Provide our target specific DBX_REGISTER_NUMBER, as advertised by the
+    common svr4.h.  VxWorks relies on the SVR4 numbering.  */
+ 
+ #undef DBX_REGISTER_NUMBER
+ #define DBX_REGISTER_NUMBER(n)  svr4_dbx_register_map[n]


More information about the Gcc-patches mailing list