OSDN Git Service

(LibGoblin)
authorKoine Yuusuke(koinec) <koinec@users.osdn.me>
Sat, 2 Nov 2019 08:35:18 +0000 (17:35 +0900)
committerKoine Yuusuke(koinec) <koinec@users.osdn.me>
Sat, 2 Nov 2019 08:35:18 +0000 (17:35 +0900)
  * CreateFile: drd64_libgoblin_debug_srcfile.[ch]

libgoblin/Makefile
libgoblin/drd64_libgoblin.h
libgoblin/drd64_libgoblin_api.c
libgoblin/drd64_libgoblin_debug_srcfile.c [new file with mode: 0644]
libgoblin/drd64_libgoblin_debug_srcfile.h [new file with mode: 0644]

index 7cc4e9c..5da37ff 100644 (file)
@@ -91,6 +91,7 @@ OBJS = drd64_libgoblin_api.o \
                drd64_libgoblin_dwarf_common.o \
                drd64_libgoblin_index_dwarfinfo.o \
                drd64_libgoblin_debug_elf.o \
+               drd64_libgoblin_debug_srcfile.o \
                drd64_libgoblin_debug_dwarf_str.o \
                drd64_libgoblin_debug_dwarf.o \
                drd64_libgoblin_debug_objinfo.o
@@ -140,6 +141,7 @@ HEADER = drd64_libgoblin.h \
                drd64_libgoblin_dwarf_common.h \
                drd64_libgoblin_index_dwarfinfo.h \
                drd64_libgoblin_debug_elf.h \
+               drd64_libgoblin_debug_srcfile.h \
                drd64_libgoblin_debug_dwarf_str.h \
                drd64_libgoblin_debug_dwarf.h \
                drd64_libgoblin_debug_objinfo.h \
@@ -330,6 +332,9 @@ drd64_libgoblin_index_dwarfinfo.o: \
 drd64_libgoblin_debug_elf.o: drd64_libgoblin_debug_elf.c $(HEADER)
        $(CC) -c -o drd64_libgoblin_debug_elf.o $(FLAGS_DEBUG) \
                                drd64_libgoblin_debug_elf.c
+drd64_libgoblin_debug_srcfile.o: drd64_libgoblin_debug_srcfile.c $(HEADER)
+       $(CC) -c -o drd64_libgoblin_debug_srcfile.o $(FLAGS_DEBUG) \
+                               drd64_libgoblin_debug_srcfile.c
 drd64_libgoblin_debug_dwarf_str.o: drd64_libgoblin_debug_dwarf_str.c $(HEADER)
        $(CC) -c -o drd64_libgoblin_debug_dwarf_str.o $(FLAGS_DEBUG) \
                                drd64_libgoblin_debug_dwarf_str.c
index 51cce94..b8d6e4d 100644 (file)
@@ -118,6 +118,7 @@ Comment:
 #include"drd64_libgoblin_debug_dwarf_str.h"
 #include"drd64_libgoblin_debug_dwarf.h"
 #include"drd64_libgoblin_debug_elf.h"
+#include"drd64_libgoblin_debug_srcfile.h"
 #include"drd64_libgoblin_debug_objinfo.h"
 
 // Defines LibGoblin SourceFileID for ErrorSystem ---
index 5cca00f..77fa5ca 100644 (file)
@@ -103,6 +103,7 @@ int
 
        // XXX: for DEBUG!
        Debug_ObjectInfo_Print_AllGroupLink( p_pginfo, 0xff );
+       Debug_SrcFile_PrintSrcFileTable( p_binfo, 0xff );
 
        return  i_result;
 }
diff --git a/libgoblin/drd64_libgoblin_debug_srcfile.c b/libgoblin/drd64_libgoblin_debug_srcfile.c
new file mode 100644 (file)
index 0000000..41798c8
--- /dev/null
@@ -0,0 +1,76 @@
+/*DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64
+
+                         D r . D e a m o n  6 4
+                        for INTEL64(R), AMD64(R)
+       
+   Copyright(C) 2007-2009 Koine Yuusuke(koinec). All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+    this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY Koine Yuusuke(koinec) ``AS IS'' AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL Koine Yuusuke(koinec) OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+OF THE POSSIBILITY OF SUCH DAMAGE.
+
+DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64*/
+
+/* File Info -----------------------------------------------------------
+File: drd64_.c
+Function: 
+Comment: 
+----------------------------------------------------------------------*/
+
+#define        DRD64_SRC_LIBGOBLIN_DEBUG_SRCFILE
+#include"drd64_libgoblin.h"
+
+
+/*----------------------------------------------------------------------
+----------------------------------------------------------------------*/
+LIBGOBLIN_DEBUG_SRCFILE_EXTERN
+int
+       Debug_SrcFile_PrintSrcFileTable(
+                       LibGoblin_BinaryInfo    *p_binfo,
+                       Byte            b_level )
+{
+       int             i_srcid;
+       LibGoblin_BinaryFile    *p_bfile;
+       LibGoblin_SrcFile               *p_srcfile;
+
+       p_bfile = BinaryFile_GetBinaryFile( p_binfo->i_binfile );
+       assert( NULL != p_bfile );
+
+       if( 0x00 < b_level )
+               { puts("[DEBUG] SrcFile Table --------------------------------------------------"); }
+
+       for( i_srcid = 0; i_srcid < p_bfile->srcfile.i_max; i_srcid++ ) {
+               p_srcfile       = SrcFile_GetSrcFile( p_bfile, i_srcid );
+               if( NULL == p_srcfile ) { continue; }
+
+               printf( "  [%3d] %s/%s\n", p_srcfile->i_id, p_srcfile->str_srcpath, p_srcfile->str_filename );
+       }
+
+       if( 0x00 < b_level )    {
+               puts("-----------------------------------------------------------------------");
+               puts("");
+       }
+
+       return 0x00;
+}
+
+
+
+/* EOF of drd64_.c ----------------------------------- */
diff --git a/libgoblin/drd64_libgoblin_debug_srcfile.h b/libgoblin/drd64_libgoblin_debug_srcfile.h
new file mode 100644 (file)
index 0000000..d91b4c7
--- /dev/null
@@ -0,0 +1,55 @@
+/*DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64
+
+                         D r . D e a m o n  6 4
+                        for INTEL64(R), AMD64(R)
+       
+   Copyright(C) 2007-2009 Koine Yuusuke(koinec). All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+    this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY Koine Yuusuke(koinec) ``AS IS'' AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL Koine Yuusuke(koinec) OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+OF THE POSSIBILITY OF SUCH DAMAGE.
+
+DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64*/
+
+/* File Info -----------------------------------------------------------
+File: drd64_.h
+Function: Header 
+Comment: 
+----------------------------------------------------------------------*/
+
+#ifndef DRD64_HEADER_LIBGOBLIN_DEBUG_SRCFILE
+#define DRD64_HEADER_LIBGOBLIN_DEBUG_SRCFILE
+
+#include"drd64_libgoblin.h"
+
+#ifdef DRD64_SRC_LIBGOBLIN_DEBUG_SRCFILE
+       #define LIBGOBLIN_DEBUG_SRCFILE_EXTERN
+#else
+       #define LIBGOBLIN_DEBUG_SRCFILE_EXTERN  extern
+#endif
+
+LIBGOBLIN_DEBUG_SRCFILE_EXTERN
+       int Debug_SrcFile_PrintSrcFileTable(
+                               LibGoblin_BinaryInfo *p_binfo, Byte b_level );
+
+
+#endif /* DRD64_HEADER_XXX */
+
+/* EOF of drd64_.h ----------------------------------- */