change log for gcc-testing (2010-05-18)

rtems-vc at rtems.org rtems-vc at rtems.org
Tue May 18 16:10:01 UTC 2010


 *joel*:
2010-05-18	Joel Sherrill <joel.sherrill at oarcorp.com>

	* ObjdumpProcessor.cc: Now read dlinfo from file.

M  1.263  rtems-coverage/ChangeLog
M   1.36  rtems-coverage/ObjdumpProcessor.cc

diff -u gcc-testing/rtems-coverage/ChangeLog:1.262 gcc-testing/rtems-coverage/ChangeLog:1.263
--- gcc-testing/rtems-coverage/ChangeLog:1.262	Tue May 18 09:44:01 2010
+++ gcc-testing/rtems-coverage/ChangeLog	Tue May 18 10:30:36 2010
@@ -1,3 +1,7 @@
+2010-05-18	Joel Sherrill <joel.sherrill at oarcorp.com>
+
+	* ObjdumpProcessor.cc: Now read dlinfo from file.
+
 2010-05-18	Glenn Humphrey
 
 	* TraceConverter.cc: Removed initialization of the dynamicLibrary

diff -u gcc-testing/rtems-coverage/ObjdumpProcessor.cc:1.35 gcc-testing/rtems-coverage/ObjdumpProcessor.cc:1.36
--- gcc-testing/rtems-coverage/ObjdumpProcessor.cc:1.35	Tue May 18 09:21:13 2010
+++ gcc-testing/rtems-coverage/ObjdumpProcessor.cc	Tue May 18 10:30:37 2010
@@ -16,6 +16,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <algorithm>
+#include <string>
 
 #include "app_common.h"
 #include "ObjdumpProcessor.h"
@@ -129,21 +130,24 @@
     ExecutableInfo* theExecutable
   )
   {
-#if 0
+    #define METHOD "ERROR: ObjdumpProcessor::determineLoadAddress - "
+    FILE*        loadAddressFile = NULL;
     char         buffer[ 512 ];
     char*        cStatus;
+    uint32_t     offset;
+
+    // This method should only be call for a dynamic library.
+    if (!theExecutable->hasDynamicLibrary())
+      return 0;
+
+#if 0
     static FILE* gdbCommands = NULL;
     int          items;
     uint32_t     loadAddress;
-    FILE*        loadAddressFile = NULL;
     FILE*        objdumpFile = NULL;
-    uint32_t     offset;
     int          status;
     char         terminator;
 
-    // This method should only be call for a dynamic library.
-    if (!theExecutable->hasDynamicLibrary())
-      return 0;
 
     //
     // Invoke gdb to determine the physical load address
@@ -253,7 +257,48 @@
 
     return (loadAddress - offset);
 # endif
-    return 0x42084000;
+#if 1
+    std::string dlinfoName = theExecutable->getFileName();
+    uint32_t address;
+    char inLibName[128];
+    std::string Library = theExecutable->getLibraryName();
+
+    dlinfoName += ".dlinfo";
+    // Read load address.
+    loadAddressFile = fopen( dlinfoName.c_str(), "r" );
+    if (!loadAddressFile) {
+      fprintf( stderr, METHOD "unable to open %s\n", dlinfoName.c_str() );
+      exit( -1 );
+    }
+
+    // Process the dlinfo file.
+    while ( 1 ) {
+
+      // Get a line.
+      cStatus = fgets( buffer, 512, loadAddressFile );
+      if (cStatus == NULL) {
+        fprintf(
+          stderr,
+          METHOD "library %s not found in %s\n",
+          Library.c_str(),
+          dlinfoName.c_str()
+        );
+        fclose( loadAddressFile );
+        exit( -1 );
+      }
+      sscanf( buffer, "%s %x", inLibName, &offset );
+      std::string tmp = inLibName;
+      if ( tmp.find( Library ) != tmp.npos ) {
+        // fprintf( stderr, "%s - 0x%08x\n", inLibName, offset );
+        address = offset; 
+        break;
+      }
+    }
+
+    fclose( loadAddressFile );
+    return address;
+#endif
+    #undef METHOD
   }
 
   bool ObjdumpProcessor::IsBranch(



--

Generated by Deluxe Loginfo [http://www.codewiz.org/projects/index.html#loginfo] 2.122 by Bernardo Innocenti <bernie at develer.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/vc/attachments/20100518/e5d546a3/attachment-0001.html>


More information about the vc mailing list