Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [Patch, microblaze]: Added cleanup data for invalid target description
@ 2014-10-07 10:16 Ajit Kumar Agarwal
  2014-10-07 16:07 ` Pedro Alves
  0 siblings, 1 reply; 4+ messages in thread
From: Ajit Kumar Agarwal @ 2014-10-07 10:16 UTC (permalink / raw)
  To: Pedro Alves, gdb-patches
  Cc: Vinod Kathail, Vidhumouli Hunsigida, Nagaraju Mekala

[-- Attachment #1: Type: text/plain, Size: 1187 bytes --]

Please find the following patch based on Pedro Suggestion. 

   [Patch, microblaze]: Added cleanup data for invalid target description.
    
    Cleanup the tdesc data if the target description check is invalid.
    
    2014-10-07  Ajit Agarwal  <ajitkum@xilinx.com>
    
        * microblaze-tdep.c (microblaze_gdbarch_init): Use of
        tdesc_data_cleanup.
    
    Signed-off-by:Ajit Agarwal ajitkum@xilinx.com

---
 gdb/microblaze-tdep.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c
index 6a9f11f..f257b96 100644
--- a/gdb/microblaze-tdep.c
+++ b/gdb/microblaze-tdep.c
@@ -722,7 +722,13 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
                                               MICROBLAZE_SHR_REGNUM,
                                               "rshr");
         }
-     }
+
+      if (!valid_p)
+        {
+          tdesc_data_cleanup (tdesc_data);
+          return NULL;
+        }
+    }

   /* Allocate space for the new architecture.  */
   tdep = XNEW (struct gdbarch_tdep);
--
1.7.1

Thanks & Regards
Ajit

[-- Attachment #2: 0001-Patch-microblaze-Added-cleanup-data-for-invalid-targ.patch --]
[-- Type: application/octet-stream, Size: 1196 bytes --]

From 00f2692d10e0254366471095516d657693aeff42 Mon Sep 17 00:00:00 2001
From: Ajit Kumar Agarwal <ajitkum@xhdspdgnu.(none)>
Date: Tue, 7 Oct 2014 15:06:08 +0530
Subject: [PATCH] [Patch, microblaze]: Added cleanup data for invalid target description.

Cleanup the tdesc data if the target description check is invalid.

2014-10-07  Ajit Agarwal  <ajitkum@xilinx.com>

	* microblaze-tdep.c (microblaze_gdbarch_init): Use of
	tdesc_data_cleanup.

Signed-off-by:Ajit Agarwal ajitkum@xilinx.com
---
 gdb/microblaze-tdep.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c
index 6a9f11f..f257b96 100644
--- a/gdb/microblaze-tdep.c
+++ b/gdb/microblaze-tdep.c
@@ -722,7 +722,13 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
                                               MICROBLAZE_SHR_REGNUM,
                                               "rshr");
         }
-     }
+
+      if (!valid_p)
+        {
+          tdesc_data_cleanup (tdesc_data);
+          return NULL;
+        }
+    }
 
   /* Allocate space for the new architecture.  */
   tdep = XNEW (struct gdbarch_tdep);
-- 
1.7.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-10-07 17:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-07 10:16 [Patch, microblaze]: Added cleanup data for invalid target description Ajit Kumar Agarwal
2014-10-07 16:07 ` Pedro Alves
2014-10-07 16:37   ` Ajit Kumar Agarwal
2014-10-07 17:09     ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox