OLD | NEW |
1 /* Darwin support for GDB, the GNU debugger. | 1 /* Darwin support for GDB, the GNU debugger. |
2 Copyright 1997-2002, 2005, 2008-2012 Free Software Foundation, Inc. | 2 Copyright 1997-2002, 2005, 2008-2012 Free Software Foundation, Inc. |
3 | 3 |
4 Contributed by Apple Computer, Inc. | 4 Contributed by Apple Computer, 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 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 | 77 |
78 /* Assuming THIS_FRAME is a Darwin sigtramp routine, return the | 78 /* Assuming THIS_FRAME is a Darwin sigtramp routine, return the |
79 address of the associated sigcontext structure. */ | 79 address of the associated sigcontext structure. */ |
80 | 80 |
81 static CORE_ADDR | 81 static CORE_ADDR |
82 amd64_darwin_sigcontext_addr (struct frame_info *this_frame) | 82 amd64_darwin_sigcontext_addr (struct frame_info *this_frame) |
83 { | 83 { |
84 struct gdbarch *gdbarch = get_frame_arch (this_frame); | 84 struct gdbarch *gdbarch = get_frame_arch (this_frame); |
85 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); | 85 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); |
86 CORE_ADDR rbx; | 86 CORE_ADDR rbx; |
87 CORE_ADDR si; | |
88 gdb_byte buf[8]; | 87 gdb_byte buf[8]; |
89 | 88 |
90 /* A pointer to the ucontext is passed as the fourth argument | 89 /* A pointer to the ucontext is passed as the fourth argument |
91 to the signal handler, which is saved in rbx. */ | 90 to the signal handler, which is saved in rbx. */ |
92 get_frame_register (this_frame, AMD64_RBX_REGNUM, buf); | 91 get_frame_register (this_frame, AMD64_RBX_REGNUM, buf); |
93 rbx = extract_unsigned_integer (buf, 8, byte_order); | 92 rbx = extract_unsigned_integer (buf, 8, byte_order); |
94 | 93 |
95 /* The pointer to mcontext is at offset 48. */ | 94 /* The pointer to mcontext is at offset 48. */ |
96 read_memory (rbx + 48, buf, 8); | 95 read_memory (rbx + 48, buf, 8); |
97 | 96 |
(...skipping 10 matching lines...) Expand all Loading... |
108 | 107 |
109 tdep->struct_return = reg_struct_return; | 108 tdep->struct_return = reg_struct_return; |
110 | 109 |
111 dwarf2_frame_set_signal_frame_p (gdbarch, darwin_dwarf_signal_frame_p); | 110 dwarf2_frame_set_signal_frame_p (gdbarch, darwin_dwarf_signal_frame_p); |
112 | 111 |
113 tdep->sigtramp_p = i386_sigtramp_p; | 112 tdep->sigtramp_p = i386_sigtramp_p; |
114 tdep->sigcontext_addr = amd64_darwin_sigcontext_addr; | 113 tdep->sigcontext_addr = amd64_darwin_sigcontext_addr; |
115 tdep->sc_reg_offset = amd64_darwin_thread_state_reg_offset; | 114 tdep->sc_reg_offset = amd64_darwin_thread_state_reg_offset; |
116 tdep->sc_num_regs = amd64_darwin_thread_state_num_regs; | 115 tdep->sc_num_regs = amd64_darwin_thread_state_num_regs; |
117 | 116 |
118 tdep->jb_pc_offset = 148; | 117 tdep->jb_pc_offset = 56; |
119 | 118 |
120 set_solib_ops (gdbarch, &darwin_so_ops); | 119 set_solib_ops (gdbarch, &darwin_so_ops); |
121 } | 120 } |
122 | 121 |
| 122 /* -Wmissing-prototypes */ |
| 123 extern initialize_file_ftype _initialize_amd64_darwin_tdep; |
| 124 |
123 void | 125 void |
124 _initialize_amd64_darwin_tdep (void) | 126 _initialize_amd64_darwin_tdep (void) |
125 { | 127 { |
126 gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64, | 128 gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64, |
127 GDB_OSABI_DARWIN, x86_darwin_init_abi_64); | 129 GDB_OSABI_DARWIN, x86_darwin_init_abi_64); |
128 } | 130 } |
OLD | NEW |