summaryrefslogtreecommitdiffstats
path: root/recipes-devtools
diff options
context:
space:
mode:
authorNathan Rossi <nathan.rossi@xilinx.com>2014-05-27 15:52:48 +1000
committerNathan Rossi <nathan.rossi@xilinx.com>2014-05-27 15:52:48 +1000
commit7c19cb06a61500f9aab21e9e95173d0305bff25c (patch)
treea5b65e80b55b0bccd6216b39a239e374c1a4b5b3 /recipes-devtools
parent56afae038a1c5a8165371cd295ab50ba2400efd8 (diff)
downloadmeta-xilinx-7c19cb06a61500f9aab21e9e95173d0305bff25c.tar.gz
gdb: Update gdb for microblaze
* Update recipe for gdb to 7.7 * Update patches for gdb, based on xlnx/master-rebase from the Xilinx binutils-gdb repository Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>
Diffstat (limited to 'recipes-devtools')
-rw-r--r--recipes-devtools/gdb/files/0001-Patch-microblaze-Add-wdc.ext.clear-and-wdc.ext.flush.patch (renamed from recipes-devtools/gdb/files/0009-Add-wdc.ext.clear-and-wdc.ext.flush-insns.patch)14
-rw-r--r--recipes-devtools/gdb/files/0003-Patch-microblaze-Initial-port-of-microblaze-core-rea.patch (renamed from recipes-devtools/gdb/files/0002-Initial-port-of-core-reading-support.patch)80
-rw-r--r--recipes-devtools/gdb/files/0004-Patch-microblaze-Communicate-in-larger-blocks-with-t.patch67
-rw-r--r--recipes-devtools/gdb/files/0005-Patch-microblaze-Add-mb-singlestepping.patch (renamed from recipes-devtools/gdb/files/0011-Patch-microblaze-Add-mb-singlestepping.patch)68
-rw-r--r--recipes-devtools/gdb/files/0006-Patch-microblaze-Add-initial-port-of-linux-gdbserver.patch (renamed from recipes-devtools/gdb/files/0001-Add-initial-port-of-linux-gdbserver.patch)154
-rw-r--r--recipes-devtools/gdb/files/0007-Patch-microblaze-Add-slr-and-shr-regs-and-little-end.patch (renamed from recipes-devtools/gdb/files/0006-Add-slr-and-shr-regs-and-little-endian-breakpoint.patch)20
-rw-r--r--recipes-devtools/gdb/files/0008-Patch-microblaze-Added-Backtrace-support-to-GDB.patch (renamed from recipes-devtools/gdb/files/0012-Added-Backtrace-support-to-GDB.patch)56
-rw-r--r--recipes-devtools/gdb/files/0009-Patch-microblaze-Initial-support-for-native-gdb.patch (renamed from recipes-devtools/gdb/files/0003-Initial-support-for-native-gdb.patch)35
-rw-r--r--recipes-devtools/gdb/files/0010-Patch-gdb-Robustify-inline-function-support.patch (renamed from recipes-devtools/gdb/files/0004-Robustify-inline-function-support.patch)17
-rw-r--r--recipes-devtools/gdb/files/0010-revert-master-rebase-changes-to-gdbserver.patch160
-rw-r--r--recipes-devtools/gdb/files/0011-Patch-gdb-Fix-debug-message-when-register-is-unavail.patch (renamed from recipes-devtools/gdb/files/0005-Fix-debug-message-when-register-is-unavailable.patch)15
-rw-r--r--recipes-devtools/gdb/files/0012-LOCAL-Disable-the-warning-message-for-eh_frame_hdr.patch34
-rw-r--r--recipes-devtools/gdb/files/0013-LOCAL-Fix-relaxation-of-assembler-resolved-reference.patch (renamed from recipes-devtools/gdb/files/0007-Fix-relaxation-of-assembler-resolved-references.patch)12
-rw-r--r--recipes-devtools/gdb/files/0013-microblaze-Handle-framless-functions-in-determining-.patch40
-rw-r--r--recipes-devtools/gdb/files/0014-LOCAL-Fixup-debug_loc-sections-after-linker-relaxati.patch (renamed from recipes-devtools/gdb/files/0008-Fixup-debug_loc-sections-after-linker-relaxation.patch)51
-rw-r--r--recipes-devtools/gdb/files/0014-microblaze-Add-build_gdbserver-yes-to-top-level-conf.patch31
-rw-r--r--recipes-devtools/gdb/files/0015-LOCAL-upstream-change-to-garbage-collection-sweep-ca.patch40
-rw-r--r--recipes-devtools/gdb/gdb-cross-canadian_7.7.bbappend (renamed from recipes-devtools/gdb/gdb-cross-canadian_7.6.2.bbappend)0
-rw-r--r--recipes-devtools/gdb/gdb-cross_7.7.bbappend (renamed from recipes-devtools/gdb/gdb-cross_7.6.2.bbappend)0
-rw-r--r--recipes-devtools/gdb/gdb-microblaze-7.6.2.inc22
-rw-r--r--recipes-devtools/gdb/gdb-microblaze-7.7.inc22
-rw-r--r--recipes-devtools/gdb/gdb_7.7.bbappend (renamed from recipes-devtools/gdb/gdb_7.6.2.bbappend)0
22 files changed, 479 insertions, 459 deletions
diff --git a/recipes-devtools/gdb/files/0009-Add-wdc.ext.clear-and-wdc.ext.flush-insns.patch b/recipes-devtools/gdb/files/0001-Patch-microblaze-Add-wdc.ext.clear-and-wdc.ext.flush.patch
index cb58f603..3575cd7e 100644
--- a/recipes-devtools/gdb/files/0009-Add-wdc.ext.clear-and-wdc.ext.flush-insns.patch
+++ b/recipes-devtools/gdb/files/0001-Patch-microblaze-Add-wdc.ext.clear-and-wdc.ext.flush.patch
@@ -1,6 +1,8 @@
1From 8ab9a20c73acedbb636a41842a681872af8ae1d6 Mon Sep 17 00:00:00 2001
1From: David Holsgrove <david.holsgrove@xilinx.com> 2From: David Holsgrove <david.holsgrove@xilinx.com>
2Date: Wed, 8 May 2013 11:03:36 +1000 3Date: Wed, 8 May 2013 11:03:36 +1000
3Subject: Add wdc.ext.clear and wdc.ext.flush insns 4Subject: [PATCH 01/16] [Patch, microblaze]: Add wdc.ext.clear and
5 wdc.ext.flush insns
4 6
5Added two new instructions, wdc.ext.clear and wdc.ext.flush, 7Added two new instructions, wdc.ext.clear and wdc.ext.flush,
6to enable MicroBlaze to flush an external cache, which is 8to enable MicroBlaze to flush an external cache, which is
@@ -10,12 +12,12 @@ Signed-off-by:nagaraju <nmekala@xilix.com>
10Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com> 12Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
11Upstream-Status: Pending 13Upstream-Status: Pending
12--- 14---
13 opcodes/microblaze-opc.h | 5 ++++- 15 opcodes/microblaze-opc.h | 5 ++++-
14 opcodes/microblaze-opcm.h | 6 +++--- 16 opcodes/microblaze-opcm.h | 6 +++---
15 2 files changed, 7 insertions(+), 4 deletions(-) 17 2 files changed, 7 insertions(+), 4 deletions(-)
16 18
17diff --git a/opcodes/microblaze-opc.h b/opcodes/microblaze-opc.h 19diff --git a/opcodes/microblaze-opc.h b/opcodes/microblaze-opc.h
18index e9da12a..dd56ab5 100644 20index e3cc1d9..f453097 100644
19--- a/opcodes/microblaze-opc.h 21--- a/opcodes/microblaze-opc.h
20+++ b/opcodes/microblaze-opc.h 22+++ b/opcodes/microblaze-opc.h
21@@ -91,6 +91,7 @@ 23@@ -91,6 +91,7 @@
@@ -46,7 +48,7 @@ index e9da12a..dd56ab5 100644
46 {"mfs", INST_TYPE_RD_SPECIAL, INST_NO_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_MFS, 0x94008000, OPCODE_MASK_H23S, mfs, special_inst }, 48 {"mfs", INST_TYPE_RD_SPECIAL, INST_NO_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_MFS, 0x94008000, OPCODE_MASK_H23S, mfs, special_inst },
47 {"br", INST_TYPE_R2, INST_PC_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_NON_SPECIAL, 0x98000000, OPCODE_MASK_H124, br, branch_inst }, 49 {"br", INST_TYPE_R2, INST_PC_OFFSET, NO_DELAY_SLOT, IMMVAL_MASK_NON_SPECIAL, 0x98000000, OPCODE_MASK_H124, br, branch_inst },
48diff --git a/opcodes/microblaze-opcm.h b/opcodes/microblaze-opcm.h 50diff --git a/opcodes/microblaze-opcm.h b/opcodes/microblaze-opcm.h
49index 124cdec..8e531f9 100644 51index 6868389..8f5c1cb 100644
50--- a/opcodes/microblaze-opcm.h 52--- a/opcodes/microblaze-opcm.h
51+++ b/opcodes/microblaze-opcm.h 53+++ b/opcodes/microblaze-opcm.h
52@@ -31,9 +31,9 @@ enum microblaze_instr 54@@ -31,9 +31,9 @@ enum microblaze_instr
@@ -63,5 +65,5 @@ index 124cdec..8e531f9 100644
63 brki, beqi, beqid, bnei, bneid, blti, bltid, blei, bleid, bgti, 65 brki, beqi, beqid, bnei, bneid, blti, bltid, blei, bleid, bgti,
64 bgtid, bgei, bgeid, lbu, lbur, lhu, lhur, lw, lwr, lwx, sb, sbr, sh, 66 bgtid, bgei, bgeid, lbu, lbur, lhu, lhur, lw, lwr, lwx, sb, sbr, sh,
65-- 67--
661.7.9.5 681.9.0
67 69
diff --git a/recipes-devtools/gdb/files/0002-Initial-port-of-core-reading-support.patch b/recipes-devtools/gdb/files/0003-Patch-microblaze-Initial-port-of-microblaze-core-rea.patch
index f0020ed4..5d856408 100644
--- a/recipes-devtools/gdb/files/0002-Initial-port-of-core-reading-support.patch
+++ b/recipes-devtools/gdb/files/0003-Patch-microblaze-Initial-port-of-microblaze-core-rea.patch
@@ -1,24 +1,26 @@
1From da27c7161c676550f5fe8a4e0f7f395e5e0d4770 Mon Sep 17 00:00:00 2001
1From: David Holsgrove <david.holsgrove@petalogix.com> 2From: David Holsgrove <david.holsgrove@petalogix.com>
2Date: Fri, 18 May 2012 11:49:50 +1000 3Date: Fri, 18 May 2012 11:49:50 +1000
3Subject: Initial port of core reading support 4Subject: [PATCH 03/16] [Patch, microblaze]: Initial port of microblaze core
5 reading support
4 6
5Added support for reading notes in linux core dumps 7Added support for reading notes in linux core dumps
6Support for reading of PRSTATUS and PSINFO information for rebuilding 8Support for reading of PRSTATUS and PSINFO information for rebuilding
7".reg" sections of core dumps at run time. 9".reg" sections of core dumps at run time.
8 10
9Signed-off-by: David Holsgrove <david.holsgrove@petalogix.com> 11Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
10Signed-off-by: Nathan Rossi <nathan.rossi@petalogix.com> 12Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>
11Upstream-Status: Pending 13Upstream-Status: Pending
12--- 14---
13 bfd/elf32-microblaze.c | 64 ++++++++++++++++++++++++++++++ 15 bfd/elf32-microblaze.c | 64 ++++++++++++++++++++++++++++++++
14 gdb/configure.tgt | 2 +- 16 gdb/configure.tgt | 2 +-
15 gdb/microblaze-linux-tdep.c | 56 +++++++++++++++++++++++++++ 17 gdb/microblaze-linux-tdep.c | 61 +++++++++++++++++++++++++++++++
16 gdb/microblaze-tdep.c | 90 +++++++++++++++++++++++++++++++++++++++++++ 18 gdb/microblaze-tdep.c | 89 +++++++++++++++++++++++++++++++++++++++++++++
17 gdb/microblaze-tdep.h | 28 ++++++++++++++ 19 gdb/microblaze-tdep.h | 28 ++++++++++++++
18 5 files changed, 239 insertions(+), 1 deletion(-) 20 5 files changed, 243 insertions(+), 1 deletion(-)
19 21
20diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c 22diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c
21index 8aafe72..365546c 100644 23index 9837b18..cbd18f0 100644
22--- a/bfd/elf32-microblaze.c 24--- a/bfd/elf32-microblaze.c
23+++ b/bfd/elf32-microblaze.c 25+++ b/bfd/elf32-microblaze.c
24@@ -668,6 +668,67 @@ microblaze_elf_is_local_label_name (bfd *abfd, const char *name) 26@@ -668,6 +668,67 @@ microblaze_elf_is_local_label_name (bfd *abfd, const char *name)
@@ -89,7 +91,7 @@ index 8aafe72..365546c 100644
89 /* The microblaze linker (like many others) needs to keep track of 91 /* The microblaze linker (like many others) needs to keep track of
90 the number of relocs that it decides to copy as dynamic relocs in 92 the number of relocs that it decides to copy as dynamic relocs in
91 check_relocs for each symbol. This is so that it can later discard 93 check_relocs for each symbol. This is so that it can later discard
92@@ -3499,4 +3560,7 @@ microblaze_elf_add_symbol_hook (bfd *abfd, 94@@ -3506,4 +3567,7 @@ microblaze_elf_add_symbol_hook (bfd *abfd,
93 #define elf_backend_size_dynamic_sections microblaze_elf_size_dynamic_sections 95 #define elf_backend_size_dynamic_sections microblaze_elf_size_dynamic_sections
94 #define elf_backend_add_symbol_hook microblaze_elf_add_symbol_hook 96 #define elf_backend_add_symbol_hook microblaze_elf_add_symbol_hook
95 97
@@ -98,10 +100,10 @@ index 8aafe72..365546c 100644
98+ 100+
99 #include "elf32-target.h" 101 #include "elf32-target.h"
100diff --git a/gdb/configure.tgt b/gdb/configure.tgt 102diff --git a/gdb/configure.tgt b/gdb/configure.tgt
101index 720d3d3..1285aac 100644 103index 01311b2..9297c56 100644
102--- a/gdb/configure.tgt 104--- a/gdb/configure.tgt
103+++ b/gdb/configure.tgt 105+++ b/gdb/configure.tgt
104@@ -339,7 +339,7 @@ mep-*-*) 106@@ -340,7 +340,7 @@ mep-*-*)
105 107
106 microblaze*-linux-*|microblaze*-*-linux*) 108 microblaze*-linux-*|microblaze*-*-linux*)
107 # Target: Xilinx MicroBlaze running Linux 109 # Target: Xilinx MicroBlaze running Linux
@@ -111,7 +113,7 @@ index 720d3d3..1285aac 100644
111 gdb_sim=../sim/microblaze/libsim.a 113 gdb_sim=../sim/microblaze/libsim.a
112 ;; 114 ;;
113diff --git a/gdb/microblaze-linux-tdep.c b/gdb/microblaze-linux-tdep.c 115diff --git a/gdb/microblaze-linux-tdep.c b/gdb/microblaze-linux-tdep.c
114index 69c333e..9dc4f85 100644 116index 8d360eb..7e6b61b 100644
115--- a/gdb/microblaze-linux-tdep.c 117--- a/gdb/microblaze-linux-tdep.c
116+++ b/gdb/microblaze-linux-tdep.c 118+++ b/gdb/microblaze-linux-tdep.c
117@@ -32,6 +32,7 @@ 119@@ -32,6 +32,7 @@
@@ -122,7 +124,7 @@ index 69c333e..9dc4f85 100644
122 #include "trad-frame.h" 124 #include "trad-frame.h"
123 #include "frame-unwind.h" 125 #include "frame-unwind.h"
124 #include "tramp-frame.h" 126 #include "tramp-frame.h"
125@@ -139,6 +140,43 @@ static struct tramp_frame microblaze_linux_sighandler_tramp_frame = 127@@ -116,6 +117,43 @@ static struct tramp_frame microblaze_linux_sighandler_tramp_frame =
126 microblaze_linux_sighandler_cache_init 128 microblaze_linux_sighandler_cache_init
127 }; 129 };
128 130
@@ -166,7 +168,7 @@ index 69c333e..9dc4f85 100644
166 168
167 static void 169 static void
168 microblaze_linux_init_abi (struct gdbarch_info info, 170 microblaze_linux_init_abi (struct gdbarch_info info,
169@@ -146,6 +184,10 @@ microblaze_linux_init_abi (struct gdbarch_info info, 171@@ -123,6 +161,10 @@ microblaze_linux_init_abi (struct gdbarch_info info,
170 { 172 {
171 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); 173 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
172 174
@@ -177,10 +179,11 @@ index 69c333e..9dc4f85 100644
177 linux_init_abi (info, gdbarch); 179 linux_init_abi (info, gdbarch);
178 180
179 set_gdbarch_memory_remove_breakpoint (gdbarch, 181 set_gdbarch_memory_remove_breakpoint (gdbarch,
180@@ -159,6 +201,20 @@ microblaze_linux_init_abi (struct gdbarch_info info, 182@@ -135,6 +177,25 @@ microblaze_linux_init_abi (struct gdbarch_info info,
183 /* Trampolines. */
181 tramp_frame_prepend_unwinder (gdbarch, 184 tramp_frame_prepend_unwinder (gdbarch,
182 &microblaze_linux_sighandler_tramp_frame); 185 &microblaze_linux_sighandler_tramp_frame);
183 186+
184+ /* BFD target for core files. */ 187+ /* BFD target for core files. */
185+ if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) 188+ if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
186+ set_gdbarch_gcore_bfd_target (gdbarch, "elf32-microblaze"); 189+ set_gdbarch_gcore_bfd_target (gdbarch, "elf32-microblaze");
@@ -195,14 +198,18 @@ index 69c333e..9dc4f85 100644
195+ set_gdbarch_regset_from_core_section (gdbarch, 198+ set_gdbarch_regset_from_core_section (gdbarch,
196+ microblaze_regset_from_core_section); 199+ microblaze_regset_from_core_section);
197+ 200+
198 /* Enable TLS support. */ 201+ /* Enable TLS support. */
199 set_gdbarch_fetch_tls_load_module_address (gdbarch, 202+ set_gdbarch_fetch_tls_load_module_address (gdbarch,
200 svr4_fetch_objfile_link_map); 203+ svr4_fetch_objfile_link_map);
204+
205 }
206
207 /* -Wmissing-prototypes */
201diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c 208diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c
202index 079d34e..cfc227d 100644 209index 14c1b52..36cf1ca 100644
203--- a/gdb/microblaze-tdep.c 210--- a/gdb/microblaze-tdep.c
204+++ b/gdb/microblaze-tdep.c 211+++ b/gdb/microblaze-tdep.c
205@@ -146,6 +146,14 @@ microblaze_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, 212@@ -145,6 +145,14 @@ microblaze_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp,
206 return sp; 213 return sp;
207 } 214 }
208 215
@@ -217,7 +224,7 @@ index 079d34e..cfc227d 100644
217 224
218 static CORE_ADDR 225 static CORE_ADDR
219 microblaze_push_dummy_call (struct gdbarch *gdbarch, struct value *function, 226 microblaze_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
220@@ -570,6 +578,12 @@ microblaze_frame_base_address (struct frame_info *next_frame, 227@@ -536,6 +544,12 @@ microblaze_frame_base_address (struct frame_info *next_frame,
221 return cache->base; 228 return cache->base;
222 } 229 }
223 230
@@ -230,7 +237,7 @@ index 079d34e..cfc227d 100644
230 static const struct frame_base microblaze_frame_base = 237 static const struct frame_base microblaze_frame_base =
231 { 238 {
232 &microblaze_frame_unwind, 239 &microblaze_frame_unwind,
233@@ -698,6 +712,70 @@ microblaze_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int reg) 240@@ -664,6 +678,70 @@ microblaze_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int reg)
234 return dwarf2_to_reg_map[reg]; 241 return dwarf2_to_reg_map[reg];
235 } 242 }
236 243
@@ -301,8 +308,8 @@ index 079d34e..cfc227d 100644
301 static struct gdbarch * 308 static struct gdbarch *
302 microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) 309 microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
303 { 310 {
304@@ -713,6 +791,11 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) 311@@ -679,6 +757,11 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
305 tdep = XMALLOC (struct gdbarch_tdep); 312 tdep = XNEW (struct gdbarch_tdep);
306 gdbarch = gdbarch_alloc (&info, tdep); 313 gdbarch = gdbarch_alloc (&info, tdep);
307 314
308+ tdep->gregset = NULL; 315+ tdep->gregset = NULL;
@@ -313,22 +320,21 @@ index 079d34e..cfc227d 100644
313 set_gdbarch_long_double_bit (gdbarch, 128); 320 set_gdbarch_long_double_bit (gdbarch, 128);
314 321
315 set_gdbarch_num_regs (gdbarch, MICROBLAZE_NUM_REGS); 322 set_gdbarch_num_regs (gdbarch, MICROBLAZE_NUM_REGS);
316@@ -761,6 +844,13 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) 323@@ -726,6 +809,12 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
317 dwarf2_append_unwinders (gdbarch);
318 frame_unwind_append_unwinder (gdbarch, &microblaze_frame_unwind); 324 frame_unwind_append_unwinder (gdbarch, &microblaze_frame_unwind);
319 frame_base_append_sniffer (gdbarch, dwarf2_frame_base_sniffer); 325 frame_base_append_sniffer (gdbarch, dwarf2_frame_base_sniffer);
320+ //frame_base_append_sniffer (gdbarch, microblaze_frame_sniffer); 326
321+
322+ /* If we have register sets, enable the generic core file support. */ 327+ /* If we have register sets, enable the generic core file support. */
323+ if (tdep->gregset) { 328+ if (tdep->gregset) {
324+ set_gdbarch_regset_from_core_section (gdbarch, 329+ set_gdbarch_regset_from_core_section (gdbarch,
325+ microblaze_regset_from_core_section); 330+ microblaze_regset_from_core_section);
326+ } 331+ }
327 332+
328 return gdbarch; 333 return gdbarch;
329 } 334 }
335
330diff --git a/gdb/microblaze-tdep.h b/gdb/microblaze-tdep.h 336diff --git a/gdb/microblaze-tdep.h b/gdb/microblaze-tdep.h
331index 9fdbda7..7de4463 100644 337index a532092..fec24b9 100644
332--- a/gdb/microblaze-tdep.h 338--- a/gdb/microblaze-tdep.h
333+++ b/gdb/microblaze-tdep.h 339+++ b/gdb/microblaze-tdep.h
334@@ -22,8 +22,22 @@ 340@@ -22,8 +22,22 @@
@@ -354,9 +360,9 @@ index 9fdbda7..7de4463 100644
354 }; 360 };
355 361
356 struct microblaze_frame_cache 362 struct microblaze_frame_cache
357@@ -118,4 +132,18 @@ enum microblaze_regnum 363@@ -117,4 +131,18 @@ enum microblaze_regnum
358 #define MICROBLAZE_BREAKPOINT {0xba, 0x0c, 0x00, 0x18} 364 Only used for native debugging. */
359 #define MICROBLAZE_BREAKPOINT_LE {0x18, 0x00, 0x0c, 0xba} 365 #define MICROBLAZE_BREAKPOINT {0xb9, 0xcc, 0x00, 0x60}
360 366
361+extern void microblaze_supply_gregset (const struct microblaze_gregset *gregset, 367+extern void microblaze_supply_gregset (const struct microblaze_gregset *gregset,
362+ struct regcache *regcache, 368+ struct regcache *regcache,
@@ -374,5 +380,5 @@ index 9fdbda7..7de4463 100644
374+ 380+
375 #endif /* microblaze-tdep.h */ 381 #endif /* microblaze-tdep.h */
376-- 382--
3771.7.9.5 3831.9.0
378 384
diff --git a/recipes-devtools/gdb/files/0004-Patch-microblaze-Communicate-in-larger-blocks-with-t.patch b/recipes-devtools/gdb/files/0004-Patch-microblaze-Communicate-in-larger-blocks-with-t.patch
new file mode 100644
index 00000000..b14e4092
--- /dev/null
+++ b/recipes-devtools/gdb/files/0004-Patch-microblaze-Communicate-in-larger-blocks-with-t.patch
@@ -0,0 +1,67 @@
1From 26e124f0d78233b1d976bd4b787f6a7866bcb7e7 Mon Sep 17 00:00:00 2001
2From: nagaraju <nmekala@xilix.com>
3Date: Wed, 4 Jan 2012 16:59:33 +0530
4Subject: [PATCH 04/16] [Patch, microblaze]: Communicate in larger blocks with
5 the target
6
7Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
8Upstream-Status: Pending
9---
10 gdb/microblaze-tdep.c | 25 ++++++++++++++++++++++---
11 1 file changed, 22 insertions(+), 3 deletions(-)
12
13diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c
14index 36cf1ca..76e87b3 100644
15--- a/gdb/microblaze-tdep.c
16+++ b/gdb/microblaze-tdep.c
17@@ -242,6 +242,10 @@ microblaze_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc,
18 int flags = 0;
19 int save_hidden_pointer_found = 0;
20 int non_stack_instruction_found = 0;
21+ int n_insns;
22+ unsigned long *insn_block;
23+ gdb_byte *buf_block;
24+ int ti, tj;
25
26 /* Find the start of this function. */
27 find_pc_partial_function (pc, &name, &func_addr, &func_end);
28@@ -281,9 +285,23 @@ microblaze_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc,
29 name, paddress (gdbarch, func_addr),
30 paddress (gdbarch, stop));
31
32+/* Do a block read to minimize the transaction with the Debug Agent */
33+ n_insns = (stop == func_addr) ? 1 : ((stop - func_addr) / INST_WORD_SIZE);
34+ insn_block = (unsigned long *)calloc(n_insns, sizeof(unsigned long));
35+ buf_block = (gdb_byte *)calloc(n_insns * INST_WORD_SIZE, sizeof(gdb_byte));
36+
37+ target_read_memory (func_addr, buf_block, n_insns * INST_WORD_SIZE );
38+
39+ for(ti = 0; ti < n_insns; ti++){
40+ insn_block[ti] = 0;
41+ for( tj = ti * INST_WORD_SIZE; tj < (ti + 1) * INST_WORD_SIZE; tj++ )
42+ insn_block[ti] = (insn_block[ti] << 8) | buf_block[tj];
43+ }
44+
45 for (addr = func_addr; addr < stop; addr += INST_WORD_SIZE)
46 {
47- insn = microblaze_fetch_instruction (addr);
48+ //insn = microblaze_fetch_instruction (addr);
49+ insn = insn_block[(addr - func_addr) / INST_WORD_SIZE];
50 op = microblaze_decode_insn (insn, &rd, &ra, &rb, &imm);
51 microblaze_debug ("%s %08lx\n", paddress (gdbarch, pc), insn);
52
53@@ -409,8 +427,9 @@ microblaze_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc,
54 part of the prologue. */
55 if (save_hidden_pointer_found)
56 prologue_end_addr -= INST_WORD_SIZE;
57-
58- return prologue_end_addr;
59+ free(insn_block);
60+ free(buf_block);
61+ return prologue_end_addr;
62 }
63
64 static CORE_ADDR
65--
661.9.0
67
diff --git a/recipes-devtools/gdb/files/0011-Patch-microblaze-Add-mb-singlestepping.patch b/recipes-devtools/gdb/files/0005-Patch-microblaze-Add-mb-singlestepping.patch
index 51b2e36e..e490f02a 100644
--- a/recipes-devtools/gdb/files/0011-Patch-microblaze-Add-mb-singlestepping.patch
+++ b/recipes-devtools/gdb/files/0005-Patch-microblaze-Add-mb-singlestepping.patch
@@ -1,64 +1,68 @@
1From 5c3a08f407e1cbee5b0a4ca6092165b97acddda5 Mon Sep 17 00:00:00 2001
1From: "Edgar E. Iglesias" <edgar@axis.com> 2From: "Edgar E. Iglesias" <edgar@axis.com>
2Date: Fri, 24 Feb 2012 11:52:30 +0100 3Date: Fri, 24 Feb 2012 11:52:30 +0100
3Subject: Add mb singlestepping. 4Subject: [PATCH 05/16] [Patch, microblaze]: Add mb singlestepping.
4 5
5Fix prologue analysis for little-endian. 6Fix prologue analysis for little-endian.
6Always provide a frame base. 7Always provide a frame base.
7 8
8Signed-off-by: Edgar E. Iglesias <edgar@axis.com> 9Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
9
10Conflicts:
11
12 gdb/microblaze-tdep.c
13
14Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
15Upstream-Status: Pending 10Upstream-Status: Pending
16--- 11---
17 gdb/microblaze-tdep.c | 117 +++++++++++++++++++++++++++++++++++++++++++++++-- 12 gdb/microblaze-tdep.c | 123 ++++++++++++++++++++++++++++++++++++++++++++------
18 1 file changed, 114 insertions(+), 3 deletions(-) 13 1 file changed, 108 insertions(+), 15 deletions(-)
19 14
20diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c 15diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c
21index a245169..9c9f3a9 100644 16index 76e87b3..50b68d2 100644
22--- a/gdb/microblaze-tdep.c 17--- a/gdb/microblaze-tdep.c
23+++ b/gdb/microblaze-tdep.c 18+++ b/gdb/microblaze-tdep.c
24@@ -282,6 +282,8 @@ microblaze_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, 19@@ -243,9 +243,7 @@ microblaze_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc,
25 int flags = 0;
26 int save_hidden_pointer_found = 0; 20 int save_hidden_pointer_found = 0;
27 int non_stack_instruction_found = 0; 21 int non_stack_instruction_found = 0;
28+ int n_insns; 22 int n_insns;
23- unsigned long *insn_block;
24- gdb_byte *buf_block;
25- int ti, tj;
29+ unsigned int *insn_block; 26+ unsigned int *insn_block;
30 27
31 /* Find the start of this function. */ 28 /* Find the start of this function. */
32 find_pc_partial_function (pc, &name, &func_addr, &func_end); 29 find_pc_partial_function (pc, &name, &func_addr, &func_end);
33@@ -321,11 +323,17 @@ microblaze_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, 30@@ -287,23 +285,16 @@ microblaze_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc,
34 name, paddress (gdbarch, func_addr),
35 paddress (gdbarch, stop));
36 31
37+ /* Do a block read to minimize the transaction with the Debug Agent */ 32 /* Do a block read to minimize the transaction with the Debug Agent */
38+ n_insns = (stop == func_addr) ? 1 : ((stop - func_addr) / INST_WORD_SIZE); 33 n_insns = (stop == func_addr) ? 1 : ((stop - func_addr) / INST_WORD_SIZE);
34- insn_block = (unsigned long *)calloc(n_insns, sizeof(unsigned long));
35- buf_block = (gdb_byte *)calloc(n_insns * INST_WORD_SIZE, sizeof(gdb_byte));
39+ insn_block = calloc(n_insns, sizeof(unsigned long)); 36+ insn_block = calloc(n_insns, sizeof(unsigned long));
40+ 37
38- target_read_memory (func_addr, buf_block, n_insns * INST_WORD_SIZE );
39-
40- for(ti = 0; ti < n_insns; ti++){
41- insn_block[ti] = 0;
42- for( tj = ti * INST_WORD_SIZE; tj < (ti + 1) * INST_WORD_SIZE; tj++ )
43- insn_block[ti] = (insn_block[ti] << 8) | buf_block[tj];
44- }
41+ target_read_memory (func_addr, (void*) insn_block, n_insns * INST_WORD_SIZE ); 45+ target_read_memory (func_addr, (void*) insn_block, n_insns * INST_WORD_SIZE );
42+ 46
43 for (addr = func_addr; addr < stop; addr += INST_WORD_SIZE) 47 for (addr = func_addr; addr < stop; addr += INST_WORD_SIZE)
44 { 48 {
45 insn = microblaze_fetch_instruction (addr); 49 //insn = microblaze_fetch_instruction (addr);
50 insn = insn_block[(addr - func_addr) / INST_WORD_SIZE];
46 op = microblaze_decode_insn (insn, &rd, &ra, &rb, &imm); 51 op = microblaze_decode_insn (insn, &rd, &ra, &rb, &imm);
47- microblaze_debug ("%s %08lx\n", paddress (gdbarch, pc), insn); 52- microblaze_debug ("%s %08lx\n", paddress (gdbarch, pc), insn);
48+ microblaze_debug ("%s %08lx op=%x r%d r%d imm=%d\n", paddress (gdbarch, addr), insn, op, rd, ra, imm); 53+ microblaze_debug ("%s %08lx op=%x r%d r%d imm=%d\n", paddress (gdbarch, addr), insn, op, rd, ra, imm);
49 54
50 /* This code is very sensitive to what functions are present in the 55 /* This code is very sensitive to what functions are present in the
51 prologue. It assumes that the (addi, addik, swi, sw) can be the 56 prologue. It assumes that the (addi, addik, swi, sw) can be the
52@@ -449,7 +457,7 @@ microblaze_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, 57@@ -428,7 +419,6 @@ microblaze_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc,
53 part of the prologue. */
54 if (save_hidden_pointer_found) 58 if (save_hidden_pointer_found)
55 prologue_end_addr -= INST_WORD_SIZE; 59 prologue_end_addr -= INST_WORD_SIZE;
56- 60 free(insn_block);
57+ free(insn_block); 61- free(buf_block);
58 return prologue_end_addr; 62 return prologue_end_addr;
59 } 63 }
60 64
61@@ -523,6 +531,7 @@ microblaze_frame_cache (struct frame_info *next_frame, void **this_cache) 65@@ -502,6 +492,7 @@ microblaze_frame_cache (struct frame_info *next_frame, void **this_cache)
62 66
63 func = get_frame_func (next_frame); 67 func = get_frame_func (next_frame);
64 68
@@ -66,7 +70,7 @@ index a245169..9c9f3a9 100644
66 cache->pc = get_frame_address_in_block (next_frame); 70 cache->pc = get_frame_address_in_block (next_frame);
67 71
68 return cache; 72 return cache;
69@@ -539,7 +548,7 @@ microblaze_frame_this_id (struct frame_info *next_frame, void **this_cache, 73@@ -518,7 +509,7 @@ microblaze_frame_this_id (struct frame_info *next_frame, void **this_cache,
70 if (cache->base == 0) 74 if (cache->base == 0)
71 return; 75 return;
72 76
@@ -75,7 +79,7 @@ index a245169..9c9f3a9 100644
75 } 79 }
76 80
77 static struct value * 81 static struct value *
78@@ -682,6 +691,107 @@ microblaze_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type) 82@@ -661,6 +652,107 @@ microblaze_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type)
79 return (TYPE_LENGTH (type) == 16); 83 return (TYPE_LENGTH (type) == 16);
80 } 84 }
81 85
@@ -183,8 +187,8 @@ index a245169..9c9f3a9 100644
183 static void 187 static void
184 microblaze_write_pc (struct regcache *regcache, CORE_ADDR pc) 188 microblaze_write_pc (struct regcache *regcache, CORE_ADDR pc)
185 { 189 {
186@@ -832,6 +942,7 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) 190@@ -809,6 +901,7 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
187 set_gdbarch_memory_remove_breakpoint (gdbarch, microblaze_linux_memory_remove_breakpoint); 191 set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
188 192
189 set_gdbarch_breakpoint_from_pc (gdbarch, microblaze_breakpoint_from_pc); 193 set_gdbarch_breakpoint_from_pc (gdbarch, microblaze_breakpoint_from_pc);
190+ set_gdbarch_software_single_step (gdbarch, microblaze_software_single_step); 194+ set_gdbarch_software_single_step (gdbarch, microblaze_software_single_step);
@@ -192,5 +196,5 @@ index a245169..9c9f3a9 100644
192 set_gdbarch_frame_args_skip (gdbarch, 8); 196 set_gdbarch_frame_args_skip (gdbarch, 8);
193 197
194-- 198--
1951.7.9.5 1991.9.0
196 200
diff --git a/recipes-devtools/gdb/files/0001-Add-initial-port-of-linux-gdbserver.patch b/recipes-devtools/gdb/files/0006-Patch-microblaze-Add-initial-port-of-linux-gdbserver.patch
index 5c195538..cb2eec18 100644
--- a/recipes-devtools/gdb/files/0001-Add-initial-port-of-linux-gdbserver.patch
+++ b/recipes-devtools/gdb/files/0006-Patch-microblaze-Add-initial-port-of-linux-gdbserver.patch
@@ -1,6 +1,8 @@
1From 2112c9ded01ddd08f0e31e5ce23eecac6c04e8c4 Mon Sep 17 00:00:00 2001
1From: David Holsgrove <david.holsgrove@petalogix.com> 2From: David Holsgrove <david.holsgrove@petalogix.com>
2Date: Mon, 6 Feb 2012 10:28:29 +1000 3Date: Mon, 6 Feb 2012 10:28:29 +1000
3Subject: Add initial port of linux gdbserver 4Subject: [PATCH 06/16] [Patch, microblaze]: Add initial port of linux
5 gdbserver
4 6
5add gdb_proc_service_h to gdbserver microblaze-linux 7add gdb_proc_service_h to gdbserver microblaze-linux
6 8
@@ -10,6 +12,7 @@ other archs use this step to run a *_arch_setup() to carry out all
10architecture specific setup - may need to add in future 12architecture specific setup - may need to add in future
11 13
12 * add linux-ptrace.o to gdbserver configure 14 * add linux-ptrace.o to gdbserver configure
15 * gdb/configure.tgt: Set build_gdbserver=yes
13 * Update breakpoint opcode 16 * Update breakpoint opcode
14 * fix segfault on connecting gdbserver 17 * fix segfault on connecting gdbserver
15 * add microblaze_linux_memory_remove_breakpoint 18 * add microblaze_linux_memory_remove_breakpoint
@@ -21,21 +24,24 @@ Signed-off-by: David Holsgrove <david.holsgrove@petalogix.com>
21Signed-off-by: Nathan Rossi <nathan.rossi@petalogix.com> 24Signed-off-by: Nathan Rossi <nathan.rossi@petalogix.com>
22Upstream-Status: Pending 25Upstream-Status: Pending
23--- 26---
24 gdb/configure.host | 3 + 27 gdb/configure.host | 3 +
25 gdb/gdbserver/linux-microblaze-low.c | 228 ++++++++++++++++++++++++++++++++++ 28 gdb/configure.tgt | 1 +
26 gdb/microblaze-linux-tdep.c | 30 ++++- 29 gdb/gdbserver/Makefile.in | 4 +
27 gdb/microblaze-tdep.c | 35 ++++++ 30 gdb/gdbserver/configure.srv | 6 +
28 gdb/microblaze-tdep.h | 3 +- 31 gdb/gdbserver/linux-microblaze-low.c | 228 +++++++++++++++++++++++++++++++++++
29 gdb/regformats/reg-microblaze.dat | 39 ++++++ 32 gdb/microblaze-linux-tdep.c | 25 +++-
30 6 files changed, 336 insertions(+), 2 deletions(-) 33 gdb/microblaze-tdep.c | 45 ++++++-
34 gdb/microblaze-tdep.h | 3 +-
35 gdb/regformats/reg-microblaze.dat | 39 ++++++
36 9 files changed, 348 insertions(+), 6 deletions(-)
31 create mode 100644 gdb/gdbserver/linux-microblaze-low.c 37 create mode 100644 gdb/gdbserver/linux-microblaze-low.c
32 create mode 100644 gdb/regformats/reg-microblaze.dat 38 create mode 100644 gdb/regformats/reg-microblaze.dat
33 39
34diff --git a/gdb/configure.host b/gdb/configure.host 40diff --git a/gdb/configure.host b/gdb/configure.host
35index 85f4491..98b0f43 100644 41index 15a8288..76cc5fe 100644
36--- a/gdb/configure.host 42--- a/gdb/configure.host
37+++ b/gdb/configure.host 43+++ b/gdb/configure.host
38@@ -47,6 +47,7 @@ i[34567]86*) gdb_host_cpu=i386 ;; 44@@ -59,6 +59,7 @@ i[34567]86*) gdb_host_cpu=i386 ;;
39 m68*) gdb_host_cpu=m68k ;; 45 m68*) gdb_host_cpu=m68k ;;
40 m88*) gdb_host_cpu=m88k ;; 46 m88*) gdb_host_cpu=m88k ;;
41 mips*) gdb_host_cpu=mips ;; 47 mips*) gdb_host_cpu=mips ;;
@@ -43,15 +49,73 @@ index 85f4491..98b0f43 100644
43 powerpc* | rs6000) gdb_host_cpu=powerpc ;; 49 powerpc* | rs6000) gdb_host_cpu=powerpc ;;
44 sparcv9 | sparc64) gdb_host_cpu=sparc ;; 50 sparcv9 | sparc64) gdb_host_cpu=sparc ;;
45 s390*) gdb_host_cpu=s390 ;; 51 s390*) gdb_host_cpu=s390 ;;
46@@ -126,6 +127,8 @@ mips*-*-netbsd* | mips*-*-knetbsd*-gnu) 52@@ -133,6 +134,8 @@ mips*-*-netbsd* | mips*-*-knetbsd*-gnu)
47 gdb_host=nbsd ;; 53 gdb_host=nbsd ;;
48 mips64*-*-openbsd*) gdb_host=obsd64 ;; 54 mips64*-*-openbsd*) gdb_host=obsd64 ;;
49 55
50+microblaze*-*linux*) gdb_host=linux ;; 56+microblaze*-*linux*) gdb_host=linux ;;
51+ 57+
52 powerpc-*-aix* | rs6000-*-*) 58 powerpc-*-aix* | rs6000-*-* | powerpc64-*-aix*)
53 gdb_host=aix ;; 59 gdb_host=aix ;;
54 powerpc*-*-freebsd*) gdb_host=fbsd ;; 60 powerpc*-*-freebsd*) gdb_host=fbsd ;;
61diff --git a/gdb/configure.tgt b/gdb/configure.tgt
62index 9297c56..3a7951a 100644
63--- a/gdb/configure.tgt
64+++ b/gdb/configure.tgt
65@@ -343,6 +343,7 @@ microblaze*-linux-*|microblaze*-*-linux*)
66 gdb_target_obs="microblaze-tdep.o microblaze-linux-tdep.o microblaze-rom.o glibc-tdep.o \
67 monitor.o dsrec.o solib-svr4.o symfile-mem.o linux-tdep.o"
68 gdb_sim=../sim/microblaze/libsim.a
69+ build_gdbserver=yes
70 ;;
71 microblaze*-*-*)
72 # Target: Xilinx MicroBlaze running standalone
73diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
74index f773fa2..a11ace1 100644
75--- a/gdb/gdbserver/Makefile.in
76+++ b/gdb/gdbserver/Makefile.in
77@@ -148,6 +148,7 @@ SFILES= $(srcdir)/gdbreplay.c $(srcdir)/inferiors.c $(srcdir)/dll.c \
78 $(srcdir)/linux-ia64-low.c $(srcdir)/linux-low.c \
79 $(srcdir)/linux-m32r-low.c \
80 $(srcdir)/linux-m68k-low.c $(srcdir)/linux-mips-low.c \
81+ $(srcdir)/linux-microblaze-low.c \
82 $(srcdir)/linux-nios2-low.c \
83 $(srcdir)/linux-ppc-low.c \
84 $(srcdir)/linux-s390-low.c \
85@@ -329,6 +330,7 @@ clean:
86 rm -f arm-with-iwmmxt.c
87 rm -f arm-with-vfpv2.c arm-with-vfpv3.c arm-with-neon.c
88 rm -f mips-linux.c mips64-linux.c
89+ rm -f microblaze-linux.c
90 rm -f nios2-linux.c
91 rm -f powerpc-32.c powerpc-32l.c powerpc-64l.c powerpc-e500l.c
92 rm -f powerpc-altivec32l.c powerpc-cell32l.c powerpc-vsx32l.c
93@@ -612,6 +614,8 @@ reg-m68k.c : $(srcdir)/../regformats/reg-m68k.dat $(regdat_sh)
94 $(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-m68k.dat reg-m68k.c
95 reg-cf.c : $(srcdir)/../regformats/reg-cf.dat $(regdat_sh)
96 $(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-cf.dat reg-cf.c
97+microblaze-linux.c : $(srcdir)/../regformats/reg-microblaze.dat $(regdat_sh)
98+ $(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-microblaze.dat microblaze-linux.c
99 mips-linux.c : $(srcdir)/../regformats/mips-linux.dat $(regdat_sh)
100 $(SHELL) $(regdat_sh) $(srcdir)/../regformats/mips-linux.dat mips-linux.c
101 mips-dsp-linux.c : $(srcdir)/../regformats/mips-dsp-linux.dat $(regdat_sh)
102diff --git a/gdb/gdbserver/configure.srv b/gdb/gdbserver/configure.srv
103index cc4f53d..359c756 100644
104--- a/gdb/gdbserver/configure.srv
105+++ b/gdb/gdbserver/configure.srv
106@@ -198,6 +198,12 @@ case "${target}" in
107 srv_linux_usrregs=yes
108 srv_linux_thread_db=yes
109 ;;
110+ microblaze*-*-linux*) srv_regobj=microblaze-linux.o
111+ srv_tgtobj="$srv_linux_obj linux-microblaze-low.o"
112+ srv_linux_usrregs=yes
113+ srv_linux_regsets=yes
114+ srv_linux_thread_db=yes
115+ ;;
116 nios2*-*-linux*) srv_regobj="nios2-linux.o"
117 srv_tgtobj="$srv_linux_obj linux-nios2-low.o"
118 srv_xmlfiles="nios2-linux.xml"
55diff --git a/gdb/gdbserver/linux-microblaze-low.c b/gdb/gdbserver/linux-microblaze-low.c 119diff --git a/gdb/gdbserver/linux-microblaze-low.c b/gdb/gdbserver/linux-microblaze-low.c
56new file mode 100644 120new file mode 100644
57index 0000000..279df9f 121index 0000000..279df9f
@@ -288,10 +352,10 @@ index 0000000..279df9f
288+} 352+}
289\ No newline at end of file 353\ No newline at end of file
290diff --git a/gdb/microblaze-linux-tdep.c b/gdb/microblaze-linux-tdep.c 354diff --git a/gdb/microblaze-linux-tdep.c b/gdb/microblaze-linux-tdep.c
291index 99fc497..69c333e 100644 355index 7e6b61b..cf58e21 100644
292--- a/gdb/microblaze-linux-tdep.c 356--- a/gdb/microblaze-linux-tdep.c
293+++ b/gdb/microblaze-linux-tdep.c 357+++ b/gdb/microblaze-linux-tdep.c
294@@ -37,6 +37,22 @@ 358@@ -38,6 +38,22 @@
295 #include "tramp-frame.h" 359 #include "tramp-frame.h"
296 #include "linux-tdep.h" 360 #include "linux-tdep.h"
297 361
@@ -314,7 +378,7 @@ index 99fc497..69c333e 100644
314 static int 378 static int
315 microblaze_linux_memory_remove_breakpoint (struct gdbarch *gdbarch, 379 microblaze_linux_memory_remove_breakpoint (struct gdbarch *gdbarch,
316 struct bp_target_info *bp_tgt) 380 struct bp_target_info *bp_tgt)
317@@ -46,20 +62,27 @@ microblaze_linux_memory_remove_breakpoint (struct gdbarch *gdbarch, 381@@ -47,20 +63,27 @@ microblaze_linux_memory_remove_breakpoint (struct gdbarch *gdbarch,
318 int val; 382 int val;
319 int bplen; 383 int bplen;
320 gdb_byte old_contents[BREAKPOINT_MAX]; 384 gdb_byte old_contents[BREAKPOINT_MAX];
@@ -343,23 +407,11 @@ index 99fc497..69c333e 100644
343 return val; 407 return val;
344 } 408 }
345 409
346@@ -135,6 +158,11 @@ microblaze_linux_init_abi (struct gdbarch_info info,
347 /* Trampolines. */
348 tramp_frame_prepend_unwinder (gdbarch,
349 &microblaze_linux_sighandler_tramp_frame);
350+
351+ /* Enable TLS support. */
352+ set_gdbarch_fetch_tls_load_module_address (gdbarch,
353+ svr4_fetch_objfile_link_map);
354+
355 }
356
357 /* -Wmissing-prototypes */
358diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c 410diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c
359index dcf556f..079d34e 100644 411index 50b68d2..1c6dbfe 100644
360--- a/gdb/microblaze-tdep.c 412--- a/gdb/microblaze-tdep.c
361+++ b/gdb/microblaze-tdep.c 413+++ b/gdb/microblaze-tdep.c
362@@ -157,6 +157,39 @@ microblaze_push_dummy_call (struct gdbarch *gdbarch, struct value *function, 414@@ -164,6 +164,39 @@ microblaze_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
363 return sp; 415 return sp;
364 } 416 }
365 417
@@ -399,20 +451,49 @@ index dcf556f..079d34e 100644
399 static const gdb_byte * 451 static const gdb_byte *
400 microblaze_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pc, 452 microblaze_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pc,
401 int *len) 453 int *len)
402@@ -707,6 +740,8 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) 454@@ -291,8 +324,8 @@ microblaze_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc,
455
456 for (addr = func_addr; addr < stop; addr += INST_WORD_SIZE)
457 {
458- //insn = microblaze_fetch_instruction (addr);
459- insn = insn_block[(addr - func_addr) / INST_WORD_SIZE];
460+ insn = microblaze_fetch_instruction (addr);
461+ //insn = insn_block[(addr - func_addr) / INST_WORD_SIZE];
462 op = microblaze_decode_insn (insn, &rd, &ra, &rb, &imm);
463 microblaze_debug ("%s %08lx op=%x r%d r%d imm=%d\n", paddress (gdbarch, addr), insn, op, rd, ra, imm);
464
465@@ -724,13 +757,15 @@ microblaze_software_single_step (struct frame_info *frame)
466 rb = get_frame_register_unsigned (frame, lrb);
467 else
468 rb = 0;
469+
470 stepbreaks[1].address = microblaze_get_target_address (insn, immfound, imm, pc, ra, rb, &targetvalid, &unconditionalbranch);
471- microblaze_debug ("single-step uncondbr=%d targetvalid=%d target=%x\n", unconditionalbranch, targetvalid, stepbreaks[1].address);
472+ microblaze_debug ("single-step uncondbr=%d targetvalid=%d target=%x\n", unconditionalbranch, targetvalid, stepbreaks[1].address);
473+
474 if (unconditionalbranch)
475 stepbreaks[0].valid = FALSE; /* This is a unconditional branch: will not come to the next address */
476 if (targetvalid && (stepbreaks[0].valid == FALSE ||
477 (stepbreaks[0].address != stepbreaks[1].address))
478- && (stepbreaks[1].address != pc)) {
479+ && (stepbreaks[1].address != pc)) {
480 stepbreaks[1].valid = TRUE;
481 } else {
482 stepbreaks[1].valid = FALSE;
483@@ -900,6 +935,8 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
403 /* Stack grows downward. */ 484 /* Stack grows downward. */
404 set_gdbarch_inner_than (gdbarch, core_addr_lessthan); 485 set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
405 486
406+ set_gdbarch_memory_remove_breakpoint (gdbarch, microblaze_linux_memory_remove_breakpoint); 487+ set_gdbarch_memory_remove_breakpoint (gdbarch, microblaze_linux_memory_remove_breakpoint);
407+ 488+
408 set_gdbarch_breakpoint_from_pc (gdbarch, microblaze_breakpoint_from_pc); 489 set_gdbarch_breakpoint_from_pc (gdbarch, microblaze_breakpoint_from_pc);
490 set_gdbarch_software_single_step (gdbarch, microblaze_software_single_step);
409 491
410 set_gdbarch_frame_args_skip (gdbarch, 8);
411diff --git a/gdb/microblaze-tdep.h b/gdb/microblaze-tdep.h 492diff --git a/gdb/microblaze-tdep.h b/gdb/microblaze-tdep.h
412index ff4515e..9fdbda7 100644 493index fec24b9..98aa0f5 100644
413--- a/gdb/microblaze-tdep.h 494--- a/gdb/microblaze-tdep.h
414+++ b/gdb/microblaze-tdep.h 495+++ b/gdb/microblaze-tdep.h
415@@ -115,6 +115,7 @@ enum microblaze_regnum 496@@ -129,7 +129,8 @@ enum microblaze_regnum
416 497
417 /* MICROBLAZE_BREAKPOINT defines the breakpoint that should be used. 498 /* MICROBLAZE_BREAKPOINT defines the breakpoint that should be used.
418 Only used for native debugging. */ 499 Only used for native debugging. */
@@ -420,7 +501,8 @@ index ff4515e..9fdbda7 100644
420+#define MICROBLAZE_BREAKPOINT {0xba, 0x0c, 0x00, 0x18} 501+#define MICROBLAZE_BREAKPOINT {0xba, 0x0c, 0x00, 0x18}
421+#define MICROBLAZE_BREAKPOINT_LE {0x18, 0x00, 0x0c, 0xba} 502+#define MICROBLAZE_BREAKPOINT_LE {0x18, 0x00, 0x0c, 0xba}
422 503
423 #endif /* microblaze-tdep.h */ 504 extern void microblaze_supply_gregset (const struct microblaze_gregset *gregset,
505 struct regcache *regcache,
424diff --git a/gdb/regformats/reg-microblaze.dat b/gdb/regformats/reg-microblaze.dat 506diff --git a/gdb/regformats/reg-microblaze.dat b/gdb/regformats/reg-microblaze.dat
425new file mode 100644 507new file mode 100644
426index 0000000..a5dd0a0 508index 0000000..a5dd0a0
@@ -467,5 +549,5 @@ index 0000000..a5dd0a0
467+32:esr 549+32:esr
468+32:fsr 550+32:fsr
469-- 551--
4701.7.9.5 5521.9.0
471 553
diff --git a/recipes-devtools/gdb/files/0006-Add-slr-and-shr-regs-and-little-endian-breakpoint.patch b/recipes-devtools/gdb/files/0007-Patch-microblaze-Add-slr-and-shr-regs-and-little-end.patch
index 53020f9d..7cd11905 100644
--- a/recipes-devtools/gdb/files/0006-Add-slr-and-shr-regs-and-little-endian-breakpoint.patch
+++ b/recipes-devtools/gdb/files/0007-Patch-microblaze-Add-slr-and-shr-regs-and-little-end.patch
@@ -1,20 +1,22 @@
1From fb2af2fffb673dbb14d743c8da94c4a83b71c792 Mon Sep 17 00:00:00 2001
1From: David Holsgrove <david.holsgrove@xilinx.com> 2From: David Holsgrove <david.holsgrove@xilinx.com>
2Date: Mon, 26 Nov 2012 17:39:17 +1000 3Date: Mon, 26 Nov 2012 17:39:17 +1000
3Subject: Add slr and shr regs and little-endian breakpoint 4Subject: [PATCH 07/16] [Patch, microblaze]: Add slr and shr regs and
5 little-endian breakpoint
4 6
5Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com> 7Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
6Upstream-Status: Pending 8Upstream-Status: Pending
7--- 9---
8 gdb/microblaze-tdep.c | 10 ++++++++-- 10 gdb/microblaze-tdep.c | 10 ++++++++--
9 gdb/microblaze-tdep.h | 6 ++++-- 11 gdb/microblaze-tdep.h | 6 ++++--
10 gdb/regformats/reg-microblaze.dat | 2 ++ 12 gdb/regformats/reg-microblaze.dat | 2 ++
11 3 files changed, 14 insertions(+), 4 deletions(-) 13 3 files changed, 14 insertions(+), 4 deletions(-)
12 14
13diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c 15diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c
14index cfc227d..a245169 100644 16index 1c6dbfe..0ce4947 100644
15--- a/gdb/microblaze-tdep.c 17--- a/gdb/microblaze-tdep.c
16+++ b/gdb/microblaze-tdep.c 18+++ b/gdb/microblaze-tdep.c
17@@ -74,7 +74,8 @@ static const char *microblaze_register_names[] = 19@@ -73,7 +73,8 @@ static const char *microblaze_register_names[] =
18 "rpc", "rmsr", "rear", "resr", "rfsr", "rbtr", 20 "rpc", "rmsr", "rear", "resr", "rfsr", "rbtr",
19 "rpvr0", "rpvr1", "rpvr2", "rpvr3", "rpvr4", "rpvr5", "rpvr6", 21 "rpvr0", "rpvr1", "rpvr2", "rpvr3", "rpvr4", "rpvr5", "rpvr6",
20 "rpvr7", "rpvr8", "rpvr9", "rpvr10", "rpvr11", 22 "rpvr7", "rpvr8", "rpvr9", "rpvr10", "rpvr11",
@@ -24,7 +26,7 @@ index cfc227d..a245169 100644
24 }; 26 };
25 27
26 #define MICROBLAZE_NUM_REGS ARRAY_SIZE (microblaze_register_names) 28 #define MICROBLAZE_NUM_REGS ARRAY_SIZE (microblaze_register_names)
27@@ -202,10 +203,15 @@ static const gdb_byte * 29@@ -201,10 +202,15 @@ static const gdb_byte *
28 microblaze_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pc, 30 microblaze_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pc,
29 int *len) 31 int *len)
30 { 32 {
@@ -42,7 +44,7 @@ index cfc227d..a245169 100644
42 44
43 /* Allocate and initialize a frame cache. */ 45 /* Allocate and initialize a frame cache. */
44diff --git a/gdb/microblaze-tdep.h b/gdb/microblaze-tdep.h 46diff --git a/gdb/microblaze-tdep.h b/gdb/microblaze-tdep.h
45index 7de4463..23dc77a 100644 47index 98aa0f5..cd32e9f 100644
46--- a/gdb/microblaze-tdep.h 48--- a/gdb/microblaze-tdep.h
47+++ b/gdb/microblaze-tdep.h 49+++ b/gdb/microblaze-tdep.h
48@@ -56,7 +56,7 @@ struct microblaze_frame_cache 50@@ -56,7 +56,7 @@ struct microblaze_frame_cache
@@ -76,5 +78,5 @@ index a5dd0a0..bd8a438 100644
76+32:slr 78+32:slr
77+32:shr 79+32:shr
78-- 80--
791.7.9.5 811.9.0
80 82
diff --git a/recipes-devtools/gdb/files/0012-Added-Backtrace-support-to-GDB.patch b/recipes-devtools/gdb/files/0008-Patch-microblaze-Added-Backtrace-support-to-GDB.patch
index b6bbe497..7f075d55 100644
--- a/recipes-devtools/gdb/files/0012-Added-Backtrace-support-to-GDB.patch
+++ b/recipes-devtools/gdb/files/0008-Patch-microblaze-Added-Backtrace-support-to-GDB.patch
@@ -1,24 +1,30 @@
1From 7944750e435100e72913f01aa0a43b7d7cffd421 Mon Sep 17 00:00:00 2001
1From: nagaraju <nmekala@xilix.com> 2From: nagaraju <nmekala@xilix.com>
2Date: Tue, 3 Sep 2013 12:09:47 +0530 3Date: Tue, 3 Sep 2013 12:09:47 +0530
3Subject: Added Backtrace support to GDB 4Subject: [PATCH 08/16] [Patch, microblaze]: Added Backtrace support to GDB
4 5
5Added backtrace support without debugging information, Earlier backtrace used to work only when debug information is avialable. 6Added backtrace support without debugging information.
6Previous pc & sp values are calculated incorrectly due to which backtrace was failing. 7
7In this patch, previous frame sp & pc values are calculated correctly in microblaze_frame_cache function 8Earlier backtrace used to work only when debug information is available.
8and supplied them to microblaze_frame_prev_register function 9Previous pc & sp values are calculated incorrectly due to which backtrace
10was failing.
11
12In this patch, previous frame sp & pc values are calculated correctly
13in microblaze_frame_cache function and supplied them to
14microblaze_frame_prev_register function
9 15
10Signed-off-by:nagaraju <nmekala@xilix.com> 16Signed-off-by:nagaraju <nmekala@xilix.com>
11Upstream-Status: Pending 17Upstream-Status: Pending
12--- 18---
13 gdb/microblaze-tdep.c | 44 ++++++++++++++++++++++++++++++-------------- 19 gdb/microblaze-tdep.c | 42 ++++++++++++++++++++++++++++++++++--------
14 gdb/microblaze-tdep.h | 5 +++-- 20 gdb/microblaze-tdep.h | 5 +++--
15 2 files changed, 33 insertions(+), 16 deletions(-) 21 2 files changed, 37 insertions(+), 10 deletions(-)
16 22
17diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c 23diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c
18index 9c9f3a9..f4b48a6 100644 24index 0ce4947..247740e 100644
19--- a/gdb/microblaze-tdep.c 25--- a/gdb/microblaze-tdep.c
20+++ b/gdb/microblaze-tdep.c 26+++ b/gdb/microblaze-tdep.c
21@@ -226,6 +226,7 @@ microblaze_alloc_frame_cache (void) 27@@ -225,6 +225,7 @@ microblaze_alloc_frame_cache (void)
22 /* Base address. */ 28 /* Base address. */
23 cache->base = 0; 29 cache->base = 0;
24 cache->pc = 0; 30 cache->pc = 0;
@@ -81,11 +87,10 @@ index 9c9f3a9..f4b48a6 100644
81 } 87 }
82 88
83 static struct value * 89 static struct value *
84@@ -558,18 +569,23 @@ microblaze_frame_prev_register (struct frame_info *this_frame, 90@@ -558,6 +569,14 @@ microblaze_frame_prev_register (struct frame_info *this_frame,
85 struct microblaze_frame_cache *cache = 91 struct microblaze_frame_cache *cache =
86 microblaze_frame_cache (this_frame, this_cache); 92 microblaze_frame_cache (this_frame, this_cache);
87 93
88- if (cache->frameless_p)
89+ if ((regnum == MICROBLAZE_SP_REGNUM && 94+ if ((regnum == MICROBLAZE_SP_REGNUM &&
90+ cache->register_offsets[MICROBLAZE_SP_REGNUM]) 95+ cache->register_offsets[MICROBLAZE_SP_REGNUM])
91+ || (regnum == MICROBLAZE_FP_REGNUM && 96+ || (regnum == MICROBLAZE_FP_REGNUM &&
@@ -94,29 +99,34 @@ index 9c9f3a9..f4b48a6 100644
94+ return frame_unwind_got_constant (this_frame, regnum, 99+ return frame_unwind_got_constant (this_frame, regnum,
95+ cache->register_offsets[MICROBLAZE_SP_REGNUM]); 100+ cache->register_offsets[MICROBLAZE_SP_REGNUM]);
96+ 101+
97+ if (regnum == MICROBLAZE_PC_REGNUM) 102 if (cache->frameless_p)
98 { 103 {
99- if (regnum == MICROBLAZE_PC_REGNUM) 104 if (regnum == MICROBLAZE_PC_REGNUM)
100- regnum = 15; 105@@ -565,11 +584,18 @@ microblaze_frame_prev_register (struct frame_info *this_frame,
101- if (regnum == MICROBLAZE_SP_REGNUM) 106 if (regnum == MICROBLAZE_SP_REGNUM)
102- regnum = 1; 107 regnum = 1;
103- return trad_frame_get_prev_register (this_frame, 108 return trad_frame_get_prev_register (this_frame,
104- cache->saved_regs, regnum); 109- cache->saved_regs, regnum);
105+ regnum = 15; 110+ cache->saved_regs, regnum);
106+ return frame_unwind_got_memory (this_frame, regnum,
107+ cache->register_offsets[MICROBLAZE_PREV_PC_REGNUM]);
108 } 111 }
109- else 112- else
110- return trad_frame_get_prev_register (this_frame, cache->saved_regs, 113- return trad_frame_get_prev_register (this_frame, cache->saved_regs,
111- regnum); 114- regnum);
112+ 115+
116+ if (regnum == MICROBLAZE_PC_REGNUM)
117+ {
118+ regnum = 15;
119+ return frame_unwind_got_memory (this_frame, regnum,
120+ cache->register_offsets[MICROBLAZE_PREV_PC_REGNUM]);
121+ }
122+
113+ return trad_frame_get_prev_register (this_frame, cache->saved_regs, 123+ return trad_frame_get_prev_register (this_frame, cache->saved_regs,
114+ regnum); 124+ regnum);
115 125
116 } 126 }
117 127
118diff --git a/gdb/microblaze-tdep.h b/gdb/microblaze-tdep.h 128diff --git a/gdb/microblaze-tdep.h b/gdb/microblaze-tdep.h
119index 23dc77a..cf24ed4 100644 129index cd32e9f..14eb3ab 100644
120--- a/gdb/microblaze-tdep.h 130--- a/gdb/microblaze-tdep.h
121+++ b/gdb/microblaze-tdep.h 131+++ b/gdb/microblaze-tdep.h
122@@ -57,6 +57,7 @@ struct microblaze_frame_cache 132@@ -57,6 +57,7 @@ struct microblaze_frame_cache
@@ -142,5 +152,5 @@ index 23dc77a..cf24ed4 100644
142 MICROBLAZE_R21_REGNUM, 152 MICROBLAZE_R21_REGNUM,
143 MICROBLAZE_R22_REGNUM, 153 MICROBLAZE_R22_REGNUM,
144-- 154--
1451.7.9.5 1551.9.0
146 156
diff --git a/recipes-devtools/gdb/files/0003-Initial-support-for-native-gdb.patch b/recipes-devtools/gdb/files/0009-Patch-microblaze-Initial-support-for-native-gdb.patch
index 8281352e..1ad6b89c 100644
--- a/recipes-devtools/gdb/files/0003-Initial-support-for-native-gdb.patch
+++ b/recipes-devtools/gdb/files/0009-Patch-microblaze-Initial-support-for-native-gdb.patch
@@ -1,6 +1,7 @@
1From c7b918283f2e438deef78aae84f6b748a7a1bb54 Mon Sep 17 00:00:00 2001
1From: David Holsgrove <david.holsgrove@petalogix.com> 2From: David Holsgrove <david.holsgrove@petalogix.com>
2Date: Fri, 20 Jul 2012 15:18:35 +1000 3Date: Fri, 20 Jul 2012 15:18:35 +1000
3Subject: Initial support for native gdb 4Subject: [PATCH 09/16] [Patch, microblaze]: Initial support for native gdb
4 5
5microblaze: Follow PPC method of getting setting registers 6microblaze: Follow PPC method of getting setting registers
6using PTRACE PEEK/POKE 7using PTRACE PEEK/POKE
@@ -8,18 +9,18 @@ using PTRACE PEEK/POKE
8Signed-off-by: David Holsgrove <david.holsgrove@petalogix.com> 9Signed-off-by: David Holsgrove <david.holsgrove@petalogix.com>
9Upstream-Status: Pending 10Upstream-Status: Pending
10--- 11---
11 gdb/Makefile.in | 4 +- 12 gdb/Makefile.in | 4 +-
12 gdb/config/microblaze/linux.mh | 9 + 13 gdb/config/microblaze/linux.mh | 10 +
13 gdb/microblaze-linux-nat.c | 431 ++++++++++++++++++++++++++++++++++++++++ 14 gdb/microblaze-linux-nat.c | 431 +++++++++++++++++++++++++++++++++++++++++
14 3 files changed, 442 insertions(+), 2 deletions(-) 15 3 files changed, 443 insertions(+), 2 deletions(-)
15 create mode 100644 gdb/config/microblaze/linux.mh 16 create mode 100644 gdb/config/microblaze/linux.mh
16 create mode 100644 gdb/microblaze-linux-nat.c 17 create mode 100644 gdb/microblaze-linux-nat.c
17 18
18diff --git a/gdb/Makefile.in b/gdb/Makefile.in 19diff --git a/gdb/Makefile.in b/gdb/Makefile.in
19index 3fd5425..e5781f2 100644 20index f2c16ec..12870a4 100644
20--- a/gdb/Makefile.in 21--- a/gdb/Makefile.in
21+++ b/gdb/Makefile.in 22+++ b/gdb/Makefile.in
22@@ -821,7 +821,7 @@ config/rs6000/nm-rs6000.h top.h bsd-kvm.h gdb-stabs.h reggroups.h \ 23@@ -904,7 +904,7 @@ top.h bsd-kvm.h gdb-stabs.h reggroups.h \
23 annotate.h sim-regno.h dictionary.h dfp.h main.h frame-unwind.h \ 24 annotate.h sim-regno.h dictionary.h dfp.h main.h frame-unwind.h \
24 remote-fileio.h i386-linux-tdep.h vax-tdep.h objc-lang.h \ 25 remote-fileio.h i386-linux-tdep.h vax-tdep.h objc-lang.h \
25 sentinel-frame.h bcache.h symfile.h windows-tdep.h linux-tdep.h \ 26 sentinel-frame.h bcache.h symfile.h windows-tdep.h linux-tdep.h \
@@ -28,7 +29,7 @@ index 3fd5425..e5781f2 100644
28 psymtab.h psympriv.h progspace.h bfin-tdep.h ia64-hpux-tdep.h \ 29 psymtab.h psympriv.h progspace.h bfin-tdep.h ia64-hpux-tdep.h \
29 amd64-darwin-tdep.h charset-list.h \ 30 amd64-darwin-tdep.h charset-list.h \
30 config/djgpp/langinfo.h config/djgpp/nl_types.h darwin-nat.h \ 31 config/djgpp/langinfo.h config/djgpp/nl_types.h darwin-nat.h \
31@@ -1481,7 +1481,7 @@ ALLDEPFILES = \ 32@@ -1631,7 +1631,7 @@ ALLDEPFILES = \
32 m68kbsd-nat.c m68kbsd-tdep.c \ 33 m68kbsd-nat.c m68kbsd-tdep.c \
33 m68klinux-nat.c m68klinux-tdep.c \ 34 m68klinux-nat.c m68klinux-tdep.c \
34 m88k-tdep.c m88kbsd-nat.c \ 35 m88k-tdep.c m88kbsd-nat.c \
@@ -39,22 +40,23 @@ index 3fd5425..e5781f2 100644
39 mips-irix-tdep.c \ 40 mips-irix-tdep.c \
40diff --git a/gdb/config/microblaze/linux.mh b/gdb/config/microblaze/linux.mh 41diff --git a/gdb/config/microblaze/linux.mh b/gdb/config/microblaze/linux.mh
41new file mode 100644 42new file mode 100644
42index 0000000..a4eaf54 43index 0000000..547d103
43--- /dev/null 44--- /dev/null
44+++ b/gdb/config/microblaze/linux.mh 45+++ b/gdb/config/microblaze/linux.mh
45@@ -0,0 +1,9 @@ 46@@ -0,0 +1,10 @@
46+# Host: Microblaze, running Linux 47+# Host: Microblaze, running Linux
47+ 48+
48+NAT_FILE= config/nm-linux.h 49+NAT_FILE= config/nm-linux.h
49+NATDEPFILES= inf-ptrace.o fork-child.o \ 50+NATDEPFILES= inf-ptrace.o fork-child.o \
50+ microblaze-linux-nat.o proc-service.o linux-thread-db.o \ 51+ microblaze-linux-nat.o proc-service.o linux-thread-db.o \
51+ linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o 52+ linux-nat.o linux-osdata.o linux-fork.o linux-procfs.o linux-ptrace.o \
53+ linux-waitpid.o
52+NAT_CDEPS = $(srcdir)/proc-service.list 54+NAT_CDEPS = $(srcdir)/proc-service.list
53+ 55+
54+LOADLIBES = -ldl $(RDYNAMIC) 56+LOADLIBES = -ldl $(RDYNAMIC)
55diff --git a/gdb/microblaze-linux-nat.c b/gdb/microblaze-linux-nat.c 57diff --git a/gdb/microblaze-linux-nat.c b/gdb/microblaze-linux-nat.c
56new file mode 100644 58new file mode 100644
57index 0000000..e9b8c9c 59index 0000000..81f8346
58--- /dev/null 60--- /dev/null
59+++ b/gdb/microblaze-linux-nat.c 61+++ b/gdb/microblaze-linux-nat.c
60@@ -0,0 +1,431 @@ 62@@ -0,0 +1,431 @@
@@ -97,7 +99,7 @@ index 0000000..e9b8c9c
97+#include "osabi.h" 99+#include "osabi.h"
98+ 100+
99+#include "gdb_assert.h" 101+#include "gdb_assert.h"
100+#include "gdb_string.h" 102+#include <string.h>
101+#include "target-descriptions.h" 103+#include "target-descriptions.h"
102+#include "opcodes/microblaze-opcm.h" 104+#include "opcodes/microblaze-opcm.h"
103+#include "opcodes/microblaze-dis.h" 105+#include "opcodes/microblaze-dis.h"
@@ -130,9 +132,9 @@ index 0000000..e9b8c9c
130+int 132+int
131+get_thread_id (ptid_t ptid) 133+get_thread_id (ptid_t ptid)
132+{ 134+{
133+ int tid = TIDGET (ptid); 135+ int tid = ptid_get_lwp (ptid);
134+ if (0 == tid) 136+ if (0 == tid)
135+ tid = PIDGET (ptid); 137+ tid = ptid_get_pid (ptid);
136+ return tid; 138+ return tid;
137+} 139+}
138+ 140+
@@ -490,5 +492,4 @@ index 0000000..e9b8c9c
490+ linux_nat_add_target (t); 492+ linux_nat_add_target (t);
491+} 493+}
492-- 494--
4931.7.9.5 4951.9.0
494
diff --git a/recipes-devtools/gdb/files/0004-Robustify-inline-function-support.patch b/recipes-devtools/gdb/files/0010-Patch-gdb-Robustify-inline-function-support.patch
index 24759d73..3912ca57 100644
--- a/recipes-devtools/gdb/files/0004-Robustify-inline-function-support.patch
+++ b/recipes-devtools/gdb/files/0010-Patch-gdb-Robustify-inline-function-support.patch
@@ -1,19 +1,20 @@
1From a02963a97d7ce38b0af205f9e3e6dd7e0e06d9be Mon Sep 17 00:00:00 2001
1From: "Edgar E. Iglesias" <edgar@axis.com> 2From: "Edgar E. Iglesias" <edgar@axis.com>
2Date: Mon, 27 Feb 2012 06:28:00 +0100 3Date: Mon, 27 Feb 2012 06:28:00 +0100
3Subject: Robustify inline function support 4Subject: [PATCH 10/16] [Patch, gdb]: Robustify inline function support
4 5
5Signed-off-by: Edgar E. Iglesias <edgar@axis.com> 6Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
6Upstream-Status: Pending 7Upstream-Status: Pending
7--- 8---
8 gdb/blockframe.c | 3 ++- 9 gdb/blockframe.c | 3 ++-
9 gdb/inline-frame.c | 3 +++ 10 gdb/inline-frame.c | 3 +++
10 2 files changed, 5 insertions(+), 1 deletion(-) 11 2 files changed, 5 insertions(+), 1 deletion(-)
11 12
12diff --git a/gdb/blockframe.c b/gdb/blockframe.c 13diff --git a/gdb/blockframe.c b/gdb/blockframe.c
13index d5787f1..80e40a3 100644 14index 0a9381e..ba41d85 100644
14--- a/gdb/blockframe.c 15--- a/gdb/blockframe.c
15+++ b/gdb/blockframe.c 16+++ b/gdb/blockframe.c
16@@ -78,7 +78,8 @@ get_frame_block (struct frame_info *frame, CORE_ADDR *addr_in_block) 17@@ -77,7 +77,8 @@ get_frame_block (struct frame_info *frame, CORE_ADDR *addr_in_block)
17 inline_count--; 18 inline_count--;
18 19
19 bl = BLOCK_SUPERBLOCK (bl); 20 bl = BLOCK_SUPERBLOCK (bl);
@@ -24,10 +25,10 @@ index d5787f1..80e40a3 100644
24 25
25 return bl; 26 return bl;
26diff --git a/gdb/inline-frame.c b/gdb/inline-frame.c 27diff --git a/gdb/inline-frame.c b/gdb/inline-frame.c
27index 2773814..c3a77ad 100644 28index eb82143..a793390 100644
28--- a/gdb/inline-frame.c 29--- a/gdb/inline-frame.c
29+++ b/gdb/inline-frame.c 30+++ b/gdb/inline-frame.c
30@@ -230,6 +230,9 @@ inline_frame_sniffer (const struct frame_unwind *self, 31@@ -231,6 +231,9 @@ inline_frame_sniffer (const struct frame_unwind *self,
31 cur_block = BLOCK_SUPERBLOCK (cur_block); 32 cur_block = BLOCK_SUPERBLOCK (cur_block);
32 } 33 }
33 34
@@ -38,5 +39,5 @@ index 2773814..c3a77ad 100644
38 for (next_frame = get_next_frame (this_frame); 39 for (next_frame = get_next_frame (this_frame);
39 next_frame && get_frame_type (next_frame) == INLINE_FRAME; 40 next_frame && get_frame_type (next_frame) == INLINE_FRAME;
40-- 41--
411.7.9.5 421.9.0
42 43
diff --git a/recipes-devtools/gdb/files/0010-revert-master-rebase-changes-to-gdbserver.patch b/recipes-devtools/gdb/files/0010-revert-master-rebase-changes-to-gdbserver.patch
deleted file mode 100644
index edd6a5a7..00000000
--- a/recipes-devtools/gdb/files/0010-revert-master-rebase-changes-to-gdbserver.patch
+++ /dev/null
@@ -1,160 +0,0 @@
1From: David Holsgrove <david.holsgrove@xilinx.com>
2Date: Mon, 22 Jul 2013 11:16:05 +1000
3Subject: revert master-rebase changes to gdbserver
4
5Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
6Upstream-Status: Pending
7---
8 gdb/gdbserver/Makefile.in | 4 +++
9 gdb/gdbserver/configure.srv | 7 +++++
10 gdb/gdbserver/linux-microblaze-low.c | 53 +++++-----------------------------
11 3 files changed, 18 insertions(+), 46 deletions(-)
12
13diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
14index 08db2cc..aa76959 100644
15--- a/gdb/gdbserver/Makefile.in
16+++ b/gdb/gdbserver/Makefile.in
17@@ -143,6 +143,7 @@ SFILES= $(srcdir)/gdbreplay.c $(srcdir)/inferiors.c $(srcdir)/dll.c \
18 $(srcdir)/linux-ia64-low.c $(srcdir)/linux-low.c \
19 $(srcdir)/linux-m32r-low.c \
20 $(srcdir)/linux-m68k-low.c $(srcdir)/linux-mips-low.c \
21+ $(srcdir)/linux-microblaze-low.c \
22 $(srcdir)/linux-ppc-low.c \
23 $(srcdir)/linux-s390-low.c \
24 $(srcdir)/linux-sh-low.c $(srcdir)/linux-sparc-low.c \
25@@ -336,6 +337,7 @@ clean:
26 rm -f i386-avx.c i386-avx-linux.c
27 rm -f amd64-avx.c amd64-avx-linux.c
28 rm -f i386-mmx.c i386-mmx-linux.c
29+ rm -f microblaze-linux.c
30 rm -f x32.c x32-linux.c
31 rm -f x32-avx.c x32-avx-linux.c
32 @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do
33@@ -616,6 +618,8 @@ mips64-linux.c : $(srcdir)/../regformats/mips64-linux.dat $(regdat_sh)
34 $(SHELL) $(regdat_sh) $(srcdir)/../regformats/mips64-linux.dat mips64-linux.c
35 mips64-dsp-linux.c : $(srcdir)/../regformats/mips64-dsp-linux.dat $(regdat_sh)
36 $(SHELL) $(regdat_sh) $(srcdir)/../regformats/mips64-dsp-linux.dat mips64-dsp-linux.c
37+microblaze-linux.c : $(srcdir)/../regformats/reg-microblaze.dat $(regdat_sh)
38+ $(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-microblaze.dat microblaze-linux.c
39 powerpc-32.c : $(srcdir)/../regformats/rs6000/powerpc-32.dat $(regdat_sh)
40 $(SHELL) $(regdat_sh) $(srcdir)/../regformats/rs6000/powerpc-32.dat powerpc-32.c
41 powerpc-32l.c : $(srcdir)/../regformats/rs6000/powerpc-32l.dat $(regdat_sh)
42diff --git a/gdb/gdbserver/configure.srv b/gdb/gdbserver/configure.srv
43index 271a0fe..57bd3a4c 100644
44--- a/gdb/gdbserver/configure.srv
45+++ b/gdb/gdbserver/configure.srv
46@@ -201,6 +201,13 @@ case "${target}" in
47 srv_linux_usrregs=yes
48 srv_linux_thread_db=yes
49 ;;
50+ microblaze*-*-linux*) srv_regobj=microblaze-linux.o
51+ srv_tgtobj="linux-low.o linux-osdata.o linux-microblaze-low.o "
52+ srv_tgtobj="${srv_tgtobj} linux-procfs.o linux-ptrace.o"
53+ srv_linux_regsets=yes
54+ srv_linux_usrregs=yes
55+ srv_linux_thread_db=yes
56+ ;;
57 powerpc*-*-linux*) srv_regobj="powerpc-32l.o"
58 srv_regobj="${srv_regobj} powerpc-altivec32l.o"
59 srv_regobj="${srv_regobj} powerpc-cell32l.o"
60diff --git a/gdb/gdbserver/linux-microblaze-low.c b/gdb/gdbserver/linux-microblaze-low.c
61index 279df9f..cba5d6f 100644
62--- a/gdb/gdbserver/linux-microblaze-low.c
63+++ b/gdb/gdbserver/linux-microblaze-low.c
64@@ -43,7 +43,6 @@ static int microblaze_regmap[] =
65
66 /* Defined in auto-generated file microblaze-linux.c. */
67 void init_registers_microblaze (void);
68-extern const struct target_desc *tdesc_microblaze;
69
70 static int
71 microblaze_cannot_store_register (int regno)
72@@ -108,7 +107,7 @@ microblaze_reinsert_addr (struct regcache *regcache)
73 static void
74 microblaze_collect_ptrace_register (struct regcache *regcache, int regno, char *buf)
75 {
76- int size = register_size (regcache->tdesc, regno);
77+ int size = register_size (regno);
78
79 memset (buf, 0, sizeof (long));
80
81@@ -122,7 +121,7 @@ static void
82 microblaze_supply_ptrace_register (struct regcache *regcache,
83 int regno, const char *buf)
84 {
85- int size = register_size (regcache->tdesc, regno);
86+ int size = register_size (regno);
87
88 if (regno == 0) {
89 unsigned long regbuf_0 = 0;
90@@ -158,7 +157,7 @@ microblaze_store_gregset (struct regcache *regcache, const void *buf)
91
92 #endif /* HAVE_PTRACE_GETREGS */
93
94-static struct regset_info microblaze_regsets[] = {
95+struct regset_info target_regsets[] = {
96 #ifdef HAVE_PTRACE_GETREGS
97 { PTRACE_GETREGS, PTRACE_SETREGS, 0, sizeof (elf_gregset_t), GENERAL_REGS, microblaze_fill_gregset, microblaze_store_gregset },
98 { 0, 0, 0, -1, -1, NULL, NULL },
99@@ -166,41 +165,11 @@ static struct regset_info microblaze_regsets[] = {
100 { 0, 0, 0, -1, -1, NULL, NULL }
101 };
102
103-static struct regsets_info microblaze_regsets_info =
104- {
105- microblaze_regsets, /* regsets */
106- 0, /* num_regsets */
107- NULL, /* disabled_regsets */
108- };
109-
110-static struct usrregs_info microblaze_usrregs_info =
111- {
112- microblaze_num_regs,
113- microblaze_regmap,
114- };
115-
116-static struct regs_info regs_info =
117- {
118- NULL, /* regset_bitmap */
119- &microblaze_usrregs_info,
120- &microblaze_regsets_info
121- };
122-
123-static const struct regs_info *
124-microblaze_regs_info (void)
125-{
126- return &regs_info;
127-}
128-
129-static void
130-microblaze_arch_setup (void)
131-{
132- current_process ()->tdesc = tdesc_microblaze;
133-}
134-
135 struct linux_target_ops the_low_target = {
136- microblaze_arch_setup,
137- microblaze_regs_info,
138+ init_registers_microblaze,
139+ microblaze_num_regs,
140+ microblaze_regmap,
141+ NULL,
142 microblaze_cannot_fetch_register,
143 microblaze_cannot_store_register,
144 NULL, /* fetch_register */
145@@ -218,11 +187,3 @@ struct linux_target_ops the_low_target = {
146 microblaze_collect_ptrace_register,
147 microblaze_supply_ptrace_register,
148 };
149-
150-void
151-initialize_low_arch (void)
152-{
153- init_registers_microblaze ();
154-
155- initialize_regsets_info (&microblaze_regsets_info);
156-}
157\ No newline at end of file
158--
1591.7.9.5
160
diff --git a/recipes-devtools/gdb/files/0005-Fix-debug-message-when-register-is-unavailable.patch b/recipes-devtools/gdb/files/0011-Patch-gdb-Fix-debug-message-when-register-is-unavail.patch
index 67520f4c..bdec77c5 100644
--- a/recipes-devtools/gdb/files/0005-Fix-debug-message-when-register-is-unavailable.patch
+++ b/recipes-devtools/gdb/files/0011-Patch-gdb-Fix-debug-message-when-register-is-unavail.patch
@@ -1,18 +1,21 @@
1From a05fb34192727fc1b63c827ed006ddde846ce6b8 Mon Sep 17 00:00:00 2001
1From: Nathan Rossi <nathan.rossi@petalogix.com> 2From: Nathan Rossi <nathan.rossi@petalogix.com>
2Date: Tue, 8 May 2012 18:11:17 +1000 3Date: Tue, 8 May 2012 18:11:17 +1000
3Subject: Fix debug message when register is unavailable 4Subject: [PATCH 11/16] [Patch, gdb]: Fix debug message when register is
5 unavailable
4 6
5Signed-off-by: Nathan Rossi <nathan.rossi@petalogix.com> 7Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>
8Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
6Upstream-Status: Pending 9Upstream-Status: Pending
7--- 10---
8 gdb/frame.c | 13 ++++++++++--- 11 gdb/frame.c | 13 ++++++++++---
9 1 file changed, 10 insertions(+), 3 deletions(-) 12 1 file changed, 10 insertions(+), 3 deletions(-)
10 13
11diff --git a/gdb/frame.c b/gdb/frame.c 14diff --git a/gdb/frame.c b/gdb/frame.c
12index 4b8ab60..7ad7cb3 100644 15index 013d602..4d0766f 100644
13--- a/gdb/frame.c 16--- a/gdb/frame.c
14+++ b/gdb/frame.c 17+++ b/gdb/frame.c
15@@ -979,12 +979,19 @@ frame_unwind_register_value (struct frame_info *frame, int regnum) 18@@ -1134,12 +1134,19 @@ frame_unwind_register_value (struct frame_info *frame, int regnum)
16 else 19 else
17 { 20 {
18 int i; 21 int i;
@@ -36,5 +39,5 @@ index 4b8ab60..7ad7cb3 100644
36 } 39 }
37 } 40 }
38-- 41--
391.7.9.5 421.9.0
40 43
diff --git a/recipes-devtools/gdb/files/0012-LOCAL-Disable-the-warning-message-for-eh_frame_hdr.patch b/recipes-devtools/gdb/files/0012-LOCAL-Disable-the-warning-message-for-eh_frame_hdr.patch
new file mode 100644
index 00000000..819cd179
--- /dev/null
+++ b/recipes-devtools/gdb/files/0012-LOCAL-Disable-the-warning-message-for-eh_frame_hdr.patch
@@ -0,0 +1,34 @@
1From f54d5334afe799e15ca21c5d83097a4c81bbab7e Mon Sep 17 00:00:00 2001
2From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
3Date: Fri, 22 Jun 2012 01:20:20 +0200
4Subject: [PATCH 12/16] [LOCAL]: Disable the warning message for eh_frame_hdr
5
6Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
7Upstream-Status: Pending
8---
9 bfd/elf-eh-frame.c | 9 ++++++---
10 1 file changed, 6 insertions(+), 3 deletions(-)
11
12diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c
13index 0f0a563..7d8e047 100644
14--- a/bfd/elf-eh-frame.c
15+++ b/bfd/elf-eh-frame.c
16@@ -919,9 +919,12 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info,
17 goto success;
18
19 free_no_table:
20- (*info->callbacks->einfo)
21- (_("%P: error in %B(%A); no .eh_frame_hdr table will be created.\n"),
22- abfd, sec);
23+ /* FIXME: Remove the microblaze specifics when relaxing gets fixed. */
24+ if (bfd_get_arch(abfd) != bfd_arch_microblaze) {
25+ (*info->callbacks->einfo)
26+ (_("%P: error in %B(%A); no .eh_frame_hdr table will be created.\n"),
27+ abfd, sec);
28+ }
29 hdr_info->table = FALSE;
30 if (sec_info)
31 free (sec_info);
32--
331.9.0
34
diff --git a/recipes-devtools/gdb/files/0007-Fix-relaxation-of-assembler-resolved-references.patch b/recipes-devtools/gdb/files/0013-LOCAL-Fix-relaxation-of-assembler-resolved-reference.patch
index 3aaaf0ab..3a0eae83 100644
--- a/recipes-devtools/gdb/files/0007-Fix-relaxation-of-assembler-resolved-references.patch
+++ b/recipes-devtools/gdb/files/0013-LOCAL-Fix-relaxation-of-assembler-resolved-reference.patch
@@ -1,17 +1,19 @@
1From c9f1f07e5b0756069e3d4b04eb9505027f09677f Mon Sep 17 00:00:00 2001
1From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com> 2From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
2Date: Tue, 14 Feb 2012 01:00:22 +0100 3Date: Tue, 14 Feb 2012 01:00:22 +0100
3Subject: Fix relaxation of assembler resolved references 4Subject: [PATCH 13/16] [LOCAL]: Fix relaxation of assembler resolved
5 references
4 6
5Upstream-Status: Pending 7Upstream-Status: Pending
6--- 8---
7 bfd/elf32-microblaze.c | 39 +++++++++++++++++++++++++++++++++++++++ 9 bfd/elf32-microblaze.c | 39 +++++++++++++++++++++++++++++++++++++++
8 1 file changed, 39 insertions(+) 10 1 file changed, 39 insertions(+)
9 11
10diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c 12diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c
11index 365546c..61926a4 100644 13index cbd18f0..f90df47 100644
12--- a/bfd/elf32-microblaze.c 14--- a/bfd/elf32-microblaze.c
13+++ b/bfd/elf32-microblaze.c 15+++ b/bfd/elf32-microblaze.c
14@@ -1967,6 +1967,45 @@ microblaze_elf_relax_section (bfd *abfd, 16@@ -1968,6 +1968,45 @@ microblaze_elf_relax_section (bfd *abfd,
15 irelscanend = irelocs + o->reloc_count; 17 irelscanend = irelocs + o->reloc_count;
16 for (irelscan = irelocs; irelscan < irelscanend; irelscan++) 18 for (irelscan = irelocs; irelscan < irelscanend; irelscan++)
17 { 19 {
@@ -58,5 +60,5 @@ index 365546c..61926a4 100644
58 { 60 {
59 isym = isymbuf + ELF32_R_SYM (irelscan->r_info); 61 isym = isymbuf + ELF32_R_SYM (irelscan->r_info);
60-- 62--
611.7.9.5 631.9.0
62 64
diff --git a/recipes-devtools/gdb/files/0013-microblaze-Handle-framless-functions-in-determining-.patch b/recipes-devtools/gdb/files/0013-microblaze-Handle-framless-functions-in-determining-.patch
deleted file mode 100644
index 70dcbe43..00000000
--- a/recipes-devtools/gdb/files/0013-microblaze-Handle-framless-functions-in-determining-.patch
+++ /dev/null
@@ -1,40 +0,0 @@
1From: David Holsgrove <david.holsgrove@xilinx.com>
2Date: Thu, 7 Nov 2013 16:58:48 +1000
3Subject: microblaze: Handle framless functions in determining
4 prev reg
5
6Add check for cache->frameless_p in microblaze_frame_prev_register
7to handle frameless functions, and correct the behaviour of using
8'next' to step through debugging
9
10Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
11Signed-off-by: Nagaraju Mekala <nagaraju.mekala@xilinx.com>
12Upstream-Status: Pending
13---
14 gdb/microblaze-tdep.c | 10 ++++++++++
15 1 file changed, 10 insertions(+)
16
17diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c
18index f4b48a6..a85adea6 100644
19--- a/gdb/microblaze-tdep.c
20+++ b/gdb/microblaze-tdep.c
21@@ -577,6 +577,16 @@ microblaze_frame_prev_register (struct frame_info *this_frame,
22 return frame_unwind_got_constant (this_frame, regnum,
23 cache->register_offsets[MICROBLAZE_SP_REGNUM]);
24
25+ if (cache->frameless_p)
26+ {
27+ if (regnum == MICROBLAZE_PC_REGNUM)
28+ regnum = 15;
29+ if (regnum == MICROBLAZE_SP_REGNUM)
30+ regnum = 1;
31+ return trad_frame_get_prev_register (this_frame,
32+ cache->saved_regs, regnum);
33+ }
34+
35 if (regnum == MICROBLAZE_PC_REGNUM)
36 {
37 regnum = 15;
38--
391.7.9.5
40
diff --git a/recipes-devtools/gdb/files/0008-Fixup-debug_loc-sections-after-linker-relaxation.patch b/recipes-devtools/gdb/files/0014-LOCAL-Fixup-debug_loc-sections-after-linker-relaxati.patch
index 95fc629b..85cee9d5 100644
--- a/recipes-devtools/gdb/files/0008-Fixup-debug_loc-sections-after-linker-relaxation.patch
+++ b/recipes-devtools/gdb/files/0014-LOCAL-Fixup-debug_loc-sections-after-linker-relaxati.patch
@@ -1,6 +1,8 @@
1From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com> 1From aca2758cff1f8fdc5ad7b6076ef985ba9ec5f857 Mon Sep 17 00:00:00 2001
2Date: Wed, 15 Feb 2012 13:53:02 +0100 2From: David Holsgrove <david.holsgrove@xilinx.com>
3Subject: Fixup debug_loc sections after linker relaxation 3Date: Mon, 4 Feb 2013 12:15:22 +1000
4Subject: [PATCH 14/16] [LOCAL]: Fixup debug_loc sections after linker
5 relaxation
4 6
5Adds a new reloctype R_MICROBLAZE_32_NONE, used for passing 7Adds a new reloctype R_MICROBLAZE_32_NONE, used for passing
6reloc info from the assembler to the linker when the linker 8reloc info from the assembler to the linker when the linker
@@ -10,22 +12,21 @@ This is a workaround for design flaws in the assembler to
10linker interface with regards to linker relaxation. 12linker interface with regards to linker relaxation.
11 13
12Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com> 14Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
15Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
13Upstream-Status: Pending 16Upstream-Status: Pending
14--- 17---
15 bfd/bfd-in2.h | 5 +++++ 18 bfd/bfd-in2.h | 5 +++++
16 bfd/elf32-microblaze.c | 45 +++++++++++++++++++++++++++++++++++++-------- 19 bfd/elf32-microblaze.c | 45 +++++++++++++++++++++++++++++++++++++--------
17 bfd/libbfd.h | 1 + 20 bfd/libbfd.h | 1 +
18 bfd/reloc.c | 6 ++++++ 21 bfd/reloc.c | 6 ++++++
19 include/elf/microblaze.h | 1 + 22 include/elf/microblaze.h | 1 +
20 5 files changed, 50 insertions(+), 8 deletions(-) 23 5 files changed, 50 insertions(+), 8 deletions(-)
21 mode change 100644 => 100755 bfd/elf32-microblaze.c
22 mode change 100644 => 100755 include/elf/microblaze.h
23 24
24diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h 25diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
25index 524e97e..17a5769 100644 26index 8b7f2ee..de38907 100644
26--- a/bfd/bfd-in2.h 27--- a/bfd/bfd-in2.h
27+++ b/bfd/bfd-in2.h 28+++ b/bfd/bfd-in2.h
28@@ -5125,6 +5125,11 @@ value relative to the read-write small data area anchor */ 29@@ -5449,6 +5449,11 @@ value relative to the read-write small data area anchor */
29 expressions of the form "Symbol Op Symbol" */ 30 expressions of the form "Symbol Op Symbol" */
30 BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM, 31 BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM,
31 32
@@ -38,9 +39,7 @@ index 524e97e..17a5769 100644
38 value in two words (with an imm instruction). No relocation is 39 value in two words (with an imm instruction). No relocation is
39 done here - only used for relaxing */ 40 done here - only used for relaxing */
40diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c 41diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c
41old mode 100644 42index f90df47..a3f89b9 100644
42new mode 100755
43index 61926a4..c44c76f
44--- a/bfd/elf32-microblaze.c 43--- a/bfd/elf32-microblaze.c
45+++ b/bfd/elf32-microblaze.c 44+++ b/bfd/elf32-microblaze.c
46@@ -177,6 +177,20 @@ static reloc_howto_type microblaze_elf_howto_raw[] = 45@@ -177,6 +177,20 @@ static reloc_howto_type microblaze_elf_howto_raw[] =
@@ -76,7 +75,7 @@ index 61926a4..c44c76f
76 microblaze_reloc = R_MICROBLAZE_64_NONE; 75 microblaze_reloc = R_MICROBLAZE_64_NONE;
77 break; 76 break;
78 case BFD_RELOC_32: 77 case BFD_RELOC_32:
79@@ -1912,14 +1929,22 @@ microblaze_elf_relax_section (bfd *abfd, 78@@ -1913,14 +1930,22 @@ microblaze_elf_relax_section (bfd *abfd,
80 } 79 }
81 break; 80 break;
82 case R_MICROBLAZE_NONE: 81 case R_MICROBLAZE_NONE:
@@ -99,7 +98,7 @@ index 61926a4..c44c76f
99 irel->r_addend -= (efix - sfix); 98 irel->r_addend -= (efix - sfix);
100 /* Should use HOWTO. */ 99 /* Should use HOWTO. */
101 microblaze_bfd_write_imm_value_32 (abfd, contents + irel->r_offset, 100 microblaze_bfd_write_imm_value_32 (abfd, contents + irel->r_offset,
102@@ -1967,12 +1992,16 @@ microblaze_elf_relax_section (bfd *abfd, 101@@ -1968,12 +1993,16 @@ microblaze_elf_relax_section (bfd *abfd,
103 irelscanend = irelocs + o->reloc_count; 102 irelscanend = irelocs + o->reloc_count;
104 for (irelscan = irelocs; irelscan < irelscanend; irelscan++) 103 for (irelscan = irelocs; irelscan < irelscanend; irelscan++)
105 { 104 {
@@ -117,7 +116,7 @@ index 61926a4..c44c76f
117 /* This was a PC-relative instruction that was completely resolved. */ 116 /* This was a PC-relative instruction that was completely resolved. */
118 if (ocontents == NULL) 117 if (ocontents == NULL)
119 { 118 {
120@@ -1997,15 +2026,15 @@ microblaze_elf_relax_section (bfd *abfd, 119@@ -1998,15 +2027,15 @@ microblaze_elf_relax_section (bfd *abfd,
121 } 120 }
122 } 121 }
123 122
@@ -138,7 +137,7 @@ index 61926a4..c44c76f
138 if (ELF32_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32) 137 if (ELF32_R_TYPE (irelscan->r_info) == (int) R_MICROBLAZE_32)
139 { 138 {
140 isym = isymbuf + ELF32_R_SYM (irelscan->r_info); 139 isym = isymbuf + ELF32_R_SYM (irelscan->r_info);
141@@ -2065,7 +2094,7 @@ microblaze_elf_relax_section (bfd *abfd, 140@@ -2066,7 +2095,7 @@ microblaze_elf_relax_section (bfd *abfd,
142 elf_section_data (o)->this_hdr.contents = ocontents; 141 elf_section_data (o)->this_hdr.contents = ocontents;
143 } 142 }
144 } 143 }
@@ -148,10 +147,10 @@ index 61926a4..c44c76f
148 0, 147 0,
149 sec); 148 sec);
150diff --git a/bfd/libbfd.h b/bfd/libbfd.h 149diff --git a/bfd/libbfd.h b/bfd/libbfd.h
151index 857d1ea..5c627fe 100644 150index 09f307f..840c662 100644
152--- a/bfd/libbfd.h 151--- a/bfd/libbfd.h
153+++ b/bfd/libbfd.h 152+++ b/bfd/libbfd.h
154@@ -2492,6 +2492,7 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", 153@@ -2644,6 +2644,7 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
155 "BFD_RELOC_MICROBLAZE_32_ROSDA", 154 "BFD_RELOC_MICROBLAZE_32_ROSDA",
156 "BFD_RELOC_MICROBLAZE_32_RWSDA", 155 "BFD_RELOC_MICROBLAZE_32_RWSDA",
157 "BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM", 156 "BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM",
@@ -160,10 +159,10 @@ index 857d1ea..5c627fe 100644
160 "BFD_RELOC_MICROBLAZE_64_GOTPC", 159 "BFD_RELOC_MICROBLAZE_64_GOTPC",
161 "BFD_RELOC_MICROBLAZE_64_GOT", 160 "BFD_RELOC_MICROBLAZE_64_GOT",
162diff --git a/bfd/reloc.c b/bfd/reloc.c 161diff --git a/bfd/reloc.c b/bfd/reloc.c
163index b59ca00..c9c547e 100644 162index 7f46c58..5bcd52d 100644
164--- a/bfd/reloc.c 163--- a/bfd/reloc.c
165+++ b/bfd/reloc.c 164+++ b/bfd/reloc.c
166@@ -6001,6 +6001,12 @@ ENUMDOC 165@@ -6396,6 +6396,12 @@ ENUMDOC
167 This is a 32 bit reloc for the microblaze to handle 166 This is a 32 bit reloc for the microblaze to handle
168 expressions of the form "Symbol Op Symbol" 167 expressions of the form "Symbol Op Symbol"
169 ENUM 168 ENUM
@@ -177,9 +176,7 @@ index b59ca00..c9c547e 100644
177 ENUMDOC 176 ENUMDOC
178 This is a 64 bit reloc that stores the 32 bit pc relative 177 This is a 64 bit reloc that stores the 32 bit pc relative
179diff --git a/include/elf/microblaze.h b/include/elf/microblaze.h 178diff --git a/include/elf/microblaze.h b/include/elf/microblaze.h
180old mode 100644 179index effca20..f8420dc 100644
181new mode 100755
182index c4d9821..72771e8
183--- a/include/elf/microblaze.h 180--- a/include/elf/microblaze.h
184+++ b/include/elf/microblaze.h 181+++ b/include/elf/microblaze.h
185@@ -58,6 +58,7 @@ START_RELOC_NUMBERS (elf_microblaze_reloc_type) 182@@ -58,6 +58,7 @@ START_RELOC_NUMBERS (elf_microblaze_reloc_type)
@@ -191,5 +188,5 @@ index c4d9821..72771e8
191 END_RELOC_NUMBERS (R_MICROBLAZE_max) 188 END_RELOC_NUMBERS (R_MICROBLAZE_max)
192 189
193-- 190--
1941.7.9.5 1911.9.0
195 192
diff --git a/recipes-devtools/gdb/files/0014-microblaze-Add-build_gdbserver-yes-to-top-level-conf.patch b/recipes-devtools/gdb/files/0014-microblaze-Add-build_gdbserver-yes-to-top-level-conf.patch
deleted file mode 100644
index 78067c87..00000000
--- a/recipes-devtools/gdb/files/0014-microblaze-Add-build_gdbserver-yes-to-top-level-conf.patch
+++ /dev/null
@@ -1,31 +0,0 @@
1From: David Holsgrove <david.holsgrove@xilinx.com>
2Date: Mon, 16 Dec 2013 16:37:32 +1000
3Subject: microblaze: Add build_gdbserver=yes to top level configure.tgt
4
5For Microblaze linux toolchains, set the build_gdbserver=yes
6to allow driving gdbserver configuration from the upper level
7
8This patch has been absorbed into the original patch to add
9linux gdbserver support for Microblaze.
10
11Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
12Upstream-Status: Pending
13---
14 gdb/configure.tgt | 1 +
15 1 file changed, 1 insertion(+)
16
17diff --git a/gdb/configure.tgt b/gdb/configure.tgt
18index 1285aac..6ea10a2 100644
19--- a/gdb/configure.tgt
20+++ b/gdb/configure.tgt
21@@ -342,6 +342,7 @@ microblaze*-linux-*|microblaze*-*-linux*)
22 gdb_target_obs="microblaze-tdep.o microblaze-linux-tdep.o microblaze-rom.o glibc-tdep.o \
23 monitor.o dsrec.o solib-svr4.o symfile-mem.o linux-tdep.o"
24 gdb_sim=../sim/microblaze/libsim.a
25+ build_gdbserver=yes
26 ;;
27 microblaze*-*-*)
28 # Target: Xilinx MicroBlaze running standalone
29--
301.7.9.5
31
diff --git a/recipes-devtools/gdb/files/0015-LOCAL-upstream-change-to-garbage-collection-sweep-ca.patch b/recipes-devtools/gdb/files/0015-LOCAL-upstream-change-to-garbage-collection-sweep-ca.patch
new file mode 100644
index 00000000..0bb66a94
--- /dev/null
+++ b/recipes-devtools/gdb/files/0015-LOCAL-upstream-change-to-garbage-collection-sweep-ca.patch
@@ -0,0 +1,40 @@
1From 22c63d4d79ac488403340470c14c73bad4984fa3 Mon Sep 17 00:00:00 2001
2From: David Holsgrove <david.holsgrove@xilinx.com>
3Date: Wed, 27 Feb 2013 13:56:11 +1000
4Subject: [PATCH 15/16] [LOCAL]: upstream change to garbage collection sweep
5 causes mb regression
6
7Upstream change for PR13177 now clears the def_regular during gc_sweep of a
8section. (All other archs in binutils/bfd/elf32-*.c received an update
9to a warning about unresolvable relocations - this warning is not present
10in binutils/bfd/elf32-microblaze.c, but this warning check would not
11prevent the error being seen)
12
13The visible issue with this change is when running a c++ application
14in Petalinux which links libstdc++.so for exception handling it segfaults
15on execution.
16
17This does not occur if static linking libstdc++.a, so its during the
18relocations for a shared lib with garbage collection this occurs
19
20Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
21Upstream-Status: Pending
22---
23 bfd/elflink.c | 1 -
24 1 file changed, 1 deletion(-)
25
26diff --git a/bfd/elflink.c b/bfd/elflink.c
27index 6756fb1..f21dc06 100644
28--- a/bfd/elflink.c
29+++ b/bfd/elflink.c
30@@ -11932,7 +11932,6 @@ elf_gc_sweep_symbol (struct elf_link_hash_entry *h, void *data)
31
32 inf = (struct elf_gc_sweep_symbol_info *) data;
33 (*inf->hide_symbol) (inf->info, h, TRUE);
34- h->def_regular = 0;
35 h->ref_regular = 0;
36 h->ref_regular_nonweak = 0;
37 }
38--
391.9.0
40
diff --git a/recipes-devtools/gdb/gdb-cross-canadian_7.6.2.bbappend b/recipes-devtools/gdb/gdb-cross-canadian_7.7.bbappend
index db1e3127..db1e3127 100644
--- a/recipes-devtools/gdb/gdb-cross-canadian_7.6.2.bbappend
+++ b/recipes-devtools/gdb/gdb-cross-canadian_7.7.bbappend
diff --git a/recipes-devtools/gdb/gdb-cross_7.6.2.bbappend b/recipes-devtools/gdb/gdb-cross_7.7.bbappend
index db1e3127..db1e3127 100644
--- a/recipes-devtools/gdb/gdb-cross_7.6.2.bbappend
+++ b/recipes-devtools/gdb/gdb-cross_7.7.bbappend
diff --git a/recipes-devtools/gdb/gdb-microblaze-7.6.2.inc b/recipes-devtools/gdb/gdb-microblaze-7.6.2.inc
deleted file mode 100644
index 9f30eb9a..00000000
--- a/recipes-devtools/gdb/gdb-microblaze-7.6.2.inc
+++ /dev/null
@@ -1,22 +0,0 @@
1
2# MicroBlaze does not support LTTng UST
3LTTNGUST_microblaze = ""
4
5# Add MicroBlaze Patches
6FILESEXTRAPATHS_append := "${THISDIR}/files:"
7SRC_URI_append += " \
8 file://0001-Add-initial-port-of-linux-gdbserver.patch \
9 file://0002-Initial-port-of-core-reading-support.patch \
10 file://0003-Initial-support-for-native-gdb.patch \
11 file://0004-Robustify-inline-function-support.patch \
12 file://0005-Fix-debug-message-when-register-is-unavailable.patch \
13 file://0006-Add-slr-and-shr-regs-and-little-endian-breakpoint.patch \
14 file://0007-Fix-relaxation-of-assembler-resolved-references.patch \
15 file://0008-Fixup-debug_loc-sections-after-linker-relaxation.patch \
16 file://0009-Add-wdc.ext.clear-and-wdc.ext.flush-insns.patch \
17 file://0010-revert-master-rebase-changes-to-gdbserver.patch \
18 file://0011-Patch-microblaze-Add-mb-singlestepping.patch \
19 file://0012-Added-Backtrace-support-to-GDB.patch \
20 file://0013-microblaze-Handle-framless-functions-in-determining-.patch \
21 file://0014-microblaze-Add-build_gdbserver-yes-to-top-level-conf.patch \
22 "
diff --git a/recipes-devtools/gdb/gdb-microblaze-7.7.inc b/recipes-devtools/gdb/gdb-microblaze-7.7.inc
new file mode 100644
index 00000000..0b82bc67
--- /dev/null
+++ b/recipes-devtools/gdb/gdb-microblaze-7.7.inc
@@ -0,0 +1,22 @@
1
2# MicroBlaze does not support LTTng UST
3LTTNGUST_microblaze = ""
4
5# Add MicroBlaze Patches
6FILESEXTRAPATHS_append := "${THISDIR}/files:"
7SRC_URI_append += " \
8 file://0001-Patch-microblaze-Add-wdc.ext.clear-and-wdc.ext.flush.patch \
9 file://0003-Patch-microblaze-Initial-port-of-microblaze-core-rea.patch \
10 file://0004-Patch-microblaze-Communicate-in-larger-blocks-with-t.patch \
11 file://0005-Patch-microblaze-Add-mb-singlestepping.patch \
12 file://0006-Patch-microblaze-Add-initial-port-of-linux-gdbserver.patch \
13 file://0007-Patch-microblaze-Add-slr-and-shr-regs-and-little-end.patch \
14 file://0008-Patch-microblaze-Added-Backtrace-support-to-GDB.patch \
15 file://0009-Patch-microblaze-Initial-support-for-native-gdb.patch \
16 file://0010-Patch-gdb-Robustify-inline-function-support.patch \
17 file://0011-Patch-gdb-Fix-debug-message-when-register-is-unavail.patch \
18 file://0012-LOCAL-Disable-the-warning-message-for-eh_frame_hdr.patch \
19 file://0013-LOCAL-Fix-relaxation-of-assembler-resolved-reference.patch \
20 file://0014-LOCAL-Fixup-debug_loc-sections-after-linker-relaxati.patch \
21 file://0015-LOCAL-upstream-change-to-garbage-collection-sweep-ca.patch \
22 "
diff --git a/recipes-devtools/gdb/gdb_7.6.2.bbappend b/recipes-devtools/gdb/gdb_7.7.bbappend
index db1e3127..db1e3127 100644
--- a/recipes-devtools/gdb/gdb_7.6.2.bbappend
+++ b/recipes-devtools/gdb/gdb_7.7.bbappend