[v2,5/7] btrace, gdbserver: remove the to_supports_btrace target method

Message ID 1516976072-19282-6-git-send-email-markus.t.metzger@intel.com
State New
Headers show
Series
  • improve btrace enable error reporting
Related show

Commit Message

Metzger, Markus T Jan. 26, 2018, 2:14 p.m.
Remove the to_supports_btrace target method and instead rely on detecting errors
when trying to enable recording.  This will also provide a suitable error
message explaining why recording is not possible.

2018-01-26  Markus Metzger  <markus.t.metzger@intel.com>

gdb/
	* btrace.c (btrace_enable): Remove target_supports_btrace call.
	* nat/linux-btrace.c (perf_event_pt_event_type): Move.
	(kernel_supports_bts, kernel_supports_pt, linux_supports_bts)
	(linux_supports_pt, linux_supports_btrace): Remove.
	(linux_enable_bts): Call cpu_supports_bts.
	* nat/linux-btrace.h (linux_supports_btrace): Remove.
	* remote.c (remote_supports_btrace): Remove.
	(init_remote_ops): Remove remote_supports_btrace.
	* target-delegates.c: Regenerated.
	* target.c (target_supports_btrace): Remove.
	* target.h (target_ops) <to_supports_btrace>: Remove
	(target_supports_btrace): Remove.
	* x86-linux-nat.c (x86_linux_create_target): Remove
	linux_supports_btrace.

gdbserver/
	* linux-low.c (linux_target_ops): Remove linux_supports_btrace.
	* nto-low.c (nto_target_ops): Remove NULL for supports_btrace.
	* spu-low.c (spu_target_ops): Likewise.
	* win32-low.c (win32_target_ops): Likewise.
	* server.c (supported_btrace_packets): Report packets unconditionally.
	* target.h (target_ops) <supports_btrace>: Remove.
	(target_supports_btrace): Remove.
---
 gdb/btrace.c              |   3 -
 gdb/gdbserver/linux-low.c |   2 -
 gdb/gdbserver/nto-low.c   |   1 -
 gdb/gdbserver/server.c    |  25 +----
 gdb/gdbserver/spu-low.c   |   1 -
 gdb/gdbserver/target.h    |   7 --
 gdb/gdbserver/win32-low.c |   1 -
 gdb/nat/linux-btrace.c    | 273 ++++------------------------------------------
 gdb/nat/linux-btrace.h    |   3 -
 gdb/remote.c              |  32 ------
 gdb/target-delegates.c    |  33 ------
 gdb/target.c              |   8 --
 gdb/target.h              |   7 --
 gdb/x86-linux-nat.c       |   1 -
 14 files changed, 24 insertions(+), 373 deletions(-)

-- 
1.8.3.1

Comments

Maciej W. Rozycki Feb. 24, 2018, 4:31 p.m. | #1
On Fri, 26 Jan 2018, Markus Metzger wrote:

> Remove the to_supports_btrace target method and instead rely on detecting errors

> when trying to enable recording.  This will also provide a suitable error

> message explaining why recording is not possible.


 Hmm, v3 of this change (apparently never posted), that is specifically 
commit de6242d30757 ("btrace, gdbserver: remove the to_supports_btrace 
target method"), has broken remote `mips-linux' target debugging 
completely, that is an attempt to make a remote connection fails in the 
initial handshake, e.g.:

Process .../gdb/testsuite/outputs/gdb.base/advance/advance created; pid = 25519
Listening on port 2346
target remote 1.2.3.4:2346
Remote debugging using 1.2.3.4:2346
Reading symbols from .../lib/ld.so.1...done.
0x77fc8de0 in __start () from .../lib/ld.so.1
Protocol error: qXfer:btrace-conf (read-btrace-conf) conflicting enabled responses.
(gdb) continue
The program is not being run.
(gdb) FAIL: gdb.base/advance.exp: can't run to main

See the attached RSP packet exchange log for details.  Please investigate.

  Maciej
Remote debugging using 1.2.3.4:2346
Sending packet: $qSupported:multiprocess+;swbreak+;hwbreak+;qRelocInsn+;fork-events+;vfork-events+;exec-events+;vContSupported+;QThreadEvents+;no-resumed+;xmlRegisters=i386#6a...Ack
Packet received: PacketSize=3fff;QPassSignals+;QProgramSignals+;QStartupWithShell+;QEnvironmentHexEncoded+;QEnvironmentReset+;QEnvironmentUnset+;QSetWorkingDir+;qXfer:libraries-svr4:read+;augmented-libraries-svr4-read+;qXfer:auxv:read+;qXfer:spu:read+;qXfer:spu:write+;qXfer:siginfo:read+;qXfer:siginfo:write+;qXfer:features:read+;QStartNoAckMode+;qXfer:osdata:read+;multiprocess+;fork-events+;vfork-events+;exec-events+;QNonStop+;QDisableRandomization+;qXfer:threads:read+;BreakpointCommands+;QAgent+;Qbtrace:bts+;Qbtrace-conf:b
Packet qSupported (supported-packets) is supported
Sending packet: $vMustReplyEmpty#3a...Ack
Packet received: 
Sending packet: $QStartNoAckMode#b0...Ack
Packet received: OK
Sending packet: $QProgramSignals:0;1;3;4;6;7;8;9;a;b;c;d;e;f;10;11;12;13;14;15;16;17;18;19;1a;1b;1c;1d;1e;1f;20;21;22;23;24;25;26;27;28;29;2a;2b;2c;2d;2e;2f;30;31;32;33;34;35;36;37;38;39;3a;3b;3c;3d;3e;3f;40;41;42;43;44;45;46;47;48;49;4a;4b;4c;4d;4e;4f;50;51;52;53;54;55;56;57;58;59;5a;5b;5c;5d;5e;5f;60;61;62;63;64;65;66;67;68;69;6a;6b;6c;6d;6e;6f;70;71;72;73;74;75;76;77;78;79;7a;7b;7c;7d;7e;7f;80;81;82;83;84;85;86;87;88;89;8a;8b;8c;8d;8e;8f;90;91;92;93;94;95;96;97;#75...Packet received: OK
Sending packet: $Hgp0.0#ad...Packet received: OK
Sending packet: $qXfer:features:read:target.xml:0,fff#7d...Packet received: l<?xml version="1.0"?>\n<!-- Copyright (C) 2012-2018 Free Software Foundation, Inc.\n\n     Copying and distribution of this file, with or without modification,\n     are permitted in any medium without royalty provided the copyright\n     notice and this notice are preserved.  -->\n\n<!DOCTYPE target SYSTEM "gdb-target.dtd">\n<target>\n  <architecture>mips</architecture>\n  <osabi>GNU/Linux</osabi>\n  <xi:include href="mips-cpu.xml"/>\n  <xi:include href="mips-cp0.xml"/>\n  <xi:include href="mips-fpu.xml"/>\n  <xi:inclu[14 bytes omitted]
Sending packet: $qXfer:features:read:mips-cpu.xml:0,fff#24...Packet received: l<?xml version="1.0"?>\n<!-- Copyright (C) 2007-2018 Free Software Foundation, Inc.\n\n     Copying and distribution of this file, with or without modification,\n     are permitted in any medium without royalty provided the copyright\n     notice and this notice are preserved.  -->\n\n<!DOCTYPE feature SYSTEM "gdb-target.dtd">\n<feature name="org.gnu.gdb.mips.cpu">\n  <reg name="r0" bitsize="32" regnum="0"/>\n  <reg name="r1" bitsize="32"/>\n  <reg name="r2" bitsize="32"/>\n  <reg name="r3" bitsize="32"/>\n  <reg name="[13 bytes omitted]
Sending packet: $qXfer:features:read:mips-cp0.xml:0,fff#df...Packet received: l<?xml version="1.0"?>\n<!-- Copyright (C) 2007-2018 Free Software Foundation, Inc.\n\n     Copying and distribution of this file, with or without modification,\n     are permitted in any medium without royalty provided the copyright\n     notice and this notice are preserved.  -->\n\n<!DOCTYPE feature SYSTEM "gdb-target.dtd">\n<feature name="org.gnu.gdb.mips.cp0">\n  <reg name="status" bitsize="32" regnum="32"/>\n  <reg name="badvaddr" bitsize="32" regnum="35"/>\n  <reg name="cause" bitsize="32" regnum="36"/>\n</featu[12 bytes omitted]
Sending packet: $qXfer:features:read:mips-fpu.xml:0,fff#27...Packet received: l<?xml version="1.0"?>\n<!-- Copyright (C) 2007-2018 Free Software Foundation, Inc.\n\n     Copying and distribution of this file, with or without modification,\n     are permitted in any medium without royalty provided the copyright\n     notice and this notice are preserved.  -->\n\n<!DOCTYPE feature SYSTEM "gdb-target.dtd">\n<feature name="org.gnu.gdb.mips.fpu">\n  <reg name="f0" bitsize="32" type="ieee_single" regnum="38"/>\n  <reg name="f1" bitsize="32" type="ieee_single"/>\n  <reg name="f2" bitsize="32" type="ie[11 bytes omitted]
Sending packet: $qXfer:features:read:mips-dsp.xml:0,fff#23...Packet received: l<?xml version="1.0"?>\n<!-- Copyright (C) 2012-2018 Free Software Foundation, Inc.\n\n     Copying and distribution of this file, with or without modification,\n     are permitted in any medium without royalty provided the copyright\n     notice and this notice are preserved.  -->\n\n<!DOCTYPE feature SYSTEM "gdb-target.dtd">\n<feature name="org.gnu.gdb.mips.dsp">\n  <reg name="hi1" bitsize="32" regnum="72"/>\n  <reg name="lo1" bitsize="32" regnum="73"/>\n  <reg name="hi2" bitsize="32" regnum="74"/>\n  <reg name="lo2"[12 bytes omitted]
Sending packet: $QNonStop:0#8c...Packet received: OK
Sending packet: $qTStatus#49...Packet received: 
Packet qTStatus (trace-status) is NOT supported
Sending packet: $?#3f...Packet received: T051d:d0baff7f;25:e08dfc77;thread:p6a61.6a61;core:0;
Sending packet: $qXfer:threads:read::0,fff#03...Packet received: l<threads>\n<thread id="p6a61.6a61" core="0" name="advance"/>\n</threads>\n
Sending packet: $qAttached:6a61#c7...Packet received: 0
Packet qAttached (query-attached) is supported
Sending packet: $Hc-1#09...Packet received: E01
Sending packet: $qOffsets#4b...Packet received: 
Sending packet: $qXfer:libraries-svr4:read::0,fff#91...Packet received: l<library-list-svr4 version="1.0"/>
Sending packet: $qXfer:auxv:read::0,1000#6b...Packet received: l!\000\000\000\000@ÿw\020\000\000\000\000\000\000\000\006\000\000\000\000@\000\000\021\000\000\000d\000\000\000\003\000\000\0004\000@\000\004\000\000\000 \000\000\000\005\000\000\000\t\000\000\000\a\000\000\000\000\200üw\b\000\000\000\000\000\000\000\t\000\000\000À\005@\000\013\000\000\000cy\000\000\f\000\000\000cy\000\000\r\000\000\000\204\003\000\000\016\000\000\000\204\003\000\000\027\000\000\000\000\000\000\000\031\000\000\000Ó»ÿ\177\037\000\000\000\221¿ÿ\177\017\000\000\000ã»ÿ\177\000\000\000\000\000\000\000\000[10 bytes omitted]
Sending packet: $vFile:setfs:0#bf...Packet received: F0
Packet vFile:setfs (hostio-setfs) is supported
Sending packet: $vFile:open:2f70726f632f32373233332f7461736b2f32373233332f6d617073,0,1c0#db...Packet received: F3
Packet vFile:open (hostio-open) is supported
readahead cache miss 251
Sending packet: $vFile:pread:3,3fff,0#96...Packet received: F33c;00400000-00404000 r-xp 00000000 00:1d 357628039  .../gdb/testsuite/outputs/gdb.base/advance/advance\n00410000-00414000 rwxp 00000000 00:1d 357628039  .../gdb/testsuite/outputs/gdb.base/advance/advance\n77fc8000-77fec000 r-xp 00000000 00:1d 3529929641  .../lib/ld-2.27.9000.so\n77ff0000-77ff4000 r--p 00000000 00:00 0   [3 bytes omitted]
Packet vFile:pread (hostio-pread) is supported
readahead cache miss 252
Sending packet: $vFile:pread:3,3fff,33c#2f...Packet received: F0;
Sending packet: $vFile:close:3#b3...Packet received: F0
Packet vFile:close (hostio-close) is supported
Sending packet: $qXfer:libraries-svr4:read::0,fff#91...Packet received: l<library-list-svr4 version="1.0"/>
Reading symbols from .../lib/ld.so.1...done.
Sending packet: $qSymbol::#5b...Packet received: qSymbol:6e70746c5f76657273696f6e
Packet qSymbol (symbol-lookup) is supported
Sending packet: $qSymbol::6e70746c5f76657273696f6e#4d...Packet received: OK
Sending packet: $m77fd9d40,4#06...Packet received: 0800e003
Sending packet: $m77ff4000,34#fe...Packet received: 7f454c4601010100000000000000000003000800010000009002000034000000c40b00000510007034002000070028000f000e00
Sending packet: $m77ff4034,e0#33...Packet received: 0300007018010000180100001801000018000000180000000400000008000000000000703001000030010000300100001800000018000000040000000400000001000000000000000000000000000000980a0000980a0000050000000000010002000000d0090000d0090000d0090000c0000000c00000000400000004000000040000004802000048020000480200003c0000003c000000040000000400000050e57464000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000004000000
Sending packet: $m77ff4000,1fff#fa...Packet received: 7f454c4601010100000000000000000003000800010000009002000034000000c40b00000510007034002000070028000f000e000300007018010000180100001801000018000000180000000400000008000000000000703001000030010000300100001800000018000000040000000400000001000000000000000000000000000000980a0000980a0000050000000000010002000000d0090000d0090000d0090000c0000000c00000000400000004000000040000004802000048020000480200003c0000003c000000040000000400000050e5746400000000000000000000000000000000000000000000000004000000000000000000000000000000
Sending packet: $m77ff5fff,1fff#9d...Packet received: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Sending packet: $m77ff7ffe,2#6d...Packet received: 0000
Sending packet: $qSymbol::#5b...Packet received: qSymbol:6e70746c5f76657273696f6e
Sending packet: $qSymbol::6e70746c5f76657273696f6e#4d...Packet received: OK
Sending packet: $qXfer:threads:read::0,fff#03...Packet received: l<threads>\n<thread id="p6a61.6a61" core="0" name="advance"/>\n</threads>\n
Sending packet: $m77fc8de0,4#35...Packet received: 25c8e003
Sending packet: $m77fc8ddc,4#67...Packet received: 00000000
Sending packet: $m77fc8de0,4#35...Packet received: 25c8e003
Sending packet: $m77fc8ddc,4#67...Packet received: 00000000
Sending packet: $m77fc8de0,4#35...Packet received: 25c8e003
0x77fc8de0 in __start ()
   from .../lib/ld.so.1
Sending packet: $qSymbol::#5b...Packet received: qSymbol:6e70746c5f76657273696f6e
Sending packet: $qSymbol::6e70746c5f76657273696f6e#4d...Packet received: OK
Sending packet: $qXfer:btrace-conf:read::0,fff#5c...Packet received: 
Protocol error: qXfer:btrace-conf (read-btrace-conf) conflicting enabled responses.
Metzger, Markus T Feb. 26, 2018, 1:08 p.m. | #2
Hello Maciej,

> Process .../gdb/testsuite/outputs/gdb.base/advance/advance created; pid =

> 25519 Listening on port 2346 target remote 1.2.3.4:2346 Remote debugging using

> 1.2.3.4:2346 Reading symbols from .../lib/ld.so.1...done.

> 0x77fc8de0 in __start () from .../lib/ld.so.1 Protocol error: qXfer:btrace-conf

> (read-btrace-conf) conflicting enabled responses.

> (gdb) continue

> The program is not being run.

> (gdb) FAIL: gdb.base/advance.exp: can't run to main

> 

> See the attached RSP packet exchange log for details.  Please investigate.


Below is a patch to address this.  I tested it on IA by undefining HAVE_LINUX_BTRACE.
Does it fix the issue you reported?

thanks,
Markus.

---

commit c4d017399e2cc62cfed793bb93967bd6b3d573bb
Author: Markus Metzger <markus.t.metzger@intel.com>
Date:   Mon Feb 26 11:59:43 2018 +0100

    btrace, gdbserver: check btrace target pointers
    
    By removing the supports_btrace gdbserver target method we relied on GDB trying
    to enable branch tracing and failing on the attempt.
    
    For targets that do not provide the btrace methods, however, an initial request
    from GDB for the branch trace configuration to detect whether gdbserver is
    already recording resulted in a protocol error.
    
    Have the btrace target methods throw a "Target does not suppor branch tracing"
    error and be prepared to handle exceptions in all functions that call btrace
    target methods.  We therefore turn the target_* macros into static inline
    functions.
    
    Also remove the additional btrace target method checks that resulted in the
    above protocol error.
    
    Thanks to Maciej W. Rozycki <macro@mips.com> for reporting this.
    
    Signed-off-by: Markus Metzger  <markus.t.metzger@intel.com>

    
    gdbserver/
    	* target.h (target_enable_btrace, target_disable_btrace,
    	target_read_btrace, target_read_btrace_conf): Turn macro into inline
    	function.  Throw error if target method not defined.
    	* server.c (handle_qxfer_btrace, handle_qxfer_btrace_conf): Remove
    	check for btrace target method.  Be prepared to handle exceptions
    	from btrace target methods.

diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index cb02b58..4fd274f 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -1818,7 +1818,7 @@ handle_qxfer_btrace (const char *annex,
   enum btrace_read_type type;
   int result;
 
-  if (the_target->read_btrace == NULL || writebuf != NULL)
+  if (writebuf != NULL)
     return -2;
 
   if (ptid_equal (general_thread, null_ptid)
@@ -1857,12 +1857,21 @@ handle_qxfer_btrace (const char *annex,
     {
       buffer_free (&cache);
 
-      result = target_read_btrace (thread->btrace, &cache, type);
-      if (result != 0)
+      TRY
 	{
-	  memcpy (own_buf, cache.buffer, cache.used_size);
-	  return -3;
+	  result = target_read_btrace (thread->btrace, &cache, type);
+	  if (result != 0)
+	    memcpy (own_buf, cache.buffer, cache.used_size);
 	}
+      CATCH (exception, RETURN_MASK_ERROR)
+	{
+	  sprintf (own_buf, "E.%s", exception.message);
+	  result = -1;
+	}
+      END_CATCH
+
+      if (result != 0)
+	return -3;
     }
   else if (offset > cache.used_size)
     {
@@ -1889,7 +1898,7 @@ handle_qxfer_btrace_conf (const char *annex,
   struct thread_info *thread;
   int result;
 
-  if (the_target->read_btrace_conf == NULL || writebuf != NULL)
+  if (writebuf != NULL)
     return -2;
 
   if (annex[0] != '\0')
@@ -1919,12 +1928,21 @@ handle_qxfer_btrace_conf (const char *annex,
     {
       buffer_free (&cache);
 
-      result = target_read_btrace_conf (thread->btrace, &cache);
-      if (result != 0)
+      TRY
 	{
-	  memcpy (own_buf, cache.buffer, cache.used_size);
-	  return -3;
+	  result = target_read_btrace_conf (thread->btrace, &cache);
+	  if (result != 0)
+	    memcpy (own_buf, cache.buffer, cache.used_size);
 	}
+      CATCH (exception, RETURN_MASK_ERROR)
+	{
+	  sprintf (own_buf, "E.%s", exception.message);
+	  result = -1;
+	}
+      END_CATCH
+
+      if (result != 0)
+	return -3;
     }
   else if (offset > cache.used_size)
     {
diff --git a/gdb/gdbserver/target.h b/gdb/gdbserver/target.h
index dcefe1a..923a63b 100644
--- a/gdb/gdbserver/target.h
+++ b/gdb/gdbserver/target.h
@@ -620,17 +620,42 @@ int kill_inferior (int);
   (the_target->supports_agent ? \
    (*the_target->supports_agent) () : 0)
 
-#define target_enable_btrace(ptid, conf) \
-  (*the_target->enable_btrace) (ptid, conf)
+static inline struct btrace_target_info *
+target_enable_btrace(ptid_t ptid, const struct btrace_config *conf)
+{
+  if (the_target->enable_btrace == nullptr)
+    error ("Target does not support branch tracing.");
+
+  return (*the_target->enable_btrace) (ptid, conf);
+}
+
+static inline int
+target_disable_btrace(struct btrace_target_info *tinfo)
+{
+  if (the_target->disable_btrace == nullptr)
+    error ("Target does not support branch tracing.");
 
-#define target_disable_btrace(tinfo) \
-  (*the_target->disable_btrace) (tinfo)
+  return (*the_target->disable_btrace) (tinfo);
+}
 
-#define target_read_btrace(tinfo, buffer, type)	\
-  (*the_target->read_btrace) (tinfo, buffer, type)
+static inline int
+target_read_btrace(struct btrace_target_info *tinfo, struct buffer *buffer,
+		   enum btrace_read_type type)
+{
+  if (the_target->read_btrace == nullptr)
+    error ("Target does not support branch tracing.");
+
+  return (*the_target->read_btrace) (tinfo, buffer, type);
+}
+
+static inline int
+target_read_btrace_conf(struct btrace_target_info *tinfo, struct buffer *buffer)
+{
+  if (the_target->read_btrace_conf == nullptr)
+    error ("Target does not support branch tracing.");
 
-#define target_read_btrace_conf(tinfo, buffer)	\
-  (*the_target->read_btrace_conf) (tinfo, buffer)
+  return (*the_target->read_btrace_conf) (tinfo, buffer);
+}
 
 #define target_supports_range_stepping() \
   (the_target->supports_range_stepping ? \

Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
Andreas Arnez Feb. 26, 2018, 7:30 p.m. | #3
On Mon, Feb 26 2018, Metzger, Markus T wrote:

> Hello Maciej,

>

>> Process .../gdb/testsuite/outputs/gdb.base/advance/advance created; pid =

>> 25519 Listening on port 2346 target remote 1.2.3.4:2346 Remote debugging using

>> 1.2.3.4:2346 Reading symbols from .../lib/ld.so.1...done.

>> 0x77fc8de0 in __start () from .../lib/ld.so.1 Protocol error: qXfer:btrace-conf

>> (read-btrace-conf) conflicting enabled responses.

>> (gdb) continue

>> The program is not being run.

>> (gdb) FAIL: gdb.base/advance.exp: can't run to main

>> 

>> See the attached RSP packet exchange log for details.  Please investigate.


For the record, the same happens on s390x.  It seems that you broke all
targets without HAVE_LINUX_BTRACE.

> Below is a patch to address this.  I tested it on IA by undefining HAVE_LINUX_BTRACE.

> Does it fix the issue you reported?


I've tested your patch on s390x, and it seems to fix the problem.

--
Andreas
Maciej W. Rozycki Feb. 26, 2018, 9:48 p.m. | #4
Hi Markus,

 Thank you for the quick action on this problem.

On Mon, 26 Feb 2018, Andreas Arnez wrote:

> >> Process .../gdb/testsuite/outputs/gdb.base/advance/advance created; pid =

> >> 25519 Listening on port 2346 target remote 1.2.3.4:2346 Remote debugging using

> >> 1.2.3.4:2346 Reading symbols from .../lib/ld.so.1...done.

> >> 0x77fc8de0 in __start () from .../lib/ld.so.1 Protocol error: qXfer:btrace-conf

> >> (read-btrace-conf) conflicting enabled responses.

> >> (gdb) continue

> >> The program is not being run.

> >> (gdb) FAIL: gdb.base/advance.exp: can't run to main

> >> 

> >> See the attached RSP packet exchange log for details.  Please investigate.

> 

> For the record, the same happens on s390x.  It seems that you broke all

> targets without HAVE_LINUX_BTRACE.


 I suspected that might be the case.  With your future changes that touch 
generic code would you please regression-test them with another target, or 
at least ask people to do so before committing them, so that such a wide 
breakage is avoided?  Having several versions not working at all makes it 
a pain to bisect changes that may have caused regressions meanwhile.

 Also did you verify that old-GDB/new-gdbserver and new-GDB/old-gdbserver 
combinations work correctly?

> > Below is a patch to address this.  I tested it on IA by undefining HAVE_LINUX_BTRACE.

> > Does it fix the issue you reported?

> 

> I've tested your patch on s390x, and it seems to fix the problem.


 I have smoke-tested your change with `gdb.base/advance.exp' and one of 
the configurations that failed previously, and it has scored all-pass now.  
I'll schedule full testing overnight.

  Maciej
Metzger, Markus T Feb. 27, 2018, 10:57 a.m. | #5
Hello Maciej, Andreas,

Sorry about the breakage.  I hope everything's working again with that patch:

https://sourceware.org/ml/gdb-patches/2018-02/msg00420.html


It's the same I sent inline to the email with a recurring white-space error fixed.

Andreas already indicated that the patch fixes the problem on s390x.  Did the full
test show any further issues on your side, Maciej?


>  Also did you verify that old-GDB/new-gdbserver and new-GDB/old-gdbserver

> combinations work correctly?


That was discussed here:
https://sourceware.org/ml/gdb-patches/2018-02/msg00117.html

regards,
markus.

Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
Maciej W. Rozycki Feb. 27, 2018, 2:56 p.m. | #6
Hi Markus,

> https://sourceware.org/ml/gdb-patches/2018-02/msg00420.html

> 

> 

> It's the same I sent inline to the email with a recurring white-space 

> error fixed.


 With the change description you have also overrun our 74-column limit: 
<https://sourceware.org/gdb/wiki/Internals%20GDB-C-Coding-Standards#Column_limits>. 
NB due to how `git log' etc. indents descriptions I prefer to stay within 
72 columns with my own changes for a better visual effect, though you are 
of course free to use your own judgement here as long as you're within 74 
columns.

 Same with ChangeLog entries.  Also as per the the GNU Coding Standard:
<https://www.gnu.org/prep/standards/standards.html#Style-of-Change-Logs>
long function lists, etc. use `)' as the closing character, so:

	* target.h (target_enable_btrace, target_disable_btrace)
	(target_read_btrace, target_read_btrace_conf): Turn macro into 
	inline function.  Throw error if target method not defined.

 You need to mark new error messages for translation, so:

+    error (_("Target does not support branch tracing."));

etc.

 This:

+static inline int
+target_read_btrace (struct btrace_target_info *tinfo, struct buffer *buffer,
+		    enum btrace_read_type type)

also overruns the 74-column limit.

 The formatting appears otherwise OK to me and I'll leave the matter 
itself of this change up to someone with suitable expertise in this area.

> Andreas already indicated that the patch fixes the problem on s390x.  Did the full

> test show any further issues on your side, Maciej?


 We had a failure last night in the lab literally as I have scheduled the 
tests and consequently they didn't run.  I'll schedule them again as soon 
as possible, but the target system I have been using for testing is not 
back up yet, so it may not happen before tomorrow.  Sorry.

> >  Also did you verify that old-GDB/new-gdbserver and new-GDB/old-gdbserver

> > combinations work correctly?

> 

> That was discussed here:

> https://sourceware.org/ml/gdb-patches/2018-02/msg00117.html


 Thanks for confirming.  Is there going to be any difference here for 
non-x86 targets that needs to be verified?

  Maciej
Metzger, Markus T Feb. 27, 2018, 6:14 p.m. | #7
Hello Maciej,

>  With the change description you have also overrun our 74-column limit:

> <https://sourceware.org/gdb/wiki/Internals%20GDB-C-Coding-

> Standards#Column_limits>.

> NB due to how `git log' etc. indents descriptions I prefer to stay within

> 72 columns with my own changes for a better visual effect, though you are of

> course free to use your own judgement here as long as you're within 74 columns.


Actually, the hard limit is 80 columns.  I've been using that, so far, and from
looking at other files in gdb/ it looks like others were using the 80 columns limit,
as well.


>  Same with ChangeLog entries.  Also as per the the GNU Coding Standard:

> <https://www.gnu.org/prep/standards/standards.html#Style-of-Change-Logs>

> long function lists, etc. use `)' as the closing character, so:

> 

> 	* target.h (target_enable_btrace, target_disable_btrace)

> 	(target_read_btrace, target_read_btrace_conf): Turn macro into

> 	inline function.  Throw error if target method not defined.

> 

>  You need to mark new error messages for translation, so:

> 

> +    error (_("Target does not support branch tracing."));


Thanks for pointing those out.  I fixed them locally.

  
> > >  Also did you verify that old-GDB/new-gdbserver and

> > > new-GDB/old-gdbserver combinations work correctly?

> >

> > That was discussed here:

> > https://sourceware.org/ml/gdb-patches/2018-02/msg00117.html

> 

>  Thanks for confirming.  Is there going to be any difference here for

> non-x86 targets that needs to be verified?


They're supposed to work the same way.  I.e. older gdbservers won't
advertise the packets and newer GDB's hence won't use them.  And
newer gdbservers would advertise the packets and, with this patch,
fail on every request with "E.Target does not support branch tracing".

Let me check that once for both directions just to be sure.

Regards,
Markus.

Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
Maciej W. Rozycki Feb. 28, 2018, 9:55 a.m. | #8
Hi Markus,

> >  With the change description you have also overrun our 74-column limit:

> > <https://sourceware.org/gdb/wiki/Internals%20GDB-C-Coding-

> > Standards#Column_limits>.

> > NB due to how `git log' etc. indents descriptions I prefer to stay within

> > 72 columns with my own changes for a better visual effect, though you are of

> > course free to use your own judgement here as long as you're within 74 columns.

> 

> Actually, the hard limit is 80 columns.  I've been using that, so far, and from

> looking at other files in gdb/ it looks like others were using the 80 columns limit,

> as well.


 Well other people doing it wrong is not an excuse I am afraid.  With 
source files it is at least bearable, however as I wrote `git log' etc. 
indent descriptions by 4 characters, which means that as soon as you are 
beyond 76 columns lines get wrapped making text really hard to follow.

 Take your recent commit de65820cd69a as an example.  Its description 
renders like this on my screen:

    In gdb.btrace/buffer-size.exp we explicitly ask for the BTS recording format
.
    This may lead to spurious fails on systems where PT is being used by some ot
her
    process at the same time.

    Set both PT and BTS buffer sizes to 1 and check that whatever recording form
at
    is used will use a 4KB buffer.

-- is this how you wanted it to look like?

 If you disagree, then please discuss and get a consensus on an update to 
the rules set in our wiki.  They are there for a reason and please look 
for past discussions as to why they have been set like they are now.

> >  Thanks for confirming.  Is there going to be any difference here for

> > non-x86 targets that needs to be verified?

> 

> They're supposed to work the same way.  I.e. older gdbservers won't

> advertise the packets and newer GDB's hence won't use them.  And

> newer gdbservers would advertise the packets and, with this patch,

> fail on every request with "E.Target does not support branch tracing".

> 

> Let me check that once for both directions just to be sure.


 Great, thanks!

  Maciej
Maciej W. Rozycki Feb. 28, 2018, 10:29 a.m. | #9
Hi Markus,

On Wed, 28 Feb 2018, Maciej W. Rozycki wrote:

>  Well other people doing it wrong is not an excuse I am afraid.  With 

> source files it is at least bearable, however as I wrote `git log' etc. 

> indent descriptions by 4 characters, which means that as soon as you are 

> beyond 76 columns lines get wrapped making text really hard to follow.


 A follow-up to myself just for avoidance of doubt: you are indeed allowed 
to exceed the soft limit in certain circumstances, but you still need to 
have "a reasonable reason", you can't just do this on a regular basis with 
no apparent reason whatsoever.

 I wouldn't care for example if you had a full stop in column 75 in one 
line in an otherwise well formatted description.  Otherwise you need to 
justify yourself.

  Maciej
Metzger, Markus T Feb. 28, 2018, 11:24 a.m. | #10
Hello Maciej,

I added

	(setq fill-column 74)

for COMMIT_EDITMSG and for *.[hc] files.  This excludes .exp and .texinfo
(and others), which are still at 80 columns.

Also for command help-text strings I believe it makes sense to stay at 80
columns.

Are you OK with that?

Regards,
Markus.

Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
Yao Qi Feb. 28, 2018, noon | #11
"Maciej W. Rozycki" <macro@mips.com> writes:

>  Hmm, v3 of this change (apparently never posted), that is specifically 

> commit de6242d30757 ("btrace, gdbserver: remove the to_supports_btrace 

> target method"), has broken remote `mips-linux' target debugging 

> completely, that is an attempt to make a remote connection fails in the 

> initial handshake, e.g.:

>

> Process .../gdb/testsuite/outputs/gdb.base/advance/advance created; pid = 25519

> Listening on port 2346

> target remote 1.2.3.4:2346

> Remote debugging using 1.2.3.4:2346

> Reading symbols from .../lib/ld.so.1...done.

> 0x77fc8de0 in __start () from .../lib/ld.so.1

> Protocol error: qXfer:btrace-conf (read-btrace-conf) conflicting enabled responses.

> (gdb) continue

> The program is not being run.

> (gdb) FAIL: gdb.base/advance.exp: can't run to main


For the record, since non-x86 gdbserver is broken, it takes much longer
to run gdb tests on non-x86 gdbserver buildbot builders,
On Ubuntu-AArch64-native-gdbserver-m64, the time is changed from 17 mins
to 5 hrs 50 mins; 
https://gdb-build.sergiodj.net/builders/Ubuntu-AArch64-native-gdbserver-m64/builds/4141
On CentOS-ppc64be-native-gdbserver-m64, the time is changed from 48 mins
to 6 hrs 34 mins;
https://gdb-build.sergiodj.net/builders/CentOS-ppc64be-native-gdbserver-m64/builds/155

CentOS-ppc64le-native-gdbserver-m64, Fedora-ppc64le-native-gdbserver-m64 and
Debian-s390x-native-gdbserver-m64 are affected as well.

By the time Markus's fix is pushed in, these builders can run tests for
only 4 commits every day, and there are already 184 commits pushed after
commit de6242d30757.  It takes at least 46 days to build and test every
commit.  If we take "try" jobs submitted in the last several days into
account, it takes more time to clear the queue.

Sergio, in short, non-x86 gdbserver is broken, it takes several hours to
run gdb tests with gdbserver builders.  As a result, many builds are
pending there, and it still also takes much time to clean them up.
After Markus commit his fix, can we do something to let non-x86
gdbserver builders to skip these pending builds, and "jump" to Markus's fix?
Or can we temporarily disable non-x86 builders, restart them after the
fix is committed, and make sure builders pick the most recent commit
rather than resuming from the pending builds.

-- 
Yao (齐尧)
Metzger, Markus T Feb. 28, 2018, 12:53 p.m. | #12
Hello Maciej,

I wondered why my fill-column auto-mode settings didn't seem to be effective and found
that they were overwritten by gdb/.dir-locals.el.

If you want to enforce the 74 columns limit, you may want to submit the below patch.

I will leave the fill-column 74 for the commit-message but fall back to 80 columns for the rest.
IIUC you were mostly concerned about the additional 4-columns indentation by 'git log'.
Are you OK with that?

Regards,
Markus.

---

diff --git a/gdb/.dir-locals.el b/gdb/.dir-locals.el
index 7e2b0cc..abfd167 100644
--- a/gdb/.dir-locals.el
+++ b/gdb/.dir-locals.el
@@ -21,6 +21,7 @@
  (nil . ((bug-reference-url-format . "http://sourceware.org/bugzilla/show_bug.cgi?id=%s")))
  (c-mode . ((c-file-style . "GNU")
            (mode . c++)
+           (fill-column . 74)
            (indent-tabs-mode . t)
            (tab-width . 8)
            (c-basic-offset . 2)



> -----Original Message-----

> From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-

> owner@sourceware.org] On Behalf Of Metzger, Markus T

> Sent: 28 February 2018 12:24

> To: Maciej W. Rozycki <macro@mips.com>

> Cc: gdb-patches@sourceware.org

> Subject: RE: [PATCH v2 5/7] btrace, gdbserver: remove the to_supports_btrace

> target method

> 

> Hello Maciej,

> 

> I added

> 

> 	(setq fill-column 74)

> 

> for COMMIT_EDITMSG and for *.[hc] files.  This excludes .exp and .texinfo (and

> others), which are still at 80 columns.

> 

> Also for command help-text strings I believe it makes sense to stay at 80 columns.

> 

> Are you OK with that?

> 

> Regards,

> Markus.

> 

> Intel Deutschland GmbH

> Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany

> Tel: +49 89 99 8853-0, www.intel.de

> Managing Directors: Christin Eisenschmid, Christian Lamprechter Chairperson of

> the Supervisory Board: Nicole Lau Registered Office: Munich Commercial

> Register: Amtsgericht Muenchen HRB 186928


Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
Maciej W. Rozycki Feb. 28, 2018, 3:15 p.m. | #13
Hi Markus,

> I wondered why my fill-column auto-mode settings didn't seem to be effective and found

> that they were overwritten by gdb/.dir-locals.el.

> 

> If you want to enforce the 74 columns limit, you may want to submit the below patch.


 I don't use Emacs so I can't comment on technical details of your change, 
although at the high level it does look reasonable to me.

> I will leave the fill-column 74 for the commit-message but fall back to 80 columns for the rest.

> IIUC you were mostly concerned about the additional 4-columns indentation by 'git log'.

> Are you OK with that?


 As I say we have the formatting rules set as documented in our wiki, so 
please do follow them, or if you want to get them changed, then you need 
to reach consensus about your proposal among GDB maintainers.

  Maciej
Eli Zaretskii Feb. 28, 2018, 4:08 p.m. | #14
> From: "Metzger, Markus T" <markus.t.metzger@intel.com>

> CC: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>

> Date: Wed, 28 Feb 2018 12:53:15 +0000

> 

> I wondered why my fill-column auto-mode settings didn't seem to be effective and found

> that they were overwritten by gdb/.dir-locals.el.

> 

> If you want to enforce the 74 columns limit, you may want to submit the below patch.

> 

> I will leave the fill-column 74 for the commit-message but fall back to 80 columns for the rest.

> IIUC you were mostly concerned about the additional 4-columns indentation by 'git log'.

> Are you OK with that?


I believe this value is so we could some day produce ChangeLog files
from Git log.
Sergio Durigan Junior Feb. 28, 2018, 4:27 p.m. | #15
On Wednesday, February 28 2018, Yao Qi wrote:

> "Maciej W. Rozycki" <macro@mips.com> writes:

>

>>  Hmm, v3 of this change (apparently never posted), that is specifically 

>> commit de6242d30757 ("btrace, gdbserver: remove the to_supports_btrace 

>> target method"), has broken remote `mips-linux' target debugging 

>> completely, that is an attempt to make a remote connection fails in the 

>> initial handshake, e.g.:

>>

>> Process .../gdb/testsuite/outputs/gdb.base/advance/advance created; pid = 25519

>> Listening on port 2346

>> target remote 1.2.3.4:2346

>> Remote debugging using 1.2.3.4:2346

>> Reading symbols from .../lib/ld.so.1...done.

>> 0x77fc8de0 in __start () from .../lib/ld.so.1

>> Protocol error: qXfer:btrace-conf (read-btrace-conf) conflicting enabled responses.

>> (gdb) continue

>> The program is not being run.

>> (gdb) FAIL: gdb.base/advance.exp: can't run to main

>

> For the record, since non-x86 gdbserver is broken, it takes much longer

> to run gdb tests on non-x86 gdbserver buildbot builders,

> On Ubuntu-AArch64-native-gdbserver-m64, the time is changed from 17 mins

> to 5 hrs 50 mins; 

> https://gdb-build.sergiodj.net/builders/Ubuntu-AArch64-native-gdbserver-m64/builds/4141

> On CentOS-ppc64be-native-gdbserver-m64, the time is changed from 48 mins

> to 6 hrs 34 mins;

> https://gdb-build.sergiodj.net/builders/CentOS-ppc64be-native-gdbserver-m64/builds/155

>

> CentOS-ppc64le-native-gdbserver-m64, Fedora-ppc64le-native-gdbserver-m64 and

> Debian-s390x-native-gdbserver-m64 are affected as well.


Ah, that explains the failures I am seeing.

> By the time Markus's fix is pushed in, these builders can run tests for

> only 4 commits every day, and there are already 184 commits pushed after

> commit de6242d30757.  It takes at least 46 days to build and test every

> commit.  If we take "try" jobs submitted in the last several days into

> account, it takes more time to clear the queue.

>

> Sergio, in short, non-x86 gdbserver is broken, it takes several hours to

> run gdb tests with gdbserver builders.  As a result, many builds are

> pending there, and it still also takes much time to clean them up.

> After Markus commit his fix, can we do something to let non-x86

> gdbserver builders to skip these pending builds, and "jump" to Markus's fix?

> Or can we temporarily disable non-x86 builders, restart them after the

> fix is committed, and make sure builders pick the most recent commit

> rather than resuming from the pending builds.


What I can do is manually cancel all the build until Markus's commit.
I've done that before for other builders, so it is possible.

I'll keep an eye and do that when the commit is pushed.  Thanks for
keeping me in the loop, Yao.

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/
Metzger, Markus T March 1, 2018, 11:33 a.m. | #16
Hello Sergio,

> What I can do is manually cancel all the build until Markus's commit.

> I've done that before for other builders, so it is possible.


I pushed the fix.

I'm sorry about the breakage this caused and the lost test coverage for
the commits for which we will have to cancel testing.

Thanks for helping with buildbot, Sergio.

Regards,
Markus.


> -----Original Message-----

> From: Sergio Durigan Junior [mailto:sergiodj@redhat.com]

> Sent: 28 February 2018 17:27

> To: Yao Qi <qiyaoltc@gmail.com>

> Cc: Maciej W. Rozycki <macro@mips.com>; Metzger, Markus T

> <markus.t.metzger@intel.com>; gdb-patches@sourceware.org

> Subject: Re: [PATCH v2 5/7] btrace, gdbserver: remove the to_supports_btrace

> target method

> 

> On Wednesday, February 28 2018, Yao Qi wrote:

> 

> > "Maciej W. Rozycki" <macro@mips.com> writes:

> >

> >>  Hmm, v3 of this change (apparently never posted), that is

> >> specifically commit de6242d30757 ("btrace, gdbserver: remove the

> >> to_supports_btrace target method"), has broken remote `mips-linux'

> >> target debugging completely, that is an attempt to make a remote

> >> connection fails in the initial handshake, e.g.:

> >>

> >> Process .../gdb/testsuite/outputs/gdb.base/advance/advance created;

> >> pid = 25519 Listening on port 2346 target remote 1.2.3.4:2346 Remote

> >> debugging using 1.2.3.4:2346 Reading symbols from

> >> .../lib/ld.so.1...done.

> >> 0x77fc8de0 in __start () from .../lib/ld.so.1 Protocol error:

> >> qXfer:btrace-conf (read-btrace-conf) conflicting enabled responses.

> >> (gdb) continue

> >> The program is not being run.

> >> (gdb) FAIL: gdb.base/advance.exp: can't run to main

> >

> > For the record, since non-x86 gdbserver is broken, it takes much

> > longer to run gdb tests on non-x86 gdbserver buildbot builders, On

> > Ubuntu-AArch64-native-gdbserver-m64, the time is changed from 17 mins

> > to 5 hrs 50 mins;

> > https://gdb-build.sergiodj.net/builders/Ubuntu-AArch64-native-gdbserve

> > r-m64/builds/4141 On CentOS-ppc64be-native-gdbserver-m64, the time is

> > changed from 48 mins to 6 hrs 34 mins;

> > https://gdb-build.sergiodj.net/builders/CentOS-ppc64be-native-gdbserve

> > r-m64/builds/155

> >

> > CentOS-ppc64le-native-gdbserver-m64,

> > Fedora-ppc64le-native-gdbserver-m64 and

> > Debian-s390x-native-gdbserver-m64 are affected as well.

> 

> Ah, that explains the failures I am seeing.

> 

> > By the time Markus's fix is pushed in, these builders can run tests

> > for only 4 commits every day, and there are already 184 commits pushed

> > after commit de6242d30757.  It takes at least 46 days to build and

> > test every commit.  If we take "try" jobs submitted in the last

> > several days into account, it takes more time to clear the queue.

> >

> > Sergio, in short, non-x86 gdbserver is broken, it takes several hours

> > to run gdb tests with gdbserver builders.  As a result, many builds

> > are pending there, and it still also takes much time to clean them up.

> > After Markus commit his fix, can we do something to let non-x86

> > gdbserver builders to skip these pending builds, and "jump" to Markus's fix?

> > Or can we temporarily disable non-x86 builders, restart them after the

> > fix is committed, and make sure builders pick the most recent commit

> > rather than resuming from the pending builds.

> 

> What I can do is manually cancel all the build until Markus's commit.

> I've done that before for other builders, so it is possible.

> 

> I'll keep an eye and do that when the commit is pushed.  Thanks for keeping me

> in the loop, Yao.

> 

> --

> Sergio

> GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36 Please send

> encrypted e-mail if possible http://sergiodj.net/

Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
Maciej W. Rozycki March 1, 2018, 6:47 p.m. | #17
Hi Markus,

> > What I can do is manually cancel all the build until Markus's commit.

> > I've done that before for other builders, so it is possible.

> 

> I pushed the fix.


 For the record, my test board has been restored to normal operation and I 
have now finished regression-testing with the `mips-mti-linux-gnu' remote 
target and its three ABIs, with no problems observed compared to results 
as at commit de6242d30757^.

 Thank you for getting the fix completed so quickly.

  Maciej
Sergio Durigan Junior March 1, 2018, 7:27 p.m. | #18
On Thursday, March 01 2018, Markus T. Metzger wrote:

> Hello Sergio,

>

>> What I can do is manually cancel all the build until Markus's commit.

>> I've done that before for other builders, so it is possible.

>

> I pushed the fix.

>

> I'm sorry about the breakage this caused and the lost test coverage for

> the commits for which we will have to cancel testing.

>

> Thanks for helping with buildbot, Sergio.


Hey Markus,

Thanks for letting me know.  I'm cancelling the pending builds on a few
builders that were affected by this issue.  Let's keep an eye and see if
there's anything else I should do :-).

Cheers,

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/
Yao Qi March 5, 2018, 12:13 p.m. | #19
Sergio Durigan Junior <sergiodj@redhat.com> writes:

> I'm cancelling the pending builds on a few

> builders that were affected by this issue.  Let's keep an eye and see if

> there's anything else I should do :-).


Hi Sergio,
Did you cancel pending builds?  There are still many pending builds on
some non-x86 gdbserver builders.

-- 
Yao (齐尧)
Sergio Durigan Junior March 5, 2018, 4:13 p.m. | #20
On Monday, March 05 2018, Yao Qi wrote:

> Sergio Durigan Junior <sergiodj@redhat.com> writes:

>

>> I'm cancelling the pending builds on a few

>> builders that were affected by this issue.  Let's keep an eye and see if

>> there's anything else I should do :-).

>

> Hi Sergio,

> Did you cancel pending builds?  There are still many pending builds on

> some non-x86 gdbserver builders.


Hi Yao,

I didn't cancel the pending builds of the ppc{be,le} builders, because I
remember seeing them even before this regression.  I will do that now.

Thanks,

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/
Yao Qi March 6, 2018, 9:02 a.m. | #21
On Mon, Mar 5, 2018 at 4:13 PM, Sergio Durigan Junior
<sergiodj@redhat.com> wrote:
>

> I didn't cancel the pending builds of the ppc{be,le} builders, because I

> remember seeing them even before this regression.  I will do that now.

>


Can you also cancel the pending builds on Ubuntu-AArch64-native-gdbserver-m64?

-- 
Yao (齐尧)
Sergio Durigan Junior March 6, 2018, 4:32 p.m. | #22
On Tuesday, March 06 2018, Yao Qi wrote:

> On Mon, Mar 5, 2018 at 4:13 PM, Sergio Durigan Junior

> <sergiodj@redhat.com> wrote:

>>

>> I didn't cancel the pending builds of the ppc{be,le} builders, because I

>> remember seeing them even before this regression.  I will do that now.

>>

>

> Can you also cancel the pending builds on Ubuntu-AArch64-native-gdbserver-m64?


Done.  I'm monitoring Ubuntu-AArch64-m64 to see if it will be able to
catch up, otherwise I'll cancel its pending builds as well.

Thanks,

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/

Patch

diff --git a/gdb/btrace.c b/gdb/btrace.c
index ffcf53a..2b031a4 100644
--- a/gdb/btrace.c
+++ b/gdb/btrace.c
@@ -1582,9 +1582,6 @@  btrace_enable (struct thread_info *tp, const struct btrace_config *conf)
     error (_("GDB does not support Intel Processor Trace."));
 #endif /* !defined (HAVE_LIBIPT) */
 
-  if (!target_supports_btrace (conf->format))
-    error (_("Target does not support branch tracing."));
-
   DEBUG ("enable thread %s (%s)", print_thread_id (tp),
 	 target_pid_to_str (tp->ptid));
 
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index 38142bb..c1ba961 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -7531,7 +7531,6 @@  static struct target_ops linux_target_ops = {
   linux_qxfer_libraries_svr4,
   linux_supports_agent,
 #ifdef HAVE_LINUX_BTRACE
-  linux_supports_btrace,
   linux_enable_btrace,
   linux_low_disable_btrace,
   linux_low_read_btrace,
@@ -7541,7 +7540,6 @@  static struct target_ops linux_target_ops = {
   NULL,
   NULL,
   NULL,
-  NULL,
 #endif
   linux_supports_range_stepping,
   linux_proc_pid_to_exec_file,
diff --git a/gdb/gdbserver/nto-low.c b/gdb/gdbserver/nto-low.c
index a570ca9..b68b811 100644
--- a/gdb/gdbserver/nto-low.c
+++ b/gdb/gdbserver/nto-low.c
@@ -991,7 +991,6 @@  static struct target_ops nto_target_ops = {
   NULL, /* get_min_fast_tracepoint_insn_len */
   NULL, /* qxfer_libraries_svr4 */
   NULL, /* support_agent */
-  NULL, /* support_btrace */
   NULL, /* enable_btrace */
   NULL, /* disable_btrace */
   NULL, /* read_btrace */
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index 5ce6281..cb02b58 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -2104,27 +2104,10 @@  crc32 (CORE_ADDR base, int len, unsigned int crc)
 static void
 supported_btrace_packets (char *buf)
 {
-  int btrace_supported = 0;
-
-  if (target_supports_btrace (BTRACE_FORMAT_BTS))
-    {
-      strcat (buf, ";Qbtrace:bts+");
-      strcat (buf, ";Qbtrace-conf:bts:size+");
-
-      btrace_supported = 1;
-    }
-
-  if (target_supports_btrace (BTRACE_FORMAT_PT))
-    {
-      strcat (buf, ";Qbtrace:pt+");
-      strcat (buf, ";Qbtrace-conf:pt:size+");
-
-      btrace_supported = 1;
-    }
-
-  if (!btrace_supported)
-    return;
-
+  strcat (buf, ";Qbtrace:bts+");
+  strcat (buf, ";Qbtrace-conf:bts:size+");
+  strcat (buf, ";Qbtrace:pt+");
+  strcat (buf, ";Qbtrace-conf:pt:size+");
   strcat (buf, ";Qbtrace:off+");
   strcat (buf, ";qXfer:btrace:read+");
   strcat (buf, ";qXfer:btrace-conf:read+");
diff --git a/gdb/gdbserver/spu-low.c b/gdb/gdbserver/spu-low.c
index fd1f8d6..5b880d2 100644
--- a/gdb/gdbserver/spu-low.c
+++ b/gdb/gdbserver/spu-low.c
@@ -717,7 +717,6 @@  static struct target_ops spu_target_ops = {
   NULL, /* get_min_fast_tracepoint_insn_len */
   NULL, /* qxfer_libraries_svr4 */
   NULL, /* support_agent */
-  NULL, /* support_btrace */
   NULL, /* enable_btrace */
   NULL, /* disable_btrace */
   NULL, /* read_btrace */
diff --git a/gdb/gdbserver/target.h b/gdb/gdbserver/target.h
index 295e64d..dcefe1a 100644
--- a/gdb/gdbserver/target.h
+++ b/gdb/gdbserver/target.h
@@ -391,9 +391,6 @@  struct target_ops
   /* Return true if target supports debugging agent.  */
   int (*supports_agent) (void);
 
-  /* Check whether the target supports branch tracing.  */
-  int (*supports_btrace) (struct target_ops *, enum btrace_format);
-
   /* Enable branch tracing for PTID based on CONF and allocate a branch trace
      target information struct for reading and for disabling branch trace.  */
   struct btrace_target_info *(*enable_btrace)
@@ -623,10 +620,6 @@  int kill_inferior (int);
   (the_target->supports_agent ? \
    (*the_target->supports_agent) () : 0)
 
-#define target_supports_btrace(format)			\
-  (the_target->supports_btrace				\
-   ? (*the_target->supports_btrace) (the_target, format) : 0)
-
 #define target_enable_btrace(ptid, conf) \
   (*the_target->enable_btrace) (ptid, conf)
 
diff --git a/gdb/gdbserver/win32-low.c b/gdb/gdbserver/win32-low.c
index b1d9b51..9f0c4e4 100644
--- a/gdb/gdbserver/win32-low.c
+++ b/gdb/gdbserver/win32-low.c
@@ -1842,7 +1842,6 @@  static struct target_ops win32_target_ops = {
   NULL, /* get_min_fast_tracepoint_insn_len */
   NULL, /* qxfer_libraries_svr4 */
   NULL, /* support_agent */
-  NULL, /* support_btrace */
   NULL, /* enable_btrace */
   NULL, /* disable_btrace */
   NULL, /* read_btrace */
diff --git a/gdb/nat/linux-btrace.c b/gdb/nat/linux-btrace.c
index 2b37e41..23ad778 100644
--- a/gdb/nat/linux-btrace.c
+++ b/gdb/nat/linux-btrace.c
@@ -175,23 +175,6 @@  perf_event_read_all (struct perf_event_buffer *pev, gdb_byte **data,
   pev->last_head = data_head;
 }
 
-/* Determine the event type.
-   Returns zero on success and fills in TYPE; returns -1 otherwise.  */
-
-static int
-perf_event_pt_event_type (int *type)
-{
-  gdb_file_up file
-    =  gdb_fopen_cloexec ("/sys/bus/event_source/devices/intel_pt/type", "r");
-  if (file == nullptr)
-    return -1;
-
-  int found = fscanf (file.get (), "%d", type);
-  if (found == 1)
-    return 0;
-  return -1;
-}
-
 /* Try to determine the start address of the Linux kernel.  */
 
 static uint64_t
@@ -376,176 +359,6 @@  perf_event_read_bts (struct btrace_target_info* tinfo, const uint8_t *begin,
   return btrace;
 }
 
-/* Check whether the kernel supports BTS.  */
-
-static int
-kernel_supports_bts (void)
-{
-  struct perf_event_attr attr;
-  pid_t child, pid;
-  int status, file;
-
-  errno = 0;
-  child = fork ();
-  switch (child)
-    {
-    case -1:
-      warning (_("test bts: cannot fork: %s."), safe_strerror (errno));
-      return 0;
-
-    case 0:
-      status = ptrace (PTRACE_TRACEME, 0, NULL, NULL);
-      if (status != 0)
-	{
-	  warning (_("test bts: cannot PTRACE_TRACEME: %s."),
-		   safe_strerror (errno));
-	  _exit (1);
-	}
-
-      status = raise (SIGTRAP);
-      if (status != 0)
-	{
-	  warning (_("test bts: cannot raise SIGTRAP: %s."),
-		   safe_strerror (errno));
-	  _exit (1);
-	}
-
-      _exit (1);
-
-    default:
-      pid = waitpid (child, &status, 0);
-      if (pid != child)
-	{
-	  warning (_("test bts: bad pid %ld, error: %s."),
-		   (long) pid, safe_strerror (errno));
-	  return 0;
-	}
-
-      if (!WIFSTOPPED (status))
-	{
-	  warning (_("test bts: expected stop. status: %d."),
-		   status);
-	  return 0;
-	}
-
-      memset (&attr, 0, sizeof (attr));
-
-      attr.type = PERF_TYPE_HARDWARE;
-      attr.config = PERF_COUNT_HW_BRANCH_INSTRUCTIONS;
-      attr.sample_period = 1;
-      attr.sample_type = PERF_SAMPLE_IP | PERF_SAMPLE_ADDR;
-      attr.exclude_kernel = 1;
-      attr.exclude_hv = 1;
-      attr.exclude_idle = 1;
-
-      file = syscall (SYS_perf_event_open, &attr, child, -1, -1, 0);
-      if (file >= 0)
-	close (file);
-
-      kill (child, SIGKILL);
-      ptrace (PTRACE_KILL, child, NULL, NULL);
-
-      pid = waitpid (child, &status, 0);
-      if (pid != child)
-	{
-	  warning (_("test bts: bad pid %ld, error: %s."),
-		   (long) pid, safe_strerror (errno));
-	  if (!WIFSIGNALED (status))
-	    warning (_("test bts: expected killed. status: %d."),
-		     status);
-	}
-
-      return (file >= 0);
-    }
-}
-
-/* Check whether the kernel supports Intel Processor Trace.  */
-
-static int
-kernel_supports_pt (void)
-{
-  struct perf_event_attr attr;
-  pid_t child, pid;
-  int status, file, type;
-
-  errno = 0;
-  child = fork ();
-  switch (child)
-    {
-    case -1:
-      warning (_("test pt: cannot fork: %s."), safe_strerror (errno));
-      return 0;
-
-    case 0:
-      status = ptrace (PTRACE_TRACEME, 0, NULL, NULL);
-      if (status != 0)
-	{
-	  warning (_("test pt: cannot PTRACE_TRACEME: %s."),
-		   safe_strerror (errno));
-	  _exit (1);
-	}
-
-      status = raise (SIGTRAP);
-      if (status != 0)
-	{
-	  warning (_("test pt: cannot raise SIGTRAP: %s."),
-		   safe_strerror (errno));
-	  _exit (1);
-	}
-
-      _exit (1);
-
-    default:
-      pid = waitpid (child, &status, 0);
-      if (pid != child)
-	{
-	  warning (_("test pt: bad pid %ld, error: %s."),
-		   (long) pid, safe_strerror (errno));
-	  return 0;
-	}
-
-      if (!WIFSTOPPED (status))
-	{
-	  warning (_("test pt: expected stop. status: %d."),
-		   status);
-	  return 0;
-	}
-
-      status = perf_event_pt_event_type (&type);
-      if (status != 0)
-	file = -1;
-      else
-	{
-	  memset (&attr, 0, sizeof (attr));
-
-	  attr.size = sizeof (attr);
-	  attr.type = type;
-	  attr.exclude_kernel = 1;
-	  attr.exclude_hv = 1;
-	  attr.exclude_idle = 1;
-
-	  file = syscall (SYS_perf_event_open, &attr, child, -1, -1, 0);
-	  if (file >= 0)
-	    close (file);
-	}
-
-      kill (child, SIGKILL);
-      ptrace (PTRACE_KILL, child, NULL, NULL);
-
-      pid = waitpid (child, &status, 0);
-      if (pid != child)
-	{
-	  warning (_("test pt: bad pid %ld, error: %s."),
-		   (long) pid, safe_strerror (errno));
-	  if (!WIFSIGNALED (status))
-	    warning (_("test pt: expected killed. status: %d."),
-		     status);
-	}
-
-      return (file >= 0);
-    }
-}
-
 /* Check whether an Intel cpu supports BTS.  */
 
 static int
@@ -596,64 +409,6 @@  cpu_supports_bts (void)
     }
 }
 
-/* Check whether the linux target supports BTS.  */
-
-static int
-linux_supports_bts (void)
-{
-  static int cached;
-
-  if (cached == 0)
-    {
-      if (!kernel_supports_bts ())
-	cached = -1;
-      else if (!cpu_supports_bts ())
-	cached = -1;
-      else
-	cached = 1;
-    }
-
-  return cached > 0;
-}
-
-/* Check whether the linux target supports Intel Processor Trace.  */
-
-static int
-linux_supports_pt (void)
-{
-  static int cached;
-
-  if (cached == 0)
-    {
-      if (!kernel_supports_pt ())
-	cached = -1;
-      else
-	cached = 1;
-    }
-
-  return cached > 0;
-}
-
-/* See linux-btrace.h.  */
-
-int
-linux_supports_btrace (struct target_ops *ops, enum btrace_format format)
-{
-  switch (format)
-    {
-    case BTRACE_FORMAT_NONE:
-      return 0;
-
-    case BTRACE_FORMAT_BTS:
-      return linux_supports_bts ();
-
-    case BTRACE_FORMAT_PT:
-      return linux_supports_pt ();
-    }
-
-  internal_error (__FILE__, __LINE__, _("Unknown branch trace format"));
-}
-
 /* Enable branch tracing in BTS format.  */
 
 static struct btrace_target_info *
@@ -664,6 +419,9 @@  linux_enable_bts (ptid_t ptid, const struct btrace_config_bts *conf)
   __u64 data_offset;
   int pid, pg;
 
+  if (!cpu_supports_bts ())
+    error (_("GDB does not support BTS for the target cpu."));
+
   gdb::unique_xmalloc_ptr<btrace_target_info> tinfo
     (XCNEW (btrace_target_info));
   tinfo->ptid = ptid;
@@ -770,6 +528,23 @@  linux_enable_bts (ptid_t ptid, const struct btrace_config_bts *conf)
 
 #if defined (PERF_ATTR_SIZE_VER5)
 
+/* Determine the event type.
+   Returns zero on success and fills in TYPE; returns -1 otherwise.  */
+
+static int
+perf_event_pt_event_type (int *type)
+{
+  gdb_file_up file =
+    gdb_fopen_cloexec ("/sys/bus/event_source/devices/intel_pt/type", "r");
+  if (file.get () == nullptr)
+    return -1;
+
+  int found = fscanf (file.get (), "%d", type);
+  if (found == 1)
+    return 0;
+  return -1;
+}
+
 /* Enable branch tracing in Intel Processor Trace format.  */
 
 static struct btrace_target_info *
@@ -1146,14 +921,6 @@  linux_btrace_conf (const struct btrace_target_info *tinfo)
 
 /* See linux-btrace.h.  */
 
-int
-linux_supports_btrace (struct target_ops *ops, enum btrace_format format)
-{
-  return 0;
-}
-
-/* See linux-btrace.h.  */
-
 struct btrace_target_info *
 linux_enable_btrace (ptid_t ptid, const struct btrace_config *conf)
 {
diff --git a/gdb/nat/linux-btrace.h b/gdb/nat/linux-btrace.h
index 31a8d9e..1180301 100644
--- a/gdb/nat/linux-btrace.h
+++ b/gdb/nat/linux-btrace.h
@@ -103,9 +103,6 @@  struct btrace_target_info
 #endif /* HAVE_LINUX_PERF_EVENT_H */
 };
 
-/* See to_supports_btrace in target.h.  */
-extern int linux_supports_btrace (struct target_ops *, enum btrace_format);
-
 /* See to_enable_btrace in target.h.  */
 extern struct btrace_target_info *
   linux_enable_btrace (ptid_t ptid, const struct btrace_config *conf);
diff --git a/gdb/remote.c b/gdb/remote.c
index 5ac84df..b12b690 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -13096,37 +13096,6 @@  remote_btrace_reset (void)
   memset (&rs->btrace_config, 0, sizeof (rs->btrace_config));
 }
 
-/* Check whether the target supports branch tracing.  */
-
-static int
-remote_supports_btrace (struct target_ops *self, enum btrace_format format)
-{
-  if (packet_support (PACKET_Qbtrace_off) != PACKET_ENABLE)
-    return 0;
-  if (packet_support (PACKET_qXfer_btrace) != PACKET_ENABLE)
-    return 0;
-
-  switch (format)
-    {
-      case BTRACE_FORMAT_NONE:
-	return 0;
-
-      case BTRACE_FORMAT_BTS:
-	return (packet_support (PACKET_Qbtrace_bts) == PACKET_ENABLE);
-
-      case BTRACE_FORMAT_PT:
-	/* The trace is decoded on the host.  Even if our target supports it,
-	   we still need to have libipt to decode the trace.  */
-#if defined (HAVE_LIBIPT)
-	return (packet_support (PACKET_Qbtrace_pt) == PACKET_ENABLE);
-#else /* !defined (HAVE_LIBIPT)  */
-	return 0;
-#endif /* !defined (HAVE_LIBIPT)  */
-    }
-
-  internal_error (__FILE__, __LINE__, _("Unknown branch trace format"));
-}
-
 /* Synchronize the configuration with the target.  */
 
 static void
@@ -13650,7 +13619,6 @@  Specify the serial device it is connected to\n\
   remote_ops.to_traceframe_info = remote_traceframe_info;
   remote_ops.to_use_agent = remote_use_agent;
   remote_ops.to_can_use_agent = remote_can_use_agent;
-  remote_ops.to_supports_btrace = remote_supports_btrace;
   remote_ops.to_enable_btrace = remote_enable_btrace;
   remote_ops.to_disable_btrace = remote_disable_btrace;
   remote_ops.to_teardown_btrace = remote_teardown_btrace;
diff --git a/gdb/target-delegates.c b/gdb/target-delegates.c
index bc84791..3d90c06 100644
--- a/gdb/target-delegates.c
+++ b/gdb/target-delegates.c
@@ -3438,35 +3438,6 @@  debug_can_use_agent (struct target_ops *self)
   return result;
 }
 
-static int
-delegate_supports_btrace (struct target_ops *self, enum btrace_format arg1)
-{
-  self = self->beneath;
-  return self->to_supports_btrace (self, arg1);
-}
-
-static int
-tdefault_supports_btrace (struct target_ops *self, enum btrace_format arg1)
-{
-  return 0;
-}
-
-static int
-debug_supports_btrace (struct target_ops *self, enum btrace_format arg1)
-{
-  int result;
-  fprintf_unfiltered (gdb_stdlog, "-> %s->to_supports_btrace (...)\n", debug_target.to_shortname);
-  result = debug_target.to_supports_btrace (&debug_target, arg1);
-  fprintf_unfiltered (gdb_stdlog, "<- %s->to_supports_btrace (", debug_target.to_shortname);
-  target_debug_print_struct_target_ops_p (&debug_target);
-  fputs_unfiltered (", ", gdb_stdlog);
-  target_debug_print_enum_btrace_format (arg1);
-  fputs_unfiltered (") = ", gdb_stdlog);
-  target_debug_print_int (result);
-  fputs_unfiltered ("\n", gdb_stdlog);
-  return result;
-}
-
 static struct btrace_target_info *
 delegate_enable_btrace (struct target_ops *self, ptid_t arg1, const struct btrace_config *arg2)
 {
@@ -4436,8 +4407,6 @@  install_delegators (struct target_ops *ops)
     ops->to_use_agent = delegate_use_agent;
   if (ops->to_can_use_agent == NULL)
     ops->to_can_use_agent = delegate_can_use_agent;
-  if (ops->to_supports_btrace == NULL)
-    ops->to_supports_btrace = delegate_supports_btrace;
   if (ops->to_enable_btrace == NULL)
     ops->to_enable_btrace = delegate_enable_btrace;
   if (ops->to_disable_btrace == NULL)
@@ -4624,7 +4593,6 @@  install_dummy_methods (struct target_ops *ops)
   ops->to_traceframe_info = tdefault_traceframe_info;
   ops->to_use_agent = tdefault_use_agent;
   ops->to_can_use_agent = tdefault_can_use_agent;
-  ops->to_supports_btrace = tdefault_supports_btrace;
   ops->to_enable_btrace = tdefault_enable_btrace;
   ops->to_disable_btrace = tdefault_disable_btrace;
   ops->to_teardown_btrace = tdefault_teardown_btrace;
@@ -4784,7 +4752,6 @@  init_debug_target (struct target_ops *ops)
   ops->to_traceframe_info = debug_traceframe_info;
   ops->to_use_agent = debug_use_agent;
   ops->to_can_use_agent = debug_can_use_agent;
-  ops->to_supports_btrace = debug_supports_btrace;
   ops->to_enable_btrace = debug_enable_btrace;
   ops->to_disable_btrace = debug_disable_btrace;
   ops->to_teardown_btrace = debug_teardown_btrace;
diff --git a/gdb/target.c b/gdb/target.c
index ce630f4..70d6842 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -3556,14 +3556,6 @@  target_ranged_break_num_registers (void)
 
 /* See target.h.  */
 
-int
-target_supports_btrace (enum btrace_format format)
-{
-  return current_target.to_supports_btrace (&current_target, format);
-}
-
-/* See target.h.  */
-
 struct btrace_target_info *
 target_enable_btrace (ptid_t ptid, const struct btrace_config *conf)
 {
diff --git a/gdb/target.h b/gdb/target.h
index 52361ba..1520e33 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -1108,10 +1108,6 @@  struct target_ops
     int (*to_can_use_agent) (struct target_ops *)
       TARGET_DEFAULT_RETURN (0);
 
-    /* Check whether the target supports branch tracing.  */
-    int (*to_supports_btrace) (struct target_ops *, enum btrace_format)
-      TARGET_DEFAULT_RETURN (0);
-
     /* Enable branch tracing for PTID using CONF configuration.
        Return a branch trace target information struct for reading and for
        disabling branch trace.  */
@@ -2424,9 +2420,6 @@  extern void update_target_permissions (void);
 
 /* Imported from machine dependent code.  */
 
-/* See to_supports_btrace in struct target_ops.  */
-extern int target_supports_btrace (enum btrace_format);
-
 /* See to_enable_btrace in struct target_ops.  */
 extern struct btrace_target_info *
   target_enable_btrace (ptid_t ptid, const struct btrace_config *);
diff --git a/gdb/x86-linux-nat.c b/gdb/x86-linux-nat.c
index 75f68de..a3bdaff 100644
--- a/gdb/x86-linux-nat.c
+++ b/gdb/x86-linux-nat.c
@@ -340,7 +340,6 @@  x86_linux_create_target (void)
   t->to_read_description = x86_linux_read_description;
 
   /* Add btrace methods.  */
-  t->to_supports_btrace = linux_supports_btrace;
   t->to_enable_btrace = x86_linux_enable_btrace;
   t->to_disable_btrace = x86_linux_disable_btrace;
   t->to_teardown_btrace = x86_linux_teardown_btrace;