X-Git-Url: http://drtracing.org/?a=blobdiff_plain;ds=sidebyside;f=gdb%2Ftarget.c;h=a9744c4f67dc4334cb68a69d06897478ac6f4bc5;hb=f3abeff575541dd80e1facd6d0f920e10f77fede;hp=0ae6708f81ff9b43aea8f73f0eee6fe743f07166;hpb=915ef8b18e28e6418216a582067b9fbdd6395e6a;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/target.c b/gdb/target.c index 0ae6708f81..a9744c4f67 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -1,6 +1,6 @@ /* Select target systems and architectures at runtime for GDB. - Copyright (C) 1990-2015 Free Software Foundation, Inc. + Copyright (C) 1990-2016 Free Software Foundation, Inc. Contributed by Cygnus Support. @@ -466,6 +466,14 @@ target_terminal_is_inferior (void) /* See target.h. */ +int +target_terminal_is_ours (void) +{ + return (terminal_state == terminal_is_ours); +} + +/* See target.h. */ + void target_terminal_inferior (void) { @@ -483,6 +491,11 @@ target_terminal_inferior (void) inferior's terminal modes. */ (*current_target.to_terminal_inferior) (¤t_target); terminal_state = terminal_is_inferior; + + /* If the user hit C-c before, pretend that it was hit right + here. */ + if (check_quit_flag ()) + target_pass_ctrlc (); } /* See target.h. */ @@ -1836,8 +1849,9 @@ read_memory_robust (struct target_ops *ops, /* Got an error reading full chunk. See if maybe we can read some subrange. */ xfree (buffer); - read_whatever_is_readable (ops, offset + xfered_total, unit_size, - offset + xfered_total + to_read, &result); + read_whatever_is_readable (ops, offset + xfered_total, + offset + xfered_total + to_read, + unit_size, &result); xfered_total += to_read; } else @@ -2156,6 +2170,8 @@ target_pre_inferior (int from_tty) the inferior was attached to. */ current_inferior ()->attach_flag = 0; + current_inferior ()->highest_thread_num = 0; + agent_capability_invalidate (); } @@ -2264,7 +2280,7 @@ target_pid_to_str (ptid_t ptid) return (*current_target.to_pid_to_str) (¤t_target, ptid); } -char * +const char * target_thread_name (struct thread_info *info) { return current_target.to_thread_name (¤t_target, info); @@ -3349,9 +3365,17 @@ target_interrupt (ptid_t ptid) /* See target.h. */ void -target_check_pending_interrupt (void) +target_pass_ctrlc (void) +{ + (*current_target.to_pass_ctrlc) (¤t_target); +} + +/* See target.h. */ + +void +default_target_pass_ctrlc (struct target_ops *ops) { - (*current_target.to_check_pending_interrupt) (¤t_target); + target_interrupt (inferior_ptid); } /* See target/target.h. */ @@ -3849,6 +3873,14 @@ target_async (int enable) current_target.to_async (¤t_target, enable); } +/* See target.h. */ + +void +target_thread_events (int enable) +{ + current_target.to_thread_events (¤t_target, enable); +} + /* Controls if targets can report that they can/are async. This is just for maintainers to use when debugging gdb. */ int target_async_permitted = 1;