CVS: python msp430-ram-usage.py,1.3,1.4

Chris Liechti <[email protected]> Thu, 29 May 2008 06:45:28 -0700
Newsgroups gmane.comp.hardware.texas-instruments.msp430.gcc.cvs
Message-ID <[email protected]>
Update of /cvsroot/mspgcc/python
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv19726/python

Modified Files:
	msp430-ram-usage.py 
Log Message:
improve error handling

Index: msp430-ram-usage.py
===================================================================
RCS file: /cvsroot/mspgcc/python/msp430-ram-usage.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -d -r1.3 -r1.4
--- msp430-ram-usage.py	14 Jun 2005 10:49:55 -0000	1.3
+++ msp430-ram-usage.py	29 May 2008 13:45:24 -0000	1.4
@@ -36,11 +36,14 @@
 
 #read labeled object from readelf dump
 objs = {}
-for line in os.popen('msp430-readelf -a -W "%s"' % args[0]):
-    #~ print line,
+syms = os.popen('msp430-readelf -a -W "%s"' % args[0])
+for line in syms:
+    #~ print ">", line,
     m = re_obj.search(line)
     if m:
         objs[m.group(4)] = ((int(m.group(1),16), int(m.group(2)), m.group(3)))
+if syms.close() != 0:
+    raise IOError("msp430-readelf failed")
 
 #store labels by address
 mmap = {}


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/