summaryrefslogtreecommitdiff
path: root/gdb/target.c
diff options
context:
space:
mode:
authorPedro Alves <pedro@codesourcery.com>2012-03-07 19:25:36 +0000
committerPedro Alves <pedro@codesourcery.com>2012-03-07 19:25:36 +0000
commitb70a3d51d2fe74ebae8a741b05f5b251e5808eb6 (patch)
tree75ebb8acb59b57795e1e5ba90b8b35613953d3b4 /gdb/target.c
parent0f71212eb8ed33023680ea1c4948cc7af44e969a (diff)
downloadgdb-b70a3d51d2fe74ebae8a741b05f5b251e5808eb6.tar.gz
2012-03-07 Pedro Alves <palves@redhat.com>
gdb/doc/ * gdb.texinfo (General Query Packets): Document new QProgramSignals packet. * gdb.texinfo (Remote configuration): Mention "program-signals-packet". gdb/gdbserver/ * linux-low.c (get_detach_signal): New. (linux_detach_one_lwp): Get rid of a pending SIGSTOP with SIGCONT. Pass on pending signals to PTRACE_DETACH. Check the result of the ptrace call. * server.c (program_signals, program_signals_p): New. (handle_general_set): Handle QProgramSignals. * server.h (program_signals, program_signals_p): Declare. gdb/ * NEWS: Mention QProgramSignals. * inferior.h (update_signals_program_target): Declare. * infrun.c: (update_signals_program_target): New. (handle_command): Update the target of the new program signals array changes. * remote.c (PACKET_QProgramSignals): New enum. (last_program_signals_packet): New global. (remote_program_signals): New. (remote_start_remote): Update the target with the program signals list. (remote_protocol_features): Add entry for QPassSignals. (remote_open_1): Free anc clear last_program_signals_packet. (init_remote_ops): Install remote_program_signals. * target.c (update_current_target): Adjust. (target_program_signals): New. * target.h (struct target_ops) <to_program_signals>: New field. (target_program_signals): Declare.
Diffstat (limited to 'gdb/target.c')
-rw-r--r--gdb/target.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/gdb/target.c b/gdb/target.c
index 88703ea6e5d..cffea2cefc7 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -639,6 +639,7 @@ update_current_target (void)
/* Do not inherit to_mourn_inferior. */
INHERIT (to_can_run, t);
/* Do not inherit to_pass_signals. */
+ /* Do not inherit to_program_signals. */
/* Do not inherit to_thread_alive. */
/* Do not inherit to_find_new_threads. */
/* Do not inherit to_pid_to_str. */
@@ -2728,6 +2729,36 @@ target_pass_signals (int numsigs, unsigned char *pass_signals)
}
}
+void
+target_program_signals (int numsigs, unsigned char *program_signals)
+{
+ struct target_ops *t;
+
+ for (t = current_target.beneath; t != NULL; t = t->beneath)
+ {
+ if (t->to_program_signals != NULL)
+ {
+ if (targetdebug)
+ {
+ int i;
+
+ fprintf_unfiltered (gdb_stdlog, "target_program_signals (%d, {",
+ numsigs);
+
+ for (i = 0; i < numsigs; i++)
+ if (program_signals[i])
+ fprintf_unfiltered (gdb_stdlog, " %s",
+ target_signal_to_name (i));
+
+ fprintf_unfiltered (gdb_stdlog, " })\n");
+ }
+
+ (*t->to_program_signals) (numsigs, program_signals);
+ return;
+ }
+ }
+}
+
/* Look through the list of possible targets for a target that can
follow forks. */