]>
Commit | Line | Data |
---|---|---|
51a5ef0f PS |
1 | http://sourceware.org/ml/gdb-patches/2010-08/msg00559.html |
2 | http://sourceware.org/ml/gdb-cvs/2010-08/msg00199.html | |
3 | ||
4 | ### src/gdb/ChangeLog 2010/08/31 18:08:42 1.12129 | |
5 | ### src/gdb/ChangeLog 2010/08/31 18:11:48 1.12130 | |
6 | ## -1,5 +1,14 @@ | |
7 | 2010-08-31 Jan Kratochvil <jan.kratochvil@redhat.com> | |
8 | ||
9 | + Make linux_get_siginfo_type `type *' unique. | |
10 | + * linux-tdep.c (linux_gdbarch_data_handle, struct linux_gdbarch_data) | |
11 | + (init_linux_gdbarch_data, get_linux_gdbarch_data): New. | |
12 | + (linux_get_siginfo_type): New variable linux_gdbarch_data. Initialize | |
13 | + it. Use linux_gdbarch_data->siginfo_type as a persistent storage. | |
14 | + (_initialize_linux_tdep): New. | |
15 | + | |
16 | +2010-08-31 Jan Kratochvil <jan.kratochvil@redhat.com> | |
17 | + | |
18 | Code cleanup. | |
19 | * defs.h (find_memory_region_ftype): New typedef. | |
20 | (exec_set_find_memory_regions): Use it. | |
21 | Index: gdb-7.2/gdb/linux-tdep.c | |
22 | =================================================================== | |
23 | --- gdb-7.2.orig/gdb/linux-tdep.c 2010-09-25 15:30:50.000000000 +0200 | |
24 | +++ gdb-7.2/gdb/linux-tdep.c 2010-09-25 15:31:54.000000000 +0200 | |
25 | @@ -26,18 +26,42 @@ | |
26 | #include "value.h" | |
27 | #include "infcall.h" | |
28 | ||
29 | +static struct gdbarch_data *linux_gdbarch_data_handle; | |
30 | + | |
31 | +struct linux_gdbarch_data | |
32 | + { | |
33 | + struct type *siginfo_type; | |
34 | + }; | |
35 | + | |
36 | +static void * | |
37 | +init_linux_gdbarch_data (struct gdbarch *gdbarch) | |
38 | +{ | |
39 | + return GDBARCH_OBSTACK_ZALLOC (gdbarch, struct linux_gdbarch_data); | |
40 | +} | |
41 | + | |
42 | +static struct linux_gdbarch_data * | |
43 | +get_linux_gdbarch_data (struct gdbarch *gdbarch) | |
44 | +{ | |
45 | + return gdbarch_data (gdbarch, linux_gdbarch_data_handle); | |
46 | +} | |
47 | + | |
48 | /* This function is suitable for architectures that don't | |
49 | extend/override the standard siginfo structure. */ | |
50 | ||
51 | struct type * | |
52 | linux_get_siginfo_type (struct gdbarch *gdbarch) | |
53 | { | |
54 | + struct linux_gdbarch_data *linux_gdbarch_data; | |
55 | struct type *int_type, *uint_type, *long_type, *void_ptr_type; | |
56 | struct type *uid_type, *pid_type; | |
57 | struct type *sigval_type, *clock_type; | |
58 | struct type *siginfo_type, *sifields_type; | |
59 | struct type *type; | |
60 | ||
61 | + linux_gdbarch_data = get_linux_gdbarch_data (gdbarch); | |
62 | + if (linux_gdbarch_data->siginfo_type != NULL) | |
63 | + return linux_gdbarch_data->siginfo_type; | |
64 | + | |
65 | int_type = arch_integer_type (gdbarch, gdbarch_int_bit (gdbarch), | |
66 | 0, "int"); | |
67 | uint_type = arch_integer_type (gdbarch, gdbarch_int_bit (gdbarch), | |
68 | @@ -137,6 +161,8 @@ linux_get_siginfo_type (struct gdbarch * | |
69 | "_sifields", sifields_type, | |
70 | TYPE_LENGTH (long_type)); | |
71 | ||
72 | + linux_gdbarch_data->siginfo_type = siginfo_type; | |
73 | + | |
74 | return siginfo_type; | |
75 | } | |
76 | ||
77 | @@ -154,3 +180,10 @@ linux_has_shared_address_space (void) | |
78 | ||
79 | return target_is_uclinux; | |
80 | } | |
81 | + | |
82 | +void | |
83 | +_initialize_linux_tdep (void) | |
84 | +{ | |
85 | + linux_gdbarch_data_handle = | |
86 | + gdbarch_data_register_post_init (init_linux_gdbarch_data); | |
87 | +} |