1 .\" $NetBSD: dwarf_finish.3,v 1.2 2014/03/09 16:58:03 christos Exp $
3 .\" Copyright (c) 2009,2011 Joseph Koshy. All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
14 .\" This software is provided by Joseph Koshy ``as is'' and
15 .\" any express or implied warranties, including, but not limited to, the
16 .\" implied warranties of merchantability and fitness for a particular purpose
17 .\" are disclaimed. in no event shall Joseph Koshy be liable
18 .\" for any direct, indirect, incidental, special, exemplary, or consequential
19 .\" damages (including, but not limited to, procurement of substitute goods
20 .\" or services; loss of use, data, or profits; or business interruption)
21 .\" however caused and on any theory of liability, whether in contract, strict
22 .\" liability, or tort (including negligence or otherwise) arising in any way
23 .\" out of the use of this software, even if advised of the possibility of
26 .\" Id: dwarf_finish.3 2122 2011-11-09 15:35:14Z jkoshy
33 .Nm dwarf_object_finish
34 .Nd free resources associated with a debug descriptor
40 .Fn dwarf_finish "Dwarf_Debug dbg" "Dwarf_Error *err"
42 .Fn dwarf_object_finish "Dwarf_Debug dbg" "Dwarf_Error *err"
47 .Fn dwarf_object_finish
48 functions are used to release the resources associated with a debug
49 descriptor allocated by a prior call to
52 .Xr dwarf_object_init 3
62 will be used to record error information in case of an error.
67 .Fn dwarf_object_finish ,
70 will be invalid and should not be used further.
74 descriptors opened using
76 the application would need to explicitly release the
78 instance associated with the descriptor by first retrieving
84 These functions return
87 In case of an error, the functions return
89 and record additional information in argument
94 instance allocated using
97 .Bd -literal -offset indent
101 if (dwarf_finish(dbg, &de) != DW_DLV_OK)
102 errx(EXIT_FAILURE, "dwarf_finish: %s", dwarf_errmsg(de));
107 instance allocated using
108 .Xr dwarf_object_init 3
110 .Bd -literal -offset indent
114 if (dwarf_object_finish(dbg, &de) != DW_DLV_OK)
115 errx(EXIT_FAILURE, "dwarf_object_finish: %s",
121 instance allocated using
124 .Bd -literal -offset indent
129 if (dwarf_get_elf(dbg, &e, &de) != DW_DLV_OK)
130 errx(EXIT_FAILURE, "dwarf_get_elf: %s", dwarf_errmsg(&de));
132 if (dwarf_finish(dbg, &de) != DW_DLV_OK)
133 errx(EXIT_FAILURE, "dwarf_finish: %s", dwarf_errmsg(de));
139 .Xr dwarf_elf_init 3 ,
140 .Xr dwarf_get_elf 3 ,
142 .Xr dwarf_object_init 3