diff options
Diffstat (limited to 'meta-microblaze/recipes-devtools/binutils/binutils/0042-porting-GDB-for-linux.patch')
-rw-r--r-- | meta-microblaze/recipes-devtools/binutils/binutils/0042-porting-GDB-for-linux.patch | 155 |
1 files changed, 155 insertions, 0 deletions
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0042-porting-GDB-for-linux.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0042-porting-GDB-for-linux.patch new file mode 100644 index 00000000..e115666c --- /dev/null +++ b/meta-microblaze/recipes-devtools/binutils/binutils/0042-porting-GDB-for-linux.patch | |||
@@ -0,0 +1,155 @@ | |||
1 | From c810c6e2a6ae66426444580d04659e8b2d0b2daa Mon Sep 17 00:00:00 2001 | ||
2 | From: Mahesh Bodapati <mbodapat@xilinx.com> | ||
3 | Date: Thu, 12 Dec 2019 14:56:17 +0530 | ||
4 | Subject: [PATCH 42/52] porting GDB for linux | ||
5 | |||
6 | --- | ||
7 | gdb/features/microblaze-linux.xml | 12 ++++++++++ | ||
8 | gdb/microblaze-linux-tdep.c | 39 ++++++++++++++++++++++++------- | ||
9 | gdbserver/Makefile.in | 2 ++ | ||
10 | gdbserver/configure.srv | 3 ++- | ||
11 | 4 files changed, 47 insertions(+), 9 deletions(-) | ||
12 | create mode 100644 gdb/features/microblaze-linux.xml | ||
13 | |||
14 | diff --git a/gdb/features/microblaze-linux.xml b/gdb/features/microblaze-linux.xml | ||
15 | new file mode 100644 | ||
16 | index 0000000000..8983e66eb3 | ||
17 | --- /dev/null | ||
18 | +++ b/gdb/features/microblaze-linux.xml | ||
19 | @@ -0,0 +1,12 @@ | ||
20 | +<?xml version="1.0"?> | ||
21 | +<!-- Copyright (C) 2014-2018 Free Software Foundation, Inc. | ||
22 | + | ||
23 | + Copying and distribution of this file, with or without modification, | ||
24 | + are permitted in any medium without royalty provided the copyright | ||
25 | + notice and this notice are preserved. --> | ||
26 | + | ||
27 | +<!DOCTYPE target SYSTEM "gdb-target.dtd"> | ||
28 | +<target> | ||
29 | + <osabi>GNU/Linux</osabi> | ||
30 | + <xi:include href="microblaze-core.xml"/> | ||
31 | +</target> | ||
32 | diff --git a/gdb/microblaze-linux-tdep.c b/gdb/microblaze-linux-tdep.c | ||
33 | index a2e858d10f..a37c4c86f4 100644 | ||
34 | --- a/gdb/microblaze-linux-tdep.c | ||
35 | +++ b/gdb/microblaze-linux-tdep.c | ||
36 | @@ -41,7 +41,7 @@ | ||
37 | |||
38 | #ifndef REGSET_H | ||
39 | #define REGSET_H 1 | ||
40 | - | ||
41 | +int MICROBLAZE_REGISTER_SIZE=4; | ||
42 | struct gdbarch; | ||
43 | struct regcache; | ||
44 | |||
45 | @@ -115,7 +115,7 @@ microblaze_debug (const char *fmt, ...) | ||
46 | va_end (args); | ||
47 | } | ||
48 | } | ||
49 | - | ||
50 | +#if 0 | ||
51 | static int | ||
52 | microblaze_linux_memory_remove_breakpoint (struct gdbarch *gdbarch, | ||
53 | struct bp_target_info *bp_tgt) | ||
54 | @@ -131,7 +131,7 @@ microblaze_linux_memory_remove_breakpoint (struct gdbarch *gdbarch, | ||
55 | bp = gdbarch_breakpoint_from_pc (gdbarch, &addr, &bplen); | ||
56 | |||
57 | /* Make sure we see the memory breakpoints. */ | ||
58 | - cleanup = make_show_memory_breakpoints_cleanup (1); | ||
59 | + cleanup = make_scoped_restore_show_memory_breakpoints (1); | ||
60 | val = target_read_memory (addr, old_contents, bplen); | ||
61 | |||
62 | /* If our breakpoint is no longer at the address, this means that the | ||
63 | @@ -146,6 +146,7 @@ microblaze_linux_memory_remove_breakpoint (struct gdbarch *gdbarch, | ||
64 | do_cleanups (cleanup); | ||
65 | return val; | ||
66 | } | ||
67 | +#endif | ||
68 | |||
69 | static void | ||
70 | microblaze_linux_sigtramp_cache (struct frame_info *next_frame, | ||
71 | @@ -248,8 +249,8 @@ microblaze_linux_init_abi (struct gdbarch_info info, | ||
72 | |||
73 | linux_init_abi (info, gdbarch); | ||
74 | |||
75 | - set_gdbarch_memory_remove_breakpoint (gdbarch, | ||
76 | - microblaze_linux_memory_remove_breakpoint); | ||
77 | +// set_gdbarch_memory_remove_breakpoint (gdbarch, | ||
78 | +// microblaze_linux_memory_remove_breakpoint); | ||
79 | |||
80 | /* Shared library handling. */ | ||
81 | set_solib_svr4_fetch_link_map_offsets (gdbarch, | ||
82 | @@ -261,10 +262,30 @@ microblaze_linux_init_abi (struct gdbarch_info info, | ||
83 | |||
84 | /* BFD target for core files. */ | ||
85 | if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) | ||
86 | - set_gdbarch_gcore_bfd_target (gdbarch, "elf32-microblaze"); | ||
87 | + { | ||
88 | + if (info.bfd_arch_info->mach == bfd_mach_microblaze64) { | ||
89 | + set_gdbarch_gcore_bfd_target (gdbarch, "elf64-microblaze"); | ||
90 | + MICROBLAZE_REGISTER_SIZE=8; | ||
91 | + } | ||
92 | + else | ||
93 | + set_gdbarch_gcore_bfd_target (gdbarch, "elf32-microblaze"); | ||
94 | + } | ||
95 | else | ||
96 | - set_gdbarch_gcore_bfd_target (gdbarch, "elf32-microblazeel"); | ||
97 | + { | ||
98 | + if (info.bfd_arch_info->mach == bfd_mach_microblaze64) { | ||
99 | + set_gdbarch_gcore_bfd_target (gdbarch, "elf64-microblazeel"); | ||
100 | + MICROBLAZE_REGISTER_SIZE=8; | ||
101 | + } | ||
102 | + else | ||
103 | + set_gdbarch_gcore_bfd_target (gdbarch, "elf32-microblazeel"); | ||
104 | + } | ||
105 | |||
106 | + switch (info.bfd_arch_info->mach) | ||
107 | + { | ||
108 | + case bfd_mach_microblaze64: | ||
109 | + set_gdbarch_ptr_bit (gdbarch, 64); | ||
110 | + break; | ||
111 | + } | ||
112 | |||
113 | /* Shared library handling. */ | ||
114 | set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target); | ||
115 | @@ -279,6 +300,8 @@ void _initialize_microblaze_linux_tdep (); | ||
116 | void | ||
117 | _initialize_microblaze_linux_tdep () | ||
118 | { | ||
119 | - gdbarch_register_osabi (bfd_arch_microblaze, 0, GDB_OSABI_LINUX, | ||
120 | + gdbarch_register_osabi (bfd_arch_microblaze, bfd_mach_microblaze, GDB_OSABI_LINUX, | ||
121 | + microblaze_linux_init_abi); | ||
122 | + gdbarch_register_osabi (bfd_arch_microblaze, bfd_mach_microblaze64, GDB_OSABI_LINUX, | ||
123 | microblaze_linux_init_abi); | ||
124 | } | ||
125 | diff --git a/gdbserver/Makefile.in b/gdbserver/Makefile.in | ||
126 | index df354d636c..680f536c06 100644 | ||
127 | --- a/gdbserver/Makefile.in | ||
128 | +++ b/gdbserver/Makefile.in | ||
129 | @@ -559,6 +559,8 @@ target/%.o: ../gdb/target/%.c | ||
130 | |||
131 | %-generated.cc: ../gdb/regformats/rs6000/%.dat $(regdat_sh) | ||
132 | $(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@ | ||
133 | +microblaze-linux.c : $(srcdir)/../regformats/reg-microblaze.dat $(regdat_sh) | ||
134 | + $(ECHO_REGDAT) $(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-microblaze.dat microblaze-linux.c | ||
135 | |||
136 | # | ||
137 | # Dependency tracking. | ||
138 | diff --git a/gdbserver/configure.srv b/gdbserver/configure.srv | ||
139 | index 456f4b3349..ff9ada71b0 100644 | ||
140 | --- a/gdbserver/configure.srv | ||
141 | +++ b/gdbserver/configure.srv | ||
142 | @@ -155,8 +155,9 @@ case "${gdbserver_host}" in | ||
143 | srv_linux_usrregs=yes | ||
144 | srv_linux_thread_db=yes | ||
145 | ;; | ||
146 | - microblaze*-*-linux*) srv_regobj=microblaze-linux.o | ||
147 | + microblaze*-*-linux*) srv_regobj="microblaze-linux.o" | ||
148 | srv_tgtobj="$srv_linux_obj linux-microblaze-low.o " | ||
149 | + srv_xmlfiles="microblaze-linux.xml" | ||
150 | srv_linux_regsets=yes | ||
151 | srv_linux_usrregs=yes | ||
152 | srv_linux_thread_db=yes | ||
153 | -- | ||
154 | 2.17.1 | ||
155 | |||