|
40 | 40 | Another example is a non-standard file system, |
41 | 41 | or file format, with the intent of obfuscating |
42 | 42 | the file or the DWARF. |
43 | | - |
| 43 | + |
44 | 44 | For this to work the code generator must generate standard DWARF. |
45 | 45 |
|
46 | 46 | Overall the idea is a simple one: You write |
|
53 | 53 | the interfaces so standard libdwarf can access |
54 | 54 | your DWARF content. |
55 | 55 |
|
56 | | - You set up a little bit of data with that code |
| 56 | + You set up a little bit of data with that code |
57 | 57 | (described below) |
58 | 58 | and then you have essentially written the |
59 | 59 | dwarf_init_path equivalent and you can access |
|
65 | 65 | and how to make them work for you. |
66 | 66 |
|
67 | 67 | @code |
68 | | - typedef struct Dwarf_Obj_Access_Interface_a_s |
| 68 | + typedef struct Dwarf_Obj_Access_Interface_a_s |
69 | 69 | Dwarf_Obj_Access_Interface_a; |
70 | 70 | struct Dwarf_Obj_Access_Interface_a_s { |
71 | 71 | void *ai_object; |
|
136 | 136 | In the description of the methods functions |
137 | 137 | described later here, this pointer |
138 | 138 | is named @b obj . |
139 | | - |
140 | 139 |
|
141 | 140 | @b ai_methods |
142 | 141 |
|
|
159 | 158 | and for most you can just fill in the value zero. |
160 | 159 | For section index zero as_name should be set to |
161 | 160 | an empty string (see below about section index numbers). |
162 | | - |
| 161 | + |
163 | 162 | @b as_name: Here you set a section name via the pointer. |
164 | 163 | The section names must be names as defined in the DWARF |
165 | 164 | standard, so if such do not appear in your data |
|
173 | 172 | where the bytes of the section are. |
174 | 173 |
|
175 | 174 | @b as_offset: Just fill in zero. |
176 | | - |
| 175 | + |
177 | 176 | @b as_size: Fill in the size, in bytes, |
178 | 177 | of the section you are telling libdwarf about. |
179 | 178 |
|
|
185 | 184 |
|
186 | 185 | @b as_entrysize: Just fill in one. |
187 | 186 |
|
188 | | - |
189 | 187 | @subsection objaccessmethods Function Pointers |
190 | 188 |
|
191 | 189 | @b struct Dwarf_Obj_Access_Methods_a_s: |
|
207 | 205 | described now) it passes the ai_object pointer |
208 | 206 | you provided to these functions as @b obj parameter . |
209 | 207 |
|
210 | | - This is the final part of your work for libdwarf. |
| 208 | + This is the final part of your work for libdwarf. |
211 | 209 | In the source file with your code you will be |
212 | 210 | allocating data, making a provision for |
213 | 211 | an array (real or conceptual) for per-section data, |
|
233 | 231 | section_index - Zero-based index. |
234 | 232 | return_section - Pointer to a structure in which |
235 | 233 | section info will be placed. Caller must |
236 | | - provide a valid pointer to a structure area. |
| 234 | + provide a valid pointer to a structure area. |
237 | 235 | The structure's contents will be overwritten |
238 | 236 | by the call to get_section_info. |
239 | 237 | error - A pointer to an integer in which an error |
|
243 | 241 | DW_DLV_OK - Everything ok. |
244 | 242 | DW_DLV_ERROR - Error occurred. Use 'error' to determine the |
245 | 243 | libdwarf defined error. |
246 | | - DW_DLV_NO_ENTRY - No such section. |
| 244 | + DW_DLV_NO_ENTRY - No such section. |
247 | 245 | @endcode |
248 | 246 |
|
249 | 247 | @b om_get_byte_order |
|
299 | 297 |
|
300 | 298 | This retrieves data you put into your @b ai_object |
301 | 299 | struct that you filled out. |
302 | | - |
| 300 | + |
303 | 301 | @code |
304 | 302 | Parameters |
305 | 303 | obj - Your data |
|
356 | 354 |
|
357 | 355 | @b om_relocate_a_section |
358 | 356 |
|
359 | | - @code |
| 357 | + @code |
360 | 358 | Leave this pointer NULL. |
361 | 359 | If relocations are required it is probably simpler |
362 | 360 | for you do to them yourself n your |
|
378 | 376 | DW_DLV_ERROR - Error. Use 'error' to indicate |
379 | 377 | a libdwarf-defined |
380 | 378 | error number. |
381 | | - DW_DLV_NO_ENTRY - No such section. |
| 379 | + DW_DLV_NO_ENTRY - No such section. |
382 | 380 | @endcode |
383 | 381 |
|
384 | 382 | */ |
0 commit comments