aboutsummaryrefslogtreecommitdiff
path: root/gdb/block.c
AgeCommit message (Collapse)AuthorFilesLines
2024-03-26gdb, gdbserver, gdbsupport: remove includes of early headersSimon Marchi1-1/+0
Now that defs.h, server.h and common-defs.h are included via the `-include` option, it is no longer necessary for source files to include them. Remove all the inclusions of these files I could find. Update the generation scripts where relevant. Change-Id: Ia026cff269c1b7ae7386dd3619bc9bb6a5332837 Approved-By: Pedro Alves <pedro@palves.net>
2024-03-21Require trivial destructor in allocate_on_obstackTom Tromey1-1/+1
This patch makes allocate_on_obstack a little bit safer, by enforcing the rule that objects allocated on an obstack must have a trivial destructor. The static assert is done in a method -- doing it inside the class itself won't work because the class is incomplete at that point.
2024-02-15Move lookup_name_info creation into basic_lookup_transparent_typeTom Tromey1-6/+3
I noticed that basic_lookup_transparent_type calls two different functions that both proceed to create a lookup_name_info. It's more efficient to create this object in the outermost layer possible. Making this change required a few related changes, resulting in this patch. There are still more changes of this sort that could be made. Regression tested on x86-64 Fedora 38.
2024-01-28Use domain_search_flags in lookup_symbol et alTom Tromey1-9/+15
This changes lookup_symbol and associated APIs to accept domain_search_flags rather than a domain_enum. Note that this introduces some new constants to Python and Guile. I chose to break out the documentation patch for this, because the internals here do not change until a later patch, and it seemed simpler to patch the docs just once, rather than twice.
2024-01-12Update copyright year range in header of all files managed by GDBAndrew Burgess1-1/+1
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-11-14Add block::function_blockTom Tromey1-0/+13
This adds the method block::function_block, to easily access a block's enclosing function block.
2023-09-07Simplify block_find_symbolTom Tromey1-32/+11
block_find_symbol takes a callback function, but only two callbacks are ever passed to it -- and they are similar enough that it seems cleaner to just have block_find_symbol do the work itself. Also, block_find_symbol can take a lookup_name_info as an argument, following the general idea of pushing the construction of these objects as high in the call chain as feasible. Regression tested on x86-64 Fedora 38. Tested-By: Alexandra Petlanova Hajkova <ahajkova@redhat.com>
2023-08-31Add symbol::matches methodTom Tromey1-7/+5
This adds symbol::matches, a wrapper for symbol_matches_domain. Most places calling symbol_matches_domain can call this method instead, which is a bit less wordy and also (IMO) clearer. Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-02-19Convert contained_in to methodTom Tromey1-4/+3
This converts contained_in to be a method of block.
2023-02-19Remove allocate_block and allocate_global_blockTom Tromey1-23/+0
This removes allocate_block and allocate_global_block in favor of simply calling 'new'.
2023-02-19Have global_block inherit from blockTom Tromey1-3/+1
This changes global_block to inherit from block, which is what was always intended.
2023-02-19Use 'new' for block and global_blockTom Tromey1-4/+2
This changes block and global_block to add initializers, and then to use 'new' for allocation.
2023-02-19Remove ALL_BLOCK_SYMBOLS_WITH_NAMETom Tromey1-9/+3
This removes ALL_BLOCK_SYMBOLS_WITH_NAME in favor of foreach.
2023-02-19Combine both styles of block iteratorTom Tromey1-32/+22
This merges the two styles of block iterator, having the initialization API decide which to use based on an optional parameter.
2023-02-19Store 'name' in block_iteratorTom Tromey1-10/+12
This changes the block_iterator to store the 'name' that is used by block_iter_match_next. This avoids any problem where the name could be passed inconsistently, and also makes the subsequent patches easier to understand.
2023-02-19Convert block_static_link to methodTom Tromey1-4/+4
This converts block_static_link to be a method. This was mostly written by script.
2023-02-19Convert set_block_compunit_symtab to methodTom Tromey1-4/+4
This converts set_block_compunit_symtab to be a method. This was mostly written by script.
2023-02-19Convert block_static_block and block_global_block to methodsTom Tromey1-8/+10
This converts block_static_block and block_global_block to be methods. This was mostly written by script. It was simpler to convert them at the same time because they're often used near each other.
2023-02-19Convert block_containing_function to methodTom Tromey1-5/+4
This converts block_containing_function to be a method. This was mostly written by script.
2023-02-19Convert block_linkage_function to methodTom Tromey1-6/+4
This converts block_linkage_function to be a method. This was mostly written by script.
2023-02-19Convert more block functions to methodsTom Tromey1-37/+26
This converts block_scope, block_set_scope, block_using, and block_set_using to be methods. These are all done at once to make it easier to also convert block_initialize_namespace at the same time. This was mostly written by script.
2023-02-19Convert block_inlined_p to methodTom Tromey1-6/+6
This converts block_inlined_p to be a method. This was mostly written by script.
2023-02-19Convert block_gdbarch to methodTom Tromey1-4/+4
This converts block_gdbarch to be a method. This was mostly written by script.
2023-02-19Convert block_objfile to methodTom Tromey1-6/+6
This converts block_objfile to be a method. This was mostly written by script.
2023-02-19Don't allow NULL as an argument to block_global_blockTom Tromey1-5/+1
block_global_block has special behavior when the block is NULL. Remove this and patch up the callers instead.
2023-02-19Don't allow NULL as an argument to block_static_blockTom Tromey1-2/+2
block_static_block has special behavior when the block is NULL. Remove this and patch up the callers instead.
2023-02-19Don't allow NULL as an argument to block_usingTom Tromey1-1/+1
block_using has special behavior when the block is NULL. Remove this. No caller seems to be affected.
2023-02-19Avoid extra allocations in blockTom Tromey1-0/+12
block_set_scope and block_set_using unconditionally allocate the block namespace object. However, this isn't truly needed, so arrange to only allocate when it is.
2023-02-19Rearrange block.c to avoid a forward declarationTom Tromey1-13/+10
Moving block_initialize_namespace before its callers lets us avoid a forward declaration.
2023-01-01Update copyright year range in header of all files managed by GDBJoel Brobecker1-1/+1
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-06-12Remove addrmap wrapper functionsTom Tromey1-2/+2
This removes the various addrmap wrapper functions in favor of simple method calls on the objects themselves.
2022-04-27gdb: remove BLOCKVECTOR_MAP macroSimon Marchi1-2/+2
Replace with equivalent methods. Change-Id: I4e56c76dfc363c1447686fb29c4212ea18b4dba0
2022-04-27gdb: remove BLOCKVECTOR_BLOCK and BLOCKVECTOR_NBLOCKS macrosSimon Marchi1-8/+6
Replace with calls to blockvector::blocks, and the appropriate method call on the returned array_view. Change-Id: I04d1f39603e4d4c21c96822421431d9a029d8ddd
2022-04-27gdb: remove BLOCK_NAMESPACE macroSimon Marchi1-10/+10
Replace with equivalent methods. Change-Id: If86b8cbdfb0f52e22c929614cd53e73358bab76a
2022-04-27gdb: remove BLOCK_MULTIDICT macroSimon Marchi1-6/+6
Replace with equivalent methods. Change-Id: If9a239c511a664f2a59fecb6d1cd579881b23dc2
2022-04-27gdb: remove BLOCK_SUPERBLOCK macroSimon Marchi1-20/+20
Replace with equivalent methods. Change-Id: I334a319909a50b5cc5570a45c38c70e10dc00630
2022-04-27gdb: remove BLOCK_FUNCTION macroSimon Marchi1-12/+12
Replace with equivalent methods. Change-Id: I31ec00f5bf85335c8b23d306ca0fe0b84d489101
2022-04-27gdb: remove BLOCK_{START,END} macrosSimon Marchi1-3/+3
Replace with equivalent methods. Change-Id: I10a6c8a2a86462d9d4a6a6409a3f07a6bea66310
2022-04-20Replace symbol_arch with symbol::archTom Tromey1-1/+1
This turns symbol_arch into a method on symbol.
2022-04-20Replace symbol_objfile with symbol::objfileTom Tromey1-1/+1
This turns symbol_objfile into a method on symbol.
2022-02-06gdb: remove SYMBOL_TYPE macroSimon Marchi1-2/+2
Add a getter and a setter for a symbol's type. Remove the corresponding macro and adjust all callers. Change-Id: Ie1a137744c5bfe1df4d4f9ae5541c5299577c8de
2022-02-06gdb: remove SYMBOL_INLINED macroSimon Marchi1-1/+1
Add a getter and a setter for whether a symbol is inlined. Remove the corresponding macro and adjust all callers. Change-Id: I934468da3b5a32dd6b161a6f252a6b1b94737279
2022-02-06gdb: remove SYMBOL_IS_ARGUMENT macroSimon Marchi1-1/+1
Add a getter and a setter for whether a symbol is an argument. Remove the corresponding macro and adjust all callers. Change-Id: I71b4f0465f3dfd2ed8b9e140bd3f7d5eb8d9ee81
2022-02-06gdb: remove SYMBOL_DOMAIN macroSimon Marchi1-9/+8
Add a getter and a setter for a symbol's domain. Remove the corresponding macro and adjust all callers. Change-Id: I54465b50ac89739c663859a726aef8cdc6e4b8f3
2022-02-06gdb: remove SYMBOL_CLASS macro, add getterSimon Marchi1-5/+4
Change-Id: I83211d5a47efc0564386e5b5ea4a29c00b1fd46a
2022-02-06gdb: remove COMPUNIT_BLOCKVECTOR macro, add getter/setterSimon Marchi1-3/+3
Add a getter and a setter for a compunit_symtab's blockvector. Remove the corresponding macro and adjust all callers. Change-Id: I99484c6619dcbbea7c5d89c72aa660316ca62f64
2022-02-06gdb: remove COMPUNIT_OBJFILE macroSimon Marchi1-1/+1
Remove the macro, update all users to use the getter directly. Change-Id: I3f0fd6f4455d1c4ebd5da73b561eb18a979ef1f6
2022-01-18Move gdb obstack code to gdbsupportTom Tromey1-1/+1
This moves the gdb-specific obstack code -- both extensions like obconcat and obstack_strdup, and things like auto_obstack -- to gdbsupport.
2022-01-01Automatic Copyright Year update after running gdb/copyright.pyJoel Brobecker1-1/+1
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-10-02[gdb/symtab] Remove COMPUNIT_CALL_SITE_HTABSimon Marchi1-5/+5
Remove macro COMPUNIT_CALL_SITE_HTAB, and provide access to the htab using member functions: - compunit_symtab::find_call_site - compunit_symtab::set_call_site_htab Tested on x86_64-linux. Co-Authored-By: Tom de Vries <tdevries@suse.de>