1To build libdwarf.a, type 2 ./configure 3 make 4 5To use dwarf or libdwarf, you may want to install dwarf.h and 6libdwarf.h somewhere convenient, and you may need the libdwarf 7in the accompanying libdwarf directory 8 9If your headers are not in the expected places, 10use the configure script to access them (and to add other ld 11or C flags). 12For example 13 ./configure CPPFLAGS="-I/home/davea/inc" CFLAGS="-I/home/davea/inc" 14Set both CFLAGS and CPPFLAGS so that configure works properly. 15 16It is now possible to request shared library build with 17 --enable-shared 18(--enable-nonshared is on by default). 19 20TARGET DEPENDENCIES of .debug_frame: 21dwarf.h 22 These should be revised if you have more than the defined 23 63 'normal' registers. It's not harmful to have these too large! 24 Too small will lead to errors reading .debug_frame and .eh_frame. 25 DW_FRAME_HIGHEST_NORMAL_REGISTER 26 DW_FRAME_LAST_REG_NUM 27 28 These you might revise, but can safely ignore if simply 29 using dwarfdump. If using the producer code you will want 30 to get these exactly right for your architecture. 31 DW_FRAME_RA_COL 32 DW_FRAME_STATIC_LINK 33 DW_FRAME_CFA_COL 34 35libdwarf.h 36 The DW_FRAME_REG_INITIAL_VALUE #define should be set to 37 the value approprate to your archtecture. See libdwarf.h 38 for details. 39 40 If DW_REG_TABLE_SIZE is not set large enough attempts to 41 fill in the .debug_frame tables will get an error. 42 Should be at least as large as DW_FRAME_LAST_REG_NUM. 43 If it's too large nothing is harmed (but some extra space taken 44 at run time). 45 46 47The .debug_frame is so very architecture dependent 48and because the host (where libdwarf/dwarfdump are executed) 49and target (the objects read) could be different. 50It's currently not supported to have dwarfdump/libdwarf determine 51the architecture on-the-fly and do-the-right-thing. 52Just setting DW_FRAME_LAST_REG_NUM and DW_FRAME_HIGHEST_NORMAL_REGISTER 53and DW_REG_TABLE_SIZE high enough will likely suffice for most 54purposes and most compilers/architectures.. 55See comments in dwarf.h/libdwarf.h. 56 57It's perfectly safe to ignore the above suggestions as long 58as libdwarf does not get a DW_DLE_DF_REG_NUM_TOO_HIGH error. 59(which would only happen on reading .debug_frame or .eh_frame data). 60 61If you intend to use the libdwarf dwarf-producer code 62for .debug_frame information 63you must do a thorough analysys and revise dwarf.h 64substantially to match the output target archtecture. 65 66In general, in the producer code, numbers are copied from and 67to integers with memcpy(). In case of endianness problems, 68constants set in dwarf_producer_init() can fix the problems. 69If one wants to produce a *different-endian* output the best 70solution is to change the integer memcpy calls to call thru a 71new dbg-based function pointer and have it 'do the right thing' 72to adjust endianness. Set the function pointer correctly in 73dwarf_producer_init() and the rest of the code will just call 74thru the function pointer. Tedious work to find and change the 75memcpy calls to be dbg->de_memcpy(), but once done the code is 76no longer endian dependent (right now there is no way to ask 77for cross-endian: a new flag needed or ?). 78 79leb128 numbers are endian-independent, so nothing need be 80done with those for cross-endian support (the storage 81of leb128 on disk is always little-endian). 82 83The .ps files are postscript. So those who cannot deal with mm 84format files but do have a postscript printer (or have 85ghostscript) can print the documents. 86This form was chosen before pdf format existed... 87 88libdwarf2.1.ps documents a way for a debugger to read dwarf information. 89libdwarf2p.1.ps documents a way for a compiler to generate dwarf information. 90dwarf.v2.ps documents Dwarf Version 2. 91index.v2.ps is an index to dwarf.v2.ps. 92indexDW.v2 is a plain text index of dwarf #defines to dwarf.v2.ps 93mips_extensions.ps documents the mips/sgi extensions to dwarf. 94 95The commands used to generate the postscript were: 96 pr -t -e libdwarf2.1.mm | tbl | psroff -t -mm >libdwarf2.1.ps 97 pr -t -e libdwarf2p.1.mm | tbl | psroff -t -mm >libdwarf2p.1.ps 98 pic dwarf.v2.mm | tbl | psroff -t -mm >dwarf.v2.ps 2> newIndex 99 pic index.v2.mm | tbl | psroff -t -mm >index.v2.ps 100 101pic is a picture processing tool (ATT command). 102tbl is a table-processing tool. 103(part of Documentor's Work Bench on ATT-like systems). 104tbl and pic are available on linux. 105 106psroff is a name for a troff-like processor, part of 107Documentor's Work Bench on IRIX. Substitute a 108troff-like or nroff-like processor. 109 110The index.v2.mm was generated by the dwarf-document writer 111using some local ATT/USL tools (which SGI does not have, so 112there is no way I know of to regenerate this). 113 114To use dwarf or libdwarf, you may want to install dwarf.h and 115libdwarf.h somewhere convenient. 116 117You will also need libelf (libelf.a and/or libelf.so) and 118libelf.h installed. These are available from GNU repositories. 119 120$Source: /plroot/cmplrs.src/v7.4.5m/.RCS/PL/libdwarf/RCS/README,v $ 121$Revision: 1.10 $ 122$Date: 2006/03/30 18:04:52 $ 123