| 1 |
# SOME DESCRIPTIVE TITLE |
| 2 |
# Copyright (C) YEAR Free Software Foundation, Inc. |
| 3 |
# This file is distributed under the same license as the PACKAGE package. |
| 4 |
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. |
| 5 |
# |
| 6 |
#, fuzzy |
| 7 |
msgid "" |
| 8 |
msgstr "" |
| 9 |
"Project-Id-Version: PACKAGE VERSION\n" |
| 10 |
"POT-Creation-Date: 2026-06-05 06:19+0200\n" |
| 11 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
| 12 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
| 13 |
"Language-Team: LANGUAGE <[email protected]>\n" |
| 14 |
"Language: \n" |
| 15 |
"MIME-Version: 1.0\n" |
| 16 |
"Content-Type: text/plain; charset=UTF-8\n" |
| 17 |
"Content-Transfer-Encoding: 8bit\n" |
| 18 |
|
| 19 |
#. type: TH |
| 20 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 21 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 22 |
#, no-wrap |
| 23 |
msgid "backtrace" |
| 24 |
msgstr "" |
| 25 |
|
| 26 |
#. type: TH |
| 27 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 28 |
#: opensuse-tumbleweed |
| 29 |
#, no-wrap |
| 30 |
msgid "2026-02-08" |
| 31 |
msgstr "" |
| 32 |
|
| 33 |
#. type: TH |
| 34 |
#: archlinux debian-unstable |
| 35 |
#, no-wrap |
| 36 |
msgid "Linux man-pages 6.18" |
| 37 |
msgstr "" |
| 38 |
|
| 39 |
#. type: SH |
| 40 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 41 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 42 |
#, no-wrap |
| 43 |
msgid "NAME" |
| 44 |
msgstr "" |
| 45 |
|
| 46 |
#. type: Plain text |
| 47 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 48 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 49 |
msgid "" |
| 50 |
"backtrace, backtrace_symbols, backtrace_symbols_fd - support for application " |
| 51 |
"self-debugging" |
| 52 |
msgstr "" |
| 53 |
|
| 54 |
#. type: SH |
| 55 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 56 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 57 |
#, no-wrap |
| 58 |
msgid "LIBRARY" |
| 59 |
msgstr "" |
| 60 |
|
| 61 |
#. type: Plain text |
| 62 |
#: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron |
| 63 |
#: opensuse-leap-16-1 opensuse-tumbleweed |
| 64 |
msgid "Standard C library (I<libc>,\\ I<-lc>)" |
| 65 |
msgstr "" |
| 66 |
|
| 67 |
#. type: SH |
| 68 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 69 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 70 |
#, no-wrap |
| 71 |
msgid "SYNOPSIS" |
| 72 |
msgstr "" |
| 73 |
|
| 74 |
#. type: Plain text |
| 75 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 76 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 77 |
#, no-wrap |
| 78 |
msgid "B<#include E<lt>execinfo.hE<gt>>\n" |
| 79 |
msgstr "" |
| 80 |
|
| 81 |
#. type: Plain text |
| 82 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 83 |
#: opensuse-tumbleweed |
| 84 |
#, no-wrap |
| 85 |
msgid "" |
| 86 |
"B<int backtrace(>int size;\n" |
| 87 |
"B< void *>I<buffer>B<[>I<size>B<], int >I<size>B<);>\n" |
| 88 |
msgstr "" |
| 89 |
|
| 90 |
#. type: Plain text |
| 91 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 92 |
#: opensuse-tumbleweed |
| 93 |
#, no-wrap |
| 94 |
msgid "" |
| 95 |
"B<char **backtrace_symbols(>int size;\n" |
| 96 |
"B< void *const >I<buffer>B<[>I<size>B<], int >I<size>B<);>\n" |
| 97 |
"B<void backtrace_symbols_fd(>int size;\n" |
| 98 |
"B< void *const >I<buffer>B<[>I<size>B<], int >I<size>B<, int >I<fd>B<);>\n" |
| 99 |
msgstr "" |
| 100 |
|
| 101 |
#. type: SH |
| 102 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 103 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 104 |
#, no-wrap |
| 105 |
msgid "DESCRIPTION" |
| 106 |
msgstr "" |
| 107 |
|
| 108 |
#. type: Plain text |
| 109 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 110 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 111 |
msgid "" |
| 112 |
"B<backtrace>() returns a backtrace for the calling program, in the array " |
| 113 |
"pointed to by I<buffer>. A backtrace is the series of currently active " |
| 114 |
"function calls for the program. Each item in the array pointed to by " |
| 115 |
"I<buffer> is of type I<void\\ *>, and is the return address from the " |
| 116 |
"corresponding stack frame. The I<size> argument specifies the maximum " |
| 117 |
"number of addresses that can be stored in I<buffer>. If the backtrace is " |
| 118 |
"larger than I<size>, then the addresses corresponding to the I<size> most " |
| 119 |
"recent function calls are returned; to obtain the complete backtrace, make " |
| 120 |
"sure that I<buffer> and I<size> are large enough." |
| 121 |
msgstr "" |
| 122 |
|
| 123 |
#. type: Plain text |
| 124 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 125 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 126 |
msgid "" |
| 127 |
"Given the set of addresses returned by B<backtrace>() in I<buffer>, " |
| 128 |
"B<backtrace_symbols>() translates the addresses into an array of strings " |
| 129 |
"that describe the addresses symbolically. The I<size> argument specifies " |
| 130 |
"the number of addresses in I<buffer>. The symbolic representation of each " |
| 131 |
"address consists of the function name (if this can be determined), a " |
| 132 |
"hexadecimal offset into the function, and the actual return address (in " |
| 133 |
"hexadecimal). The address of the array of string pointers is returned as " |
| 134 |
"the function result of B<backtrace_symbols>(). This array is B<malloc>(3)ed " |
| 135 |
"by B<backtrace_symbols>(), and must be freed by the caller. (The strings " |
| 136 |
"pointed to by the array of pointers need not and should not be freed.)" |
| 137 |
msgstr "" |
| 138 |
|
| 139 |
#. type: Plain text |
| 140 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 141 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 142 |
msgid "" |
| 143 |
"B<backtrace_symbols_fd>() takes the same I<buffer> and I<size> arguments as " |
| 144 |
"B<backtrace_symbols>(), but instead of returning an array of strings to the " |
| 145 |
"caller, it writes the strings, one per line, to the file descriptor I<fd>. " |
| 146 |
"B<backtrace_symbols_fd>() does not call B<malloc>(3), and so can be " |
| 147 |
"employed in situations where the latter function might fail, but see NOTES." |
| 148 |
msgstr "" |
| 149 |
|
| 150 |
#. type: SH |
| 151 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 152 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 153 |
#, no-wrap |
| 154 |
msgid "RETURN VALUE" |
| 155 |
msgstr "" |
| 156 |
|
| 157 |
#. type: Plain text |
| 158 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 159 |
#: opensuse-tumbleweed |
| 160 |
msgid "" |
| 161 |
"B<backtrace>() returns the number of addresses returned in I<buffer>, which " |
| 162 |
"is not greater than I<size>. If the return value is less than I<size>, then " |
| 163 |
"the full backtrace was stored; if it is equal to I<size>, then it may have " |
| 164 |
"been truncated, in which case, the addresses of the oldest stack frames are " |
| 165 |
"not returned." |
| 166 |
msgstr "" |
| 167 |
|
| 168 |
#. type: Plain text |
| 169 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 170 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 171 |
msgid "" |
| 172 |
"On success, B<backtrace_symbols>() returns a pointer to the array " |
| 173 |
"B<malloc>(3)ed by the call; on error, NULL is returned." |
| 174 |
msgstr "" |
| 175 |
|
| 176 |
#. type: SH |
| 177 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 178 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 179 |
#, no-wrap |
| 180 |
msgid "ATTRIBUTES" |
| 181 |
msgstr "" |
| 182 |
|
| 183 |
#. type: Plain text |
| 184 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 185 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 186 |
msgid "" |
| 187 |
"For an explanation of the terms used in this section, see B<attributes>(7)." |
| 188 |
msgstr "" |
| 189 |
|
| 190 |
#. type: tbl table |
| 191 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 192 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 193 |
#, no-wrap |
| 194 |
msgid "Interface" |
| 195 |
msgstr "" |
| 196 |
|
| 197 |
#. type: tbl table |
| 198 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 199 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 200 |
#, no-wrap |
| 201 |
msgid "Attribute" |
| 202 |
msgstr "" |
| 203 |
|
| 204 |
#. type: tbl table |
| 205 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 206 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 207 |
#, no-wrap |
| 208 |
msgid "Value" |
| 209 |
msgstr "" |
| 210 |
|
| 211 |
#. type: tbl table |
| 212 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 213 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 214 |
#, no-wrap |
| 215 |
msgid ".na\n" |
| 216 |
msgstr "" |
| 217 |
|
| 218 |
#. type: tbl table |
| 219 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 220 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 221 |
#, no-wrap |
| 222 |
msgid ".nh\n" |
| 223 |
msgstr "" |
| 224 |
|
| 225 |
#. type: tbl table |
| 226 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 227 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 228 |
#, no-wrap |
| 229 |
msgid "" |
| 230 |
"B<backtrace>(),\n" |
| 231 |
"B<backtrace_symbols>(),\n" |
| 232 |
"B<backtrace_symbols_fd>()" |
| 233 |
msgstr "" |
| 234 |
|
| 235 |
#. type: tbl table |
| 236 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 237 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 238 |
#, no-wrap |
| 239 |
msgid "Thread safety" |
| 240 |
msgstr "" |
| 241 |
|
| 242 |
#. type: tbl table |
| 243 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 244 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 245 |
#, no-wrap |
| 246 |
msgid "MT-Safe" |
| 247 |
msgstr "" |
| 248 |
|
| 249 |
#. type: SH |
| 250 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 251 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 252 |
#, no-wrap |
| 253 |
msgid "STANDARDS" |
| 254 |
msgstr "" |
| 255 |
|
| 256 |
#. type: Plain text |
| 257 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 258 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 259 |
msgid "GNU." |
| 260 |
msgstr "" |
| 261 |
|
| 262 |
#. type: SH |
| 263 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 264 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 265 |
#, no-wrap |
| 266 |
msgid "HISTORY" |
| 267 |
msgstr "" |
| 268 |
|
| 269 |
#. type: Plain text |
| 270 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 271 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 272 |
msgid "glibc 2.1." |
| 273 |
msgstr "" |
| 274 |
|
| 275 |
#. type: SH |
| 276 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 277 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 278 |
#, no-wrap |
| 279 |
msgid "NOTES" |
| 280 |
msgstr "" |
| 281 |
|
| 282 |
#. type: Plain text |
| 283 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 284 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 285 |
msgid "" |
| 286 |
"These functions make some assumptions about how a function's return address " |
| 287 |
"is stored on the stack. Note the following:" |
| 288 |
msgstr "" |
| 289 |
|
| 290 |
#. type: IP |
| 291 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 292 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 293 |
#, no-wrap |
| 294 |
msgid "\\[bu]" |
| 295 |
msgstr "" |
| 296 |
|
| 297 |
#. type: Plain text |
| 298 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 299 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 300 |
msgid "" |
| 301 |
"Omission of the frame pointers (as implied by any of B<gcc>(1)'s nonzero " |
| 302 |
"optimization levels) may cause these assumptions to be violated." |
| 303 |
msgstr "" |
| 304 |
|
| 305 |
#. type: Plain text |
| 306 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 307 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 308 |
msgid "Inlined functions do not have stack frames." |
| 309 |
msgstr "" |
| 310 |
|
| 311 |
#. type: Plain text |
| 312 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 313 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 314 |
msgid "Tail-call optimization causes one stack frame to replace another." |
| 315 |
msgstr "" |
| 316 |
|
| 317 |
#. type: Plain text |
| 318 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 319 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 320 |
msgid "" |
| 321 |
"B<backtrace>() and B<backtrace_symbols_fd>() don't call B<malloc>() " |
| 322 |
"explicitly, but they are part of I<libgcc>, which gets loaded dynamically " |
| 323 |
"when first used. Dynamic loading usually triggers a call to B<malloc>(3). " |
| 324 |
"If you need certain calls to these two functions to not allocate memory (in " |
| 325 |
"signal handlers, for example), you need to make sure I<libgcc> is loaded " |
| 326 |
"beforehand." |
| 327 |
msgstr "" |
| 328 |
|
| 329 |
#. type: Plain text |
| 330 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 331 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 332 |
msgid "" |
| 333 |
"The symbol names may be unavailable without the use of special linker " |
| 334 |
"options. For systems using the GNU linker, it is necessary to use the I<-" |
| 335 |
"rdynamic> linker option. Note that names of \"static\" functions are not " |
| 336 |
"exposed, and won't be available in the backtrace." |
| 337 |
msgstr "" |
| 338 |
|
| 339 |
#. type: SH |
| 340 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 341 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 342 |
#, no-wrap |
| 343 |
msgid "EXAMPLES" |
| 344 |
msgstr "" |
| 345 |
|
| 346 |
#. type: Plain text |
| 347 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 348 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 349 |
msgid "" |
| 350 |
"The program below demonstrates the use of B<backtrace>() and " |
| 351 |
"B<backtrace_symbols>(). The following shell session shows what we might see " |
| 352 |
"when running the program:" |
| 353 |
msgstr "" |
| 354 |
|
| 355 |
#. type: Plain text |
| 356 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 357 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 358 |
#, no-wrap |
| 359 |
msgid "" |
| 360 |
"$B< cc -rdynamic prog.c -o prog>\n" |
| 361 |
"$B< ./prog 3>\n" |
| 362 |
"backtrace() returned 8 addresses\n" |
| 363 |
"\\&./prog(myfunc3+0x5c) [0x80487f0]\n" |
| 364 |
"\\&./prog [0x8048871]\n" |
| 365 |
"\\&./prog(myfunc+0x21) [0x8048894]\n" |
| 366 |
"\\&./prog(myfunc+0x1a) [0x804888d]\n" |
| 367 |
"\\&./prog(myfunc+0x1a) [0x804888d]\n" |
| 368 |
"\\&./prog(main+0x65) [0x80488fb]\n" |
| 369 |
"\\&/lib/libc.so.6(__libc_start_main+0xdc) [0xb7e38f9c]\n" |
| 370 |
"\\&./prog [0x8048711]\n" |
| 371 |
msgstr "" |
| 372 |
|
| 373 |
#. type: SS |
| 374 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 375 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 376 |
#, no-wrap |
| 377 |
msgid "Program source" |
| 378 |
msgstr "" |
| 379 |
|
| 380 |
#. type: Plain text |
| 381 |
#: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1 |
| 382 |
#: opensuse-tumbleweed |
| 383 |
#, no-wrap |
| 384 |
msgid "" |
| 385 |
"#include E<lt>execinfo.hE<gt>\n" |
| 386 |
"#include E<lt>stdio.hE<gt>\n" |
| 387 |
"#include E<lt>stdlib.hE<gt>\n" |
| 388 |
"#include E<lt>unistd.hE<gt>\n" |
| 389 |
"\\&\n" |
| 390 |
"#define BT_BUF_SIZE 100\n" |
| 391 |
"\\&\n" |
| 392 |
"void\n" |
| 393 |
"myfunc3(void)\n" |
| 394 |
"{\n" |
| 395 |
" int nptrs;\n" |
| 396 |
" void *buffer[BT_BUF_SIZE];\n" |
| 397 |
" char **strings;\n" |
| 398 |
"\\&\n" |
| 399 |
" nptrs = backtrace(buffer, BT_BUF_SIZE);\n" |
| 400 |
" printf(\"backtrace() returned %d addresses\\[rs]n\", nptrs);\n" |
| 401 |
"\\&\n" |
| 402 |
" /* The call backtrace_symbols_fd(buffer, nptrs, STDOUT_FILENO)\n" |
| 403 |
" would produce similar output to the following: */\n" |
| 404 |
"\\&\n" |
| 405 |
" strings = backtrace_symbols(buffer, nptrs);\n" |
| 406 |
" if (strings == NULL) {\n" |
| 407 |
" perror(\"backtrace_symbols\");\n" |
| 408 |
" exit(EXIT_FAILURE);\n" |
| 409 |
" }\n" |
| 410 |
"\\&\n" |
| 411 |
" for (size_t j = 0; j E<lt> nptrs; j++)\n" |
| 412 |
" printf(\"%s\\[rs]n\", strings[j]);\n" |
| 413 |
"\\&\n" |
| 414 |
" free(strings);\n" |
| 415 |
"}\n" |
| 416 |
"\\&\n" |
| 417 |
"static void /* \"static\" means don\\[aq]t export the symbol. */\n" |
| 418 |
"myfunc2(void)\n" |
| 419 |
"{\n" |
| 420 |
" myfunc3();\n" |
| 421 |
"}\n" |
| 422 |
"\\&\n" |
| 423 |
"void\n" |
| 424 |
"myfunc(int ncalls)\n" |
| 425 |
"{\n" |
| 426 |
" if (ncalls E<gt> 1)\n" |
| 427 |
" myfunc(ncalls - 1);\n" |
| 428 |
" else\n" |
| 429 |
" myfunc2();\n" |
| 430 |
"}\n" |
| 431 |
"\\&\n" |
| 432 |
"int\n" |
| 433 |
"main(int argc, char *argv[])\n" |
| 434 |
"{\n" |
| 435 |
" if (argc != 2) {\n" |
| 436 |
" fprintf(stderr, \"%s num-calls\\[rs]n\", argv[0]);\n" |
| 437 |
" exit(EXIT_FAILURE);\n" |
| 438 |
" }\n" |
| 439 |
"\\&\n" |
| 440 |
" myfunc(atoi(argv[1]));\n" |
| 441 |
" exit(EXIT_SUCCESS);\n" |
| 442 |
"}\n" |
| 443 |
msgstr "" |
| 444 |
|
| 445 |
#. SRC END |
| 446 |
#. type: SH |
| 447 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 448 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 449 |
#, no-wrap |
| 450 |
msgid "SEE ALSO" |
| 451 |
msgstr "" |
| 452 |
|
| 453 |
#. type: Plain text |
| 454 |
#: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide |
| 455 |
#: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed |
| 456 |
msgid "" |
| 457 |
"B<addr2line>(1), B<gcc>(1), B<gdb>(1), B<ld>(1), B<dlopen>(3), B<malloc>(3)" |
| 458 |
msgstr "" |
| 459 |
|
| 460 |
#. type: TH |
| 461 |
#: debian-trixie |
| 462 |
#, no-wrap |
| 463 |
msgid "2024-06-15" |
| 464 |
msgstr "" |
| 465 |
|
| 466 |
#. type: TH |
| 467 |
#: debian-trixie |
| 468 |
#, no-wrap |
| 469 |
msgid "Linux man-pages 6.9.1" |
| 470 |
msgstr "" |
| 471 |
|
| 472 |
#. type: Plain text |
| 473 |
#: debian-trixie |
| 474 |
msgid "Standard C library (I<libc>, I<-lc>)" |
| 475 |
msgstr "" |
| 476 |
|
| 477 |
#. type: Plain text |
| 478 |
#: debian-trixie fedora-44 fedora-rawhide |
| 479 |
#, no-wrap |
| 480 |
msgid "B<int backtrace(void *>I<buffer>B<[.>I<size>B<], int >I<size>B<);>\n" |
| 481 |
msgstr "" |
| 482 |
|
| 483 |
#. type: Plain text |
| 484 |
#: debian-trixie fedora-44 fedora-rawhide |
| 485 |
#, no-wrap |
| 486 |
msgid "" |
| 487 |
"B<char **backtrace_symbols(void *const >I<buffer>B<[.>I<size>B<], int >I<size>B<);>\n" |
| 488 |
"B<void backtrace_symbols_fd(void *const >I<buffer>B<[.>I<size>B<], int >I<size>B<, int >I<fd>B<);>\n" |
| 489 |
msgstr "" |
| 490 |
|
| 491 |
#. type: Plain text |
| 492 |
#: debian-trixie fedora-44 fedora-rawhide |
| 493 |
msgid "" |
| 494 |
"B<backtrace>() returns the number of addresses returned in I<buffer>, which " |
| 495 |
"is not greater than I<size>. If the return value is less than I<size>, then " |
| 496 |
"the full backtrace was stored; if it is equal to I<size>, then it may have " |
| 497 |
"been truncated, in which case the addresses of the oldest stack frames are " |
| 498 |
"not returned." |
| 499 |
msgstr "" |
| 500 |
|
| 501 |
#. type: Plain text |
| 502 |
#: debian-trixie fedora-44 fedora-rawhide |
| 503 |
#, no-wrap |
| 504 |
msgid "" |
| 505 |
"#include E<lt>execinfo.hE<gt>\n" |
| 506 |
"#include E<lt>stdio.hE<gt>\n" |
| 507 |
"#include E<lt>stdlib.hE<gt>\n" |
| 508 |
"#include E<lt>unistd.hE<gt>\n" |
| 509 |
"\\&\n" |
| 510 |
"#define BT_BUF_SIZE 100\n" |
| 511 |
"\\&\n" |
| 512 |
"void\n" |
| 513 |
"myfunc3(void)\n" |
| 514 |
"{\n" |
| 515 |
" int nptrs;\n" |
| 516 |
" void *buffer[BT_BUF_SIZE];\n" |
| 517 |
" char **strings;\n" |
| 518 |
"\\&\n" |
| 519 |
" nptrs = backtrace(buffer, BT_BUF_SIZE);\n" |
| 520 |
" printf(\"backtrace() returned %d addresses\\[rs]n\", nptrs);\n" |
| 521 |
"\\&\n" |
| 522 |
" /* The call backtrace_symbols_fd(buffer, nptrs, STDOUT_FILENO)\n" |
| 523 |
" would produce similar output to the following: */\n" |
| 524 |
"\\&\n" |
| 525 |
" strings = backtrace_symbols(buffer, nptrs);\n" |
| 526 |
" if (strings == NULL) {\n" |
| 527 |
" perror(\"backtrace_symbols\");\n" |
| 528 |
" exit(EXIT_FAILURE);\n" |
| 529 |
" }\n" |
| 530 |
"\\&\n" |
| 531 |
" for (size_t j = 0; j E<lt> nptrs; j++)\n" |
| 532 |
" printf(\"%s\\[rs]n\", strings[j]);\n" |
| 533 |
"\\&\n" |
| 534 |
" free(strings);\n" |
| 535 |
"}\n" |
| 536 |
"\\&\n" |
| 537 |
"static void /* \"static\" means don\\[aq]t export the symbol... */\n" |
| 538 |
"myfunc2(void)\n" |
| 539 |
"{\n" |
| 540 |
" myfunc3();\n" |
| 541 |
"}\n" |
| 542 |
"\\&\n" |
| 543 |
"void\n" |
| 544 |
"myfunc(int ncalls)\n" |
| 545 |
"{\n" |
| 546 |
" if (ncalls E<gt> 1)\n" |
| 547 |
" myfunc(ncalls - 1);\n" |
| 548 |
" else\n" |
| 549 |
" myfunc2();\n" |
| 550 |
"}\n" |
| 551 |
"\\&\n" |
| 552 |
"int\n" |
| 553 |
"main(int argc, char *argv[])\n" |
| 554 |
"{\n" |
| 555 |
" if (argc != 2) {\n" |
| 556 |
" fprintf(stderr, \"%s num-calls\\[rs]n\", argv[0]);\n" |
| 557 |
" exit(EXIT_FAILURE);\n" |
| 558 |
" }\n" |
| 559 |
"\\&\n" |
| 560 |
" myfunc(atoi(argv[1]));\n" |
| 561 |
" exit(EXIT_SUCCESS);\n" |
| 562 |
"}\n" |
| 563 |
msgstr "" |
| 564 |
|
| 565 |
#. type: TH |
| 566 |
#: fedora-44 fedora-rawhide |
| 567 |
#, no-wrap |
| 568 |
msgid "2024-07-23" |
| 569 |
msgstr "" |
| 570 |
|
| 571 |
#. type: TH |
| 572 |
#: fedora-44 fedora-rawhide |
| 573 |
#, no-wrap |
| 574 |
msgid "Linux man-pages 6.13" |
| 575 |
msgstr "" |
| 576 |
|
| 577 |
#. type: TH |
| 578 |
#: mageia-cauldron |
| 579 |
#, no-wrap |
| 580 |
msgid "Linux man-pages 6.17" |
| 581 |
msgstr "" |
| 582 |
|
| 583 |
#. type: TH |
| 584 |
#: opensuse-leap-16-1 opensuse-tumbleweed |
| 585 |
#, no-wrap |
| 586 |
msgid "Linux man-pages (unreleased)" |
| 587 |
msgstr "" |