| OLD | NEW |
| 1 /* Target-dependent code for GDB, the GNU debugger. | 1 /* Target-dependent code for GDB, the GNU debugger. |
| 2 | 2 |
| 3 Copyright (C) 2001-2012 Free Software Foundation, Inc. | 3 Copyright (C) 2001-2012 Free Software Foundation, Inc. |
| 4 | 4 |
| 5 Contributed by D.J. Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com) | 5 Contributed by D.J. Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com) |
| 6 for IBM Deutschland Entwicklung GmbH, IBM Corporation. | 6 for IBM Deutschland Entwicklung GmbH, IBM Corporation. |
| 7 | 7 |
| 8 This file is part of GDB. | 8 This file is part of GDB. |
| 9 | 9 |
| 10 This program is free software; you can redistribute it and/or modify | 10 This program is free software; you can redistribute it and/or modify |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 #include "reggroups.h" | 38 #include "reggroups.h" |
| 39 #include "regset.h" | 39 #include "regset.h" |
| 40 #include "value.h" | 40 #include "value.h" |
| 41 #include "gdb_assert.h" | 41 #include "gdb_assert.h" |
| 42 #include "dis-asm.h" | 42 #include "dis-asm.h" |
| 43 #include "solib-svr4.h" | 43 #include "solib-svr4.h" |
| 44 #include "prologue-value.h" | 44 #include "prologue-value.h" |
| 45 #include "linux-tdep.h" | 45 #include "linux-tdep.h" |
| 46 #include "s390-tdep.h" | 46 #include "s390-tdep.h" |
| 47 | 47 |
| 48 #include "stap-probe.h" |
| 49 #include "ax.h" |
| 50 #include "ax-gdb.h" |
| 51 #include "user-regs.h" |
| 52 #include "cli/cli-utils.h" |
| 53 #include <ctype.h> |
| 54 |
| 48 #include "features/s390-linux32.c" | 55 #include "features/s390-linux32.c" |
| 49 #include "features/s390-linux32v1.c" | 56 #include "features/s390-linux32v1.c" |
| 50 #include "features/s390-linux32v2.c" | 57 #include "features/s390-linux32v2.c" |
| 51 #include "features/s390-linux64.c" | 58 #include "features/s390-linux64.c" |
| 52 #include "features/s390-linux64v1.c" | 59 #include "features/s390-linux64v1.c" |
| 53 #include "features/s390-linux64v2.c" | 60 #include "features/s390-linux64v2.c" |
| 54 #include "features/s390x-linux64.c" | 61 #include "features/s390x-linux64.c" |
| 55 #include "features/s390x-linux64v1.c" | 62 #include "features/s390x-linux64v1.c" |
| 56 #include "features/s390x-linux64v2.c" | 63 #include "features/s390x-linux64v2.c" |
| 57 | 64 |
| 58 | |
| 59 /* The tdep structure. */ | 65 /* The tdep structure. */ |
| 60 | 66 |
| 61 struct gdbarch_tdep | 67 struct gdbarch_tdep |
| 62 { | 68 { |
| 63 /* ABI version. */ | 69 /* ABI version. */ |
| 64 enum { ABI_LINUX_S390, ABI_LINUX_ZSERIES } abi; | 70 enum { ABI_LINUX_S390, ABI_LINUX_ZSERIES } abi; |
| 65 | 71 |
| 66 /* Pseudo register numbers. */ | 72 /* Pseudo register numbers. */ |
| 67 int gpr_full_regnum; | 73 int gpr_full_regnum; |
| 68 int pc_regnum; | 74 int pc_regnum; |
| (...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1153 stores. Thus every store we cannot recognize does not hit our data. */ | 1159 stores. Thus every store we cannot recognize does not hit our data. */ |
| 1154 } | 1160 } |
| 1155 | 1161 |
| 1156 /* Do a SIZE-byte load from D2(X2,B2). */ | 1162 /* Do a SIZE-byte load from D2(X2,B2). */ |
| 1157 static pv_t | 1163 static pv_t |
| 1158 s390_load (struct s390_prologue_data *data, | 1164 s390_load (struct s390_prologue_data *data, |
| 1159 int d2, unsigned int x2, unsigned int b2, CORE_ADDR size) | 1165 int d2, unsigned int x2, unsigned int b2, CORE_ADDR size) |
| 1160 | 1166 |
| 1161 { | 1167 { |
| 1162 pv_t addr = s390_addr (data, d2, x2, b2); | 1168 pv_t addr = s390_addr (data, d2, x2, b2); |
| 1163 pv_t offset; | |
| 1164 | 1169 |
| 1165 /* If it's a load from an in-line constant pool, then we can | 1170 /* If it's a load from an in-line constant pool, then we can |
| 1166 simulate that, under the assumption that the code isn't | 1171 simulate that, under the assumption that the code isn't |
| 1167 going to change between the time the processor actually | 1172 going to change between the time the processor actually |
| 1168 executed it creating the current frame, and the time when | 1173 executed it creating the current frame, and the time when |
| 1169 we're analyzing the code to unwind past that frame. */ | 1174 we're analyzing the code to unwind past that frame. */ |
| 1170 if (pv_is_constant (addr)) | 1175 if (pv_is_constant (addr)) |
| 1171 { | 1176 { |
| 1172 struct target_section *secp; | 1177 struct target_section *secp; |
| 1173 secp = target_section_by_addr (¤t_target, addr.k); | 1178 secp = target_section_by_addr (¤t_target, addr.k); |
| (...skipping 1631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2805 case TYPE_CODE_ARRAY: | 2810 case TYPE_CODE_ARRAY: |
| 2806 case TYPE_CODE_COMPLEX: | 2811 case TYPE_CODE_COMPLEX: |
| 2807 return RETURN_VALUE_STRUCT_CONVENTION; | 2812 return RETURN_VALUE_STRUCT_CONVENTION; |
| 2808 | 2813 |
| 2809 default: | 2814 default: |
| 2810 return RETURN_VALUE_REGISTER_CONVENTION; | 2815 return RETURN_VALUE_REGISTER_CONVENTION; |
| 2811 } | 2816 } |
| 2812 } | 2817 } |
| 2813 | 2818 |
| 2814 static enum return_value_convention | 2819 static enum return_value_convention |
| 2815 s390_return_value (struct gdbarch *gdbarch, struct type *func_type, | 2820 s390_return_value (struct gdbarch *gdbarch, struct value *function, |
| 2816 struct type *type, struct regcache *regcache, | 2821 struct type *type, struct regcache *regcache, |
| 2817 gdb_byte *out, const gdb_byte *in) | 2822 gdb_byte *out, const gdb_byte *in) |
| 2818 { | 2823 { |
| 2819 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); | 2824 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); |
| 2820 int word_size = gdbarch_ptr_bit (gdbarch) / 8; | 2825 int word_size = gdbarch_ptr_bit (gdbarch) / 8; |
| 2821 enum return_value_convention rvc; | 2826 enum return_value_convention rvc; |
| 2822 int length; | 2827 int length; |
| 2823 | 2828 |
| 2824 type = check_typedef (type); | 2829 type = check_typedef (type); |
| 2825 rvc = s390_return_value_convention (gdbarch, type); | 2830 rvc = s390_return_value_convention (gdbarch, type); |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2946 { | 2951 { |
| 2947 if (strcmp (name, "mode32") == 0) | 2952 if (strcmp (name, "mode32") == 0) |
| 2948 { | 2953 { |
| 2949 *type_flags_ptr = TYPE_INSTANCE_FLAG_ADDRESS_CLASS_1; | 2954 *type_flags_ptr = TYPE_INSTANCE_FLAG_ADDRESS_CLASS_1; |
| 2950 return 1; | 2955 return 1; |
| 2951 } | 2956 } |
| 2952 else | 2957 else |
| 2953 return 0; | 2958 return 0; |
| 2954 } | 2959 } |
| 2955 | 2960 |
| 2961 /* Implementation of `gdbarch_stap_is_single_operand', as defined in |
| 2962 gdbarch.h. */ |
| 2963 |
| 2964 static int |
| 2965 s390_stap_is_single_operand (struct gdbarch *gdbarch, const char *s) |
| 2966 { |
| 2967 return ((isdigit (*s) && s[1] == '(' && s[2] == '%') /* Displacement |
| 2968 or indirection. */ |
| 2969 || *s == '%' /* Register access. */ |
| 2970 || isdigit (*s)); /* Literal number. */ |
| 2971 } |
| 2972 |
| 2956 /* Set up gdbarch struct. */ | 2973 /* Set up gdbarch struct. */ |
| 2957 | 2974 |
| 2958 static struct gdbarch * | 2975 static struct gdbarch * |
| 2959 s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) | 2976 s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) |
| 2960 { | 2977 { |
| 2961 const struct target_desc *tdesc = info.target_desc; | 2978 const struct target_desc *tdesc = info.target_desc; |
| 2962 struct tdesc_arch_data *tdesc_data = NULL; | 2979 struct tdesc_arch_data *tdesc_data = NULL; |
| 2963 struct gdbarch *gdbarch; | 2980 struct gdbarch *gdbarch; |
| 2964 struct gdbarch_tdep *tdep; | 2981 struct gdbarch_tdep *tdep; |
| 2965 int tdep_abi; | 2982 int tdep_abi; |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3276 set_gdbarch_print_insn (gdbarch, print_insn_s390); | 3293 set_gdbarch_print_insn (gdbarch, print_insn_s390); |
| 3277 | 3294 |
| 3278 set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target); | 3295 set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target); |
| 3279 | 3296 |
| 3280 /* Enable TLS support. */ | 3297 /* Enable TLS support. */ |
| 3281 set_gdbarch_fetch_tls_load_module_address (gdbarch, | 3298 set_gdbarch_fetch_tls_load_module_address (gdbarch, |
| 3282 svr4_fetch_objfile_link_map); | 3299 svr4_fetch_objfile_link_map); |
| 3283 | 3300 |
| 3284 set_gdbarch_get_siginfo_type (gdbarch, linux_get_siginfo_type); | 3301 set_gdbarch_get_siginfo_type (gdbarch, linux_get_siginfo_type); |
| 3285 | 3302 |
| 3303 /* SystemTap functions. */ |
| 3304 set_gdbarch_stap_register_prefix (gdbarch, "%"); |
| 3305 set_gdbarch_stap_register_indirection_prefix (gdbarch, "("); |
| 3306 set_gdbarch_stap_register_indirection_suffix (gdbarch, ")"); |
| 3307 set_gdbarch_stap_is_single_operand (gdbarch, s390_stap_is_single_operand); |
| 3308 |
| 3286 return gdbarch; | 3309 return gdbarch; |
| 3287 } | 3310 } |
| 3288 | 3311 |
| 3289 | 3312 |
| 3290 extern initialize_file_ftype _initialize_s390_tdep; /* -Wmissing-prototypes */ | 3313 extern initialize_file_ftype _initialize_s390_tdep; /* -Wmissing-prototypes */ |
| 3291 | 3314 |
| 3292 void | 3315 void |
| 3293 _initialize_s390_tdep (void) | 3316 _initialize_s390_tdep (void) |
| 3294 { | 3317 { |
| 3295 /* Hook us into the gdbarch mechanism. */ | 3318 /* Hook us into the gdbarch mechanism. */ |
| 3296 register_gdbarch_init (bfd_arch_s390, s390_gdbarch_init); | 3319 register_gdbarch_init (bfd_arch_s390, s390_gdbarch_init); |
| 3297 | 3320 |
| 3298 /* Initialize the GNU/Linux target descriptions. */ | 3321 /* Initialize the GNU/Linux target descriptions. */ |
| 3299 initialize_tdesc_s390_linux32 (); | 3322 initialize_tdesc_s390_linux32 (); |
| 3300 initialize_tdesc_s390_linux32v1 (); | 3323 initialize_tdesc_s390_linux32v1 (); |
| 3301 initialize_tdesc_s390_linux32v2 (); | 3324 initialize_tdesc_s390_linux32v2 (); |
| 3302 initialize_tdesc_s390_linux64 (); | 3325 initialize_tdesc_s390_linux64 (); |
| 3303 initialize_tdesc_s390_linux64v1 (); | 3326 initialize_tdesc_s390_linux64v1 (); |
| 3304 initialize_tdesc_s390_linux64v2 (); | 3327 initialize_tdesc_s390_linux64v2 (); |
| 3305 initialize_tdesc_s390x_linux64 (); | 3328 initialize_tdesc_s390x_linux64 (); |
| 3306 initialize_tdesc_s390x_linux64v1 (); | 3329 initialize_tdesc_s390x_linux64v1 (); |
| 3307 initialize_tdesc_s390x_linux64v2 (); | 3330 initialize_tdesc_s390x_linux64v2 (); |
| 3308 } | 3331 } |
| OLD | NEW |