Skip to content
Snippets Groups Projects
  1. Jan 01, 2023
  2. Jan 01, 2022
  3. Jan 01, 2021
  4. Dec 04, 2020
    • Tom Tromey's avatar
      Remove redundant typedefs · f99b5177
      Tom Tromey authored
      I was inspired by this patch of Simon's:
      
      https://sourceware.org/pipermail/gdb-patches/2020-November/173522.html
      
      ... to remove other typedefs that are no longer necessary now that gdb
      uses C++.
      
      I didn't remove absolutely every one -- I didn't touch the tdep files.
      However, I removed many of them.  In some cases, I removed an existing
      different struct tag.
      
      2020-12-04  Tom Tromey  <tromey@adacore.com>
      
      	* linespec.c (struct linespec_token): Rename; remove typedef.
      	* guile/scm-block.c (struct block_smob): Remove typedef.
      	(struct block_syms_progress_smob): Likewise.
      	* guile/scm-symbol.c (struct symbol_smob): Remove typedef.
      	* guile/scm-symtab.c (symtab_smob): Remove typedef.
      	(struct sal_smob): Remove typedef.
      	* guile/scm-param.c (struct param_smob): Remove typedef.
      	* guile/scm-progspace.c (struct pspace_smob): Rename.
      	* guile/scm-objfile.c (struct objfile_smob): Rename.
      	* guile/scm-iterator.c (struct iterator_smob): Rename.
      	* guile/scm-frame.c (struct frame_smob): Rename.
      	* guile/scm-arch.c (struct arch_smob): Rename.
      	* guile/scm-type.c (struct field_smob): Remove typedef.
      	(struct type_smob): Rename.
      	* guile/scm-cmd.c (struct command_smob): Remove typedef.
      	* guile/scm-ports.c (struct ioscm_memory_port): Remove typedef.
      	* guile/scm-value.c (struct value_smob): Remove typedef.
      	* guile/scm-lazy-string.c (lazy_string_smob): Remove typedef.
      	* guile/guile-internal.h (struct scheme_variable)
      	(struct scheme_function, struct scheme_integer_constant)
      	(struct gdb_smob, struct chained_gdb_smob)
      	(struct eqable_gdb_smob, arch_smob, frame_smob, iterator_smob)
      	(objfile_smob, pspace_smob, type_smob): Remove typedef.
      	* guile/scm-pretty-print.c (pretty_printer_smob): Remove typedef.
      	(struct pretty_printer_worker_smob): Remove typedef.
      	* guile/scm-exception.c (struct exception_smob): Remove typedef.
      	* python/py-block.c (struct block_object): Remove typedef.
      	(block_syms_iterator_object): Update.
      	(set_block): Update.
      	(block_syms_iterator_object): Remove typedef.
      	* python/py-inferior.c (struct membuf_object): Remove typedef.
      	* python/py-symtab.c (struct symtab_object): Remove typedef.
      	(set_symtab): Update.
      	(sal_object): Remove typedef.
      	(set_sal): Update.
      	* python/py-frame.c (frame_object): Remove typedef.
      	* python/py-record-btrace.c (struct btpy_list_object): Remove
      	typedef.
      	* python/py-arch.c (struct arch_object): Remove typedef.
      	* python/py-linetable.c (struct linetable_entry_object)
      	(linetable_object, struct ltpy_iterator_object): Remove typedef.
      	* python/py-events.h (eventregistry_object): Remove typedef.
      	(struct events_object): Remove typedef.
      	* python/python-internal.h (gdbpy_breakpoint_object): Remove
      	typedef.
      	(thread_object): Remove typedef.
      	* python/py-progspace.c (pspace_object): Remove typedef.
      	* python/py-value.c (struct value_object): Remove typedef.
      	* python/py-record.h (recpy_record_object): Remove typedef.
      	(struct recpy_element_object): Remove typedef.
      	* python/py-lazy-string.c (lazy_string_object): Remove typedef.
      	* python/py-objfile.c (objfile_object): Remove typedef.
      	* python/py-cmd.c (struct cmdpy_object): Remove typedef.
      	* python/py-type.c (type_object): Remove typedef.
      	(typy_iterator_object): Update.
      	(set_type): Update.
      	(field_object): Remove typedef.
      	(typy_iterator_object): Remove typedef.
      	* python/py-registers.c (register_descriptor_iterator_object):
      	Remove typedef.
      	(struct register_descriptor_object)
      	(struct reggroup_iterator_object, struct reggroup_object): Remove
      	typedef.
      	* python/py-record.c (recpy_gap_object): Remove typedef.
      	* python/py-symbol.c (symbol_object): Remove typedef.
      	(set_symbol): Update.
      	* python/py-event.h (event_object): Remove typedef.
      	* python/py-param.c (parmpy_object): Remove typedef.
      	* python/py-instruction.c (struct py_insn_obj): Remove typedef.
      	* python/py-unwind.c (struct pending_frame_object): Remove typedef.
      	(unwind_info_object, struct cached_frame_info): Likewise.
      f99b5177
  5. Jan 01, 2020
  6. Feb 07, 2019
    • Tom Tromey's avatar
      Normalize include guards in gdb · 1a5c2598
      Tom Tromey authored
      While working on my other scripts to deal with gdb headers, I noticed
      that some files were missing include guards.  I wrote a script to add
      the missing ones, but found that using the obvious names for the
      guards ran into clashes -- for example, gdb/nat/linux-nat.h used
      "LINUX_NAT_H", but this was also the script's choice for
      gdb/linux-nat.h.
      
      So, I changed the script to normalize all include guards in gdb.  This
      patch is the result.
      
      As usual the script is available here:
      
          https://github.com/tromey/gdb-refactoring-scripts
      
      Tested by rebuilding; I also ran it through "Fedora-x86_64-m64" on the
      buildbot.
      
      gdb/ChangeLog
      2019-02-07  Tom Tromey  <tom@tromey.com>
      
      	* yy-remap.h: Add include guard.
      	* xtensa-tdep.h: Add include guard.
      	* xcoffread.h: Rename include guard.
      	* varobj-iter.h: Add include guard.
      	* tui/tui.h: Rename include guard.
      	* tui/tui-winsource.h: Rename include guard.
      	* tui/tui-wingeneral.h: Rename include guard.
      	* tui/tui-windata.h: Rename include guard.
      	* tui/tui-win.h: Rename include guard.
      	* tui/tui-stack.h: Rename include guard.
      	* tui/tui-source.h: Rename include guard.
      	* tui/tui-regs.h: Rename include guard.
      	* tui/tui-out.h: Rename include guard.
      	* tui/tui-layout.h: Rename include guard.
      	* tui/tui-io.h: Rename include guard.
      	* tui/tui-hooks.h: Rename include guard.
      	* tui/tui-file.h: Rename include guard.
      	* tui/tui-disasm.h: Rename include guard.
      	* tui/tui-data.h: Rename include guard.
      	* tui/tui-command.h: Rename include guard.
      	* tic6x-tdep.h: Add include guard.
      	* target/waitstatus.h: Rename include guard.
      	* target/wait.h: Rename include guard.
      	* target/target.h: Rename include guard.
      	* target/resume.h: Rename include guard.
      	* target-float.h: Rename include guard.
      	* stabsread.h: Add include guard.
      	* rs6000-tdep.h: Add include guard.
      	* riscv-fbsd-tdep.h: Add include guard.
      	* regformats/regdef.h: Rename include guard.
      	* record.h: Rename include guard.
      	* python/python.h: Rename include guard.
      	* python/python-internal.h: Rename include guard.
      	* python/py-stopevent.h: Rename include guard.
      	* python/py-ref.h: Rename include guard.
      	* python/py-record.h: Rename include guard.
      	* python/py-record-full.h: Rename include guard.
      	* python/py-record-btrace.h: Rename include guard.
      	* python/py-instruction.h: Rename include guard.
      	* python/py-events.h: Rename include guard.
      	* python/py-event.h: Rename include guard.
      	* procfs.h: Add include guard.
      	* proc-utils.h: Add include guard.
      	* p-lang.h: Add include guard.
      	* or1k-tdep.h: Rename include guard.
      	* observable.h: Rename include guard.
      	* nto-tdep.h: Rename include guard.
      	* nat/x86-linux.h: Rename include guard.
      	* nat/x86-linux-dregs.h: Rename include guard.
      	* nat/x86-gcc-cpuid.h: Add include guard.
      	* nat/x86-dregs.h: Rename include guard.
      	* nat/x86-cpuid.h: Rename include guard.
      	* nat/ppc-linux.h: Rename include guard.
      	* nat/mips-linux-watch.h: Rename include guard.
      	* nat/linux-waitpid.h: Rename include guard.
      	* nat/linux-ptrace.h: Rename include guard.
      	* nat/linux-procfs.h: Rename include guard.
      	* nat/linux-osdata.h: Rename include guard.
      	* nat/linux-nat.h: Rename include guard.
      	* nat/linux-namespaces.h: Rename include guard.
      	* nat/linux-btrace.h: Rename include guard.
      	* nat/glibc_thread_db.h: Rename include guard.
      	* nat/gdb_thread_db.h: Rename include guard.
      	* nat/gdb_ptrace.h: Rename include guard.
      	* nat/fork-inferior.h: Rename include guard.
      	* nat/amd64-linux-siginfo.h: Rename include guard.
      	* nat/aarch64-sve-linux-sigcontext.h: Rename include guard.
      	* nat/aarch64-sve-linux-ptrace.h: Rename include guard.
      	* nat/aarch64-linux.h: Rename include guard.
      	* nat/aarch64-linux-hw-point.h: Rename include guard.
      	* mn10300-tdep.h: Add include guard.
      	* mips-linux-tdep.h: Add include guard.
      	* mi/mi-parse.h: Rename include guard.
      	* mi/mi-out.h: Rename include guard.
      	* mi/mi-main.h: Rename include guard.
      	* mi/mi-interp.h: Rename include guard.
      	* mi/mi-getopt.h: Rename include guard.
      	* mi/mi-console.h: Rename include guard.
      	* mi/mi-common.h: Rename include guard.
      	* mi/mi-cmds.h: Rename include guard.
      	* mi/mi-cmd-break.h: Rename include guard.
      	* m2-lang.h: Add include guard.
      	* location.h: Rename include guard.
      	* linux-record.h: Rename include guard.
      	* linux-nat.h: Add include guard.
      	* linux-fork.h: Add include guard.
      	* i386-darwin-tdep.h: Rename include guard.
      	* hppa-linux-offsets.h: Add include guard.
      	* guile/guile.h: Rename include guard.
      	* guile/guile-internal.h: Rename include guard.
      	* gnu-nat.h: Rename include guard.
      	* gdb-stabs.h: Rename include guard.
      	* frv-tdep.h: Add include guard.
      	* f-lang.h: Add include guard.
      	* event-loop.h: Add include guard.
      	* darwin-nat.h: Rename include guard.
      	* cp-abi.h: Rename include guard.
      	* config/sparc/nm-sol2.h: Rename include guard.
      	* config/nm-nto.h: Rename include guard.
      	* config/nm-linux.h: Add include guard.
      	* config/i386/nm-i386gnu.h: Rename include guard.
      	* config/djgpp/nl_types.h: Rename include guard.
      	* config/djgpp/langinfo.h: Rename include guard.
      	* compile/gcc-cp-plugin.h: Add include guard.
      	* compile/gcc-c-plugin.h: Add include guard.
      	* compile/compile.h: Rename include guard.
      	* compile/compile-object-run.h: Rename include guard.
      	* compile/compile-object-load.h: Rename include guard.
      	* compile/compile-internal.h: Rename include guard.
      	* compile/compile-cplus.h: Rename include guard.
      	* compile/compile-c.h: Rename include guard.
      	* common/xml-utils.h: Rename include guard.
      	* common/x86-xstate.h: Rename include guard.
      	* common/version.h: Rename include guard.
      	* common/vec.h: Rename include guard.
      	* common/tdesc.h: Rename include guard.
      	* common/selftest.h: Rename include guard.
      	* common/scoped_restore.h: Rename include guard.
      	* common/scoped_mmap.h: Rename include guard.
      	* common/scoped_fd.h: Rename include guard.
      	* common/safe-iterator.h: Rename include guard.
      	* common/run-time-clock.h: Rename include guard.
      	* common/refcounted-object.h: Rename include guard.
      	* common/queue.h: Rename include guard.
      	* common/ptid.h: Rename include guard.
      	* common/print-utils.h: Rename include guard.
      	* common/preprocessor.h: Rename include guard.
      	* common/pathstuff.h: Rename include guard.
      	* common/observable.h: Rename include guard.
      	* common/netstuff.h: Rename include guard.
      	* common/job-control.h: Rename include guard.
      	* common/host-defs.h: Rename include guard.
      	* common/gdb_wait.h: Rename include guard.
      	* common/gdb_vecs.h: Rename include guard.
      	* common/gdb_unlinker.h: Rename include guard.
      	* common/gdb_unique_ptr.h: Rename include guard.
      	* common/gdb_tilde_expand.h: Rename include guard.
      	* common/gdb_sys_time.h: Rename include guard.
      	* common/gdb_string_view.h: Rename include guard.
      	* common/gdb_splay_tree.h: Rename include guard.
      	* common/gdb_setjmp.h: Rename include guard.
      	* common/gdb_ref_ptr.h: Rename include guard.
      	* common/gdb_optional.h: Rename include guard.
      	* common/gdb_locale.h: Rename include guard.
      	* common/gdb_assert.h: Rename include guard.
      	* common/filtered-iterator.h: Rename include guard.
      	* common/filestuff.h: Rename include guard.
      	* common/fileio.h: Rename include guard.
      	* common/environ.h: Rename include guard.
      	* common/common-utils.h: Rename include guard.
      	* common/common-types.h: Rename include guard.
      	* common/common-regcache.h: Rename include guard.
      	* common/common-inferior.h: Rename include guard.
      	* common/common-gdbthread.h: Rename include guard.
      	* common/common-exceptions.h: Rename include guard.
      	* common/common-defs.h: Rename include guard.
      	* common/common-debug.h: Rename include guard.
      	* common/cleanups.h: Rename include guard.
      	* common/buffer.h: Rename include guard.
      	* common/btrace-common.h: Rename include guard.
      	* common/break-common.h: Rename include guard.
      	* cli/cli-utils.h: Rename include guard.
      	* cli/cli-style.h: Rename include guard.
      	* cli/cli-setshow.h: Rename include guard.
      	* cli/cli-script.h: Rename include guard.
      	* cli/cli-interp.h: Rename include guard.
      	* cli/cli-decode.h: Rename include guard.
      	* cli/cli-cmds.h: Rename include guard.
      	* charset-list.h: Add include guard.
      	* buildsym-legacy.h: Rename include guard.
      	* bfin-tdep.h: Add include guard.
      	* ax.h: Rename include guard.
      	* arm-linux-tdep.h: Add include guard.
      	* arm-fbsd-tdep.h: Add include guard.
      	* arch/xtensa.h: Rename include guard.
      	* arch/tic6x.h: Add include guard.
      	* arch/i386.h: Add include guard.
      	* arch/arm.h: Rename include guard.
      	* arch/arm-linux.h: Rename include guard.
      	* arch/arm-get-next-pcs.h: Rename include guard.
      	* arch/amd64.h: Add include guard.
      	* arch/aarch64-insn.h: Rename include guard.
      	* arch-utils.h: Rename include guard.
      	* annotate.h: Add include guard.
      	* amd64-darwin-tdep.h: Rename include guard.
      	* aarch64-linux-tdep.h: Add include guard.
      	* aarch64-fbsd-tdep.h: Add include guard.
      	* aarch32-linux-nat.h: Add include guard.
      
      gdb/gdbserver/ChangeLog
      2019-02-07  Tom Tromey  <tom@tromey.com>
      
      	* x86-tdesc.h: Rename include guard.
      	* x86-low.h: Add include guard.
      	* wincecompat.h: Rename include guard.
      	* win32-low.h: Add include guard.
      	* utils.h: Rename include guard.
      	* tracepoint.h: Rename include guard.
      	* tdesc.h: Rename include guard.
      	* target.h: Rename include guard.
      	* server.h: Rename include guard.
      	* remote-utils.h: Rename include guard.
      	* regcache.h: Rename include guard.
      	* nto-low.h: Rename include guard.
      	* notif.h: Add include guard.
      	* mem-break.h: Rename include guard.
      	* lynx-low.h: Add include guard.
      	* linux-x86-tdesc.h: Add include guard.
      	* linux-s390-tdesc.h: Add include guard.
      	* linux-ppc-tdesc-init.h: Add include guard.
      	* linux-low.h: Add include guard.
      	* linux-aarch64-tdesc.h: Add include guard.
      	* linux-aarch32-low.h: Add include guard.
      	* inferiors.h: Rename include guard.
      	* i387-fp.h: Rename include guard.
      	* hostio.h: Rename include guard.
      	* gdbthread.h: Rename include guard.
      	* gdb_proc_service.h: Rename include guard.
      	* event-loop.h: Rename include guard.
      	* dll.h: Rename include guard.
      	* debug.h: Rename include guard.
      	* ax.h: Rename include guard.
      1a5c2598
  7. Jan 01, 2019
    • Joel Brobecker's avatar
      Update copyright year range in all GDB files. · 42a4f53d
      Joel Brobecker authored
      This commit applies all changes made after running the gdb/copyright.py
      script.
      
      Note that one file was flagged by the script, due to an invalid
      copyright header
      (gdb/unittests/basic_string_view/element_access/char/empty.cc).
      As the file was copied from GCC's libstdc++-v3 testsuite, this commit
      leaves this file untouched for the time being; a patch to fix the header
      was sent to gcc-patches first.
      
      gdb/ChangeLog:
      
      	Update copyright year range in all GDB files.
      42a4f53d
  8. Jun 21, 2018
    • Pedro Alves's avatar
      Use thread_info and inferior pointers more throughout · 00431a78
      Pedro Alves authored
      This is more preparation bits for multi-target support.
      
      In a multi-target scenario, we need to address the case of different
      processes/threads running on different targets that happen to have the
      same PID/PTID.  E.g., we can have both process 123 in target 1, and
      process 123 in target 2, while they're in reality different processes
      running on different machines.  Or maybe we've loaded multiple
      instances of the same core file.  Etc.
      
      To address this, in my WIP multi-target branch, threads and processes
      are uniquely identified by the (process_stratum target_ops *, ptid_t)
      and (process_stratum target_ops *, pid) tuples respectively.  I.e.,
      each process_stratum instance has its own thread/process number space.
      
      As you can imagine, that requires passing around target_ops * pointers
      in a number of functions where we're currently passing only a ptid_t
      or an int.  E.g., when we look up a thread_info object by ptid_t in
      find_thread_ptid, the ptid_t alone isn't sufficient.
      
      In many cases though, we already have the thread_info or inferior
      pointer handy, but we "lose" it somewhere along the call stack, only
      to look it up again by ptid_t/pid.  Since thread_info or inferior
      objects know their parent target, if we pass around thread_info or
      inferior pointers when possible, we avoid having to add extra
      target_ops parameters to many functions, and also, we eliminate a
      number of by ptid_t/int lookups.
      
      So that's what this patch does.  In a bit more detail:
      
      - Changes a number of functions and methods to take a thread_info or
        inferior pointer instead of a ptid_t or int parameter.
      
      - Changes a number of structure fields from ptid_t/int to inferior or
        thread_info pointers.
      
      - Uses the inferior_thread() function whenever possible instead of
        inferior_ptid.
      
      - Uses thread_info pointers directly when possible instead of the
        is_running/is_stopped etc. routines that require a lookup.
      
      - A number of functions are eliminated along the way, such as:
      
        int valid_gdb_inferior_id (int num);
        int pid_to_gdb_inferior_id (int pid);
        int gdb_inferior_id_to_pid (int num);
        int in_inferior_list (int pid);
      
      - A few structures and places hold a thread_info pointer across
        inferior execution, so now they take a strong reference to the
        (refcounted) thread_info object to avoid the thread_info pointer
        getting stale.  This is done in enable_thread_stack_temporaries and
        in the infcall.c code.
      
      - Related, there's a spot in infcall.c where using a RAII object to
        handle the refcount would be handy, so a gdb::ref_ptr specialization
        for thread_info is added (thread_info_ref, in gdbthread.h), along
        with a gdb_ref_ptr policy that works for all refcounted_object types
        (in common/refcounted-object.h).
      
      gdb/ChangeLog:
      2018-06-21  Pedro Alves  <palves@redhat.com>
      
      	* ada-lang.h (ada_get_task_number): Take a thread_info pointer
      	instead of a ptid_t.  All callers adjusted.
      	* ada-tasks.c (ada_get_task_number): Likewise.  All callers
      	adjusted.
      	(print_ada_task_info, display_current_task_id, task_command_1):
      	Adjust.
      	* breakpoint.c (watchpoint_in_thread_scope): Adjust to use
      	inferior_thread.
      	(breakpoint_kind): Adjust.
      	(remove_breakpoints_pid): Rename to ...
      	(remove_breakpoints_inf): ... this.  Adjust to take an inferior
      	pointer.  All callers adjusted.
      	(bpstat_clear_actions): Use inferior_thread.
      	(get_bpstat_thread): New.
      	(bpstat_do_actions): Use it.
      	(bpstat_check_breakpoint_conditions, bpstat_stop_status): Adjust
      	to take a thread_info pointer.  All callers adjusted.
      	(set_longjmp_breakpoint_for_call_dummy, set_momentary_breakpoint)
      	(breakpoint_re_set_thread): Use inferior_thread.
      	* breakpoint.h (struct inferior): Forward declare.
      	(bpstat_stop_status): Update.
      	(remove_breakpoints_pid): Delete.
      	(remove_breakpoints_inf): New.
      	* bsd-uthread.c (bsd_uthread_target::wait)
      	(bsd_uthread_target::update_thread_list): Use find_thread_ptid.
      	* btrace.c (btrace_add_pc, btrace_enable, btrace_fetch)
      	(maint_btrace_packet_history_cmd)
      	(maint_btrace_clear_packet_history_cmd): Adjust.
      	(maint_btrace_clear_cmd, maint_info_btrace_cmd): Adjust to use
      	inferior_thread.
      	* cli/cli-interp.c: Include "inferior.h".
      	* common/refcounted-object.h (struct
      	refcounted_object_ref_policy): New.
      	* compile/compile-object-load.c: Include gdbthread.h.
      	(store_regs): Use inferior_thread.
      	* corelow.c (core_target::close): Use current_inferior.
      	(core_target_open): Adjust to use first_thread_of_inferior and use
      	the current inferior.
      	* ctf.c (ctf_target::close): Adjust to use current_inferior.
      	* dummy-frame.c (dummy_frame_id) <ptid>: Delete, replaced by ...
      	<thread>: ... this new field.  All references adjusted.
      	(dummy_frame_pop, dummy_frame_discard, register_dummy_frame_dtor):
      	Take a thread_info pointer instead of a ptid_t.
      	* dummy-frame.h (dummy_frame_push, dummy_frame_pop)
      	(dummy_frame_discard, register_dummy_frame_dtor): Take a
      	thread_info pointer instead of a ptid_t.
      	* elfread.c: Include "inferior.h".
      	(elf_gnu_ifunc_resolver_stop, elf_gnu_ifunc_resolver_return_stop):
      	Use inferior_thread.
      	* eval.c (evaluate_subexp): Likewise.
      	* frame.c (frame_pop, has_stack_frames, find_frame_sal): Use
      	inferior_thread.
      	* gdb_proc_service.h (struct thread_info): Forward declare.
      	(struct ps_prochandle) <ptid>: Delete, replaced by ...
      	<thread>: ... this new field.  All references adjusted.
      	* gdbarch.h, gdbarch.c: Regenerate.
      	* gdbarch.sh (get_syscall_number): Replace 'ptid' parameter with a
      	'thread' parameter.  All implementations and callers adjusted.
      	* gdbthread.h (thread_info) <set_running>: New method.
      	(delete_thread, delete_thread_silent): Take a thread_info pointer
      	instead of a ptid.
      	(global_thread_id_to_ptid, ptid_to_global_thread_id): Delete.
      	(first_thread_of_process): Delete, replaced by ...
      	(first_thread_of_inferior): ... this new function.  All callers
      	adjusted.
      	(any_live_thread_of_process): Delete, replaced by ...
      	(any_live_thread_of_inferior): ... this new function.  All callers
      	adjusted.
      	(switch_to_thread, switch_to_no_thread): Declare.
      	(is_executing): Delete.
      	(enable_thread_stack_temporaries): Update comment.
      	<enable_thread_stack_temporaries>: Take a thread_info pointer
      	instead of a ptid_t.  Incref the thread.
      	<~enable_thread_stack_temporaries>: Decref the thread.
      	<m_ptid>: Delete
      	<m_thr>: New.
      	(thread_stack_temporaries_enabled_p, push_thread_stack_temporary)
      	(get_last_thread_stack_temporary)
      	(value_in_thread_stack_temporaries, can_access_registers_thread):
      	Take a thread_info pointer instead of a ptid_t.  All callers
      	adjusted.
      	* infcall.c (get_call_return_value): Use inferior_thread.
      	(run_inferior_call): Work with thread pointers instead of ptid_t.
      	(call_function_by_hand_dummy): Work with thread pointers instead
      	of ptid_t.  Use thread_info_ref.
      	* infcmd.c (proceed_thread_callback): Access thread's state
      	directly.
      	(ensure_valid_thread, ensure_not_running): Use inferior_thread,
      	access thread's state directly.
      	(continue_command): Use inferior_thread.
      	(info_program_command): Use find_thread_ptid and access thread
      	state directly.
      	(proceed_after_attach_callback): Use thread state directly.
      	(notice_new_inferior): Take a thread_info pointer instead of a
      	ptid_t.  All callers adjusted.
      	(exit_inferior): Take an inferior pointer instead of a pid.  All
      	callers adjusted.
      	(exit_inferior_silent): New.
      	(detach_inferior): Delete.
      	(valid_gdb_inferior_id, pid_to_gdb_inferior_id)
      	(gdb_inferior_id_to_pid, in_inferior_list): Delete.
      	(detach_inferior_command, kill_inferior_command): Use
      	find_inferior_id instead of valid_gdb_inferior_id and
      	gdb_inferior_id_to_pid.
      	(inferior_command): Use inferior and thread pointers.
      	* inferior.h (struct thread_info): Forward declare.
      	(notice_new_inferior): Take a thread_info pointer instead of a
      	ptid_t.  All callers adjusted.
      	(detach_inferior): Delete declaration.
      	(exit_inferior, exit_inferior_silent): Take an inferior pointer
      	instead of a pid.  All callers adjusted.
      	(gdb_inferior_id_to_pid, pid_to_gdb_inferior_id, in_inferior_list)
      	(valid_gdb_inferior_id): Delete.
      	* infrun.c (follow_fork_inferior, proceed_after_vfork_done)
      	(handle_vfork_child_exec_or_exit, follow_exec): Adjust.
      	(struct displaced_step_inferior_state) <pid>: Delete, replaced by
      	...
      	<inf>: ... this new field.
      	<step_ptid>: Delete, replaced by ...
      	<step_thread>: ... this new field.
      	(get_displaced_stepping_state): Take an inferior pointer instead
      	of a pid.  All callers adjusted.
      	(displaced_step_in_progress_any_inferior): Adjust.
      	(displaced_step_in_progress_thread): Take a thread pointer instead
      	of a ptid_t.  All callers adjusted.
      	(displaced_step_in_progress, add_displaced_stepping_state): Take
      	an inferior pointer instead of a pid.  All callers adjusted.
      	(get_displaced_step_closure_by_addr): Adjust.
      	(remove_displaced_stepping_state): Take an inferior pointer
      	instead of a pid.  All callers adjusted.
      	(displaced_step_prepare_throw, displaced_step_prepare)
      	(displaced_step_fixup): Take a thread pointer instead of a ptid_t.
      	All callers adjusted.
      	(start_step_over): Adjust.
      	(infrun_thread_ptid_changed): Remove bit updating ptids in the
      	displaced step queue.
      	(do_target_resume): Adjust.
      	(fetch_inferior_event): Use inferior_thread.
      	(context_switch, get_inferior_stop_soon): Take an
      	execution_control_state pointer instead of a ptid_t.  All callers
      	adjusted.
      	(switch_to_thread_cleanup): Delete.
      	(stop_all_threads): Use scoped_restore_current_thread.
      	* inline-frame.c: Include "gdbthread.h".
      	(inline_state) <inline_state>: Take a thread pointer instead of a
      	ptid_t.  All callers adjusted.
      	<ptid>: Delete, replaced by ...
      	<thread>: ... this new field.
      	(find_inline_frame_state): Take a thread pointer instead of a
      	ptid_t.  All callers adjusted.
      	(skip_inline_frames, step_into_inline_frame)
      	(inline_skipped_frames, inline_skipped_symbol): Take a thread
      	pointer instead of a ptid_t.  All callers adjusted.
      	* inline-frame.h (skip_inline_frames, step_into_inline_frame)
      	(inline_skipped_frames, inline_skipped_symbol): Likewise.
      	* linux-fork.c (delete_checkpoint_command): Adjust to use thread
      	pointers directly.
      	* linux-nat.c (get_detach_signal): Likewise.
      	* linux-thread-db.c (thread_from_lwp): New 'stopped' parameter.
      	(thread_db_notice_clone): Adjust.
      	(thread_db_find_new_threads_silently)
      	(thread_db_find_new_threads_2, thread_db_find_new_threads_1): Take
      	a thread pointer instead of a ptid_t.  All callers adjusted.
      	* mi/mi-cmd-var.c: Include "inferior.h".
      	(mi_cmd_var_update_iter): Update to use thread pointers.
      	* mi/mi-interp.c (mi_new_thread): Update to use the thread's
      	inferior directly.
      	(mi_output_running_pid, mi_inferior_count): Delete, bits factored
      	out to ...
      	(mi_output_running): ... this new function.
      	(mi_on_resume_1): Adjust to use it.
      	(mi_user_selected_context_changed): Adjust to use inferior_thread.
      	* mi/mi-main.c (proceed_thread): Adjust to use thread pointers
      	directly.
      	(interrupt_thread_callback): : Adjust to use thread and inferior
      	pointers.
      	* proc-service.c: Include "gdbthread.h".
      	(ps_pglobal_lookup): Adjust to use the thread's inferior directly.
      	* progspace-and-thread.c: Include "inferior.h".
      	* progspace.c: Include "inferior.h".
      	* python/py-exitedevent.c (create_exited_event_object): Adjust to
      	hold a reference to an inferior_object.
      	* python/py-finishbreakpoint.c (bpfinishpy_init): Adjust to use
      	inferior_thread.
      	* python/py-inferior.c (struct inferior_object): Give the type a
      	tag name instead of a typedef.
      	(python_on_normal_stop): No need to check if the current thread is
      	listed.
      	(inferior_to_inferior_object): Change return type to
      	inferior_object.  All callers adjusted.
      	(find_thread_object): Delete, bits factored out to ...
      	(thread_to_thread_object): ... this new function.
      	* python/py-infthread.c (create_thread_object): Use
      	inferior_to_inferior_object.
      	(thpy_is_stopped): Use thread pointer directly.
      	(gdbpy_selected_thread): Use inferior_thread.
      	* python/py-record-btrace.c (btpy_list_object) <ptid>: Delete
      	field, replaced with ...
      	<thread>: ... this new field.  All users adjusted.
      	(btpy_insn_or_gap_new): Drop const.
      	(btpy_list_new): Take a thread pointer instead of a ptid_t.  All
      	callers adjusted.
      	* python/py-record.c: Include "gdbthread.h".
      	(recpy_insn_new, recpy_func_new): Take a thread pointer instead of
      	a ptid_t.  All callers adjusted.
      	(gdbpy_current_recording): Use inferior_thread.
      	* python/py-record.h (recpy_record_object) <ptid>: Delete
      	field, replaced with ...
      	<thread>: ... this new field.  All users adjusted.
      	(recpy_element_object) <ptid>: Delete
      	field, replaced with ...
      	<thread>: ... this new field.  All users adjusted.
      	(recpy_insn_new, recpy_func_new): Take a thread pointer instead of
      	a ptid_t.  All callers adjusted.
      	* python/py-threadevent.c: Include "gdbthread.h".
      	(get_event_thread): Use thread_to_thread_object.
      	* python/python-internal.h (struct inferior_object): Forward
      	declare.
      	(find_thread_object, find_inferior_object): Delete declarations.
      	(thread_to_thread_object, inferior_to_inferior_object): New
      	declarations.
      	* record-btrace.c: Include "inferior.h".
      	(require_btrace_thread): Use inferior_thread.
      	(record_btrace_frame_sniffer)
      	(record_btrace_tailcall_frame_sniffer): Use inferior_thread.
      	(get_thread_current_frame): Use scoped_restore_current_thread and
      	switch_to_thread.
      	(get_thread_current_frame): Use thread pointer directly.
      	(record_btrace_replay_at_breakpoint): Use thread's inferior
      	pointer directly.
      	* record-full.c: Include "inferior.h".
      	* regcache.c: Include "gdbthread.h".
      	(get_thread_arch_regcache): Use the inferior's address space
      	directly.
      	(get_thread_regcache, registers_changed_thread): New.
      	* regcache.h (get_thread_regcache(thread_info *thread)): New
      	overload.
      	(registers_changed_thread): New.
      	(remote_target) <remote_detach_1>: Swap order of parameters.
      	(remote_add_thread): <remote_add_thread>: Return the new thread.
      	(get_remote_thread_info(ptid_t)): New overload.
      	(remote_target::remote_notice_new_inferior): Use thread pointers
      	directly.
      	(remote_target::process_initial_stop_replies): Use
      	thread_info::set_running.
      	(remote_target::remote_detach_1, remote_target::detach)
      	(extended_remote_target::detach): Adjust.
      	* stack.c (frame_show_address): Use inferior_thread.
      	* target-debug.h (target_debug_print_thread_info_pp): New.
      	* target-delegates.c: Regenerate.
      	* target.c (default_thread_address_space): Delete.
      	(memory_xfer_partial_1): Use current_inferior.
      	(target_detach): Use current_inferior.
      	(target_thread_address_space): Delete.
      	(generic_mourn_inferior): Use current_inferior.
      	* target.h (struct target_ops) <thread_address_space>: Delete.
      	(target_thread_address_space): Delete.
      	* thread.c (init_thread_list): Use ALL_THREADS_SAFE.  Use thread
      	pointers directly.
      	(delete_thread_1, delete_thread, delete_thread_silent): Take a
      	thread pointer instead of a ptid_t.  Adjust all callers.
      	(ptid_to_global_thread_id, global_thread_id_to_ptid): Delete.
      	(first_thread_of_process): Delete, replaced by ...
      	(first_thread_of_inferior): ... this new function.  All callers
      	adjusted.
      	(any_thread_of_process): Rename to ...
      	(any_thread_of_inferior): ... this, and take an inferior pointer.
      	(any_live_thread_of_process): Rename to ...
      	(any_live_thread_of_inferior): ... this, and take an inferior
      	pointer.
      	(thread_stack_temporaries_enabled_p, push_thread_stack_temporary)
      	(value_in_thread_stack_temporaries)
      	(get_last_thread_stack_temporary): Take a thread pointer instead
      	of a ptid_t.  Adjust all callers.
      	(thread_info::set_running): New.
      	(validate_registers_access): Use inferior_thread.
      	(can_access_registers_ptid): Rename to ...
      	(can_access_registers_thread): ... this, and take a thread
      	pointer.
      	(print_thread_info_1): Adjust to compare thread pointers instead
      	of ptids.
      	(switch_to_no_thread, switch_to_thread): Make extern.
      	(scoped_restore_current_thread::~scoped_restore_current_thread):
      	Use m_thread pointer directly.
      	(scoped_restore_current_thread::scoped_restore_current_thread):
      	Use inferior_thread.
      	(thread_command): Use thread pointer directly.
      	(thread_num_make_value_helper): Use inferior_thread.
      	* top.c (execute_command): Use inferior_thread.
      	* tui/tui-interp.c: Include "inferior.h".
      	* varobj.c (varobj_create): Use inferior_thread.
      	(value_of_root_1): Use find_thread_global_id instead of
      	global_thread_id_to_ptid.
      00431a78
  9. Jan 02, 2018
  10. May 02, 2017
  11. Jan 27, 2017
    • Walfred Tedeschi's avatar
      amd64-linux: expose system register FS_BASE and GS_BASE for Linux. · 2735833d
      Walfred Tedeschi authored
      
      This patch allows examination of the registers FS_BASE and GS_BASE
      for Linux Systems running on 64bit. Tests for simple read and write
      of the new registers is also added with this patch.
      
      2017-01-27  Walfred Tedeschi  <walfred.tedeschi@intel.com>
      	    Richard Henderson  <rth@redhat.com>
      
      gdb/ChangeLog:
      
      	* amd64-linux-nat.c (PTRACE_ARCH_PRCTL): New define.
      	(amd64_linux_fetch_inferior_registers): Add case to fetch FS_BASE
      	GS_BASE for older kernels.
      	(amd64_linux_store_inferior_registers): Add case to store FS_BASE
      	GS_BASE for older kernels.
      	* amd64-linux-tdep.c (amd64_linux_gregset_reg_offset): Add FS_BASE
      	and GS_BASE to the offset table.
      	(amd64_linux_register_reggroup_p): Add FS_BASE and GS_BASE to the
      	system register group.
      	* amd64-nat.c (amd64_native_gregset_reg_offset): Implements case
      	for older kernels.
      	* amd64-tdep.c (amd64_init_abi): Add segment registers for the
      	amd64 ABI.
      	* amd64-tdep.h (amd64_regnum): Add AMD64_FSBASE_REGNUM and
      	AMD64_GSBASE_REGNUM.
      	(AMD64_NUM_REGS): Set to AMD64_GSBASE_REGNUM + 1.
      	* features/Makefile (amd64-linux.dat, amd64-avx-linux.dat)
      	(amd64-mpx-linux.dat, amd64-avx512-linux.dat, x32-linux.dat)
      	(x32-avx-linux.dat, x32-avx512-linux.dat): Add
      	i386/64bit-segments.xml in those rules.
      	* features/i386/64bit-segments.xml: New file.
      	* features/i386/amd64-avx-mpx-linux.xml: Add 64bit-segments.xml.
      	* features/i386/amd64-avx-linux.xml: Add 64bit-segments.xml.
      	* features/i386/amd64-avx512-linux.xml: Add 64bit-segments.xml.
      	* features/i386/amd64-mpx-linux.xml: Add 64bit-segments.xml.
      	* features/i386/x32-avx512-linux.xml: Add 64bit-segments.xml.
      	* features/i386/x32-avx-linux.xml: Add 64bit-segments.xml.
      	* features/i386/amd64-linux.xml: Add 64bit-segments.xml.
      	* features/i386/amd64-avx-linux.c: Regenerated.
      	* features/i386/amd64-avx-mpx-linux.c: Regenerated.
      	* features/i386/amd64-avx-mpx.c: Regenerated.
      	* features/i386/amd64-avx512-linux.c: Regenerated.
      	* features/i386/amd64-linux.c: Regenerated.
      	* features/i386/amd64-mpx-linux.c: Regenerated.
      	* features/i386/i386-avx-mpx-linux.c: Regenerated.
      	* features/i386/i386-avx-mpx.c: Regenerated.
      	* features/i386/x32-avx-linux.c: Regenerated.
      	* features/i386/x32-avx512-linux.c: Regenerated.
      	* regformats/i386/amd64-avx-linux.dat: Regenerated.
      	* regformats/i386/amd64-avx-mpx-linux.dat: Regenerated.
      	* regformats/i386/amd64-avx512-linux.dat: Regenerated.
      	* regformats/i386/amd64-linux.dat: Regenerated.
      	* regformats/i386/amd64-mpx-linux.dat: Regenerated.
      	* regformats/i386/x32-avx-linux.dat: Regenerated.
      	* regformats/i386/x32-avx512-linux.dat: Regenerated.
      	* regformats/i386/x32-linux.dat: Regenerated.
      
      gdb/doc/ChangeLog:
      
      	* gdb.texinfo (i386 Features): Add system segment registers
      	as feature.
      
      gdb/gdbserver/ChangeLog:
      
      	* linux-x86-low.c (x86_64_regmap): Add fs_base and gs_base
      	to the register table.
      	(x86_fill_gregset): Add support for old kernels for the
      	fs_base and gs_base system registers.
      	(x86_store_gregset): Likewise.
      	* configure.srv (srv_i386_64bit_xmlfiles): Add 64bit-segments.xml.
      
      gdb/testsuite/ChangeLog:
      
      	* gdb.arch/amd64-gs_base.c: New file.
      	* gdb.arch/amd64-gs_base.exp: New file.
      
      Change-Id: I2e0eeb93058a2320d4d3b045082643cfe4aff963
      Signed-off-by: default avatarWalfred Tedeschi <walfred.tedeschi@intel.com>
      2735833d
  12. Jan 01, 2017
    • Joel Brobecker's avatar
      update copyright year range in GDB files · 61baf725
      Joel Brobecker authored
      This applies the second part of GDB's End of Year Procedure, which
      updates the copyright year range in all of GDB's files.
      
      gdb/ChangeLog:
      
              Update copyright year range in all GDB files.
      61baf725
  13. Jan 01, 2016
  14. Jan 01, 2015
  15. Mar 31, 2014
    • Doug Evans's avatar
      New option "set print symbol-loading". · 770e7fc7
      Doug Evans authored
      	* NEWS: Mention it.
      	* solib.c (solib_read_symbols): Only print symbol loading messages
      	if requested.
      	(solib_add): If symbol loading is in "brief" mode, notify user
      	symbols are being loaded.
      	(reload_shared_libraries_1): Ditto.
      	* symfile.c (print_symbol_loading_off): New static global.
      	(print_symbol_loading_brief): New static global.
      	(print_symbol_loading_full): New static global.
      	(print_symbol_loading_enums): New static global.
      	(print_symbol_loading): New static global.
      	(print_symbol_loading_p): New function.
      	(symbol_file_add_with_addrs): Only print symbol loading messages
      	if requested.
      	(_initialize_symfile): Register "print symbol-loading" set/show
      	command.
      	* symfile.h (print_symbol_loading_p): Declare.
      
      	doc/
      	* gdb.texinfo (Symbols): Document set/show print symbol-loading.
      
      	testsuite/
      	* gdb.base/print-symbol-loading-lib.c: New file.
      	* gdb.base/print-symbol-loading-main.c: New file.
      	* gdb.base/print-symbol-loading.exp: New file.
      770e7fc7
  16. Jan 01, 2014
  17. Jan 01, 2013
  18. Aug 07, 2012
    • Jan Kratochvil's avatar
      gdb/ · 4f69f4c2
      Jan Kratochvil authored
      	PR 11804
      	* defs.h (find_memory_region_ftype): New comment.  New arg modified.
      	* fbsd-nat.c (fbsd_find_memory_regions): Add the passed modified value.
      	* gcore.c (gcore_create_callback): New function comment.  Add modified
      	parameter.  Only write modified regions.  Set SEC_READONLY exactly
      	according to MODIFIED.
      	(objfile_find_memory_regions): Ignore separate debug info files.  Ass
      	the passed modified value to FUNC.
      	* gnu-nat.c (gnu_find_memory_regions): Add the passed modified value.
      	* linux-tdep.c (linux_find_memory_regions): Try to reads smaps file
      	first.  New variables modified and has_anonymous.  Parse the lines of
      	smaps file.  Add the passed MODIFIED value to FUNC.
      	* procfs.c (find_memory_regions_callback): Add the passed modified
      	value.
      
      gdb/testsuite/
      	PR 11804
      	* gdb.base/gcore-relro.exp: New file.
      	* gdb.base/gcore-relro-main.c: New file.
      	* gdb.base/gcore-relro-lib.c: New file.
      4f69f4c2
  19. Jan 04, 2012
  20. Jan 01, 2011
  21. Jan 01, 2010
  22. Jan 03, 2009
  23. May 06, 2008
  24. Jan 01, 2008
  25. Aug 23, 2007
  26. Jan 09, 2007
  27. Oct 17, 2006
    • Daniel Jacobowitz's avatar
      gdb/ · 94277a38
      Daniel Jacobowitz authored
      	* Makefile.in (symtab.o): Update.
      	* symtab.h (matching_bfd_section): New prototype.
      	* symtab.c (matching_bfd_section): New.
      	(find_pc_sect_psymbol, find_pc_sect_symtab): Use it.
      	* minsyms.c (lookup_minimal_symbol_by_pc_section): Likewise.
      	* printcmd.c (sym_info): Ignore separate debug objfiles.
      gdb/testsuite/
      	* gdb.base/sepdebug.exp: Remove debug format test.
      	* lib/gdb.exp (gdb_gnu_strip_debug): Perform debug format test.
      	Handle no-symtab.
      	* gdb.base/sepsymtab.c, gdb.base/sepsymtab.exp: New.
      94277a38
  28. Oct 09, 2006
  29. Apr 11, 2005
    • Daniel Jacobowitz's avatar
      gdb/ · 9494c6a5
      Daniel Jacobowitz authored
      	* config/djgpp/fnchange.lst: Remove entries for gdb.gdbserver.
      gdb/testsuite/
      	* Makefile.in (ALL_SUBDIRS): Replace gdb.gdbserver with
      	gdb.server.
      	* configure.ac: Likewise.
      	* configure: Regenerated.
      	* gdb.gdbserver/Makefile.in: Moved to...
      	* gdb.server/Makefile.in: ... here.
      	* gdb.gdbserver/server.c: Moved to...
      	* gdb.server/server.c: ... here.
      	* gdb.gdbserver/server-run.exp: Moved to...
      	* gdb.server/server-run.exp: ... here.
      9494c6a5
  30. Apr 08, 2005
    • Daniel Jacobowitz's avatar
      gdb/testsuite/ · 6f8eac0e
      Daniel Jacobowitz authored
      	* Makefile.in (ALL_SUBDIRS): Add gdb.gdbserver.
      	* configure.ac: Create gdb.gdbserver/Makefile.
      	* configure: Regenerated.
      	* lib/gdbserver-support.exp: New file, derived from
      	config/gdbserver.exp.
      	* config/gdbserver.exp: Use gdbserver-support.exp.
      	* gdb.gdbserver/Makefile.in: New file.
      	* gdb.gdbserver/server.c: New file.
      	* gdb.gdbserver/server-run.exp: New file.
      gdb/
      	* config/fnchange.lst: Add testsuite/gdb.gdbserver entries.
      6f8eac0e
  31. Oct 12, 2004
    • Daniel Jacobowitz's avatar
      * configure.in: Add gdb.dwarf2. · 0eb3658b
      Daniel Jacobowitz authored
      	* configure: Regenerated.
      	* Makefile.in: Add gdb.dwarf2.
      	* gdb.dwarf2/Makefile.in, gdb.dwarf2/dw2-basic.S,
      	gdb.dwarf2/dw2-basic.exp, gdb.dwarf2/main.c,
      	gdb.dwarf2/file1.txt: New files.
      0eb3658b
  32. Aug 12, 2004
    • Jeff Johnston's avatar
      · 37fdf854
      Jeff Johnston authored
      2004-08-12  Jeff Johnston  <jjohnstn@redhat.com>
      
              * gdb.base/unload.exp: New test for breakpoints in dynamically
              loaded libraries.
              * gdb.base/unload.c: Ditto.
              * gdb.base/unloadshr.c: Ditto.
      37fdf854
  33. Apr 22, 2004
  34. Apr 12, 2004
  35. Feb 05, 2004
    • Jeff Johnston's avatar
      · 4d806929
      Jeff Johnston authored
      2004-02-04  Jeff Johnston  <jjohnstn@redhat.com>
      
              * gdb.base/pendshr.c (pendfunc): New function that calls
              pendfunc1.
              * gdb.base/pending.c: Call pendfunc instead of pendfunc1.
      4d806929
  36. Feb 02, 2004
    • Jeff Johnston's avatar
      · 18fe2033
      Jeff Johnston authored
      2004-02-02  Jeff Johnston  <jjohnstn@redhat.com>
      
              * lib/gdb.exp (gdb_breakpoint): Add pending breakpoint
              support.
              * gdb.base/langs.exp: Fix test which attempts to create
              breakpoint on non-existent function to handle new pending
              support.
              * gdb.base/shlib-call.exp: Use gdb_breakpoint to set
              a breakpoint.
              * gdb.base/pending.exp: New test.
              * gdb.base/pending.c: New file.
              * gdb.base/pendshr.c: Ditto.
      18fe2033
  37. Jan 08, 2004
Loading