Identify remote fork event support
[deliverable/binutils-gdb.git] / gdb / gdbserver / server.c
index 174ab398b0b4c15f283ca56c77b1e7311adc88fe..1544e99bdb3a9d79226ce8c00b41da151b47e34d 100644 (file)
@@ -57,6 +57,8 @@ static int exit_requested;
 int run_once;
 
 int multi_process;
+int report_fork_events;
+int report_vfork_events;
 int non_stop;
 int swbreak_feature;
 int hwbreak_feature;
@@ -2046,6 +2048,18 @@ handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
                  if (target_supports_stopped_by_hw_breakpoint ())
                    hwbreak_feature = 1;
                }
+             else if (strcmp (p, "fork-events+") == 0)
+               {
+                 /* GDB supports and wants fork events if possible.  */
+                 if (target_supports_fork_events ())
+                   report_fork_events = 1;
+               }
+             else if (strcmp (p, "vfork-events+") == 0)
+               {
+                 /* GDB supports and wants vfork events if possible.  */
+                 if (target_supports_vfork_events ())
+                   report_vfork_events = 1;
+               }
              else
                target_process_qsupported (p);
 
@@ -2096,6 +2110,12 @@ handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
       if (target_supports_multi_process ())
        strcat (own_buf, ";multiprocess+");
 
+      if (target_supports_fork_events ())
+       strcat (own_buf, ";fork-events+");
+
+      if (target_supports_vfork_events ())
+       strcat (own_buf, ";vfork-events+");
+
       if (target_supports_non_stop ())
        strcat (own_buf, ";QNonStop+");
 
@@ -3472,6 +3492,8 @@ captured_main (int argc, char *argv[])
 
       noack_mode = 0;
       multi_process = 0;
+      report_fork_events = 0;
+      report_vfork_events = 0;
       /* Be sure we're out of tfind mode.  */
       current_traceframe = -1;
       cont_thread = null_ptid;
This page took 0.034449 seconds and 4 git commands to generate.