OSDN Git Service

* WorkBackup: 2015/08/28(Fri) AM 04:58
authorKoine Yuusuke(koinec) <koinec@users.odsn.me>
Thu, 27 Aug 2015 19:58:22 +0000 (04:58 +0900)
committerKoine Yuusuke(koinec) <koinec@users.odsn.me>
Thu, 27 Aug 2015 19:58:22 +0000 (04:58 +0900)
include/drd64_types.h
testpg/testpg02/Makefile
testpg/testpg02/dwarftest1.c
testpg/testpg02/dwarftest2.c

index 8294f93..c75c383 100644 (file)
@@ -15,6 +15,7 @@ Comment:
 #ifndef DRD64_HEADER_TYPES
 #define DRD64_HEADER_TYPES
 
+typedef        void *                  Ptr;
 
 typedef unsigned char  Byte;
 typedef        char                    Char;
index af17239..cd5f7de 100644 (file)
@@ -36,7 +36,6 @@
 
 # Section 1 : Setting Build Command ####################################
 MAKE = make
-CC = gcc
 
 FLAGS_DEBUG = -g
 
index a721799..1023e1e 100644 (file)
@@ -3,23 +3,21 @@
 #include<stdio.h>
 #include"dwarftest.h"
 
-static int     gi_data = 5;
+int                    gi_glob_data    = 3;
+static int     gi_static_data  = 5;
 int                    gi_bss;
 TYPEDEF_STRUCTURE      g_struc;
 
 extern int     test_sub( int i_value, void *p_value);
 
-int main(
-               int     argc, 
-               char *argv[] )
+
+void datatype( int i_main_data )
 {
        int             i_main_bss;
-       int             i_main_data     = 10;
        struct  test_structure  t_auto;
-       union   Value   u_value;
-       void    *(*pf_function)(int i_value);
+       static union    Value   u_value;
 
-       gi_bss  = gi_data;
+       gi_bss  = gi_static_data + gi_glob_data;
        i_main_bss      = i_main_data - gi_bss;
 
        u_value.qw_qword                = 0x0102030405060708;
@@ -33,7 +31,7 @@ int main(
        t_auto.qw_qword64               = i_main_bss * 8 + u_value.qw_qword;
        t_auto.pqw_pointer64    = &(t_auto.qw_qword64);
        t_auto.bits.bit3                = 0x07;
-       t_auto.bits.bit2                = 0x03;
+       t_auto.bits.bit2                = -2;
        t_auto.bits.bit4                = 0x0c;
 
        test_sub2( &g_struc, t_auto );
@@ -50,11 +48,21 @@ int main(
        test_sub2( &g_struc, t_auto );
 
        test_sub( i_main_bss, &i_main_data );
+
+       return;
+}
+
+
+int main( int argc, char *argv[] )
+{
+       int             i_main_bss;
+       static int              i_main_data     = 10;
+
+       datatype( i_main_data );
        g_struc.pf_function( (void *)&g_struc );
 
        return 0x00;
 }
 
 
-
 /* EOF of test1.c */
index 20a93d7..55b5f93 100644 (file)
@@ -12,10 +12,10 @@ extern int
        int             i_sub_bss;
        int             i_sub_data      = 123;
 
-       p_value         = INT_P(&i_sub_bss);
+       p_value         = (void *)INT_P(&i_sub_bss);
        i_sub_bss       = i_sub_data * i_value;
 
-       printf(" Result1: %d\n", INT_P(p_value) );
+       printf(" Result1: %d\n", (int)INT_P(p_value) );
        
        return 0x00;
 }
@@ -41,7 +41,7 @@ void *test_print( void *pt_strc_void )
                                p_typdef->i_int32,
                                p_typdef->dw_dword32,
                                *(p_typdef->pdw_pointer32) );
-       printf("  QWord: %ld %ld (%x)\n",
+       printf("  QWord: %lld %lld (%llx)\n",
                                p_typdef->ll_dint64,
                                p_typdef->qw_qword64,
                                *(p_typdef->pqw_pointer64) );