| OLD | NEW |
| 1 /* Target-dependent code for Solaris x86. | 1 /* Target-dependent code for Solaris x86. |
| 2 | 2 |
| 3 Copyright (C) 2002-2004, 2006-2012 Free Software Foundation, Inc. | 3 Copyright (C) 2002-2004, 2006-2012 Free Software Foundation, Inc. |
| 4 | 4 |
| 5 This file is part of GDB. | 5 This file is part of GDB. |
| 6 | 6 |
| 7 This program is free software; you can redistribute it and/or modify | 7 This program is free software; you can redistribute it and/or modify |
| 8 it under the terms of the GNU General Public License as published by | 8 it under the terms of the GNU General Public License as published by |
| 9 the Free Software Foundation; either version 3 of the License, or | 9 the Free Software Foundation; either version 3 of the License, or |
| 10 (at your option) any later version. | 10 (at your option) any later version. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 0 * 4 /* %gs */ | 48 0 * 4 /* %gs */ |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 /* Return whether THIS_FRAME corresponds to a Solaris sigtramp | 51 /* Return whether THIS_FRAME corresponds to a Solaris sigtramp |
| 52 routine. */ | 52 routine. */ |
| 53 | 53 |
| 54 static int | 54 static int |
| 55 i386_sol2_sigtramp_p (struct frame_info *this_frame) | 55 i386_sol2_sigtramp_p (struct frame_info *this_frame) |
| 56 { | 56 { |
| 57 CORE_ADDR pc = get_frame_pc (this_frame); | 57 CORE_ADDR pc = get_frame_pc (this_frame); |
| 58 char *name; | 58 const char *name; |
| 59 | 59 |
| 60 find_pc_partial_function (pc, &name, NULL, NULL); | 60 find_pc_partial_function (pc, &name, NULL, NULL); |
| 61 return (name && (strcmp ("sigacthandler", name) == 0 | 61 return (name && (strcmp ("sigacthandler", name) == 0 |
| 62 || strcmp (name, "ucbsigvechandler") == 0)); | 62 || strcmp (name, "ucbsigvechandler") == 0)); |
| 63 } | 63 } |
| 64 | 64 |
| 65 /* Solaris doesn't have a `struct sigcontext', but it does have a | 65 /* Solaris doesn't have a `struct sigcontext', but it does have a |
| 66 `mcontext_t' that contains the saved set of machine registers. */ | 66 `mcontext_t' that contains the saved set of machine registers. */ |
| 67 | 67 |
| 68 static CORE_ADDR | 68 static CORE_ADDR |
| 69 i386_sol2_mcontext_addr (struct frame_info *this_frame) | 69 i386_sol2_mcontext_addr (struct frame_info *this_frame) |
| 70 { | 70 { |
| 71 CORE_ADDR sp, ucontext_addr; | 71 CORE_ADDR sp, ucontext_addr; |
| 72 | 72 |
| 73 sp = get_frame_register_unsigned (this_frame, I386_ESP_REGNUM); | 73 sp = get_frame_register_unsigned (this_frame, I386_ESP_REGNUM); |
| 74 ucontext_addr = get_frame_memory_unsigned (this_frame, sp + 8, 4); | 74 ucontext_addr = get_frame_memory_unsigned (this_frame, sp + 8, 4); |
| 75 | 75 |
| 76 return ucontext_addr + 36; | 76 return ucontext_addr + 36; |
| 77 } | 77 } |
| 78 | 78 |
| 79 /* SunPRO encodes the static variables. This is not related to C++ | 79 /* SunPRO encodes the static variables. This is not related to C++ |
| 80 mangling, it is done for C too. */ | 80 mangling, it is done for C too. */ |
| 81 | 81 |
| 82 static char * | 82 static const char * |
| 83 i386_sol2_static_transform_name (char *name) | 83 i386_sol2_static_transform_name (const char *name) |
| 84 { | 84 { |
| 85 char *p; | 85 char *p; |
| 86 if (name[0] == '.') | 86 if (name[0] == '.') |
| 87 { | 87 { |
| 88 /* For file-local statics there will be a period, a bunch of | 88 /* For file-local statics there will be a period, a bunch of |
| 89 junk (the contents of which match a string given in the | 89 junk (the contents of which match a string given in the |
| 90 N_OPT), a period and the name. For function-local statics | 90 N_OPT), a period and the name. For function-local statics |
| 91 there will be a bunch of junk (which seems to change the | 91 there will be a bunch of junk (which seems to change the |
| 92 second character from 'A' to 'B'), a period, the name of the | 92 second character from 'A' to 'B'), a period, the name of the |
| 93 function, and the name. So just skip everything before the | 93 function, and the name. So just skip everything before the |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 void | 158 void |
| 159 _initialize_i386_sol2_tdep (void) | 159 _initialize_i386_sol2_tdep (void) |
| 160 { | 160 { |
| 161 /* Register an ELF OS ABI sniffer for Solaris 2 binaries. */ | 161 /* Register an ELF OS ABI sniffer for Solaris 2 binaries. */ |
| 162 gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_elf_flavour, | 162 gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_elf_flavour, |
| 163 i386_sol2_osabi_sniffer); | 163 i386_sol2_osabi_sniffer); |
| 164 | 164 |
| 165 gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_SOLARIS, | 165 gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_SOLARIS, |
| 166 i386_sol2_init_abi); | 166 i386_sol2_init_abi); |
| 167 } | 167 } |
| OLD | NEW |