This is the mail archive of the gdb-patches@sourceware.org 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]

[PATCH V2 4/5] Use FAST_TRACEPOINT_LABEL in range-stepping.exp


This patch uses FAST_TRACEPOINT_LABEL for the fast tracepoint label rather
than the local version of that same code.

gdb/testsuite/ChangeLog:

	* gdb.trace/range-stepping.c: Use FAST_TRACEPOINT_LABEL
---
 gdb/testsuite/gdb.trace/range-stepping.c | 22 ++--------------------
 1 file changed, 2 insertions(+), 20 deletions(-)

diff --git a/gdb/testsuite/gdb.trace/range-stepping.c b/gdb/testsuite/gdb.trace/range-stepping.c
index 46ddcf7..401cee7 100644
--- a/gdb/testsuite/gdb.trace/range-stepping.c
+++ b/gdb/testsuite/gdb.trace/range-stepping.c
@@ -15,22 +15,7 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#ifdef SYMBOL_PREFIX
-#define SYMBOL(str)     SYMBOL_PREFIX #str
-#else
-#define SYMBOL(str)     #str
-#endif
-
-/* `set_point' further below is the label where we'll set tracepoints
-   at.  The insn at the label must the large enough to fit a fast
-   tracepoint jump.  */
-#if (defined __x86_64__ || defined __i386__)
-#  define NOP "   .byte 0xe9,0x00,0x00,0x00,0x00\n" /* jmp $+5 (5-byte nop) */
-#elif (defined __aarch64__)
-#  define NOP "    nop\n"
-#else
-#  define NOP "" /* port me */
-#endif
+#include "trace-common.h"
 
 int
 main(void)
@@ -45,10 +30,7 @@ main(void)
 #define LINE_WITH_FAST_TRACEPOINT					\
   do {									\
     i = 1;								\
-    asm ("    .global " SYMBOL (set_point) "\n"			\
-	 SYMBOL (set_point) ":\n"					\
-	 NOP								\
-    );									\
+    FAST_TRACEPOINT_LABEL(set_point);					\
     i = 2;								\
  } while (0)
 
-- 
2.9.2


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