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]
Other format: [Raw text]

RFA: Support ARM BKPT instruction without an argument.


Hi Guys,

  Any objections to the following patch ?

  It adds a convenience feature to the ARM port of GAS.  It allows
  the breakpoint instruction - BKPT - to be specified without an
  argument.  (If no argument is given, a value of zero is assumed).
  This was requested by Intel, and it is easy enough to do.

Cheers
        Nick

gas/ChangeLog
2002-11-28  Nick Clifton  <nickc@redhat.com>

	* config/tc-arm.c (do_t_bkpt): If no operand is specified,
	assume a value of zero.
	(do_bkpt): Likewise.

gas/testsuite/ChangeLog
2002-11-28  Nick Clifton  <nickc@redhat.com>

	* gas/arm/arch5tej.s: Replace "nop"s with tests of breakpoint
	instruction.
        * gas/arm/arch5tej.d: Expect "bkpt"s not nops.

Index: gas/config/tc-arm.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-arm.c,v
retrieving revision 1.130
diff -c -3 -p -w -r1.130 tc-arm.c
*** gas/config/tc-arm.c	23 Oct 2002 10:34:18 -0000	1.130
--- gas/config/tc-arm.c	28 Nov 2002 09:28:43 -0000
*************** do_t_bkpt (str)
*** 3931,3936 ****
--- 3931,3940 ----
    memset (& expr, '\0', sizeof (expr));
    if (my_get_expression (& expr, & str) || (expr.X_op != O_constant))
      {
+       if (expr.X_op == O_absent)
+ 	/* As a convenience we allow 'bkpt' without an operand.  */
+ 	end_of_line (str);
+       else
  	inst.error = _("bad or missing expression");
        return;
      }
*************** do_bkpt (str)
*** 4113,4118 ****
--- 4117,4126 ----
  
    if (my_get_expression (& expr, & str) || (expr.X_op != O_constant))
      {
+       if (expr.X_op == O_absent)
+ 	/* As a convenience we allow 'bkpt' without an operand.  */
+ 	end_of_line (str);
+       else
  	inst.error = _("bad or missing expression");
        return;
      }

Index: gas/testsuite/gas/arm/arch5tej.s
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/arm/arch5tej.s,v
retrieving revision 1.2
diff -c -3 -p -w -r1.2 arch5tej.s
*** gas/testsuite/gas/arm/arch5tej.s	22 Aug 2002 16:10:04 -0000	1.2
--- gas/testsuite/gas/arm/arch5tej.s	28 Nov 2002 09:28:43 -0000
*************** label:	
*** 8,14 ****
  	bxjmi	r0
  	bxjpl	r7
  	
! 	# Add two nop instructions to ensure that the output
! 	# is aligned as will automatically be done for arm-aout.
! 	nop
! 	nop
--- 8,12 ----
  	bxjmi	r0
  	bxjpl	r7
  
! 	bkpt		@ Support for a breakpoint without an argument
! 	bkpt	10	@ is a feature added to GAS.

Index: gas/testsuite/gas/arm/arch5tej.d
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/arm/arch5tej.d,v
retrieving revision 1.2
diff -c -3 -p -w -r1.2 arch5tej.d
*** gas/testsuite/gas/arm/arch5tej.d	22 Aug 2002 16:10:04 -0000	1.2
--- gas/testsuite/gas/arm/arch5tej.d	28 Nov 2002 09:28:43 -0000
*************** Disassembly of section .text:
*** 13,17 ****
  0+0c <[^>]*> 012fff20 ?	bxjeq	r0
  0+10 <[^>]*> 412fff20 ?	bxjmi	r0
  0+14 <[^>]*> 512fff27 ?	bxjpl	r7
! 0+18 <[^>]*> e1a00000 ?	nop[ 	]+\(mov r0,r0\)
! 0+1c <[^>]*> e1a00000 ?	nop[ 	]+\(mov r0,r0\)
--- 13,17 ----
  0+0c <[^>]*> 012fff20 ?	bxjeq	r0
  0+10 <[^>]*> 412fff20 ?	bxjmi	r0
  0+14 <[^>]*> 512fff27 ?	bxjpl	r7
! 0+18 <[^>]*> e1200070 ?	bkpt	0x0000
! 0+1c <[^>]*> e120007a ?	bkpt	0x000a


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