Index: head/contrib/elftoolchain/libdwarf/dwarf_get_AT_name.3 =================================================================== --- head/contrib/elftoolchain/libdwarf/dwarf_get_AT_name.3 (revision 276250) +++ head/contrib/elftoolchain/libdwarf/dwarf_get_AT_name.3 (revision 276251) @@ -1,258 +1,259 @@ .\" Copyright (c) 2011 Kai Wang .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $Id: dwarf_get_AT_name.3 2071 2011-10-27 03:20:00Z jkoshy $ .\" .Dd April 22, 2011 .Os .Dt DWARF_GET_AT_NAME 3 .Sh NAME .Nm dwarf_get_ACCESS_name , .Nm dwarf_get_AT_name , .Nm dwarf_get_ATE_name , .Nm dwarf_get_CC_name , .Nm dwarf_get_CFA_name , .Nm dwarf_get_CHILDREN_name , .Nm dwarf_get_DS_name , .Nm dwarf_get_DSC_name , .Nm dwarf_get_EH_name , .Nm dwarf_get_END_name , .Nm dwarf_get_FORM_name , .Nm dwarf_get_ID_name , .Nm dwarf_get_INL_name , .Nm dwarf_get_LANG_name , .Nm dwarf_get_LNE_name , .Nm dwarf_get_LNS_name , .Nm dwarf_get_MACINFO_name , .Nm dwarf_get_OP_name , .Nm dwarf_get_ORD_name , .Nm dwarf_get_TAG_name , .Nm dwarf_get_VIRTUALITY_name , .Nm dwarf_get_VIS_name .Nd retrieve the symbolic names of DWARF constants .Sh LIBRARY .Lb libdwarf .Sh SYNOPSIS .In libdwarf.h .Ft int .Fo dwarf_get_ACCESS_name .Fa "unsigned val" .Fa "char **str" .Fc .Ft int .Fo dwarf_get_AT_name .Fa "unsigned val" .Fa "char **str" .Fc .Ft int .Fo dwarf_get_ATE_name .Fa "unsigned val" .Fa "char **str" .Fc .Ft int .Fo dwarf_get_CC_name .Fa "unsigned val" .Fa "char **str" .Fc .Ft int .Fo dwarf_get_CFA_name .Fa "unsigned val" .Fa "char **str" .Fc .Ft int .Fo dwarf_get_CHILDREN_name .Fa "unsigned val" .Fa "char **str" .Fc .Ft int .Fo dwarf_get_DS_name .Fa "unsigned val" .Fa "char **str" .Fc .Ft int .Fo dwarf_get_DSC_name .Fa "unsigned val" .Fa "char **str" .Fc .Ft int .Fo dwarf_get_EH_name .Fa "unsigned val" .Fa "char **str" .Fc .Ft int .Fo dwarf_get_END_name .Fa "unsigned val" .Fa "char **str" .Fc .Ft int .Fo dwarf_get_FORM_name .Fa "unsigned val" .Fa "char **str" .Fc .Ft int .Fo dwarf_get_ID_name .Fa "unsigned val" .Fa "char **str" .Fc .Ft int .Fo dwarf_get_INL_name .Fa "unsigned val" .Fa "char **str" .Fc .Ft int .Fo dwarf_get_LANG_name .Fa "unsigned val" .Fa "char **str" .Fc .Ft int .Fo dwarf_get_LNE_name .Fa "unsigned val" .Fa "char **str" .Fc .Ft int .Fo dwarf_get_LNS_name .Fa "unsigned val" .Fa "char **str" .Fc .Ft int .Fo dwarf_get_MACINFO_name .Fa "unsigned val" .Fa "char **str" .Fc .Ft int .Fo dwarf_get_OP_name .Fa "unsigned val" .Fa "char **str" .Fc .Ft int .Fo dwarf_get_ORD_name .Fa "unsigned val" .Fa "char **str" .Fc .Ft int .Fo dwarf_get_TAG_name .Fa "unsigned val" .Fa "char **str" .Fc .Ft int .Fo dwarf_get_VIRTUALITY_name .Fa "unsigned val" .Fa "char **str" .Fc .Ft int .Fo dwarf_get_VIS_name .Fa "unsigned val" .Fa "char **str" .Fc .Sh DESCRIPTION These functions return the symbolic name of a numeric DWARF constant. .Pp Argument .Ar val specifies the numeric value whose symbolic name is desired. .Pp Argument .Ar str should point to a location which will hold the returned NUL-terminated string containing the symbolic name of the specified value. .Pp The list of functions and the DWARF constants that they accept are: .Pp .Bl -tag -width ".Fn dwarf_get_VIRTUALITY_name" -compact .It Fn dwarf_get_ACCESS_name .Dv DW_ACCESS_* constants. .It Fn dwarf_get_AT_name .Dv DW_AT_* constants. .It Fn dwarf_get_ATE_name .Dv DW_ATE_* constants. .It Fn dwarf_get_CC_name .Dv DW_CC_* constants. .It Fn dwarf_get_CFA_name .Dv DW_CFA_* constants. .It Fn dwarf_get_CHILDREN_name .Dv DW_CHILDREN_* constants. .It Fn dwarf_get_DS_name .Dv DW_DS_* constants. .It Fn dwarf_get_DSC_name .Dv DW_DSC_* constants. .It Fn dwarf_get_EH_name .Dv DW_EH_PE_* constants. .It Fn dwarf_get_END_name .Dv DW_END_* constants. .It Fn dwarf_get_FORM_name .Dv DW_FORM_* constants. .It Fn dwarf_get_ID_name .Dv DW_ID_* constants. .It Fn dwarf_get_INL_name .Dv DW_INL_* constants. .It Fn dwarf_get_LANG_name .Dv DW_LANG_* constants. .It Fn dwarf_get_LNE_name .Dv DW_LNE_* constants. .It Fn dwarf_get_LNS_name .Dv DW_LNS_* constants. .It Fn dwarf_get_MACINFO_name .Dv DW_MACINFO_* constants. .It Fn dwarf_get_OP_name .Dv DW_OP_* constants. .It Fn dwarf_get_ORD_name .Dv DW_ORD_* constants. .It Fn dwarf_get_TAG_name .Dv DW_TAG_* constants. .It Fn dwarf_get_VIRTUALITY_name .Dv DW_VIRTUALITY_* constants. .It Fn dwarf_get_VIS_name .Dv DW_VIS_* constants. +.El .Sh RETURN VALUES These functions return .Dv DW_DLV_OK on success. If the DWARF constant denoted by argument .Ar val is not recognized, these function return .Dv DW_DLV_NO_ENTRY . .Sh SEE ALSO .Xr dwarf 3 Index: head/contrib/elftoolchain/libdwarf/dwarf_get_arange_info.3 =================================================================== --- head/contrib/elftoolchain/libdwarf/dwarf_get_arange_info.3 (revision 276250) +++ head/contrib/elftoolchain/libdwarf/dwarf_get_arange_info.3 (revision 276251) @@ -1,134 +1,135 @@ .\" Copyright (c) 2011 Kai Wang .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $Id: dwarf_get_arange_info.3 2134 2011-11-10 08:40:14Z jkoshy $ .\" .Dd April 16, 2011 .Os .Dt DWARF_GET_ARANGE_INFO 3 .Sh NAME .Nm dwarf_get_arange_info .Nd extract address range information from a descriptor .Sh LIBRARY .Lb libdwarf .Sh SYNOPSIS .In libdwarf.h .Ft int .Fo dwarf_get_arange_info .Fa "Dwarf_Arange ar" .Fa "Dwarf_Addr *start" .Fa "Dwarf_Unsigned *length" .Fa "Dwarf_Off *cu_die_offset" .Fa "Dwarf_Error *err" .Fc .Sh DESCRIPTION Function .Fn dwarf_get_arange_info extracts address range information from a .Vt Dwarf_Arange descriptor. .Pp Argument .Ar ar should reference a valid .Vt Dwarf_Arange descriptor returned by function .Xr dwarf_get_aranges 3 . .Pp Argument .Ar start should point to a location which will hold the start value of the address range associated with the descriptor. .Pp Argument .Ar length should point to a location which will hold the length in bytes of the address range associated with the descriptor. .Pp Argument .Ar cu_die_offset should point to a location which will be set to an offset, relative to the .Dq ".debug_info" section, of the first debugging information entry in the compilation unit associated with argument .Ar ar . .Pp If argument .Ar err is not NULL, it will be used to store error information in case of an error. .Sh RETURN VALUES Function .Fn dwarf_get_arange_info returns .Dv DW_DLV_OK when it succeeds. In case of an error, it returns .Dv DW_DLV_ERROR and sets the argument .Ar err . .Sh ERRORS Function .Fn dwarf_get_arange_info can fail with: .Bl -tag -width ".Bq Er DW_DLE_ARGUMENT" .It Bq Er DW_DLE_ARGUMENT One of the arguments .Ar ar , .Ar start , .Ar length or .Ar cu_die_offset was NULL. +.El .Sh EXAMPLE To loop through all the address lookup table entries, use: .Bd -literal -offset indent Dwarf_Debug dbg; Dwarf_Addr start; Dwarf_Arange *aranges; Dwarf_Off die_off; Dwarf_Signed i, cnt; Dwarf_Unsigned length; Dwarf_Error de; if (dwarf_get_aranges(dbg, &aranges, &cnt, &de) != DW_DLV_OK) errx(EXIT_FAILURE, "dwarf_get_aranges: %s", dwarf_errmsg(de)); for (i = 0; i < cnt; i++) { if (dwarf_get_arange_info(aranges[i], &start, &length, &die_off, &de) != DW_DLV_OK) { warnx("dwarf_get_arange_info: %s", dwarf_errmsg(de)); continue; } /* Do something with the returned information. */ } .Ed .Sh SEE ALSO .Xr dwarf 3 , .Xr dwarf_get_arange 3 , .Xr dwarf_get_aranges 3 , .Xr dwarf_get_arange_cu_header_offset 3 , .Xr dwarf_get_cu_die_offset 3 Index: head/contrib/elftoolchain/libdwarf/dwarf_hasattr.3 =================================================================== --- head/contrib/elftoolchain/libdwarf/dwarf_hasattr.3 (revision 276250) +++ head/contrib/elftoolchain/libdwarf/dwarf_hasattr.3 (revision 276251) @@ -1,91 +1,92 @@ .\" Copyright (c) 2010 Kai Wang .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $Id: dwarf_hasattr.3 2073 2011-10-27 03:30:47Z jkoshy $ .\" .Dd April 17, 2010 .Os .Dt DWARF_HASATTR 3 .Sh NAME .Nm dwarf_hasattr .Nd check for the presence of an attribute .Sh LIBRARY .Lb libdwarf .Sh SYNOPSIS .In libdwarf.h .Ft int .Fo dwarf_hasattr .Fa "Dwarf_Die die" .Fa "Dwarf_Half attr" .Fa "Dwarf_Bool *ret_bool" .Fa "Dwarf_Error *err" .Fc .Sh DESCRIPTION Function .Fn dwarf_hasattr tests whether the debugging information entry referenced in argument .Ar die contains the attribute named by argument .Ar attr . Legal values for argument .Ar attr are those denoted by the .Dv DW_AT_* constants in the DWARF specification. .Pp If the named attribute is present in the debugging information entry, function .Fn dwarf_hasattr returns a non-zero value in the location pointed to by argument .Ar ret_bool . If the named attribute is not present, a zero is written instead. .Pp If argument .Ar err is not NULL, it will be used to return an error descriptor in case of an error. .Sh RETURN VALUES On success, function .Fn dwarf_hasattr returns .Dv DW_DLV_OK . In case of an error, it returns .Dv DW_DLV_ERROR and sets argument .Ar err . .Sh ERRORS Function .Fn dwarf_hasattr can fail with the following error: .Bl -tag -width ".Bq Er DW_DLE_ARGUMENT" .It Bq Er DW_DLE_ARGUMENT Either of argument .Va die or .Va ret_bool was NULL. +.El .Sh SEE ALSO .Xr dwarf 3 , .Xr dwarf_attr 3 , .Xr dwarf_whatattr 3 Index: head/contrib/elftoolchain/libdwarf/dwarf_whatattr.3 =================================================================== --- head/contrib/elftoolchain/libdwarf/dwarf_whatattr.3 (revision 276250) +++ head/contrib/elftoolchain/libdwarf/dwarf_whatattr.3 (revision 276251) @@ -1,78 +1,79 @@ .\" Copyright (c) 2010 Joseph Koshy .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $Id: dwarf_whatattr.3 2075 2011-10-27 03:47:28Z jkoshy $ .\" .Dd May 22, 2010 .Os .Dt DWARF_WHATATTR 3 .Sh NAME .Nm dwarf_whatattr .Nd retrieve the attribute code for a DWARF attribute .Sh LIBRARY .Lb libdwarf .Sh SYNOPSIS .In libdwarf.h .Ft int .Fo dwarf_whatattr .Fa "Dwarf_Attribute attr" .Fa "Dwarf_Half *retcode" .Fa "Dwarf_Error *err" .Fc .Sh DESCRIPTION Function .Fn dwarf_whatattr retrieves the attribute code for the DWARF attribute referenced by argument .Ar attr , and writes it to the location pointed to by argument .Ar retcode . If argument .Ar err is not NULL, it will be used to return an error descriptor in case of an error. .Sh RETURN VALUES On success, function .Fn dwarf_whatattr returns .Dv DW_DLV_OK . In case of an error, it returns .Dv DW_DLV_ERROR and sets argument .Ar err . .Sh ERRORS Function .Fn dwarf_whatattr can fail with the following error: .Bl -tag -width ".Bq Er DW_DLE_ARGUMENT" .It Bq Er DW_DLE_ARGUMENT Either of argument .Va attr or .Va retcode was NULL. +.El .Sh SEE ALSO .Xr dwarf 3 , .Xr dwarf_attr 3 , .Xr dwarf_hasattr 3