diff options
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/testsuite/gdb.trace/tfile.c | 11 |
2 files changed, 15 insertions, 2 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 19e6232..2278496 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2014-07-10 Yao Qi <yao@codesourcery.com> + + * gdb.trace/tfile.c (write_basic_trace_file) + [__thumb__||__thumb2__]: Clear the Thumb bit of the function + address written to trace file. + 2014-07-09 Pedro Alves <palves@redhat.com> * gdb.base/attach-wait-input.exp: New file. diff --git a/gdb/testsuite/gdb.trace/tfile.c b/gdb/testsuite/gdb.trace/tfile.c index ac65901..bc25b80 100644 --- a/gdb/testsuite/gdb.trace/tfile.c +++ b/gdb/testsuite/gdb.trace/tfile.c @@ -91,6 +91,7 @@ write_basic_trace_file (void) { int fd, int_x; short short_x; + long func_addr; fd = start_trace_file (TFILE_DIR "tfile-basic.tf"); @@ -109,8 +110,14 @@ write_basic_trace_file (void) /* Dump tracepoint definitions, in syntax similar to that used for reconnection uploads. */ /* FIXME need a portable way to print function address in hex */ - snprintf (spbuf, sizeof spbuf, "tp T1:%lx:E:0:0\n", - (long) &write_basic_trace_file); + func_addr = (long) &write_basic_trace_file; +#if defined(__thumb__) || defined(__thumb2__) + /* Although Thumb functions are two-byte aligned, function + pointers have the Thumb bit set. Clear it. */ + func_addr &= ~1; +#endif + + snprintf (spbuf, sizeof spbuf, "tp T1:%lx:E:0:0\n", func_addr); write (fd, spbuf, strlen (spbuf)); /* (Note that we would only need actions defined if we wanted to test tdump.) */ |