summaryrefslogtreecommitdiff
path: root/tests/ChangeLog
Commit message (Collapse)AuthorAgeFilesLines
* PR30377: fix debuginfod -r -X combinationFrank Ch. Eigler2023-04-221-0/+5
| | | | | | | | Until this fix, debuginfod -r -X '.*' didn't trigger groom-time removal of everything, because the -I include regex overrode it. Corrected logic to match the scan-time tie-breaking between -I / -X. Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
* libdw: Handle DW_OP_GNU_uninit in dwarf_getlocationMark Wielaard2023-02-141-0/+4
| | | | | | | | | | | dwarf_getlocation would return an error when it saw a DW_OP_GNU_uninit. Handle it by simply recognizing as a no argument operation. DW_OP_GNU_uninit is emitted by GCC as a marker to flag the location expression as referring to an uninitialized value. Signed-off-by: Mark Wielaard <mark@klomp.org>
* backends: Handle DW_TAG_unspecified_type in dwarf_peeled_die_typeMark Wielaard2023-02-141-0/+5
| | | | | | | | | | | | | | | | binutils 2.40 introduces DW_TAG_unspecified_type for assembly functions with an unknown return type. This breaks the run-funcretval.sh testcase because dwfl_module_return_value_location returns an error for such functions because it cannot determine the return value location. Fix that by treating DW_TAG_unspecified_type as if the DIE doesn't have a DW_AT_type. Also update the testcase to explicitly checking for DW_TAG_unspecified_type and printing "returns unspecified type". https://sourceware.org/bugzilla/show_bug.cgi?id=30047 Signed-off-by: Mark Wielaard <mark@klomp.org>
* tests: Check ELFUTILS_DISABLE_DEMANGLE in run-addr2line-C-test.shMark Wielaard2023-02-031-0/+4
| | | | | | https://sourceware.org/bugzilla/show_bug.cgi?id=30072 Signed-off-by: Mark Wielaard <mark@klomp.org>
* libdw: Search for abstract origin in the correct CUMark Wielaard2023-01-301-0/+6
| | | | | | | | | | | | | | | With gcc -flto the abstract origin of an inlined subroutine could be in a different CU. dwarf_getscopes might return an empty scope if it cannot find the abstract origin scope. So make sure to search in the We also tried to add the origin match in pc_record directly in the current inlined scope. This always failed, causing to do a needless traversal, followed by the full CU scan in dwarf_getscopes. Just always stop the pc_record search and then do the CU origin_match in dwarf_getscopes. Signed-off-by: Mark Wielaard <mark@klomp.org>
* addr2line: -C should not try to handle optional (ignored) argumentMark Wielaard2023-01-301-0/+6
| | | | | | | | | | | | | | | | The --demangle option takes an option (ignored) argument. Since -C is the short option of --demangle it also takes that optional argument. But that means that something like -Cfi is like -C got fi as argument, while the user expects -Cfi to be like -C -f -i. Separate the --demangle and -C options. --demangle still takes an optional (ignored) argument, but -C doesn't take any arguments so -Cfi acts the same as -fiC. Also fix --target, -b, so that it is properly ignored (and not accidentially enables demangling). Signed-off-by: Mark Wielaard <mark@klomp.org>
* tests: run-debuginfod-query-retry.sh /bin/sh might not have a build-idMark Wielaard2023-01-191-0/+5
| | | | | | | | | If /bin/sh wasn't build with build-id the test fails because debuginfod-find will not be able to even try to fetch something. Use libdebuginfod.so.1 instead as test file because we just build that and configure makes sure we always produce a build-id. Signed-off-by: Mark Wielaard <mark@klomp.org>
* Add support for Synopsys ARCv2 processorsShahab Vahedi2022-12-221-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no regression in tests for an x86_64 build, while the new hello_arc_hs4.ko is added as well. This is the only meaningful test that I could add at the moment, given the features supported by this port. $ cat tests/test-suite.log ========================================== elfutils 0.188: tests/test-suite.log ========================================== # TOTAL: 236 # PASS: 235 # SKIP: 1 # XFAIL: 0 # FAIL: 0 # XPASS: 0 # ERROR: 0 .. contents:: :depth: 2 SKIP: run-lfs-symbols.sh ======================== LFS testing is irrelevant on this system SKIP run-lfs-symbols.sh (exit status: 77) $ cat tests/run-strip-reloc.sh.log runtest hello_i386.ko runtest hello_x86_64.ko runtest hello_ppc64.ko runtest hello_s390.ko runtest hello_aarch64.ko runtest hello_m68k.ko runtest hello_riscv64.ko runtest hello_csky.ko runtest hello_arc_hs4.ko <-- [ new ARC HS4 test ] runtest /home/shahab/pahole_pkg/elfutils-git/bld_arc/src/strip runtest /home/shahab/pahole_pkg/elfutils-git/bld_arc/src/strip.o runtest strip-uncompressed.o runtest strip-compressed.o runtest testfile-debug-rel-ppc64.o runtest testfile-debug-rel-ppc64-z.o runtest testfile-debug-rel-ppc64-g.o PASS run-strip-reloc.sh (exit status: 0) Signed-off-by: Shahab Vahedi <shahab@synopsys.email>
* Changelog: Update entries from previous commits.Aaron Merey2022-11-011-0/+5
| | | | | | Update Changelogs with details from commits 04b1a3aa and 054b3bde9. Signed-off-by: Aaron Merey <amerey@redhat.com>
* debuginfod: Support queries for ELF/DWARF sectionsAaron Merey2022-11-011-0/+5
| | | | | | | | | | | | | | | | | | | | | | Add new function debuginfod_find_section which queries debuginfod servers for the raw binary contents of the specified ELF/DWARF section in a file matching the given build-id. Extend the server webapi to support section queries. Section query URLS have the following format: /buildid/BUILDID/section/SECTION The server will attempt to extract the section from a debuginfo file matching the given build-id. If the debuginfo file cannot be found or the section has type SHT_NOBITS, the server will attempt to extract the section from the executable file matching the build-id. If the server is built without section query support, the client will attempt to download the debuginfo matching the build-id and extract the section. If the debuginfo file cannot be found or the section has type SHT_NOBITS, the server will attempt to download the executable file matching the build-id and extract the section. Signed-off-by: Aaron Merey <amerey@redhat.com>
* Rename 'hello{2,3}.spec.' -> 'hello{2,3}.specfile'Yonggang Luo2022-10-311-0/+9
| | | | | | | | | | | These filenames are invalid on win32. We don't want to include multiple .spec files for make rpm. rpmbuild --sign is not supported anymore. Also include hello3.specfile in EXTRA_DIST. Escape some macros in the elfutils.spec.in file comments. Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Signed-off-by: Mark Wielaard <mark@klomp.org>
* readelf: add binutils-style --syms optionArsen Arsenović2022-10-301-0/+4
| | | | | | This helps people with a lot of built up muscle memory :) Signed-off-by: Arsen Arsenović <arsen@aarsen.me>
* Use grep -E instead of egrep, use grep -F instead of fgrep.Mark Wielaard2022-10-271-0/+11
| | | | | | | GNU grep 3.8 gives a deprecation warning when using egrep or fgrep. Just use grep -E and grep -F. Signed-off-by: Mark Wielaard <mark@klomp.org>
* tests: include config.h first.Mark Wielaard2022-10-161-0/+4
| | | | | | | Otherwise some symbols (lseek, open) might not get the 64bit offset variants because they don't pick up _FILE_OFFSET_BITS. Signed-off-by: Mark Wielaard <mark@klomp.org>
* tests: Check lseek, read and malloc results with correct types in test.Mark Wielaard2022-10-161-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | When compiling dwfl-report-offline-memory.c on some systems (latest gcc/glibc and --enable-sanitize-undefined) we might get: In file included from /usr/include/features.h:490, from /usr/include/assert.h:35, from dwfl-report-offline-memory.c:18: In function ‘read’, inlined from ‘main’ at dwfl-report-offline-memory.c:68:23: /usr/include/bits/unistd.h:38:10: error: ‘__read_alias’ specified size 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=] 38 | return __glibc_fortify (read, __nbytes, sizeof (char), | ^~~~~~~~~~~~~~~ /usr/include/bits/unistd.h: In function ‘main’: /usr/include/bits/unistd.h:26:16: note: in a call to function ‘__read_alias’ declared with attribute ‘access (write_only, 2, 3)’ 26 | extern ssize_t __REDIRECT (__read_alias, (int __fd, void *__buf, | ^~~~~~~~~~ cc1: all warnings being treated as errors make[2]: *** [Makefile:2461: dwfl-report-offline-memory.o] Error 1 Fix by using the correct types and checking all return values. Signed-off-by: Mark Wielaard <mark@klomp.org>
* libdwfl: add dwfl_report_offline_memoryAleksei Vetrov2022-10-161-0/+9
| | | | | | | | | | | | | This method allows to read and report ELF from memory instead of opening a file. That way arbitrary memory can be worked with, e.g. when coming from a stream without the need to persist. Another useful application is for fuzzing, because fuzzers might be able to track accesses to the memory and change the fuzzer input to cover more edge cases through more targeted input. Hence, add a new function along with a test case. Signed-off-by: Aleksei Vetrov <vvvvvv@google.com>
* tests: Add libeu to tests needing error() APIKhem Raj2022-10-131-0/+4
| | | | | | | | A local error() implementation is used when libc does not provide it, therefore link in libeu.a which contains this function in tests needing error() API Signed-off-by: Khem Raj <raj.khem@gmail.com>
* ar: Correct -N COUNT off-by-oneMark Wielaard2022-09-141-0/+6
| | | | | | | | | | | | | When using instance [COUNT], the instance check is wrong. instance-- == 0 should be --instance == 0. Add a testcase run-ar-N.sh that uses -N COUNT with extract and delete operations checking the right instance was extracted and deleted. https://sourceware.org/bugzilla/show_bug.cgi?id=28725 Reported-by: panxiaohe <panxh_ran@163.com> Signed-off-by: Mark Wielaard <mark@klomp.org>
* PR28284: add tweaks on previous debuginfod x-debuginfod* header forwarding workFrank Ch. Eigler2022-09-071-0/+7
| | | | | | | | Embrace case-independent headers, more fully document, handle HTTP \r. In addition to test case, hand-tested against fedora debuginfod instances, running federated servers under valgrind. Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
* PR28284 - Debuginfod header functionality implementedNoah Sanci2022-09-061-0/+6
| | | | | | | | Debuginfod and debuginfod clients are now equipped to send and receive http headers prefixed with X-DEBUGINFOD and print them in verbose mode for more context Signed-off-by: Noah Sanci <nsanci@redhat.com>
* tests: run-low_high_pc.sh: drop redundant 'lx' suffixSergei Trofimovich via Elfutils-devel2022-08-081-0/+4
| | | | | | | | | Noticed when debugged test failure: lowpc: 8049000, highpc: 8049000lx ../sysdeps/i386/crti.S: [2def] '_init' highpc <= lowpc Signed-off-by: Sergei Trofimovich <slyich@gmail.com>
* tests: Add initial scan wait_ready in run-debuginfod-percent-escape.shMark Wielaard2022-08-011-0/+4
| | | | | | | | | Otherwise wait_ready for thread_work_total{role="traverse"} after the kill -USR1 can be either zero, one or two. We want to see it change to one first, then after the kill -USR1 it should change to two to be sure the scan happened after the new binary was created. Signed-off-by: Mark Wielaard <mark@klomp.org>
* readelf: Support --dynamic with --use-dynamicDi Chen2022-08-011-0/+6
| | | | | | | | | | | | Currently, eu-readelf is using section headers to dump the dynamic segment information (print_dynamic -> handle_dynamic). This patch adds new options to eu-readelf (-D, --use-dynamic) for (-d, --dynamic). https://sourceware.org/bugzilla/show_bug.cgi?id=28873 Signed-off-by: Di Chen <dichen@redhat.com>
* Arm Ehdr flag printingUlrich Drepper2022-06-061-0/+7
| | | | | | | | | | | | | | | | | | Arm needs to decode flags and I modeled it after the binutils code. The same messages are printed. Given the requirement of the interface and the ABIs the current version of the callback function isn't sufficient unless one wants to create a stateful interface. The problem is that most flags need to be interpreted in the context of the ABI version. So I changed the API to also pass the original flag value. This shouldn't be a problem because there are no users yet. There is also a bug in ebl_machine_flag_name. When copying the string provided by the callback cp is moved past the NUL byte. It should move to the NUL byte. Otherwise one cannot anything but the first added flag description. Finally some cosmetic changes (space after each comma in the output). Signed-off-by: Mark Wielaard <mark@klomp.org>
* PR28577: Make run-debuginfod-fd-prefetch-caches.sh test somethingNoah Sanci2022-06-031-0/+4
| | | | | | | Update to the run-debuginfod-fd-prefetch to make the test more sound. Signed-off-by: Mark Wielaard <mark@klomp.org>
* tests: Disable run-debuginfod-federation-metrics.sh for old libmicrohttpdMark Wielaard2022-06-021-0/+5
| | | | | | | | | On really old libmicrohttpd the run-debuginfod-federation-metrics.sh test will crash debuginfod after too many file descriptors have been used. libmicrohttpd looses track of the state and aborts instead of producing an error. Just disable the testcase on these very old versions. Signed-off-by: Mark Wielaard <mark@klomp.org>
* debuginfod: Use MHD_USE_ITC in MHD_start_daemon flagsMark Wielaard2022-04-241-0/+4
| | | | | | | | | | | | | | | | | | | This prevents the "Server reached connection limit. Closing inbound connection." issue we have been seeing in the run-debuginfod-webapi-concurrency.sh testcase. From the manual: If the connection limit is reached, MHD’s behavior depends a bit on other options. If MHD_USE_ITC was given, MHD will stop accepting connections on the listen socket. This will cause the operating system to queue connections (up to the listen() limit) above the connection limit. Those connections will be held until MHD is done processing at least one of the active connections. If MHD_USE_ITC is not set, then MHD will continue to accept() and immediately close() these connections. https://sourceware.org/bugzilla/show_bug.cgi?id=28708 Signed-off-by: Mark Wielaard <mark@klomp.org>
* tests: Lower parallel lookups in run-debuginfod-webapi-concurrency.shMark Wielaard2022-04-231-0/+4
| | | | | | | | | With 100 parallel lookups we sometimes see: Server reached connection limit. Closing inbound connection. Lower parallel lookups to 64 Signed-off-by: Mark Wielaard <mark@klomp.org>
* readelf: Don't consider padding DT_NULL as dynamic section entryDi Chen2022-04-191-0/+7
| | | | | | | | | | | when using `$ eu-readelf -d {FILE}` to get the number of dynamic section entris, it wrongly counts the padding DT_NULLs as dynamic section entries. However, DT_NULL Marks end of dynamic section. They should not be considered as dynamic section entries. https://sourceware.org/bugzilla/show_bug.cgi?id=28928 Signed-off-by: Di Chen <dichen@redhat.com>
* tests: Don't try to corrupt sqlite database during test.Mark Wielaard2022-04-141-0/+5
| | | | | | | | | | In run-debuginfod-federation-sqlite.sh we used to try to corrupt the sqlite database while the debuginfod server was running and check it detected errors, but that was unreliably and slightly dangerous since part of the database was already mapped into memory. Instead trigger some some random activity, then trigger a shutdown. Signed-off-by: Mark Wielaard <mark@klomp.org>
* PR29022: 000-permissions files cause problems for backupsAaron Merey2022-04-131-0/+11
| | | | | | | | | | | | | | 000-permission files currently used for negative caching can cause permission problems for some backup software and disk usage checkers. Fix this by using empty files for negative caching instead. Also use each empty file's mtime to determine the time since last download attempt instead of the cache_miss_s file's mtime. https://sourceware.org/bugzilla/show_bug.cgi?id=29022 Tested-by: Milian Wolff <mail@milianw.de> Signed-off-by: Aaron Merey <amerey@redhat.com>
* tests: Check addsections test binary is 64bit for run-large-elf-file.shMark Wielaard2022-03-241-0/+4
| | | | | | | | | The test binary should be 64bit to be able to create 4GB, or larger, ELF files. https://sourceware.org/bugzilla/show_bug.cgi?id=28975 Signed-off-by: Mark Wielaard <mark@klomp.org>
* tests: Use /bin/sh instead of /bin/ls as always there binaryMark Wielaard2021-12-171-0/+4
| | | | | | | | | run-debuginfod-query-retry.sh would fail when /bin/ls wasn't available. Use /bin/sh instead which really is always available. GNU Guix doesn't have any other standard binary in /bin except for sh. Signed-off-by: Mark Wielaard <mark@klomp.org>
* PR28661: debuginfo connection thread pool supportFrank Ch. Eigler2021-12-101-0/+6
| | | | | | | | | | | | Add an option -C, which activates libmicrohttpd's thread-pool mode for handling incoming http connections. Add libmicrohttpd error-logging callback function so as to receive indication of its internal errors, and relay counts to our metrics. Some of these internal errors tipped us off to a microhttpd bug that thread pooling works around. Document in debuginfod.8 page. Hand-tested against "ulimit -u NNN" shells, and with a less strenuous new test case. Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
* configure: Add --enable-sanitize-addressMark Wielaard2021-12-091-0/+6
| | | | | | | | | | | | | | | | --enable-sanitize-address makes sure that all code is compiled with -fsanitizer=address and all tests run against libasan. It can be combined with --enable-sanitize-undefined, but not with --enable-valgrind. In maintainer mode there is one program that causes leaks, i386_gendis, so disable leak detection for that program. One testcase, test_nlist, needs special linker flags, make sure it also uses -fsanitizer=address when using the address sanitizer. Signed-off-by: Mark Wielaard <mark@klomp.org>
* tests: varlocs workaround format-overflow errorsMark Wielaard2021-12-091-0/+10
| | | | | | | | | | | | | | | | In function ‘printf’, inlined from ‘handle_attr’ at varlocs.c:932:3: error: ‘%s’ directive argument is null [-Werror=format-overflow=] The warning is technically correct. A %s argument should not be NULL. Although in practice all implementations will print it as "(null)". Workaround this by simply changing the dwarf string functions to return an "<unknown>" string. The test is for the correct names, either "(null)" or "<unknown>" would make it fail (also remove a now unnecessary assert, the switch statement will check for unknown opcodes anyway). Signed-off-by: Mark Wielaard <mark@klomp.org>
* tests: Add -rdynamic to dwfl_proc_attach_LDFLAGSMark Wielaard2021-11-251-0/+4
| | | | | | | | | | | | | | | | | dwfl-proc-attach uses (overrides) dlopen (so it does nothing). This seems to cause a versioned dlopen symbol to be pulled in when building with LTO. Resulting in a link failure (when dlopen isn't integrated into libc): /usr/bin/ld: dwfl-proc-attach.o (symbol from plugin): undefined reference to symbol 'dlopen@@GLIBC_2.2.5' /usr/bin/ld: /usr/lib64/libdl.so.2: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status Add -rdynamic to the LDFLAGS to add all symbols to the dynamic symbol table for dwfl-proc-attach. Signed-off-by: Mark Wielaard <mark@klomp.org>
* tests: Don't set DEBUGINFOD_TIMEOUTMark Wielaard2021-11-151-0/+16
| | | | | | | Various tests set DEBUGINFOD_TIMEOUT to 10. Which is less than the default of 90. None of the tests relied on a lower timeout. So just don't set it. Signed-off-by: Mark Wielaard <mark@klomp.org>
* PR28430: debuginfod: support --passive modeFrank Ch. Eigler2021-11-101-0/+6
| | | | | | | | Add support for a limited mode for debuginfod that uses a pure read-only sqlite index. This mode is useful for load spreading based on naively shared or replicated databases. Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
* libdw, readelf: Read inlining info in NVIDIA extended line mapJohn M Mellor-Crummey2021-11-101-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As of CUDA 11.2, NVIDIA added extensions to the line map section of CUDA binaries to represent inlined functions. These extensions include - two new fields in a line table row to represent inline information: context, and functionname, - two new DWARF extended opcodes: DW_LNE_NVIDIA_inlined_call, DW_LNE_NVIDIA_set_function_name, - an additional word in the line table header that indicates the offset in the .debug_str function where the function names for this line table begin, and A line table row for an inlined function contains a non-zero "context" value. The “context” field indicates the index of the line table row that serves as the call site for an inlined context. The "functionname" field in a line table row is only meaningful if the "context" field of the row is non-zero. A meaningful "functionname" field contains an index into the .debug_str section relative to the base offset established in the line table header; the position in the .debug_str section indicates the name of the inlined function. These extensions resemble the proposed DWARF extensions (http://dwarfstd.org/ShowIssue.php?issue=140906.1) by Cary Coutant, but are not identical. This commit integrates support for handling NVIDIA's extended line maps into elfutil's libdw library, by adding two functions dwarf_linecontext and dwarf_linefunctionname, and the readelf --debug-dump=line command line utility. Signed-off-by: John M Mellor-Crummey <johnmc@rice.edu> Signed-off-by: Mark Wielaard <mark@klomp.org>
* libdw: dwarf_elf_begin should use either plain, dwo or lto DWARF sections.Mark Wielaard2021-11-091-0/+8
| | | | | | | | | | | When opening an ELF file that contained a mix of plain, dwo or lto .debug sections the result could be confusing. Add a check to pick just the plain .debug sections, or the .dwo sections or the .gnu.debuglto_.debug sections (in that order of preference). That way there is always a consistent set. https://sourceware.org/bugzilla/show_bug.cgi?id=27367 Signed-off-by: Mark Wielaard <mark@klomp.org>
* PR28514: debuginfod: limit groom operation timesFrank Ch. Eigler2021-11-051-0/+5
| | | | | | | | | | | | | | | | | | | For large databases and many stale files, it was possible to starve rescan operations by numerous groom "nuke" (database delete ops). Under the theory that including new data is at least as important as aging old, we now impose a rough deadline on groom queries. In the process, we discovered that we were commiting some undefined-behaviour sqlite ops (deleting rows while iterating), which may explain some previous heisenbug occurrences. So the groom nuke operations are split into decision & action phases, with associated progress-tracking metrics. Testing the timeout facility requires hand-testing beyond the testsuite (since it requires LARGE databases to show measurable query times). So confirmed this part by hand. Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
* PR28240: debuginfod client root-safe negative cachingFrank Ch. Eigler2021-10-221-0/+6
| | | | | | | | | | | | | | | Negative cache (000-permission) files were incorrectly treated as valid cached files for the root user, because root can open even 000-perm files without -EACCES. Corrected this checking sequence. Fixed the debuginfod testsuite to run to completion as root or as an ordinary user, correcting corresponding permission checks: stat -c %A $FILE is right and [ -w $FILE] [ -r $FILE ] were wrong. Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
* tests: Handle dwarf_attr_string returning NULL in show-die-info.cMark Wielaard2021-10-061-0/+4
| | | | | Reported-by: Jan-Benedict Glaw <jbglaw@lug-owl.de> Signed-off-by: Mark Wielaard <mark@klomp.org>
* PR28242: debuginfod prometheus metric wideningDi Chen2021-10-061-0/+5
| | | | | | | | | | | | This patch aims to extend http_responses_* metrics with another label "type" by getting the extra artifact-type content added as a new key=value tag. v2, tweaked patch to perform artifact-type sanitization at point of vulnerability rather than in general metric tabulation logic. Signed-off-by: Di Chen <dichen@redhat.com> Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
* debuginfod: Remove checking for unsafe headersNoah Sanci2021-09-171-0/+5
| | | | | | | | | | | | | | Some http response header checks were removed such as checking for Connection and Cache-Control. These headers are not guarenteed to be received and depend on proxy and libmicrohttpd versions. Checking for the existance of Content-Length and DEBUGINFOD-* headers is sufficient since Content-Length is added upon creation of an MHD_Response object and DEBUGINFOD-* are added manually. (source on Content-Length being added: https://www.gnu.org/software/libmicrohttpd/manual/libmicrohttpd.html# microhttpd_002dresponse-headers ) Signed-off-by: Noah Sanci <nsanci@redhat.com>
* debuginfod: PR27277 - Describe retrieved files when verboseNoah Sanci2021-09-161-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | Allow users, with enough verbosity, to print the HTTP response headers upon retrieving a file. These files may include several custome http response headers such as X-DEBUGINFOD-FILE, X-DEBUGINFOD-SIZE, and X-DEBUGINFOD-ARCHIVE. These headers are added from the daemon, in debuginfod.cxx. E.g output: HTTP/1.1 200 OK Connection: Keep-Alive Content-Length: 4095072 Cache-Control: public Last-Modified: Thu, 09 Sep 2021 19:06:40 GMT X-FILE: debuginfod X-FILE-SIZE: 4095072 Content-Type: application/octet-stream Date: Fri, 10 Sep 2021 16:38:06 GMT https://sourceware.org/bugzilla/show_bug.cgi?id=27277 Signed-off-by: Noah Sanci <nsanci@redhat.com>
* debuginfod: PR28034 - No longer escape '/', and loop efficiencyNoah Sanci2021-09-161-5/+7
| | | | | | | | | | | | | | | Previously, urls containing '/', so most urls, would escape '/' to %2F, which is undesirable for use in other libraries which may escape differently. This patch escapes the '/' and replaces all of them ensuring there are no %2Fs sent. Some inefficiencies within the code were fixed, such as changing constant operations of a while loop within a for loop to a while loop outside of a for loop. Also strlen is no longer used within the loop, simplifying the interior operations to mere arithmetic. https://sourceware.org/bugzilla/show_bug.cgi?id=28034 Signed-off-by: Noah Sanci <nsanci@redhat.com>
* libdw: set address size, offset size and version on fake CUsMark Wielaard2021-09-121-0/+14
| | | | | | | | | | | | | | | | | | There are three "fake CUs" that are associated with .debug_loc, .debug_loclist and .debug_addr. These fake CUs are used for "fake attributes" to provide values that are stored in these sections instead of in the .debug_info section. These fake CUs didn't have the address size, offset size and DWARF version set. This meant that values that depended on those properties might not be interpreted correctly. One example was the value associated with a DW_OP_addrx (which comes from the .debug_addr section). Add a testcase using varlocs to test that addresses can correctly be retrieved for gcc/clang, DWARF4/5 and 32/64 bits objects. https://sourceware.org/bugzilla/show_bug.cgi?id=28220 Signed-off-by: Mark Wielaard <mark@klomp.org>
* tests: Don't fail run-debuginfod-fd-prefetch-caches.sh if grep -c failsMark Wielaard2021-09-091-0/+7
| | | | | | | | | | | | | | The set -o errtrace made run-debuginfod-fd-prefetch-caches.sh fail. On some systems. Add set -o functrace to make it fail consistently. The failure is because the grep -c for in the log file fails (it returns zero). Fix this by using || true. But this is only a workaround. It makes the test pass, but only because all values are always zero. The test doesn't currently test anything. Also make sure that err and cleanup are only executed once. Signed-off-by: Mark Wielaard <mark@klomp.org>