aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.ctf
AgeCommit message (Collapse)AuthorFilesLines
2024-01-12Update copyright year range in header of all files managed by GDBAndrew Burgess13-13/+13
This commit is the result of the following actions: - Running gdb/copyright.py to update all of the copyright headers to include 2024, - Manually updating a few files the copyright.py script told me to update, these files had copyright headers embedded within the file, - Regenerating gdbsupport/Makefile.in to refresh it's copyright date, - Using grep to find other files that still mentioned 2023. If these files were updated last year from 2022 to 2023 then I've updated them this year to 2024. I'm sure I've probably missed some dates. Feel free to fix them up as you spot them.
2023-03-03[gdb/testsuite] Use set always-read-ctf on instead of --strip-debugTom de Vries3-6/+15
Use "set always-read-ctf on" instead of --strip-debug in the ctf test-cases. Tested on x86_64-linux.
2023-03-02[gdb/symtab] Add set/show always-read-ctf on/offTom de Vries3-0/+104
[ This is a simplified rewrite of an earlier submission "[RFC][gdb/symtab] Add maint set symbol-read-order", submitted here ( https://sourceware.org/pipermail/gdb-patches/2022-September/192044.html ). ] With the test-case included in this patch, we run into: ... (gdb) file dwarf2-and-ctf (gdb) print var_ctf^M 'var_ctf' has unknown type; cast it to its declared type^M ... The problem is that the executable contains both ctf and dwarf2, so the ctf info (which contains the type information about var_ctf) is ignored. GDB has support for handling multiple debug formats, but the common use case for ctf is to be used when dwarf2 is not present, and gdb reflects that, assuming that by reading ctf in addition there won't be any extra information, so it's not worth the additional cycles and memory. Add a new command "set/show always-read-ctf on/off", that when on forces unconditional reading of ctf, allowing us to do: ... (gdb) set always-read-ctf on (gdb) file dwarf2-and-ctf (gdb) print var_ctf^M $2 = 2^M ... The setting is off by default, preserving current behaviour. A bit of background on the relevance of reading order: the formats have a priority relationship between them, where reading earlier means lower priority. By reading the format with the most detail last, we ensure it has the highest priority, which makes sure that in case there is overlapping info, the most detailed info is found. This explains the current reading order of mdebug, stabs and dwarf2. Add the unconditional reading of ctf before dwarf2, because it's less detailed than dwarf2. The conditional reading of ctf is still done after the attempt to read dwarf2, necessarily so because we only know whether there's dwarf2 after we've tried to read it. The new command allow us to replace uses of -Wl,--strip-debug added in commit 908a926ec4e ("[gdb/testsuite] Fix ctf test-cases on openSUSE Tumbleweed") by uses of "set always-read-ctf on", but I've left that for another commit. Tested on x86_64-linux. Reviewed-By: Eli Zaretskii <eliz@gnu.org> Reviewed-By: Tom Tromey <tom@tromey.com>
2023-01-13Rename to allow_ctf_testsTom Tromey3-3/+3
This changes skip_ctf_tests to invert the sense, and renames it to allow_ctf_tests.
2023-01-13Use require !skip_ctf_testsTom Tromey3-12/+3
This changes some tests to use "require !skip_ctf_tests".
2023-01-01Update copyright year range in header of all files managed by GDBJoel Brobecker10-10/+10
This commit is the result of running the gdb/copyright.py script, which automated the update of the copyright year range for all source files managed by the GDB project to be updated to include year 2023.
2022-11-28gdb/testsuite: remove use of then keyword from gdb.*/*.exp scriptsAndrew Burgess1-2/+2
The canonical form of 'if' in modern TCL is 'if {} {}'. But there's still a bunch of places in the testsuite where we make use of the 'then' keyword, and sometimes these get copies into new tests, which just spreads poor practice. This commit removes all use of the 'then' keyword from the remaining gdb.*/*.exp scripts. Previous commits have done the bulk of this removal, this commit just handles the remaining directories that each contain a low number of instances. There should be no changes in what is tested after this commit.
2022-10-12[gdb/testsuite] Fix ctf test-cases on openSUSE TumbleweedTom de Vries3-6/+20
When running test-case gdb.base/ctf-constvars.exp on openSUSE Tumbleweed (with system gcc version 12, providing gcc -gctf support, enabling the ctf test-cases in the gdb testsuite), I run into: ... (gdb) print vox^M 'vox' has unknown type; cast it to its declared type^M (gdb) FAIL: gdb.base/ctf-constvars.exp: print vox ... There are two causes for this: - the linker flags are missing --ctf-variables, so the information for variable vox is missing (reported in PR29468), and - the executable contains some dwarf2 due to some linked-in glibc objects, so the ctf info is ignored (reported in PR29160). By using: - -Wl,--ctf-variable, - -Wl,--strip-debug, and we can make the test-case and some similar test-cases pass. Tested on x86_64-linux. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29160 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29468
2022-06-24gdb/testsuite: remove unneeded calls to get_compiler_infoAndrew Burgess2-12/+0
It is not necessary to call get_compiler_info before calling test_compiler_info, and, after recent commits that removed setting up the gcc_compiled, true, and false globals from get_compiler_info, there is now no longer any need for any test script to call get_compiler_info directly. As a result every call to get_compiler_info outside of lib/gdb.exp is redundant, and this commit removes them all. There should be no change in what is tested after this commit.
2022-06-24gdb/testsuite: remove global gcc_compiled from gdb.expAndrew Burgess1-6/+3
After this commit the gcc_compiled global is no longer exported from lib/gdb.exp. In theory we could switch over all uses of gcc_compiled to instead call test_compiler_info directly, however, I have instead added a new proc to gdb.exp: 'is_c_compiler_gcc'. I've then updated the testsuite to call this proc instead of using the global. Having a new proc specifically for this task means that we have a single consistent pattern for detecting gcc. By wrapping this logic within a proc that calls test_compiler_info, rather than using the global, means that test scripts don't need to call get_compiler_info before they read the global, simply calling the new proc does everything in one go. As a result I've been able to remove the get_compiler_info calls from all the test scripts that I've touched in this commit. In some of the tests e.g. gdb.dwarf2/*.exp, the $gcc_compiled flag was being checked at the top of the script to decide if the whole script should be skipped or not. In these cases I've called the new proc directly and removed all uses of gcc_compiled. In other cases, e.g. most of the gdb.base scripts, there were many uses of gcc_compiled. In these cases I set a new global gcc_compiled near the top of the script, and leave the rest of the script unchanged. There should be no changes in what is tested after this commit.
2022-06-04[gdb/testsuite] Fix ERROR in gdb.ctf/funcreturn.expTom de Vries1-14/+12
On openSUSE Tumbleweed (with gcc-12, enabling ctf tests) I run into: ... ERROR: tcl error sourcing src/gdb/testsuite/gdb.ctf/funcreturn.exp. ERROR: tcl error code NONE ERROR: Unexpected arguments: \ {print v_double_func} \ {[0-9]+ = {double \(\)} 0x[0-9a-z]+.*} \ {print double function} \ } ... The problem is a curly brace as fourth argument to gdb_test, which errors out due to recently introduced more strict argument checking in gdb_test. Fix the error by removing the brace. Though this fixes the error for me, due to PR29160 I get only FAILs, so I can't claim proper testing on x86_64-linux.
2022-01-01Automatic Copyright Year update after running gdb/copyright.pyJoel Brobecker10-10/+10
This commit brings all the changes made by running gdb/copyright.py as per GDB's Start of New Year Procedure. For the avoidance of doubt, all changes in this commits were performed by the script.
2021-09-18CTF: multi-CU and archive supportWeimin Pan13-2/+275
Now gdb is capable of debugging executable, which consists of multiple compilation units (CUs) with the CTF debug info. An executable could potentially have one or more archives, which, in CTF context, contain conflicting types. all changes were made in ctfread.c in which elfctf_build_psymtabs was modified to handle archives, via the ctf archive iterator and its callback build_ctf_archive_member and scan_partial_symbols was modified to scan archives, which are treated as subfiles, to build the psymtabs. Also changes were made to handle CTF's data object section and function info section which now share the same format of their contents - an array of type IDs. New functions ctf_psymtab_add_stt_entries, which is called by ctf_psymtab_add_stt_obj and ctf_psymtab_add_stt_func, and add_stt_entries, which is called by add_stt_obj and add_stt_func when setting up psymtabs and full symtab, respectively.
2021-05-16CTF: handle forward reference typeWeimin Pan2-0/+529
The problems can be illustrated, with any program, below: (gdb) print main $1 = {main} 0x0 The return type was incorrectly set in read_func_kind_type, with the name of the function, which leads c_type_print_base_1 to print it. In addition, the address of a new function needs to be set with that info in its minimal symtab entry, when the new function is added. After the fix: (gdb) print main $1 = {int ()} 0x4004b7 <main> A new test, gdb.ctf/funcreturn.exp, is added to the testsuite. gdb/ChangeLog: * ctfread.c (new_symbol): Set function address. (read_func_kind_type): Remove incorrect type name setting. Don't copy name returned from ctf_type_ame_raw throughout file. gdb/testsuite/ChangeLog: * gdb.ctf/funcreturn.exp: New file. * gdb.ctf/whatis.c: Copy from gdb.base.