1 /*DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64
4 for INTEL64(R), AMD64(R)
6 Copyright(C) 2007-2009 Koine Yuusuke(koinec). All rights reserved.
8 Redistribution and use in source and binary forms, with or without
9 modification, are permitted provided that the following conditions are met:
11 1. Redistributions of source code must retain the above copyright notice,
12 this list of conditions and the following disclaimer.
13 2. Redistributions in binary form must reproduce the above copyright
14 notice, this list of conditions and the following disclaimer in the
15 documentation and/or other materials provided with the distribution.
17 THIS SOFTWARE IS PROVIDED BY Koine Yuusuke(koinec) ``AS IS'' AND ANY
18 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 DISCLAIMED. IN NO EVENT SHALL Koine Yuusuke(koinec) OR CONTRIBUTORS BE
21 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
27 OF THE POSSIBILITY OF SUCH DAMAGE.
29 DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64*/
31 /* File Info -----------------------------------------------------------
35 ----------------------------------------------------------------------*/
37 #define DRD64_SRC_LIBGOBLIN_DEBUG_OBJINFO
38 #include"drd64_libgoblin.h"
40 static char gstr_type[256][8] = {
49 "", "", "", "", "", "", "", "",
50 "", "", "", "", "", "", "", "",
51 "", "", "", "", "", "", "", "",
52 "", "", "", "", "", "", "", "",
53 "", "", "", "", "", "", "", "",
54 "", "", "", "", "", "", "", "",
56 "", "", "", "", "", "", "", "",
57 "", "", "", "", "", "", "", "",
58 "", "", "", "", "", "", "", "",
59 "", "", "", "", "", "", "", "",
60 "", "", "", "", "", "", "", "",
61 "", "", "", "", "", "", "", "",
62 "", "", "", "", "", "", "", "",
64 "", "", "", "", "", "", "", "",
65 "", "", "", "", "", "", "", "",
66 "", "", "", "", "", "", "", "",
67 "", "", "", "", "", "", "", "",
68 "", "", "", "", "", "", "", "",
69 "", "", "", "", "", "", "", "",
70 "", "", "", "", "", "", "", "",
72 "", "", "", "", "", "", "", "",
73 "", "", "", "", "", "", "", "",
74 "", "", "", "", "", "", "", "",
75 "", "", "", "", "", "", "", "",
76 "", "", "", "", "", "", "", "",
77 "", "", "", "", "", "", "", "",
78 "", "", "", "", "", "", "", ""
81 /*====================================================================*/
82 /*--------------------------------------------------------------------*/
84 Debug_ObjectInfo_PrintInfo(
85 LibGoblin_ObjectInfo *p_obj,
91 // Set Space String ---
92 if( 127 <= i_depth ) { i_depth = 127; }
93 memset( str_space, (int)' ', (i_depth * 2));
94 str_space[ (i_depth * 2) ] = '\0';
98 printf(" %s*OBJINFO[%4d] (%-8s) %16lxh - %16lxh (Size: %16lxh) : %s\n",
99 str_space, p_obj->i_id,
100 gstr_type[ p_obj->b_type ],
101 p_obj->addr.ptr_addr.value,
102 (( 0 < p_obj->addr.qw_size )
103 ? (p_obj->addr.ptr_addr.value + p_obj->addr.qw_size - 1)
104 : p_obj->addr.ptr_addr.value),
112 /*====================================================================*/
113 /*--------------------------------------------------------------------*/
114 LIBGOBLIN_DEBUG_OBJINFO_EXTERN
116 Debug_ObjectInfo_Print_AllAddrLink(
117 LibGoblin_ProgramInfo *p_pginfo,
120 //LibGoblin_ObjectInfo *p_objinfo;
123 { puts("[DEBUG] ObjectInfo - Addr.Link --------------------------------------"); }
128 if( 0x00 < b_level ) {
129 puts("-----------------------------------------------------------------------");
136 /*====================================================================*/
137 /*--------------------------------------------------------------------*/
139 Debug_ObjectInfo_Print_GroupLink(
140 LibGoblin_ProgramInfo *p_pginfo,
141 LibGoblin_ObjectInfo *p_objstart,
145 LibGoblin_ObjectInfo *p_objinfo;
147 if( NULL == p_objstart ) { return; }
148 p_objinfo = p_objstart;
151 Debug_ObjectInfo_PrintInfo( p_objinfo, i_depth, b_level );
154 if( NO_OBJINFO != p_objinfo->grplink.i_child_topid ) {
155 Debug_ObjectInfo_Print_GroupLink(
157 OBJINFO( p_pginfo, p_objinfo->grplink.i_child_topid ), (i_depth + 1), b_level );
160 // Set Next ObjectInfo ---
161 p_objinfo = ((NO_OBJINFO == p_objinfo->grplink.i_next_id)
162 ? NULL : OBJINFO( p_pginfo, p_objinfo->grplink.i_next_id ));
163 } while( NULL != p_objinfo );
169 /*--------------------------------------------------------------------*/
170 LIBGOBLIN_DEBUG_OBJINFO_EXTERN
172 Debug_ObjectInfo_Print_AllGroupLink(
173 LibGoblin_ProgramInfo *p_pginfo,
176 LibGoblin_ObjectInfo *p_objinfo;
179 { puts("[DEBUG] ObjectInfo - GroupLink --------------------------------------"); }
182 Debug_ObjectInfo_Print_GroupLink( p_pginfo, p_pginfo->objinfo.p_objinfo, 0, b_level );
184 if( 0x00 < b_level ) {
185 puts("-----------------------------------------------------------------------");
193 /* EOF of drd64_.c ----------------------------------- */