OLD | NEW |
1 /* Functions specific to running gdb native on IA-64 running | 1 /* Functions specific to running gdb native on IA-64 running |
2 GNU/Linux. | 2 GNU/Linux. |
3 | 3 |
4 Copyright (C) 1999-2012 Free Software Foundation, Inc. | 4 Copyright (C) 1999-2013 Free Software Foundation, Inc. |
5 | 5 |
6 This file is part of GDB. | 6 This file is part of GDB. |
7 | 7 |
8 This program is free software; you can redistribute it and/or modify | 8 This program is free software; you can redistribute it and/or modify |
9 it under the terms of the GNU General Public License as published by | 9 it under the terms of the GNU General Public License as published by |
10 the Free Software Foundation; either version 3 of the License, or | 10 the Free Software Foundation; either version 3 of the License, or |
11 (at your option) any later version. | 11 (at your option) any later version. |
12 | 12 |
13 This program is distributed in the hope that it will be useful, | 13 This program is distributed in the hope that it will be useful, |
14 but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 GNU General Public License for more details. | 16 GNU General Public License for more details. |
17 | 17 |
18 You should have received a copy of the GNU General Public License | 18 You should have received a copy of the GNU General Public License |
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */ | 19 along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
20 | 20 |
21 #include "defs.h" | 21 #include "defs.h" |
22 #include "gdb_string.h" | 22 #include <string.h> |
23 #include "inferior.h" | 23 #include "inferior.h" |
24 #include "target.h" | 24 #include "target.h" |
25 #include "gdbcore.h" | 25 #include "gdbcore.h" |
26 #include "regcache.h" | 26 #include "regcache.h" |
27 #include "ia64-tdep.h" | 27 #include "ia64-tdep.h" |
28 #include "linux-nat.h" | 28 #include "linux-nat.h" |
29 | 29 |
30 #include <signal.h> | 30 #include <signal.h> |
31 #include <sys/ptrace.h> | 31 #include <sys/ptrace.h> |
32 #include "gdb_wait.h" | 32 #include "gdb_wait.h" |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 } | 504 } |
505 } | 505 } |
506 | 506 |
507 static long debug_registers[8]; | 507 static long debug_registers[8]; |
508 | 508 |
509 static void | 509 static void |
510 store_debug_register (ptid_t ptid, int idx, long val) | 510 store_debug_register (ptid_t ptid, int idx, long val) |
511 { | 511 { |
512 int tid; | 512 int tid; |
513 | 513 |
514 tid = TIDGET (ptid); | 514 tid = ptid_get_lwp (ptid); |
515 if (tid == 0) | 515 if (tid == 0) |
516 tid = PIDGET (ptid); | 516 tid = ptid_get_pid (ptid); |
517 | 517 |
518 (void) ptrace (PT_WRITE_U, tid, (PTRACE_TYPE_ARG3) (PT_DBR + 8 * idx), val); | 518 (void) ptrace (PT_WRITE_U, tid, (PTRACE_TYPE_ARG3) (PT_DBR + 8 * idx), val); |
519 } | 519 } |
520 | 520 |
521 static void | 521 static void |
522 store_debug_register_pair (ptid_t ptid, int idx, long *dbr_addr, | 522 store_debug_register_pair (ptid_t ptid, int idx, long *dbr_addr, |
523 long *dbr_mask) | 523 long *dbr_mask) |
524 { | 524 { |
525 if (dbr_addr) | 525 if (dbr_addr) |
526 store_debug_register (ptid, 2 * idx, *dbr_addr); | 526 store_debug_register (ptid, 2 * idx, *dbr_addr); |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
897 t->to_stopped_by_watchpoint = ia64_linux_stopped_by_watchpoint; | 897 t->to_stopped_by_watchpoint = ia64_linux_stopped_by_watchpoint; |
898 t->to_stopped_data_address = ia64_linux_stopped_data_address; | 898 t->to_stopped_data_address = ia64_linux_stopped_data_address; |
899 t->to_insert_watchpoint = ia64_linux_insert_watchpoint; | 899 t->to_insert_watchpoint = ia64_linux_insert_watchpoint; |
900 t->to_remove_watchpoint = ia64_linux_remove_watchpoint; | 900 t->to_remove_watchpoint = ia64_linux_remove_watchpoint; |
901 | 901 |
902 /* Register the target. */ | 902 /* Register the target. */ |
903 linux_nat_add_target (t); | 903 linux_nat_add_target (t); |
904 linux_nat_set_new_thread (t, ia64_linux_new_thread); | 904 linux_nat_set_new_thread (t, ia64_linux_new_thread); |
905 linux_nat_set_status_is_event (t, ia64_linux_status_is_event); | 905 linux_nat_set_status_is_event (t, ia64_linux_status_is_event); |
906 } | 906 } |
OLD | NEW |