|
3 | 3 | @tableofcontents{HTML:3,LaTeX:3} |
4 | 4 | @author David Anderson |
5 | 5 | @copyright This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. |
6 | | - @date 2022-04-06 v0.4.0 |
| 6 | + @date 2022-04-07 v0.4.0 |
7 | 7 |
|
8 | 8 | @section draft This is a draft. |
9 | 9 |
|
|
63 | 63 | Libdwarf can safely open multiple Dwarf_Debug |
64 | 64 | pointers simultaneously but all such Dwarf_Debug |
65 | 65 | pointers must be opened within the same thread. |
66 | | - And all libdwarf calls must be made from within |
| 66 | + And all @e libdwarf calls must be made from within |
67 | 67 | that single (same) thread. |
68 | 68 |
|
69 | | - @section dwsec_error Error Handling in libdwarf |
70 | | - Essentially every libdwarf call could involve dealing |
| 69 | + @section dwsec_error Error Handling in @e libdwarf |
| 70 | + Essentially every @e libdwarf call could involve dealing |
71 | 71 | with an error (possibly data corruption in |
72 | 72 | the object file). Here we explain the two main |
73 | 73 | approaches the library provides (though we think |
|
178 | 178 | } |
179 | 179 | @endcode |
180 | 180 | because it returns. The DW_DLV_ERROR code |
181 | | - is returned from libdwarf and your code |
| 181 | + is returned from @e libdwarf and your code |
182 | 182 | can do what it likes with the error situation. |
183 | 183 |
|
184 | 184 |
|
|
293 | 293 | But usually the wasted space, if any, is small. |
294 | 294 |
|
295 | 295 | Compiler writers or others may be interested in looking |
296 | | - at these sections independently so libdwarf provides |
| 296 | + at these sections independently so @e libdwarf provides |
297 | 297 | functions |
298 | 298 | that allow reading the sections without reference |
299 | 299 | to what references them. |
|
312 | 312 | But if there is some random data somewhere |
313 | 313 | outside of referenced areas the reader function |
314 | 314 | may fail, returning DW_DLV_ERROR. |
315 | | - Such an error is neither a compiler bug nor a libdwarf bug. |
| 315 | + Such an error is neither a compiler bug nor a @e libdwarf bug. |
316 | 316 |
|
317 | 317 | @section frameregs Special Frame Registers |
318 | 318 |
|
|
441 | 441 | For a simple example of this |
442 | 442 | @see jitreader |
443 | 443 |
|
444 | | - But the libdwarf feature can be used in a wide variety of ways. |
| 444 | + But the @e libdwarf feature can be used in a wide variety of ways. |
445 | 445 |
|
446 | 446 | For example, the DWARF data could be kept |
447 | 447 | in simple files of bytes on the internet. |
|
460 | 460 | a small handful of functions and supply |
461 | 461 | function pointers and code implementing the |
462 | 462 | functions. These are part of your application |
463 | | - or library, not part of libdwarf. |
| 463 | + or library, not part of @e libdwarf. |
464 | 464 |
|
465 | 465 | You set up a little bit of data with that code |
466 | 466 | (all described below) |
467 | 467 | and then you have essentially written the |
468 | 468 | dwarf_init_path equivalent and you can access |
469 | 469 | compilation units, line tables etc and |
470 | | - the standard libdwarf function calls simply work. |
| 470 | + the standard @e libdwarf function calls simply work. |
471 | 471 |
|
472 | 472 | Data you need to create involves these types. |
473 | 473 | What follows describes how to fill them in |
|
522 | 522 | @b Dwarf_Obj_Access_Section_a: |
523 | 523 | Your implementation of a @b om_get_section_info |
524 | 524 | must simply fill in a few fields (leaving most zero) |
525 | | - for libdwarf. The fields here are standard Elf, |
| 525 | + for @e libdwarf. The fields here are standard Elf, |
526 | 526 | but for most you can just use the value zero. |
527 | 527 | We assume here you will not be doing relocations |
528 | 528 | at runtime. |
|
542 | 542 | @b as_offset: Just fill in zero. |
543 | 543 |
|
544 | 544 | @b as_size: Fill in the size, in bytes, |
545 | | - of the section you are telling libdwarf about. |
| 545 | + of the section you are telling @e libdwarf about. |
546 | 546 |
|
547 | 547 | @b as_link: Just fill in zero. |
548 | 548 |
|
|
554 | 554 |
|
555 | 555 | @b Dwarf_Obj_Access_Methods_a_s: |
556 | 556 | The functions we need to access object data |
557 | | - from libdwarf are declared here. |
| 557 | + from @e libdwarf are declared here. |
558 | 558 |
|
559 | 559 | In these function pointer declarations |
560 | 560 | 'void *obj' is intended to be a pointer (the object field in |
|
564 | 564 | it possible to handle multiple object formats |
565 | 565 | and multiple libraries. |
566 | 566 | It's not required that one handles multiple such |
567 | | - in a single libdwarf |
| 567 | + in a single @e libdwarf |
568 | 568 | archive/shared-library (but not ruled out either). |
569 | 569 | See dwarf_elf_object_access_internals_t and dwarf_elf_access.c |
570 | 570 | for an example. |
|
608 | 608 | #define DW_GROUPNUMBER_DWO 2 |
609 | 609 | @endcode |
610 | 610 |
|
611 | | - The DW_GROUPNUMBER_ are used in libdwarf functions |
| 611 | + The DW_GROUPNUMBER_ are used in @e libdwarf functions |
612 | 612 | dwarf_init_path(), dwarf_init_path_dl() and |
613 | 613 | dwarf_init_b(). In all those cases unless |
614 | 614 | you know there is any complexity in your object file, |
|
626 | 626 | @see dwarf_sec_group_map |
627 | 627 |
|
628 | 628 | If an object file has multiple groups |
629 | | - libdwarf will not reveal contents of the other |
| 629 | + @e libdwarf will not reveal contents of the other |
630 | 630 | groups. |
631 | 631 | One must pass in another groupnumber |
632 | 632 | to dwarf_init_path, meaning init |
633 | | - a new Dwarf_Debug, to get libdwarf to |
| 633 | + a new Dwarf_Debug, to get @e libdwarf to |
634 | 634 | access that group. |
635 | 635 |
|
636 | 636 | When opening a Dwarf_Debug the following applies: |
637 | 637 |
|
638 | | - If DW_GROUPNUMBER_ANY is passed in libdwarf will |
| 638 | + If DW_GROUPNUMBER_ANY is passed in @e libdwarf will |
639 | 639 | choose either of DW_GROUPNUMBER_BASE(1) or |
640 | 640 | DW_GROUPNUMBER_DWO (2) depending on the object |
641 | 641 | content. If both groups one and two are in the |
642 | | - object libdwarf will chose DW_GROUPNUMBER_BASE. |
| 642 | + object @e libdwarf will chose DW_GROUPNUMBER_BASE. |
643 | 643 |
|
644 | | - If DW_GROUPNUMBER_BASE is passed in libdwarf |
| 644 | + If DW_GROUPNUMBER_BASE is passed in @e libdwarf |
645 | 645 | will choose it if non-split DWARF is in the object, else |
646 | 646 | the init call will return DW_DLV_NO_ENTRY. |
647 | 647 |
|
648 | | - If DW_GROUPNUMBER_DWO is passed in libdwarf |
| 648 | + If DW_GROUPNUMBER_DWO is passed in @e libdwarf |
649 | 649 | will choose it if .dwo sections are in the object, else |
650 | 650 | the init will call return DW_DLV_NO_ENTRY. |
651 | 651 |
|
652 | 652 | If a groupnumber greater than two is passed in |
653 | | - libdwarf simply accepts it, whether any sections |
| 653 | + @e libdwarf simply accepts it, whether any sections |
654 | 654 | corresponding to that groupnumber exist or not. |
655 | 655 |
|
656 | 656 | For information on groups "dwarfdump -i" |
|
669 | 669 | (but none in an executable or shared object). |
670 | 670 | Each such COMDAT group will have a small set of |
671 | 671 | sections in it and each section in such a group |
672 | | - will be assigned the same group number by libdwarf. |
| 672 | + will be assigned the same group number by @e libdwarf. |
673 | 673 |
|
674 | 674 | Sections that are in a .dwp .dwo object file |
675 | 675 | are assigned to DW_GROUPNUMBER_DWO, |
|
699 | 699 | (but none in an executable or shared object). |
700 | 700 | Each such COMDAT group will have a small set of |
701 | 701 | sections in it and each section in such a group |
702 | | - will be assigned the same group number by libdwarf. |
| 702 | + will be assigned the same group number by @e libdwarf. |
703 | 703 |
|
704 | 704 | Sections that are in a .dwp .dwo object file |
705 | 705 | are assigned to DW_GROUPNUMBER_DWO, |
|
714 | 714 |
|
715 | 715 | Popular compilers and tools are using such sections. There |
716 | 716 | is no detailed documentation that we can find (so far) |
717 | | - on how the COMDAT section groups are used, so libdwarf is |
| 717 | + on how the COMDAT section groups are used, so @e libdwarf is |
718 | 718 | based on observations of what compilers generate. |
719 | 719 |
|
720 | 720 | @section dwsec_changes Recent Changes |
|
752 | 752 | Added support for the meson build system. |
753 | 753 |
|
754 | 754 | Updated an include in libdwarfp source files. |
755 | | - Improved doxygen documentation of libdwarf. |
| 755 | + Improved doxygen documentation of @e libdwarf. |
756 | 756 | Now 'make check -j8' and the like works correctly. |
757 | 757 | Fixed a bug where reading a PE (Windows) |
758 | 758 | object could fail for certain section |
|
0 commit comments