aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-04-12Add batching parameter to parallel_for_eachTom Tromey3-9/+15
parallel_for_each currently requires each thread to process at least 10 elements. However, when indexing, it's fine for a thread to handle just a single CU. This patch parameterizes this, and updates the one user.
2022-04-12Refactor build_type_psymtabs_readerTom Tromey1-12/+7
The new DWARF scanner needs to save the entire cutu_reader object, not just parts of it. In order to make this possible, this patch refactors build_type_psymtabs_reader. This change is done separately because it is easy to review in isolation and it helps make the later patches smaller.
2022-04-12Add new overload of dwarf5_djb_hashTom Tromey2-0/+18
This adds a new overload of dwarf5_djb_hash. This is used in subsequent patches.
2022-04-12Add name splittingTom Tromey4-0/+165
The new DWARF index code works by keeping names pre-split. That is, rather than storing a symbol name like "a::b::c", the names "a", "b", and "c" will be stored separately. This patch introduces some helper code to split a full name into its components.
2022-04-12Let skip_one_die not skip childrenTom Tromey1-6/+10
This patch adds an option to skip_one_die that causes it not to skip child DIEs. This is needed in the new scanner.
2022-04-12Allow ada_decode not to decode operatorsTom Tromey2-7/+12
The new DWARF scanner records names as they appear in DWARF. However, because Ada is unusual, it also decodes the Ada names to synthesize package components for them. In order for this to work out properly, gdb also needs a mode where ada_decode can be instructed not to decode Ada operator names. That is what this patch implements.
2022-04-12Refactor dwarf2_get_pc_boundsTom Tromey1-20/+29
This changes dwarf2_get_pc_bounds so that it does not directly access a psymtab or psymtabs_addrmap. Instead, both the addrmap and the desired payload are passed as parameters. This makes it suitable to be used by the new indexer.
2022-04-12Add dwarf2_per_cu_data::addresses_seenTom Tromey2-0/+7
This adds a new member to dwarf2_per_cu_data that indicates whether addresses have been seen for this CU. This is then set by the .debug_aranges reader. The idea here is to detect when a CU does not have address information, so that the new indexer will know to do extra scanning in that case.
2022-04-12Fix latent bug in read_addrmap_from_arangesTom Tromey1-2/+3
Tom de Vries found a failure that we tracked down to a latent bug in read_addrmap_from_aranges (previously create_addrmap_from_aranges). The bug is that this code can erroneously reject .debug_aranges when dwz is in use, due to CUs at duplicate offsets. Because aranges can't refer to a CU coming from the dwz file, the fix is to simply skip such CUs in the loop.
2022-04-12Split create_addrmap_from_arangesTom Tromey1-17/+32
This patch splits create_addrmap_from_aranges into a wrapper function and a worker function. The worker function is then used in a later patch.
2022-04-12Allow thread-pool.h to work without threadsTom Tromey4-21/+28
thread-pool.h requires CXX_STD_THREAD in order to even be included. However, there's no deep reason for this, and during review we found that one patch in the new DWARF indexer series unconditionally requires the thread pool. Because the thread pool already allows a task to be run in the calling thread (for example if it is configured to have no threads in the pool), it seemed straightforward to make this code ok to use when host threads aren't available at all. This patch implements this idea. I built it on a thread-less host (mingw, before my recent configure patch) and verified that the result builds. After the thread-pool change, parallel-for.h no longer needs any CXX_STD_THREAD checks at all, so this patch removes these as well.
2022-04-12Rebase the zlib sources to the 1.2.12 releaseNick Clifton82-1969/+12505
2022-04-12[gdb/testsuite] Fix gdb.base/stap-probe.exp with read1Tom de Vries1-2/+2
When running test-case gdb.base/stap-probe.exp with make target check-read1, I run into this and similar: ... FAIL: gdb.base/stap-probe.exp: without semaphore, not optimized: \ info probes stap (timeout) ... Fix this by using gdb_test_lines instead of gdb_test. Tested on x86_64-linux.
2022-04-12Add C++ "save gdb-index" testTom Tromey2-0/+64
I found a bug in the new DWARF reader series, related to the handling of enumerator names. This bug caused a crash, so this patch adds a regression test for this particular case. I'm checking this in.
2022-04-12Remove "Ada Settings" node from the manualTom Tromey1-32/+0
A while back, I sent a patch to unify the Ada varsize-limit setting with the more generic max-value-size: https://sourceware.org/pipermail/gdb-patches/2021-September/182004.html However, it turns out I somehow neglected to send part of the patch. Internally, I also removed the "Ada Settings" node from the manual, as it only documents the obsolete setting. This patch removes this text.
2022-04-12Require GNAT debug info for some Ada testsTom Tromey5-0/+25
A few Ada tests require some debug info in the GNAT runtime. When run without this info, these tests can't pass. This patch changes these tests to detect this situation and stop with "untested".
2022-04-12Stop strip from removing debuglink sections.Nick Clifton2-2/+20
PR 28992 * objcopy.c (is_strip_section_1): Do not delete debuglink sections when stripping debug information.
2022-04-12gas: new_logical_line{,_flags}() can return "void"Jan Beulich3-18/+13
With the sole user of the return value gone, convert the return type to void. This in turn allows simplifying another construct, by moving it slightly later in the function.
2022-04-12gas: drop .appfile and .applineJan Beulich18-141/+109
These were used originally to represent "# <line> <file>" constructs inserted by (typically) compilers when pre-processing. Quite some time ago they were replaced by .linefile though. Since the original directives were never documented, we ought to be able to remove support for them. As a result in a number of case function parameter aren't used anymore and can hence be dropped.
2022-04-12gas: further adjust file/line handling for .macroJan Beulich4-22/+50
Commit 7992631e8c0b ("gas/Dwarf: improve debug info generation from .irp and alike blocks"), while dealing okay with actual assembly source files not using .file/.line and alike outside but not inside of .macro, has undue effects when the logical file/line pair was already overridden: Line numbers would continuously increment while processing the expanded macro, while the goal of the PR gas/16908 workaround is to keep the expansion associated with the line invoking the macro. However, as soon as enough state was overridden _inside_ the macro to cause as_where() to no longer fall back top as_where_physical(), honor this by resuming the bumping of the logical line number. Note that from_sb_is_expansion's initializer was 1 for an unknown reason. While renaming the variable and changing its type, also change the initializer to "expanding_none", which would have been "0" in the original code. Originally the initializer value itself wasn't ever used anyway (requiring sb_index != -1), as it necessarily had changed in input_scrub_include_sb() alongside setting sb_index to other than -1. Strictly speaking input_scrub_insert_line() perhaps shouldn't use expanding_none, yet none of the other enumerators fit there either. And then strictly speaking that function probably shouldn't exist in the first place. It's used only by tic54x.
2022-04-12gas: further adjust file/line handling for .irp and alikeJan Beulich17-1208/+1350
Commit 7992631e8c0b ("gas/Dwarf: improve debug info generation from .irp and alike blocks"), while dealing okay with actual assembly source files not using .file/.line and alike outside but not inside of .irp et al, has undue effects when the logical file/line pair was already overridden: Line numbers would continuously increment upon every iteration, thus potentially getting far off. Furthermore it left it to the user to actually insert .file/.line inside such constructs. Note though that before aforementioned change things weren't pretty either: Diagnostics (and debug info) would be associated with the directive terminating the iteration construct, rather than with the actual lines. Handle this automatically by simply latching the present line and then re-instating coordinates first thing on every iteration; note that the file can't change from what was previously pushed on the scrubber's state stack, and hence can be taken from there by using a new flavor of .linefile (which is far better memory-footprint-wise than recording the full path in the inserted directive). (This then leaves undisturbed any file/line control occurring in the body of the construct, as these will only be seen and processed afterwards.)
2022-04-12x86: make {disp16} work similarly to {disp32}Jan Beulich5-4/+22
In a few places {disp32} was handled specially when really {disp16} wants handling just the same.
2022-04-11gprofng doesn't build with gcc 5.5Vladimir Mezentsev13-3586/+222
gprofng/ChangeLog 2022-04-07 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> PR gprofng/29026 * configure.ac: Check version of bison. * src/Makefile.am (QLParser.yy): Run bison * src/QLParser.yy: Adapted for bison 3.04 or later. * src/DbeSession.cc: make some params const. * src/DbeSession.h: Likewise. * configure: Regenerate. * Makefile.in: Regenerate. * src/Makefile.in: Regenerate. * src/QLParser.tab.cc: Deleted. * src/QLParser.tab.hh: Deleted. * doc/Makefile.in: Regenerate. * gp-display-html/Makefile.in: Regenerate. * libcollector/configure: Regenerate.
2022-04-12Automatic date update in version.inGDB Administrator1-1/+1
2022-04-11i386-fbsd-nat: Remove two unused variables.John Baldwin1-6/+0
Earlier versions of the change in 1285ce8629b37f800bf21731ee7c7a8b1b8d0233 used this variable, but not the final version that landed.
2022-04-11gdb: remove MSYMBOL_TARGET_FLAG_{1,2} macrosSimon Marchi6-17/+51
Replace with equivalent getter/setter macros. Change-Id: I1042564dd47347337374762bd64ec31b5c573ee2
2022-04-11gdb: remove minimal symbol size macrosSimon Marchi9-33/+46
Remove MSYMBOL_HAS_SIZE, MSYMBOL_SIZE and SET_MSYMBOL_SIZE, replace them with equivalent methods. Change-Id: I6ee1cf82df37e58dff52ea6568ceb4649c7d7538
2022-04-11gdb: remove MSYMBOL_TYPE macroSimon Marchi17-78/+90
Add a getter and a setter for a minimal symbol's type. Remove the corresponding macro and adjust all callers. Change-Id: I89900df5ffa5687133fe1a16b2e0d4684e67a77d
2022-04-11gdb: remove symbol value macrosSimon Marchi90-461/+503
Remove all macros related to getting and setting some symbol value: #define SYMBOL_VALUE(symbol) (symbol)->value.ivalue #define SYMBOL_VALUE_ADDRESS(symbol) \ #define SET_SYMBOL_VALUE_ADDRESS(symbol, new_value) \ #define SYMBOL_VALUE_BYTES(symbol) (symbol)->value.bytes #define SYMBOL_VALUE_COMMON_BLOCK(symbol) (symbol)->value.common_block #define SYMBOL_BLOCK_VALUE(symbol) (symbol)->value.block #define SYMBOL_VALUE_CHAIN(symbol) (symbol)->value.chain #define MSYMBOL_VALUE(symbol) (symbol)->value.ivalue #define MSYMBOL_VALUE_RAW_ADDRESS(symbol) ((symbol)->value.address + 0) #define MSYMBOL_VALUE_ADDRESS(objfile, symbol) \ #define BMSYMBOL_VALUE_ADDRESS(symbol) \ #define SET_MSYMBOL_VALUE_ADDRESS(symbol, new_value) \ #define MSYMBOL_VALUE_BYTES(symbol) (symbol)->value.bytes #define MSYMBOL_BLOCK_VALUE(symbol) (symbol)->value.block Replace them with equivalent methods on the appropriate objects. Change-Id: Iafdab3b8eefc6dc2fd895aa955bf64fafc59ed50
2022-04-11gdb/doc: add section about Fortran intrinsic functions and typesNils-Christian Kempke1-10/+133
The earlier version of this document had no sections about the available Fortran intrinsic functions or the Fortran builtin types. I added two sections 'Fortran intrinsics' and 'Fortran types' to document the available Fortran language features. The subsection 'Fortran Defaults' has been integrated into the Fortran subsection.
2022-04-11gdb/fortran/testsuite: add complex from integers testNils-Christian Kempke2-1/+12
When working on the files I noted that there was no actual test for a COMPLEX built from two INTEGERS. I added that now for completion.
2022-04-11gdb/fortran: rewrite intrinsic handling and add some missing overloadsNils-Christian Kempke9-236/+904
The operators FLOOR, CEILING, CMPLX, LBOUND, UBOUND, and SIZE accept (some only with Fortran 2003) the optional parameter KIND. This parameter determines the kind of the associated return value. So far, implementation of this kind parameter has been missing in GDB. Additionally, the one argument overload for the CMPLX intrinsic function was not yet available. This patch adds overloads for all above mentioned functions to the Fortran intrinsics handling in GDB. It re-writes the intrinsic function handling section to use the helper methods wrap_unop_intrinsic/wrap_binop_intrinsic/wrap_triop_intrinsic. These methods define the action taken when a Fortran intrinsic function is called with a certain amount of arguments (1/2/3). The helper methods fortran_wrap2_kind and fortran_wrap3_kind have been added as equivalents to the existing wrap and wrap2 methods. After adding more overloads to the intrinsics handling, some of the operation names were no longer accurate. E.g. UNOP_FORTRAN_CEILING has been renamed to FORTRAN_CEILING as it is no longer a purely unary intrinsic function. This patch also introduces intrinsic functions with one, two, or three arguments to the Fortran parser and the UNOP_OR_BINOP_OR_TERNOP_INTRINSIC token has been added.
2022-04-11gdb/fortran: rename f77_keywords to f_keywordsNils-Christian Kempke1-2/+2
Rename f77_keywords to f_keywords since some of the introduced keywords in the array are f90 only.
2022-04-11gdb/fortran: Change GDB print for fortran default typesNils-Christian Kempke3-16/+11
Currently, when asking GDB to print the type of a Fortran default type such as INTEGER or REAL, GDB will return the default name of that type, e.g. "integer"/"real": (gdb) ptype integer type = integer (gdb) ptype real type = real For LOGICAL and COMPLEX it would return the actual underlying types (gdb) ptype logical type = logical*4 (gdb) ptype complex type = complex*4 Similarly, GDB would print the default integer type for the underlying default type: (gdb) ptype integer*4 type = integer (gdb) ptype real*4 type = real (gdb) ptype logical type = logical*4 (gdb) ptype complex*4 type = complex*4 This is inconsistent and a bit confusing. Both options somehow indicate what the internal underlying type for the default type is - but I think the logical/complex version is a bit clearer. Consider again: (gdb) ptype integer type = integer This indicates to a user that the type of "integer" is Fortran's default integer type. Without examining "ptype integer*4" I would expect, that any variable declared integer in the actual code would also fit into a GDB integer. But, since we cannot adapt out internal types to the compiler flags used at compile time of a debugged binary, this might be wrong. Consider debugging Fortran code compiled with GNU and e.g. the "-fdefault-integer-8" flag. In this case the gfortran default integer would be integer*8 while GDB internally still would use a builtin_integer, so an integer of the size of an integer*4 type. On the other hand having GDB print (gdb) ptype integer type = integer*4 makes this clearer. I would still be tempted to fit a variable declared integer in the code into a GDB integer - but at least ptype would directly tell me what is going on. Note, that when debugging a binary compiled with "-fdefault-integer-8" a user will always see the actual underlying type of any variable declared "integer" in the Fortran code. So having the code program test integer :: a = 5 print *, a ! breakpt end program test will, when breaking at breakpt print (gdb) ptype var type = integer(kind=4) or (gdb) ptype var type = integer(kind=8) depending on the compiler flag. This patch changes the outputs for the REAL and INTEGER default types to actually print the internally used type over the default type name. The new behavior for the above examples is: (gdb) ptype integer type = integer*4 (gdb) ptype integer*4 type = integer*4 Existing testcases have been adapted to reflect the new behavior.
2022-04-11gdb/fortran: clean-up Fortran intrinsic typesNils-Christian Kempke4-35/+74
The currently implemented intrinsic type handling for Fortran missed some tokens and their parsing. While still not all Fortran type kinds are implemented this patch at least makes the currently handled types consistent. As an example for what this patch does, consider the intrinsic type INTEGER. GDB implemented the handling of the keywords "integer" and "integer_2" but missed "integer_4" and "integer_8" even though their corresponding internal types were already available as the Fortran builtin types builtin_integer and builtin_integer_s8. Similar problems applied to LOGICAL, REAL, and COMPLEX. This patch adds all missing tokens and their parsing. Whenever a section containing the type handling was touched, it also was reordered to be in a more easy to grasp order. All INTEGER/REAL/LOGICAL/COMPLEX types were grouped together and ordered ascending in their size making a missing one more easy to spot. Before this change GDB would print the following when tyring to use the INTEGER keywords: (gdb) set language fortran (gdb) ptype integer*1 unsupported kind 1 for type integer (gdb) ptype integer_1 No symbol table is loaded. Use the "file" command. (gdb) ptype integer*2 type = integer*2 (gdb) ptype integer_2 type = integer*2 (gdb) ptype integer*4 type = integer (gdb) ptype integer_4 No symbol table is loaded. Use the "file" command. (gdb) ptype integer*8 type = integer*8 (gdb) ptype integer_8 No symbol table is loaded. Use the "file" command. (gdb) ptype integer type = integer With this patch all keywords are available and the GDB prints: (gdb) set language fortran (gdb) ptype integer*1 type = integer*1 (gdb) ptype integer_1 type = integer*1 (gdb) ptype integer*2 type = integer*2 (gdb) ptype integer_2 type = integer*2 (gdb) ptype integer*4 type = integer*4 (gdb) ptype integer_4 type = integer*4 (gdb) ptype integer*8 type = integer*8 (gdb) ptype integer_8 type = integer*8 (gdb) ptype integer type = integer The described changes have been applied to INTEGER, REAL, COMPLEX, and LOGICAL. Existing testcases have been adapted to reflect the new behavior. Tests for formerly missing types have been added.
2022-04-11gdb/fortran: change default logical type to builtin_logicalNils-Christian Kempke2-5/+5
According to the Fortran standard, logical is of the size of a 'single numeric storage unit' (just like real and integer). For gfortran, flang and ifx/ifort this storage unit (or the default logical type) is of size kind 4, actually occupying 4 bytes of storage, and so the default type for logical expressions in Fortran should probably also be Logical*4 and not Logical*2. I adapted GDB's behavior to be in line with gfortran/ifort/ifx/flang.
2022-04-11gdb/fortran: reformat build_fortran_types in f-lang.cNils-Christian Kempke1-10/+8
Add a few newlines after the type definitions and remove some unnecessary linebreaks.
2022-04-11gdb/fortran: fix complex type in Fortran builtin typesNils-Christian Kempke4-23/+23
Before this patch things like (gdb) ptype complex*8 complex*16 (gdb) ptype complex*4 complex*8 were possible in GDB, which seems confusing for a user. The reason is a mixup in the implementation of the Fortran COMPLEX type. In Fortran the "*X" after a type would normally (I don't think this is language required) specify the type's size in memory. For the COMPLEX type the kind parameters usually (at least for GNU, Intel, Flang) specify not the size of the whole type but the size of the individual two REALs used to form the COMPLEX. Thus, a COMPLEX*4 will usually consist of two REAL*4s. Internally this type was represented by a builtin_complex_s8 - but here I think the s8 actually meant the raw size of the type. This is confusing and I renamed the types (e.g. builting_complex_s8 became builtin_complex_s4 according to its most common useage) and their printed names to their language equivalent. Additionally, I added the default COMPLEX type "COMPLEX" being the same as a COMPLEX*4 (as is normally the case) and removed the latter. I added a few tests for this new behavior as well. The new behavior is (gdb) ptype complex*8 complex*8 (gdb) ptype complex*4 complex*4
2022-04-11gdb/f-lang: remove hidden ^L charactersNils-Christian Kempke1-3/+0
2022-04-11gdb/f-lang: add Integer*1 to Fortran builtin typesNils-Christian Kempke5-2/+11
Add builtin_integer_s1 of size TARGET_CHAR_BIT to Fortran builtin types.
2022-04-11[gdb/testsuite] Fix gdb.base/annota1.exp with pieTom de Vries1-0/+2
Since commit 359efc2d894 ("[gdb/testsuite] Make gdb.base/annota1.exp more robust") we see this fail with target board unix/-fPIE/-pie: ... FAIL: gdb.base/annota1.exp: run until main breakpoint (timeout) ... The problem is that the commit makes the number and order of matched annotations fixed, while between target boards unix and unix/-fPIE/-pie there is a difference: ... \032\032post-prompt Starting program: outputs/gdb.base/annota1/annota1 +\032\032breakpoints-invalid + \032\032starting \032\032frames-invalid ... Fix this by optionally matching the additional annotation. Tested on x86_64-linux.
2022-04-11[gdb/testsuite] Fix gdb.dwarf2/dw2-lines.exp for m32 pieTom de Vries1-1/+1
As reported in PR29043, when running test-case gdb.dwarf2/dw2-lines.exp with target board unix/-m32/-fPIE/-pie, we run into: ... Breakpoint 2, 0x56555540 in bar ()^M (gdb) PASS: gdb.dwarf2/dw2-lines.exp: cv=2: cdw=32: lv=2: ldw=32: \ continue to breakpoint: foo \(1\) next^M Single stepping until exit from function bar,^M which has no line number information.^M 0x56555587 in main ()^M (gdb) FAIL: gdb.dwarf2/dw2-lines.exp: cv=2: cdw=32: lv=2: ldw=32: \ next to foo (2) ... The problem is that the bar breakpoint ends up at an unexpected location because: - the synthetic debug info is incomplete and doesn't provide line info for the prologue part of the function, so consequently gdb uses the i386 port prologue skipper to get past the prologue - the i386 port prologue skipper doesn't get past a get_pc_thunk call. Work around this in the test-case by breaking on bar_label instead. Tested on x86_64-linux with target boards unix, unix/-m32, unix/-fPIE/-pie and unix/-m32/-fPIE/-pie.
2022-04-11Automatic date update in version.inGDB Administrator1-1/+1
2022-04-10Automatic date update in version.inGDB Administrator1-1/+1
2022-04-09Remove MSYMBOL_VALUE_CHAINTom Tromey1-1/+0
I noticed that MSYMBOL_VALUE_CHAIN is unused, so this patch removes it.
2022-04-09Rearrange struct bfd_section a littleAlan Modra2-34/+34
For better packing on 64-bit hosts. * section.c (struct bfd_section): Move next and prev field earlier. Move alignment_power later. (BFD_FAKE_SECTION): Adjust to suit. * bfd-in2.h: Regenerate.
2022-04-09Don't run pr27228 test for hppaAlan Modra1-1/+1
As the comment says, hppa doesn't support use of BFD_RELOC_* in .reloc directives. Using xfail can result in a spurious XPASS result as BFD_RELOC values change. * testsuite/gas/elf/pr27228.d: Change xfail to notarget for hppa.
2022-04-09Correct nds32 readelf reloc numbersAlan Modra1-7/+7
* readelf.c (is_32bit_abs_reloc, is_16bit_abs_reloc): Comment fixes. (is_none_reloc): Correct nds32 reloc numbers.
2022-04-09Automatic date update in version.inGDB Administrator1-1/+1
2022-04-08gas: Port "copy st_size only if unset" to aarch64 and riscvFangrui Song3-21/+22
And disable the new test gas/elf/size.s for alpha which uses its own .set, for hppa*-*-hpux* which does not allow .size before declaration.