aboutsummaryrefslogtreecommitdiff
path: root/gdb/defs.h
AgeCommit message (Collapse)AuthorFilesLines
2024-04-23gdb: move symbol_file_command declaration to symfile.hSimon Marchi1-4/+0
Move it out of defs.h, the corresponding definition is in symfile.c. Change-Id: I984666c3bcd213f8574e9ec91462e1d61f77f16b Approved-By: Tom Tromey <tom@tromey.com>
2024-04-23gdb: remove enum precision_typeSimon Marchi1-7/+0
It is unused. Change-Id: Ic49a3ef03c21b209594cd567ae80b5441606bef6 Approved-By: Tom Tromey <tom@tromey.com>
2024-04-23gdb: move annotation_level declaration/definition to annotate.{h,c}Simon Marchi1-6/+0
The declaration of annotation_level is currently in defs.h, while the definition is in stack.c. I don't really understand why that variable would live in stack.c, it seems completely unrelated. Move it to annotate.c, and move the declaration to annotate.h. Change-Id: I6cf8e9bd20e83959bdf5ad58dd008b6e1187d7d8 Approved-By: Tom Tromey <tom@tromey.com>
2024-04-23gdb: move a bunch of quit-related things to event-top.{c,h}Simon Marchi1-44/+0
Move some declarations related to the "quit" machinery from defs.h to event-top.h. Most of the definitions associated to these declarations are in event-top.c. The exceptions are `quit()` and `maybe_quit()`, that are defined in utils.c. For consistency, move these two definitions to event-top.c. Include "event-top.h" in many files that use these things. Change-Id: I6594f6df9047a9a480e7b9934275d186afb14378 Approved-By: Tom Tromey <tom@tromey.com>
2024-04-23gdb: move declarations of check_quit_flag and set_quit_flag to extension.hSimon Marchi1-19/+0
Move them out of defs.h, to extension.h, since the implementations are in extension.c. Change-Id: Ie7321468bd7fecc684d70b09f72c3ee8ac75d8f4 Approved-By: Tom Tromey <tom@tromey.com>
2024-04-22gdb: don't include gdbsupport/array-view.h in defs.hSimon Marchi1-1/+0
Nothing in defs.h actually uses this. Everything that I (and the buildbot) can compile still compiles, so I guess that all users of array_view already include it one way or another. Worst case, if this causes some build failure, the fix will be one #include away. Change-Id: I981be98b0653cc18c929d85e9afd8732332efd15 Approved-By: John Baldwin <jhb@FreeBSD.org>
2024-04-22gdb: don't include hashtab.h in defs.hSimon Marchi1-2/+0
Nothing in defs.h actually uses this. Add some includes for some spots using things from hashtab.h. Note that if the GDB build doesn't use libxxhash, hashtab.h is included by gdbsupport/common-utils.h, so all files still see hashtab.h. It puzzled me for some time why I didn't see build failures in my build (which didn't use libxxhash) but the buildbot gave build failures (it uses libxxhash). Change-Id: I8efd68decdaf579f048941c7537cd689885caa2a Approved-By: John Baldwin <jhb@FreeBSD.org>
2024-04-22gdb: move RequireLongest to gdbsupport/traits.hSimon Marchi1-4/+0
Move it out of defs.h. Change-Id: Ie1743d41a57f81667650048563e66073c72230cf Approved-By: John Baldwin <jhb@FreeBSD.org>
2024-04-22gdb: move store/extract integer functions to extract-store-integer.{c,h}Simon Marchi1-89/+0
Move the declarations out of defs.h, and the implementations out of findvar.c. I opted for a new file, because this functionality of converting integers to bytes and vice-versa seems a bit to generic to live in findvar.c. Change-Id: I524858fca33901ee2150c582bac16042148d2251 Approved-By: John Baldwin <jhb@FreeBSD.org>
2024-04-22gdb: remove extract_long_unsigned_integerSimon Marchi1-3/+0
It is unused. Change-Id: I5d4091368c4dfc29752b12061e38f1df8353ba74 Approved-By: John Baldwin <jhb@FreeBSD.org>
2024-04-22gdb: move `enum compile_i_scope_types` to compile/compile.hSimon Marchi1-28/+0
Move it out of defs.h, adjust the includes here and there. Change-Id: I11901fdce55d54f5e51723e123cef154cfb1bbc5 Approved-By: John Baldwin <jhb@FreeBSD.org>
2024-04-22gdb: move two declarations out of defs.hSimon Marchi1-5/+0
Move declarations of initialize_progspace and initialize_inferiors to progspace.h and inferior.h, respectively. Change-Id: I62292ffda429861b9f27d8c836a56d161dfa548d Approved-By: John Baldwin <jhb@FreeBSD.org>
2024-01-31Fix AIX build break.Aditya Vidyadhar Kamath1-2/+0
A recent commit broke AIX build. The thread_local type defined functions were being considered a weak symbol and hence while creating the binary these symbols were not visible. This patch is a fix for the same.
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.
2024-01-08Refactor complaint thread-safety approachTom Tromey1-1/+1
This patch changes the way complaint works in a background thread. The new approach requires installing a complaint interceptor in each worker, and then the resulting complaints are treated as one of the results of the computation. This change is needed for a subsequent patch, where installing a complaint interceptor around a parallel-for is no longer a viable approach.
2023-12-14gdb: make store_integer take an array_viewSimon Marchi1-8/+31
Change store_integer, store_signed_integer and store_unsigned_integer to accept an array_view. Add some backwards compatibility overloads to avoid changing all callers at once. Change-Id: Ibb1381228ab1cb65fc7e2e4b92cf9ab1047cdc03 Reviewed-By: John Baldwin <jhb@FreeBSD.org>
2023-11-29Remove gdb_static_assertTom Tromey1-1/+1
C++17 makes the second parameter to static_assert optional, so we can remove gdb_static_assert now.
2023-11-12Remove declaration of re_compTom Tromey1-6/+0
defs.h declares re_comp, but it shouldn't. If this is needed, it should be picked up from xregex.h via gdb_regex.h. Tested by rebuilding. Reviewed-by: Kevin Buettner <kevinb@redhat.com>
2023-11-06Remove EXTERN_C and related definesTom Tromey1-1/+1
common-defs.h has a few defines that I suspect were used during the transition to C++. These aren't needed any more, so remove them. Tested by rebuilding. Approved-By: Simon Marchi <simon.marchi@efficios.com> Approved-By: Andrew Burgess <aburgess@redhat.com>
2023-09-18Move val_prettyformat to valprint.hTom Tromey1-14/+0
I stumbled across an ancient FIXME comment that was easy to fix -- val_prettyformat does not need to be in defs.h, and is easily moved to valprint.h, where (despite what the comment says) it belongs. Tested by rebuilding.
2023-04-21gdb: remove language_autoSimon Marchi1-1/+0
I think that the language_auto enumerator and the auto_language class can be removed. There isn't really an "auto" language, it's only a construct of the "set language" command to say "pick the appropriate language automatically". But "auto" is never the current language. The `current_language` points to the current effective language, and the fact that we're in "auto language" mode is noted by the language_mode global. - Change set_language to handle the "auto" (and "local", which is a synonym) early, instead of in the for loop. I think it makes the two cases (auto vs explicit language) more clearly separated anyway. - Adjust add_set_language_command to hard-code the "auto" string, instead of using the "auto" language definition. - Remove auto_language, rename auto_or_unknown_language to unknown_language and move the bits of the existing unknown_language in there. - Remove the set_language at the end of _initialize_language. I think it's not needed, because we call set_language in gdb_init, after all _initialize functions are called. There is some chance that an _initialize function that runs after _initialize_language implicitly depends on current_language being set, but my testsuite runs haven't found anything like that. - Use language_unknown instead of language_auto when creating a minimal symbol (minimal_symbol_reader::record_full). I think that this value is used to indicate that we don't know the symbol of the minimal symbol (yet), so language_unknown makes sense to me. Update a condition accordingly in ada-lang.c. symbol_find_demangled_name also appears to "normalize" this value from "unknown" to "auto", remove that part and update the condition to just check for language_unknown. Change-Id: I47bcd6c15f607d9818f2e6e413053c2dc8ec5034 Reviewed-By: Tom Tromey <tom@tromey.com>
2023-03-20Use rust_demangle to fix a crashTom Tromey1-4/+3
PR rust/30211 points out a crash caused by a particular completion. This turns out to happen because a Rust minsym winds up in a C++-specific path in strncmp_iw_with_mode, which ultimately causes the completer to pass invalid arguments to string::append. This patch fixes the bug by reordering the language constants so that Rust comes before C++, and then using rust_demangle. This ensures that minsyms are correctly marked as "Rust", avoiding this code and thus the crash. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=20367 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30211 Reviewed-By: Andrew Burgess <aburgess@redhat.com>
2023-02-27Introduce set_force_quit_flag and change type of sync_quit_force_runKevin Buettner1-1/+4
At the moment, handle_sigterm() in event-top.c does the following: sync_quit_force_run = 1; set_quit_flag (); This was used several more times in a later patch in this series, so I'm introducing (at Pedro's suggestion) a new function named 'set_force_quit_flag'. It simply sets sync_quit_force_run and also calls set_quit_flag(). I've revised the later patch to call set_force_quit_flag instead. I noticed that sync_quit_force_run is declared as an int but is being used as a bool, so I also changed its type to bool in this commit. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=26761 Approved-By: Pedro Alves <pedro@palves.net>
2023-02-27Remove old GNU indent directivesTom Tromey1-2/+0
Now that gdb_indent.sh has been removed, I think it makes sense to also remove the directives intended for GNU indent.
2023-02-10GDB: Switch to using C++ standard integer type limitsMaciej W. Rozycki1-32/+1
Use <climits> instead of <limits.h> and ditch local fallback definitions for minimum and maximum value macros provided by C++11. Add LONGEST_MAX and LONGEST_MIN definitions. Approved-By: Tom Tromey <tom@tromey.com>
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-12-15gdb: remove static buffer in command_line_inputSimon Marchi1-1/+2
[I sent this earlier today, but I don't see it in the archives. Resending it through a different computer / SMTP.] The use of the static buffer in command_line_input is becoming problematic, as explained here [1]. In short, with this patch [2] that attempt to fix a post-hook bug, when running gdb.base/commands.exp, we hit a case where we read a "define" command line from a script file using command_command_line_input. The command line is stored in command_line_input's static buffer. Inside the define command's execution, we read the lines inside the define using command_line_input, which overwrites the define command, in command_line_input's static buffer. After the execution of the define command, execute_command does a command look up to see if a post-hook is registered. For that, it uses a now stale pointer that used to point to the define command, in the static buffer, causing a use-after-free. Note that the pointer in execute_command points to the dynamically-allocated buffer help by the static buffer in command_line_input, not to the static object itself, hence why we see a use-after-free. Fix that by removing the static buffer. I initially changed command_line_input and other related functions to return an std::string, which is the obvious but naive solution. The thing is that some callees don't need to return an allocated string, so this this an unnecessary pessimization. I changed it to passing in a reference to an std::string buffer, which the callee can use if it needs to return dynamically-allocated content. It fills the buffer and returns a pointers to the C string inside. The callees that don't need to return dynamically-allocated content simply don't use it. So, it started with modifying command_line_input as described above, all the other changes derive directly from that. One slightly shady thing is in handle_line_of_input, where we now pass a pointer to an std::string's internal buffer to readline's history_value function, which takes a `char *`. I'm pretty sure that this function does not modify the input string, because I was able to change it (with enough massaging) to take a `const char *`. A subtle change is that we now clear a UI's line buffer using a SCOPE_EXIT in command_line_handler, after executing the command. This was previously done by this line in handle_line_of_input: /* We have a complete command line now. Prepare for the next command, but leave ownership of memory to the buffer . */ cmd_line_buffer->used_size = 0; I think the new way is clearer. [1] https://inbox.sourceware.org/gdb-patches/becb8438-81ef-8ad8-cc42-fcbfaea8cddd@simark.ca/ [2] https://inbox.sourceware.org/gdb-patches/20221213112241.621889-1-jan.vrany@labware.com/ Change-Id: I8fc89b1c69870c7fc7ad9c1705724bd493596300 Reviewed-By: Tom Tromey <tom@tromey.com>
2022-11-23Document the memory_tagged argument for memory region callbacksLuis Machado1-2/+6
There were no comments in some instances (gdb/defs.h, gdb/core.c and gdb/linux-tdep.c), so address that by adding comments where those are missing.
2022-10-10Change GDB to use frame_info_ptrTom Tromey1-1/+1
This changes GDB to use frame_info_ptr instead of frame_info * The substitution was done with multiple sequential `sed` commands: sed 's/^struct frame_info;/class frame_info_ptr;/' sed 's/struct frame_info \*/frame_info_ptr /g' - which left some issues in a few files, that were manually fixed. sed 's/\<frame_info \*/frame_info_ptr /g' sed 's/frame_info_ptr $/frame_info_ptr/g' - used to remove whitespace problems. The changed files were then manually checked and some 'sed' changes undone, some constructors and some gets were added, according to what made sense, and what Tromey originally did Co-Authored-By: Bruno Larsen <blarsen@redhat.com> Approved-by: Tom Tomey <tom@tromey.com>
2022-07-19[AArch64] MTE corefile supportLuis Machado1-1/+2
Teach GDB how to dump memory tags for AArch64 when using the gcore command and how to read memory tag data back from a core file generated by GDB (via gcore) or by the Linux kernel. The format is documented in the Linux Kernel documentation [1]. Each tagged memory range (listed in /proc/<pid>/smaps) gets dumped to its own PT_AARCH64_MEMTAG_MTE segment. A section named ".memtag" is created for each of those segments when reading the core file back. To save a little bit of space, given MTE tags only take 4 bits, the memory tags are stored packed as 2 tags per byte. When reading the data back, the tags are unpacked. I've added a new testcase to exercise the feature. Build-tested with --enable-targets=all and regression tested on aarch64-linux Ubuntu 20.04. [1] Documentation/arm64/memory-tagging-extension.rst (Core Dump Support)
2022-07-18Replace input_interactive_p with a methodTom Tromey1-2/+0
This replaces the global input_interactive_p function with a new method ui::input_interactive_p.
2022-07-12Fix -fsanitize=thread for per_cu fieldsTom de Vries1-0/+3
When building gdb with -fsanitize=thread and gcc 12, and running test-case gdb.dwarf2/dwz.exp, we run into a data race between: ... Read of size 1 at 0x7b200000300d by thread T2:^M #0 cutu_reader::cutu_reader(dwarf2_per_cu_data*, dwarf2_per_objfile*, \ abbrev_table*, dwarf2_cu*, bool, abbrev_cache*) gdb/dwarf2/read.c:6164 \ (gdb+0x82ec95)^M ... and: ... Previous write of size 1 at 0x7b200000300d by main thread:^M #0 prepare_one_comp_unit gdb/dwarf2/read.c:23588 (gdb+0x86f973)^M ... In other words, between: ... if (this_cu->reading_dwo_directly) ... and: ... cu->per_cu->lang = pretend_language; ... Likewise, we run into a data race between: ... Write of size 1 at 0x7b200000300e by thread T4: #0 process_psymtab_comp_unit gdb/dwarf2/read.c:6789 (gdb+0x830720) ... and: ... Previous read of size 1 at 0x7b200000300e by main thread: #0 cutu_reader::cutu_reader(dwarf2_per_cu_data*, dwarf2_per_objfile*, \ abbrev_table*, dwarf2_cu*, bool, abbrev_cache*) gdb/dwarf2/read.c:6164 \ (gdb+0x82edab) ... In other words, between: ... this_cu->unit_type = DW_UT_partial; ... and: ... if (this_cu->reading_dwo_directly) ... Likewise for the write to addresses_seen in cooked_indexer::check_bounds and a read from is_dwz in dwarf2_find_containing_comp_unit for test-case gdb.dwarf2/dw2-dir-file-name.exp and target board cc-with-dwz-m. The problem is that the written fields are part of the same memory location as the read fields, so executing a read and write in different threads is undefined behavour. Making the written fields separate memory locations, using the new struct packed template fixes this. The set of fields has been established experimentally to be the minimal set to get rid of this type of -fsanitize=thread errors, but more fields might require the same treatment. Looking at the properties of the lang field, unlike dwarf_version it's not available in the unit header, so it will be set the first time during the parallel cooked index reading. The same holds for unit_type, and likewise for addresses_seen. dwarf2_per_cu_data::addresses_seen is moved so that the bitfields that currently follow it can be merged in the same memory location as the bitfields that currently precede it, for better packing. Tested on x86_64-linux. Co-Authored-By: Pedro Alves <pedro@palves.net> Change-Id: Ifa94f0a2cebfae5e8f6ddc73265f05e7fd9e1532
2022-03-31Remove dbx modeTom Tromey1-3/+0
This patch removes gdb's dbx mode. Regression tested on x86-64 Fedora 34.
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-12-03gdb: make extract_integer take an array_viewSimon Marchi1-3/+20
I think it would make sense for extract_integer, extract_signed_integer and extract_unsigned_integer to take an array_view. This way, when we extract an integer, we can validate that we don't overflow the buffer passed by the caller (e.g. ask to extract a 4-byte integer but pass a 2-byte buffer). - Change extract_integer to take an array_view - Add overloads of extract_signed_integer and extract_unsigned_integer that take array_views. Keep the existing versions so we don't need to change all callers, but make them call the array_view versions. This shortens some places like: result = extract_unsigned_integer (value_contents (result_val).data (), TYPE_LENGTH (value_type (result_val)), byte_order); into result = extract_unsigned_integer (value_contents (result_val), byte_order); value_contents returns an array view that is of length `TYPE_LENGTH (value_type (result_val))` already, so the length is implicitly communicated through the array view. Change-Id: Ic1c1f98c88d5c17a8486393af316f982604d6c95
2021-10-03gdb: make string-like set show commands use std::string variableSimon Marchi1-2/+2
String-like settings (var_string, var_filename, var_optional_filename, var_string_noescape) currently take a pointer to a `char *` storage variable (typically global) that holds the setting's value. I'd like to "mordernize" this by changing them to use an std::string for storage. An obvious reason is that string operations on std::string are often easier to write than with C strings. And they avoid having to do any manual memory management. Another interesting reason is that, with `char *`, nullptr and an empty string often both have the same meaning of "no value". String settings are initially nullptr (unless initialized otherwise). But when doing "set foo" (where `foo` is a string setting), the setting now points to an empty string. For example, solib_search_path is nullptr at startup, but points to an empty string after doing "set solib-search-path". This leads to some code that needs to check for both to check for "no value". Or some code that converts back and forth between NULL and "" when getting or setting the value. I find this very error-prone, because it is very easy to forget one or the other. With std::string, we at least know that the variable is not "NULL". There is only one way of representing an empty string setting, that is with an empty string. I was wondering whether the distinction between NULL and "" would be important for some setting, but it doesn't seem so. If that ever happens, it would be more C++-y and self-descriptive to use optional<string> anyway. Actually, there's one spot where this distinction mattered, it's in init_history, for the test gdb.base/gdbinit-history.exp. init_history sets the history filename to the default ".gdb_history" if it sees that the setting was never set - if history_filename is nullptr. If history_filename is an empty string, it means the setting was explicitly cleared, so it leaves it as-is. With the change to std::string, this distinction doesn't exist anymore. This can be fixed by moving the code that chooses a good default value for history_filename to _initialize_top. This is ran before -ex commands are processed, so an -ex command can then clear that value if needed (what gdb.base/gdbinit-history.exp tests). Another small improvement, in my opinion is that we can now easily give string parameters initial values, by simply initializing the global variables, instead of xstrdup-ing it in the _initialize function. In Python and Guile, when registering a string-like parameter, we allocate (with new) an std::string that is owned by the param_smob (in Guile) and the parmpy_object (in Python) objects. This patch started by changing all relevant add_setshow_* commands to take an `std::string *` instead of a `char **` and fixing everything that failed to build. That includes of course all string setting variable and their uses. string_option_def now uses an std::string also, because there's a connection between options and settings (see add_setshow_cmds_for_options). The add_path function in source.c is really complex and twisted, I'd rather not try to change it to work on an std::string right now. Instead, I added an overload that copies the std:string to a `char *` and back. This means more copying, but this is not used in a hot path at all, so I think it is acceptable. Change-Id: I92c50a1bdd8307141cdbacb388248e4e4fc08c93 Co-authored-by: Lancelot SIX <lsix@lancelotsix.com>
2021-01-01Update copyright year range in all GDB filesJoel Brobecker1-1/+1
This commits the result of running gdb/copyright.py as per our Start of New Year procedure... gdb/ChangeLog Update copyright year range in copyright header of all GDB files.
2020-03-16gdb: move enum gdb_osabi to osabi.hSimon Marchi1-31/+0
I think it makes sense to have it there instead of in the catch-all defs.h. gdb/ChangeLog: * defs.h (enum gdb_osabi): Move to... * osabi.h (enum gdb_osabi): ... here. * gdbarch.sh: Include osabi.h in gdbarch.h. * gdbarch.h: Re-generate.
2020-01-14Move gdbsupport to the top levelTom Tromey1-0/+9
This patch moves the gdbsupport directory to the top level. This is the next step in the ongoing project to move gdbserver to the top level. The bulk of this patch was created by "git mv gdb/gdbsupport gdbsupport". This patch then adds a build system to gdbsupport and wires it into the top level. Then it changes gdb to use the top-level build. gdbserver, on the other hand, is not yet changed. It still does its own build of gdbsupport. ChangeLog 2020-01-14 Tom Tromey <tom@tromey.com> * src-release.sh (GDB_SUPPORT_DIRS): Add gdbsupport. * MAINTAINERS: Add gdbsupport. * configure: Rebuild. * configure.ac (configdirs): Add gdbsupport. * gdbsupport: New directory, move from gdb/gdbsupport. * Makefile.def (host_modules, dependencies): Add gnulib. * Makefile.in: Rebuild. gdb/ChangeLog 2020-01-14 Tom Tromey <tom@tromey.com> * nat/x86-linux-dregs.c: Include configh.h. * nat/linux-ptrace.c: Include configh.h. * nat/linux-btrace.c: Include configh.h. * defs.h: Include config.h, bfd.h. * configure.ac: Don't source common.host. (CONFIG_OBS, CONFIG_SRCS): Remove gdbsupport files. * configure: Rebuild. * acinclude.m4: Update path. * Makefile.in (SUPPORT, LIBSUPPORT, INCSUPPORT): New variables. (CONFIG_SRC_SUBDIR): Remove gdbsupport. (INTERNAL_CFLAGS_BASE): Add INCSUPPORT. (CLIBS): Add LIBSUPPORT. (CDEPS): Likewise. (COMMON_SFILES): Remove gdbsupport files. (HFILES_NO_SRCDIR): Likewise. (stamp-version): Update path to create-version.sh. (ALLDEPFILES): Remove gdbsupport files. gdb/gdbserver/ChangeLog 2020-01-14 Tom Tromey <tom@tromey.com> * server.h: Include config.h. * gdbreplay.c: Include config.h. * configure: Rebuild. * configure.ac: Don't source common.host. * acinclude.m4: Update path. * Makefile.in (INCSUPPORT): New variable. (INCLUDE_CFLAGS): Add INCSUPPORT. (SFILES): Update paths. (version-generated.c): Update path to create-version.sh. (gdbsupport/%-ipa.o, gdbsupport/%.o): Update paths. gdbsupport/ChangeLog 2020-01-14 Tom Tromey <tom@tromey.com> * common-defs.h: Add GDBSERVER case. Update includes. * acinclude.m4, aclocal.m4, config.in, configure, configure.ac, Makefile.am, Makefile.in, README: New files. * Moved from ../gdb/gdbsupport/ Change-Id: I07632e7798635c1bab389bf885971e584fb4bb78
2020-01-01Update copyright year range in all GDB files.Joel Brobecker1-1/+1
gdb/ChangeLog: Update copyright year range in all GDB files.
2019-11-08Constify command_line_inputTom Tromey1-1/+1
This changes command_line_input to return a "const char *", which is appropriate because the memory is owned by command_line_input. Then it fixes up the users. I looked at making command_line_input transfer ownership to its caller instead, but this is complicated due to the way read_next_line is called, so I decided against it. Tested by rebuilding. gdb/ChangeLog 2019-11-08 Tom Tromey <tromey@adacore.com> * top.c (read_command_file): Update. (command_line_input): Make return type const. * python/py-gdb-readline.c: Update. * linespec.c (decode_line_2): Update. * defs.h (command_line_input): Make return type const. * cli/cli-script.c (read_next_line): Make return type const. * ada-lang.c (get_selections): Update. Change-Id: I27e6c9477fd1005ab5b16e0d337e4c015b6e6248
2019-09-18Change boolean options to bool instead of intChristian Biesinger1-1/+1
This is for add_setshow_boolean_cmd as well as the gdb::option interface. gdb/ChangeLog: 2019-09-17 Christian Biesinger <cbiesinger@google.com> * ada-lang.c (ada_ignore_descriptive_types_p): Change to bool. (print_signatures): Likewise. (trust_pad_over_xvs): Likewise. * arch/aarch64-insn.c (aarch64_debug): Likewise. * arch/aarch64-insn.h (aarch64_debug): Likewise. * arm-linux-nat.c (arm_apcs_32): Likewise. * arm-linux-tdep.c (arm_apcs_32): Likewise. * arm-nbsd-nat.c (arm_apcs_32): Likewise. * arm-tdep.c (arm_debug): Likewise. (arm_apcs_32): Likewise. * auto-load.c (debug_auto_load): Likewise. (auto_load_gdb_scripts): Likewise. (global_auto_load): Likewise. (auto_load_local_gdbinit): Likewise. (auto_load_local_gdbinit_loaded): Likewise. * auto-load.h (global_auto_load): Likewise. (auto_load_local_gdbinit): Likewise. (auto_load_local_gdbinit_loaded): Likewise. * breakpoint.c (disconnected_dprintf): Likewise. (breakpoint_proceeded): Likewise. (automatic_hardware_breakpoints): Likewise. (always_inserted_mode): Likewise. (target_exact_watchpoints): Likewise. (_initialize_breakpoint): Update. * breakpoint.h (target_exact_watchpoints): Change to bool. * btrace.c (maint_btrace_pt_skip_pad): Likewise. * cli/cli-cmds.c (trace_commands): Likewise. * cli/cli-cmds.h (trace_commands): Likewise. * cli/cli-decode.c (add_setshow_boolean_cmd): Change int* argument to bool*. * cli/cli-logging.c (logging_overwrite): Change to bool. (logging_redirect): Likewise. (debug_redirect): Likewise. * cli/cli-option.h (option_def) <boolean>: Change return type to bool*. (struct boolean_option_def) <get_var_address_cb_>: Change return type to bool. <boolean_option_def>: Update. (struct flag_option_def): Change default type of Context to bool from int. <flag_option_def>: Change return type of var_address_cb_ to bool*. * cli/cli-setshow.c (do_set_command): Cast to bool* instead of int*. (get_setshow_command_value_string): Likewise. * cli/cli-style.c (cli_styling): Change to bool. (source_styling): Likewise. * cli/cli-style.h (source_styling): Likewise. (cli_styling): Likewise. * cli/cli-utils.h (struct qcs_flags) <quiet, cont, silent>: Change to bool. * command.h (var_types): Update comment. (add_setshow_boolean_cmd): Change int* var argument to bool*. * compile/compile-cplus-types.c (debug_compile_cplus_types): Change to bool. (debug_compile_cplus_scopes): Likewise. * compile/compile-internal.h (compile_debug): Likewise. * compile/compile.c (compile_debug): Likewise. (struct compile_options) <raw>: Likewise. * cp-support.c (catch_demangler_crashes): Likewise. * cris-tdep.c (usr_cmd_cris_version_valid): Likewise. (usr_cmd_cris_dwarf2_cfi): Likewise. * csky-tdep.c (csky_debug): Likewise. * darwin-nat.c (enable_mach_exceptions): Likewise. * dcache.c (dcache_enabled_p): Likewise. * defs.h (info_verbose): Likewise. * demangle.c (demangle): Likewise. (asm_demangle): Likewise. * dwarf-index-cache.c (debug_index_cache): Likewise. * dwarf2-frame.c (dwarf2_frame_unwinders_enabled_p): Likewise. * dwarf2-frame.h (dwarf2_frame_unwinders_enabled_p): Likewise. * dwarf2read.c (check_physname): Likewise. (use_deprecated_index_sections): Likewise. (dwarf_always_disassemble): Likewise. * eval.c (overload_resolution): Likewise. * event-top.c (set_editing_cmd_var): Likewise. (exec_done_display_p): Likewise. * event-top.h (set_editing_cmd_var): Likewise. (exec_done_display_p): Likewise. * exec.c (write_files): Likewise. * fbsd-nat.c (debug_fbsd_lwp): Likewise (debug_fbsd_nat): Likewise. * frame.h (struct frame_print_options) <print_raw_frame_arguments>: Likewise. (struct set_backtrace_options) <backtrace_past_main>: Likewise. <backtrace_past_entry> Likewise. * gdb-demangle.h (demangle): Likewise. (asm_demangle): Likewise. * gdb_bfd.c (bfd_sharing): Likewise. * gdbcore.h (write_files): Likewise. * gdbsupport/common-debug.c (show_debug_regs): Likewise. * gdbsupport/common-debug.h (show_debug_regs): Likewise. * gdbthread.h (print_thread_events): Likewise. * gdbtypes.c (opaque_type_resolution): Likewise. (strict_type_checking): Likewise. * gnu-nat.c (gnu_debug_flag): Likewise. * guile/scm-auto-load.c (auto_load_guile_scripts): Likewise. * guile/scm-param.c (pascm_variable): Add boolval. (add_setshow_generic): Update. (pascm_param_value): Update. (pascm_set_param_value_x): Update. * hppa-tdep.c (hppa_debug): Change to bool.. * infcall.c (may_call_functions_p): Likewise. (coerce_float_to_double_p): Likewise. (unwind_on_signal_p): Likewise. (unwind_on_terminating_exception_p): Likewise. * infcmd.c (startup_with_shell): Likewise. * inferior.c (print_inferior_events): Likewise. * inferior.h (startup_with_shell): Likewise. (print_inferior_events): Likewise. * infrun.c (step_stop_if_no_debug): Likewise. (detach_fork): Likewise. (debug_displaced): Likewise. (disable_randomization): Likewise. (non_stop): Likewise. (non_stop_1): Likewise. (observer_mode): Likewise. (observer_mode_1): Likewise. (set_observer_mode): Update. (sched_multi): Change to bool. * infrun.h (debug_displaced): Likewise. (sched_multi): Likewise. (step_stop_if_no_debug): Likewise. (non_stop): Likewise. (disable_randomization): Likewise. * linux-tdep.c (use_coredump_filter): Likewise. (dump_excluded_mappings): Likewise. * linux-thread-db.c (auto_load_thread_db): Likewise. (check_thread_db_on_load): Likewise. * main.c (captured_main_1): Update. * maint-test-options.c (struct test_options_opts) <flag_opt, xx1_opt, xx2_opt, boolean_opt>: Change to bool. * maint-test-settings.c (maintenance_test_settings_boolean): Likewise. * maint.c (maintenance_profile_p): Likewise. (per_command_time): Likewise. (per_command_space): Likewise. (per_command_symtab): Likewise. * memattr.c (inaccessible_by_default): Likewise. * mi/mi-main.c (mi_async): Likewise. (mi_async_1): Likewise. * mips-tdep.c (mips64_transfers_32bit_regs_p): Likewise. * nat/fork-inferior.h (startup_with_shell): Likewise. * nat/linux-namespaces.c (debug_linux_namespaces): Likewise. * nat/linux-namespaces.h (debug_linux_namespaces): Likewise. * nios2-tdep.c (nios2_debug): Likewise. * or1k-tdep.c (or1k_debug): Likewise. * parse.c (parser_debug): Likewise. * parser-defs.h (parser_debug): Likewise. * printcmd.c (print_symbol_filename): Likewise. * proc-api.c (procfs_trace): Likewise. * python/py-auto-load.c (auto_load_python_scripts): Likewise. * python/py-param.c (union parmpy_variable): Add "bool boolval" field. (set_parameter_value): Update. (add_setshow_generic): Update. * python/py-value.c (copy_py_bool_obj): Change argument from int* to bool*. * python/python.c (gdbpy_parameter_value): Cast to bool* instead of int*. * ravenscar-thread.c (ravenscar_task_support): Change to bool. * record-btrace.c (record_btrace_target::store_registers): Update. * record-full.c (record_full_memory_query): Change to bool. (record_full_stop_at_limit): Likewise. * record-full.h (record_full_memory_query): Likewise. * remote-notif.c (notif_debug): Likewise. * remote-notif.h (notif_debug): Likewise. * remote.c (use_range_stepping): Likewise. (interrupt_on_connect): Likewise. (remote_break): Likewise. * ser-tcp.c (tcp_auto_retry): Likewise. * ser-unix.c (serial_hwflow): Likewise. * skip.c (debug_skip): Likewise. * solib-aix.c (solib_aix_debug): Likewise. * spu-tdep.c (spu_stop_on_load_p): Likewise. (spu_auto_flush_cache_p): Likewise. * stack.c (struct backtrace_cmd_options) <full, no_filters, hide>: Likewise. (struct info_print_options) <quiet>: Likewise. * symfile-debug.c (debug_symfile): Likewise. * symfile.c (auto_solib_add): Likewise. (separate_debug_file_debug): Likewise. * symfile.h (auto_solib_add): Likewise. (separate_debug_file_debug): Likewise. * symtab.c (basenames_may_differ): Likewise. (struct filename_partial_match_opts) <dirname, basename>: Likewise. (struct info_print_options) <quiet, exclude_minsyms>: Likewise. (struct info_types_options) <quiet>: Likewise. * symtab.h (demangle): Likewise. (basenames_may_differ): Likewise. * target-dcache.c (stack_cache_enabled_1): Likewise. (code_cache_enabled_1): Likewise. * target.c (trust_readonly): Likewise. (may_write_registers): Likewise. (may_write_memory): Likewise. (may_insert_breakpoints): Likewise. (may_insert_tracepoints): Likewise. (may_insert_fast_tracepoints): Likewise. (may_stop): Likewise. (auto_connect_native_target): Likewise. (target_stop_and_wait): Update. (target_async_permitted): Change to bool. (target_async_permitted_1): Likewise. (may_write_registers_1): Likewise. (may_write_memory_1): Likewise. (may_insert_breakpoints_1): Likewise. (may_insert_tracepoints_1): Likewise. (may_insert_fast_tracepoints_1): Likewise. (may_stop_1): Likewise. * target.h (target_async_permitted): Likewise. (may_write_registers): Likewise. (may_write_memory): Likewise. (may_insert_breakpoints): Likewise. (may_insert_tracepoints): Likewise. (may_insert_fast_tracepoints): Likewise. (may_stop): Likewise. * thread.c (struct info_threads_opts) <show_global_ids>: Likewise. (make_thread_apply_all_options_def_group): Change argument from int* to bool*. (thread_apply_all_command): Update. (print_thread_events): Change to bool. * top.c (confirm): Likewise. (command_editing_p): Likewise. (history_expansion_p): Likewise. (write_history_p): Likewise. (info_verbose): Likewise. * top.h (confirm): Likewise. (history_expansion_p): Likewise. * tracepoint.c (disconnected_tracing): Likewise. (circular_trace_buffer): Likewise. * typeprint.c (print_methods): Likewise. (print_typedefs): Likewise. * utils.c (debug_timestamp): Likewise. (sevenbit_strings): Likewise. (pagination_enabled): Likewise. * utils.h (sevenbit_strings): Likewise. (pagination_enabled): Likewise. * valops.c (overload_resolution): Likewise. * valprint.h (struct value_print_options) <prettyformat_arrays, prettyformat_structs, vtblprint, unionprint, addressprint, objectprint, stop_print_at_null, print_array_indexes, deref_ref, static_field_print, pascal_static_field_print, raw, summary, symbol_print, finish_print>: Likewise. * windows-nat.c (new_console): Likewise. (cygwin_exceptions): Likewise. (new_group): Likewise. (debug_exec): Likewise. (debug_events): Likewise. (debug_memory): Likewise. (debug_exceptions): Likewise. (useshell): Likewise. * windows-tdep.c (maint_display_all_tib): Likewise. * xml-support.c (debug_xml): Likewise.
2019-09-11Make relocate_{path,gdb_directory} return std::stringChristian Biesinger1-4/+4
This simplifies memory management. I've also changed some global variables to std::string accordingly (which store the result of these functions), but not all because some are used with add_setshow_optional_filename_cmd which requires a char*. gdb/ChangeLog: 2019-09-11 Christian Biesinger <cbiesinger@google.com> * auto-load.c (auto_load_expand_dir_vars): Update. * defs.h (gdb_datadir): Change to std::string. (python_libdir): Likewise. (relocate_gdb_directory): Change return type to std::string. * guile/guile.c (gdbscm_data_directory): Update. (initialize_scheme_side): Update. * jit.c (jit_reader_dir): Change to std::string. (jit_reader_load_command): Update. * main.c (gdb_datadir): Change to std::string. (python_libdir): Likewise. (set_gdb_data_directory): Update. (relocate_path): Change to return std::string. (relocate_gdb_directory): Change to return std::string. (relocate_gdbinit_path_maybe_in_datadir): Update. (captured_main_1): Update. * python/python.c (do_start_initialization): Update. * top.c (show_gdb_datadir): Update. * xml-syscall.c (xml_init_syscalls_info): Update. (init_syscalls_info): Update.
2019-09-06Change int to bool for the relocate_* functionsChristian Biesinger1-1/+1
These parameters are only used as bools. This also renames "flag" to "relocatable" to make it clearer what it does. gdb/ChangeLog: 2019-09-06 Christian Biesinger <cbiesinger@google.com> * defs.h (relocate_gdb_directory): Change int to bool in signature and rename flag to relocatable. * main.c (relocate_path): Likewise. (relocate_gdb_directory): Likewise.
2019-07-10Don't include gdbarch.h from defs.hTom Tromey1-3/+0
I touched symtab.h and was surprised to see how many files were rebuilt. I looked into it a bit, and found that defs.h includes gdbarch.h, which in turn includes many things. gdbarch.h is only needed by a minority ofthe files in gdb, so this patch removes the include from defs.h and updates the fallout. I did "wc -l" on the files in build/gdb/.deps; this patch reduces the line count from 139935 to 137030; so there are definitely future build-time savings here. Note that while I configured with --enable-targets=all, it's possible that some *-nat.c file needs an update. I could not test all of these. The buildbot caught a few problems along these lines. gdb/ChangeLog 2019-07-10 Tom Tromey <tom@tromey.com> * defs.h: Don't include gdbarch.h. * aarch64-ravenscar-thread.c, aarch64-tdep.c, alpha-bsd-tdep.h, alpha-linux-tdep.c, alpha-mdebug-tdep.c, arch-utils.h, arm-tdep.h, ax-general.c, btrace.c, buildsym-legacy.c, buildsym.h, c-lang.c, cli/cli-decode.h, cli/cli-dump.c, cli/cli-script.h, cli/cli-style.h, coff-pe-read.h, compile/compile-c-support.c, compile/compile-cplus.h, compile/compile-loc2c.c, corefile.c, cp-valprint.c, cris-linux-tdep.c, ctf.c, d-lang.c, d-namespace.c, dcache.c, dicos-tdep.c, dictionary.c, disasm-selftests.c, dummy-frame.c, dummy-frame.h, dwarf2-frame-tailcall.c, dwarf2expr.c, expression.h, f-lang.c, frame-base.c, frame-unwind.c, frv-linux-tdep.c, gdbarch-selftests.c, gdbtypes.h, go-lang.c, hppa-nbsd-tdep.c, hppa-obsd-tdep.c, i386-dicos-tdep.c, i386-tdep.h, ia64-vms-tdep.c, interps.h, language.c, linux-record.c, location.h, m2-lang.c, m32r-linux-tdep.c, mem-break.c, memattr.c, mn10300-linux-tdep.c, nios2-linux-tdep.c, objfiles.h, opencl-lang.c, or1k-linux-tdep.c, p-lang.c, parser-defs.h, ppc-tdep.h, probe.h, python/py-record-btrace.c, record-btrace.c, record.h, regcache-dump.c, regcache.h, riscv-fbsd-tdep.c, riscv-linux-tdep.c, rust-exp.y, sh-linux-tdep.c, sh-nbsd-tdep.c, source-cache.c, sparc-nbsd-tdep.c, sparc-obsd-tdep.c, sparc-ravenscar-thread.c, sparc64-fbsd-tdep.c, std-regs.c, target-descriptions.h, target-float.c, tic6x-linux-tdep.c, tilegx-linux-tdep.c, top.c, tracefile.c, trad-frame.c, type-stack.h, ui-style.c, utils.c, utils.h, valarith.c, valprint.c, varobj.c, x86-tdep.c, xml-support.h, xtensa-linux-tdep.c, cli/cli-cmds.h: Update. * s390-linux-nat.c, procfs.c, inf-ptrace.c: Likewise.
2019-07-09Rename common to gdbsupportTom Tromey1-3/+3
This is the next patch in the ongoing series to move gdbsever to the top level. This patch just renames the "common" directory. The idea is to do this move in two parts: first rename the directory (this patch), then move the directory to the top. This approach makes the patches a bit more tractable. I chose the name "gdbsupport" for the directory. However, as this patch was largely written by sed, we could pick a new name without too much difficulty. Tested by the buildbot. gdb/ChangeLog 2019-07-09 Tom Tromey <tom@tromey.com> * contrib/ari/gdb_ari.sh: Change common to gdbsupport. * configure: Rebuild. * configure.ac: Change common to gdbsupport. * gdbsupport: Rename from common. * acinclude.m4: Change common to gdbsupport. * Makefile.in (CONFIG_SRC_SUBDIR, COMMON_SFILES) (HFILES_NO_SRCDIR, stamp-version, ALLDEPFILES): Change common to gdbsupport. * aarch64-tdep.c, ada-lang.c, ada-lang.h, agent.c, alloc.c, amd64-darwin-tdep.c, amd64-dicos-tdep.c, amd64-fbsd-nat.c, amd64-fbsd-tdep.c, amd64-linux-nat.c, amd64-linux-tdep.c, amd64-nbsd-tdep.c, amd64-obsd-tdep.c, amd64-sol2-tdep.c, amd64-tdep.c, amd64-windows-tdep.c, arch-utils.c, arch/aarch64-insn.c, arch/aarch64.c, arch/aarch64.h, arch/amd64.c, arch/amd64.h, arch/arm-get-next-pcs.c, arch/arm-linux.c, arch/arm.c, arch/i386.c, arch/i386.h, arch/ppc-linux-common.c, arch/riscv.c, arch/riscv.h, arch/tic6x.c, arm-tdep.c, auto-load.c, auxv.c, ax-gdb.c, ax-general.c, ax.h, breakpoint.c, breakpoint.h, btrace.c, btrace.h, build-id.c, build-id.h, c-lang.h, charset.c, charset.h, cli/cli-cmds.c, cli/cli-cmds.h, cli/cli-decode.c, cli/cli-dump.c, cli/cli-option.h, cli/cli-script.c, coff-pe-read.c, command.h, compile/compile-c-support.c, compile/compile-c.h, compile/compile-cplus-symbols.c, compile/compile-cplus-types.c, compile/compile-cplus.h, compile/compile-loc2c.c, compile/compile.c, completer.c, completer.h, contrib/ari/gdb_ari.sh, corefile.c, corelow.c, cp-support.c, cp-support.h, cp-valprint.c, csky-tdep.c, ctf.c, darwin-nat.c, debug.c, defs.h, disasm-selftests.c, disasm.c, disasm.h, dtrace-probe.c, dwarf-index-cache.c, dwarf-index-cache.h, dwarf-index-write.c, dwarf2-frame.c, dwarf2expr.c, dwarf2loc.c, dwarf2read.c, event-loop.c, event-top.c, exceptions.c, exec.c, extension.h, fbsd-nat.c, features/aarch64-core.c, features/aarch64-fpu.c, features/aarch64-pauth.c, features/aarch64-sve.c, features/i386/32bit-avx.c, features/i386/32bit-avx512.c, features/i386/32bit-core.c, features/i386/32bit-linux.c, features/i386/32bit-mpx.c, features/i386/32bit-pkeys.c, features/i386/32bit-segments.c, features/i386/32bit-sse.c, features/i386/64bit-avx.c, features/i386/64bit-avx512.c, features/i386/64bit-core.c, features/i386/64bit-linux.c, features/i386/64bit-mpx.c, features/i386/64bit-pkeys.c, features/i386/64bit-segments.c, features/i386/64bit-sse.c, features/i386/x32-core.c, features/riscv/32bit-cpu.c, features/riscv/32bit-csr.c, features/riscv/32bit-fpu.c, features/riscv/64bit-cpu.c, features/riscv/64bit-csr.c, features/riscv/64bit-fpu.c, features/tic6x-c6xp.c, features/tic6x-core.c, features/tic6x-gp.c, filename-seen-cache.h, findcmd.c, findvar.c, fork-child.c, gcore.c, gdb_bfd.c, gdb_bfd.h, gdb_proc_service.h, gdb_regex.c, gdb_select.h, gdb_usleep.c, gdbarch-selftests.c, gdbthread.h, gdbtypes.h, gnu-nat.c, go32-nat.c, guile/guile.c, guile/scm-ports.c, guile/scm-safe-call.c, guile/scm-type.c, i386-fbsd-nat.c, i386-fbsd-tdep.c, i386-go32-tdep.c, i386-linux-nat.c, i386-linux-tdep.c, i386-tdep.c, i387-tdep.c, ia64-libunwind-tdep.c, ia64-linux-nat.c, inf-child.c, inf-ptrace.c, infcall.c, infcall.h, infcmd.c, inferior-iter.h, inferior.c, inferior.h, inflow.c, inflow.h, infrun.c, infrun.h, inline-frame.c, language.h, linespec.c, linux-fork.c, linux-nat.c, linux-tdep.c, linux-thread-db.c, location.c, machoread.c, macrotab.h, main.c, maint.c, maint.h, memattr.c, memrange.h, mi/mi-cmd-break.h, mi/mi-cmd-env.c, mi/mi-cmd-stack.c, mi/mi-cmd-var.c, mi/mi-interp.c, mi/mi-main.c, mi/mi-parse.h, minsyms.c, mips-linux-tdep.c, namespace.h, nat/aarch64-linux-hw-point.c, nat/aarch64-linux-hw-point.h, nat/aarch64-linux.c, nat/aarch64-sve-linux-ptrace.c, nat/amd64-linux-siginfo.c, nat/fork-inferior.c, nat/linux-btrace.c, nat/linux-btrace.h, nat/linux-namespaces.c, nat/linux-nat.h, nat/linux-osdata.c, nat/linux-personality.c, nat/linux-procfs.c, nat/linux-ptrace.c, nat/linux-ptrace.h, nat/linux-waitpid.c, nat/mips-linux-watch.c, nat/mips-linux-watch.h, nat/ppc-linux.c, nat/x86-dregs.c, nat/x86-dregs.h, nat/x86-linux-dregs.c, nat/x86-linux.c, nto-procfs.c, nto-tdep.c, objfile-flags.h, objfiles.c, objfiles.h, obsd-nat.c, observable.h, osdata.c, p-valprint.c, parse.c, parser-defs.h, ppc-linux-nat.c, printcmd.c, probe.c, proc-api.c, procfs.c, producer.c, progspace.h, psymtab.h, python/py-framefilter.c, python/py-inferior.c, python/py-ref.h, python/py-type.c, python/python.c, record-btrace.c, record-full.c, record.c, record.h, regcache-dump.c, regcache.c, regcache.h, remote-fileio.c, remote-fileio.h, remote-sim.c, remote.c, riscv-tdep.c, rs6000-aix-tdep.c, rust-exp.y, s12z-tdep.c, selftest-arch.c, ser-base.c, ser-event.c, ser-pipe.c, ser-tcp.c, ser-unix.c, skip.c, solib-aix.c, solib-target.c, solib.c, source-cache.c, source.c, source.h, sparc-nat.c, spu-linux-nat.c, stack.c, stap-probe.c, symfile-add-flags.h, symfile.c, symfile.h, symtab.c, symtab.h, target-descriptions.c, target-descriptions.h, target-memory.c, target.c, target.h, target/waitstatus.c, target/waitstatus.h, thread-iter.h, thread.c, tilegx-tdep.c, top.c, top.h, tracefile-tfile.c, tracefile.c, tracepoint.c, tracepoint.h, tui/tui-io.c, ui-file.c, ui-out.h, unittests/array-view-selftests.c, unittests/child-path-selftests.c, unittests/cli-utils-selftests.c, unittests/common-utils-selftests.c, unittests/copy_bitwise-selftests.c, unittests/environ-selftests.c, unittests/format_pieces-selftests.c, unittests/function-view-selftests.c, unittests/lookup_name_info-selftests.c, unittests/memory-map-selftests.c, unittests/memrange-selftests.c, unittests/mkdir-recursive-selftests.c, unittests/observable-selftests.c, unittests/offset-type-selftests.c, unittests/optional-selftests.c, unittests/parse-connection-spec-selftests.c, unittests/ptid-selftests.c, unittests/rsp-low-selftests.c, unittests/scoped_fd-selftests.c, unittests/scoped_mmap-selftests.c, unittests/scoped_restore-selftests.c, unittests/string_view-selftests.c, unittests/style-selftests.c, unittests/tracepoint-selftests.c, unittests/unpack-selftests.c, unittests/utils-selftests.c, unittests/xml-utils-selftests.c, utils.c, utils.h, valarith.c, valops.c, valprint.c, value.c, value.h, varobj.c, varobj.h, windows-nat.c, x86-linux-nat.c, xml-support.c, xml-support.h, xml-tdesc.h, xstormy16-tdep.c, xtensa-linux-nat.c, dwarf2read.h: Change common to gdbsupport. gdb/gdbserver/ChangeLog 2019-07-09 Tom Tromey <tom@tromey.com> * configure: Rebuild. * configure.ac: Change common to gdbsupport. * acinclude.m4: Change common to gdbsupport. * Makefile.in (SFILES, OBS, GDBREPLAY_OBS, IPA_OBJS) (version-generated.c, gdbsupport/%-ipa.o, gdbsupport/%.o): Change common to gdbsupport. * ax.c, event-loop.c, fork-child.c, gdb_proc_service.h, gdbreplay.c, gdbthread.h, hostio-errno.c, hostio.c, i387-fp.c, inferiors.c, inferiors.h, linux-aarch64-tdesc-selftest.c, linux-amd64-ipa.c, linux-i386-ipa.c, linux-low.c, linux-tic6x-low.c, linux-x86-low.c, linux-x86-tdesc-selftest.c, linux-x86-tdesc.c, lynx-i386-low.c, lynx-low.c, mem-break.h, nto-x86-low.c, regcache.c, regcache.h, remote-utils.c, server.c, server.h, spu-low.c, symbol.c, target.h, tdesc.c, tdesc.h, thread-db.c, tracepoint.c, win32-i386-low.c, win32-low.c: Change common to gdbsupport.
2019-07-02Move generic_load declaration to symfile.hSimon Marchi1-3/+0
... since the implementation is in symfile.c. At the same time, add some documentation and make sure the first parameter's name in the declaration matches the definition. gdb/ChangeLog: * defs.h (generic_load): Move from here... * symfile.h (generic_load): ... to here. Rename name parameter to args. * symfile.c (generic_load): Add comment.
2019-06-18gdb: Remove use of deprecated_interactive_hookAndrew Burgess1-1/+0
The deprecated_interactive_hook is not used within GDB. It is used in gdbtk, however this patch removes that use: https://sourceware.org/ml/insight/2019-q2/msg00001.html So I think there is no longer a reason to keep this hook around. This patch removes it. There should be no user visible changes after this commit. gdb/ChangeLog: * defs.h (deprecated_interactive_hook): Delete declaration. * interps.c (clear_interpreter_hooks): Remove use of deprecated_interactive_hook. * top.c (deprecated_interactive_hook): Delete definition. * utils.c (maybe_quit): Remove use of deprecated_interactive_hook.
2019-05-08Move "watchdog" to remote.cTom Tromey1-4/+0
The "watchdog" global is only used in remote.c, so this patch moves it there and makes it static. gdb/ChangeLog 2019-05-08 Tom Tromey <tromey@adacore.com> * maint.c (_initialize_maint_cmds): Move initialization code to remote.c. (watchdog, show_watchdog): Move to remote.c. * remote.c (watchdog, show_watchdog): Move from maint.c. Make "watchdog" static. (_initialize_remote): Move initialization code from maint.c. * defs.h (watchdog): Don't declare.
2019-05-08Move interpreter_p declaration to main.hTom Tromey1-3/+0
This moves the interpreter_p declaration from defs.h to main.h. I think this makes more sense, as it is defined in main.c. Also, this declaration was in the wrong place -- between a comment and the things the comment described. gdb/ChangeLog 2019-05-08 Tom Tromey <tromey@adacore.com> * tui/tui-interp.c: Include main.h. * interps.c: Include main.h. * main.h (interpreter_p): Declare. * defs.h (interpreter_p): Don't declare.