aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/thread-db.c
AgeCommit message (Collapse)AuthorFilesLines
2014-09-16Rename current_inferior as current_thread in gdbserverGary Benson1-11/+11
GDB has a function named "current_inferior" and gdbserver has a global variable named "current_inferior", but the two are not equivalent; indeed, gdbserver does not have any real equivalent of what GDB calls an inferior. What gdbserver's "current_inferior" is actually pointing to is a structure describing the current thread. This commit renames current_inferior as current_thread in gdbserver to clarify this. It also renames the function "set_desired_inferior" to "set_desired_thread" and renames various local variables from foo_inferior to foo_thread. gdb/gdbserver/ChangeLog: * inferiors.h (current_inferior): Renamed as... (current_thread): New variable. All uses updated. * linux-low.c (get_pc): Renamed saved_inferior as saved_thread. (maybe_move_out_of_jump_pad): Likewise. (cancel_breakpoint): Likewise. (linux_low_filter_event): Likewise. (wait_for_sigstop): Likewise. (linux_resume_one_lwp): Likewise. (need_step_over_p): Likewise. (start_step_over): Likewise. (linux_stabilize_threads): Renamed save_inferior as saved_thread. * linux-x86-low.c (x86_linux_update_xmltarget): Likewise. * proc-service.c (ps_lgetregs): Renamed reg_inferior as reg_thread and save_inferior as saved_thread. * regcache.c (get_thread_regcache): Renamed saved_inferior as saved_thread. (regcache_invalidate_thread): Likewise. * remote-utils.c (prepare_resume_reply): Likewise. * thread-db.c (thread_db_get_tls_address): Likewise. (disable_thread_event_reporting): Likewise. (remove_thread_event_breakpoints): Likewise. * tracepoint.c (gdb_agent_about_to_close): Renamed save_inferior as saved_thread. * target.h (set_desired_inferior): Renamed as... (set_desired_thread): New declaration. All uses updated. * server.c (myresume): Updated comment to reference thread instead of inferior. (handle_serial_event): Likewise. (handle_target_event): Likewise.
2014-08-28Straightforward fatal to internal_error conversionsGary Benson1-6/+3
This commit replaces most of the calls to fatal that represent internal errors with calls to internal_error, either directly or via gdb_assert and gdb_assert_not_reached. gdb/gdbserver/ChangeLog: * inferiors.c (get_thread_process): Replace check with gdb_assert. * linux-low.c (linux_wait_for_event_filtered): Replace fatal with internal_error. (linux_resume_one_lwp): Likewise. * linux-x86-low.c (x86_siginfo_fixup): Replace checks with gdb_assert. * mem-break.c (raw_bkpt_type_to_target_hw_bp_type): Replace fatal with internal_error. * regcache.c (get_thread_regcache): Replace check with gdb_assert. (init_register_cache): Replace fatal with gdb_assert_not_reached. (find_register_by_name): Replace fatal with internal_error. (find_regno): Likewise. * tdesc.c (init_target_desc): Replace check with gdb_assert. * thread-db.c (thread_db_create_event): Likewise. (thread_db_load_search): Likewise. (try_thread_db_load_1): Likewise. * tracepoint.c (get_jump_space_head): Replace fatal with internal_error. (claim_trampoline_space): Likewise. (have_fast_tracepoint_trampoline_buffer): Likewise. (cmd_qtstart): Likewise. (stop_tracing): Likewise. (fast_tracepoint_collecting): Likewise. (target_malloc): Likewise. (download_tracepoint): Likewise. (download_trace_state_variables): Replace check with gdb_assert. (upload_fast_traceframes): Replace fatal with internal_error.
2014-06-20Move shared native target specific code to gdb/natGary Benson1-1/+1
https://sourceware.org/gdb/wiki/Common describes the following directory structure: gdb/nat/ Native target backend files. Code that interfaces with the host debug API. E.g., ptrace code, Windows debug API code, procfs code should go here. gdb/target/ Host-independent, target vector specific code (target_ops). gdb/common/ All other shared code. This commit moves all native target backend files currently in gdb/common to gdb/nat. gdb/ 2014-06-20 Gary Benson <gbenson@redhat.com> * common/gdb_thread_db.h: Moved to nat. All includes updated. * common/glibc_thread_db.h: Likewise. * common/i386-cpuid.h: Likewise. * common/i386-gcc-cpuid.h: Likewise. * common/linux-btrace.h: Likewise. * common/linux-osdata.h: Likewise. * common/linux-procfs.h: Likewise. * common/linux-ptrace.h: Likewise. * common/mips-linux-watch.h: Likewise. * common/linux-btrace.c: Moved to nat. * common/linux-osdata.c: Likewise. * common/linux-procfs.c: Likewise. * common/linux-ptrace.c: Likewise. * common/mips-linux-watch.c: Likewise. * nat/gdb_thread_db.h: Moved from common. * nat/glibc_thread_db.h: Likewise. * nat/i386-cpuid.h: Likewise. * nat/i386-gcc-cpuid.h: Likewise. * nat/linux-btrace.c: Likewise. * nat/linux-btrace.h: Likewise. * nat/linux-osdata.c: Likewise. * nat/linux-osdata.h: Likewise. * nat/linux-procfs.c: Likewise. * nat/linux-procfs.h: Likewise. * nat/linux-ptrace.c: Likewise. * nat/linux-ptrace.h: Likewise. * nat/mips-linux-watch.c: Likewise. * nat/mips-linux-watch.h: Likewise. * Makefile.in (HFILES_NO_SRCDIR): Reflect new locations. (object file files): Reordered. * gdb/copyright.py (EXCLUDE_LIST): Reflect new location of glibc_thread_db.h. gdb/gdbserver/ 2014-06-20 Gary Benson <gbenson@redhat.com> * Makefile.in (SFILES): Update locations for files moved from common to nat. (object file files): Reordered. gdb/testsuite/ 2014-06-20 Gary Benson <gbenson@redhat.com> * gdb.arch/i386-avx.exp: Fix include file location. * gdb.arch/i386-sse.exp: Likewise.
2014-05-21Fix TLS access for -static -pthreadJan Kratochvil1-7/+31
I have posted: TLS variables access for -static -lpthread executables https://sourceware.org/ml/libc-help/2014-03/msg00024.html and the GDB patch below has been confirmed as OK for current glibcs. Further work should be done for newer glibcs: Improve TLS variables glibc compatibility https://sourceware.org/bugzilla/show_bug.cgi?id=16954 Still the patch below implements the feature in a fully functional way backward compatible with current glibcs, it depends on the following glibc source line: csu/libc-tls.c main_map->l_tls_modid = 1; gdb/ 2014-05-21 Jan Kratochvil <jan.kratochvil@redhat.com> Fix TLS access for -static -pthread. * linux-thread-db.c (struct thread_db_info): Add td_thr_tlsbase_p. (try_thread_db_load_1): Initialize it. (thread_db_get_thread_local_address): Call it if LM is zero. * target.c (target_translate_tls_address): Remove LM_ADDR zero check. * target.h (struct target_ops) (to_get_thread_local_address): Add load_module_addr comment. gdb/gdbserver/ 2014-05-21 Jan Kratochvil <jan.kratochvil@redhat.com> Fix TLS access for -static -pthread. * gdbserver/thread-db.c (struct thread_db): Add td_thr_tlsbase_p. (thread_db_get_tls_address): Call it if LOAD_MODULE is zero. (thread_db_load_search, try_thread_db_load_1): Initialize it. gdb/testsuite/ 2014-05-21 Jan Kratochvil <jan.kratochvil@redhat.com> Fix TLS access for -static -pthread. * gdb.threads/staticthreads.c <HAVE_TLS> (tlsvar): New. <HAVE_TLS> (thread_function, main): Initialize it. * gdb.threads/staticthreads.exp: Try gdb_compile_pthreads for $have_tls. Add clean_restart. <$have_tls != "">: Check TLSVAR. Message-ID: <20140410115204.GB16411@host2.jankratochvil.net>
2014-04-25PR server/16255: gdbserver cannot attach to a second inferior that is ↵Pedro Alves1-6/+12
multi-threaded. On Linux, we need to explicitly ptrace attach to all lwps of a process. Because GDB might not be connected yet when an attach is requested, and thus it may not be possible to activate thread_db, as that requires access to symbols (IOW, gdbserver --attach), a while ago we make linux_attach loop over the lwps as listed by /proc/PID/task to find the lwps to attach to. linux_attach_lwp_1 has: ... if (initial) /* If lwp is the tgid, we handle adding existing threads later. Otherwise we just add lwp without bothering about any other threads. */ ptid = ptid_build (lwpid, lwpid, 0); else { /* Note that extracting the pid from the current inferior is safe, since we're always called in the context of the same process as this new thread. */ int pid = pid_of (current_inferior); ptid = ptid_build (pid, lwpid, 0); } That "safe" comment referred to linux_attach_lwp being called by thread-db.c. But this was clearly missed when a new call to linux_attach_lwp_1 was added to linux_attach. As a result, current_inferior will be set to some random process, and non-initial lwps of the second inferior get assigned the pid of the wrong inferior. E.g., in the case of attaching to two inferiors, for the second inferior (and so on), non-initial lwps of the second inferior get assigned the pid of the first inferior. This doesn't trigger on the first inferior, when current_inferior is NULL, add_thread switches the current inferior to the newly added thread. Rather than making linux_attach switch current_inferior temporarily (thus avoiding further reliance on global state), or making linux_attach_lwp_1 get the tgid from /proc, which add extra syscalls, and will be wrong in case of the user having originally attached directly to a non-tgid lwp, and then that lwp spawning new clones (the ptid.pid field of further new clones should be the same as the original lwp's pid, which is not the tgid), we note that callers of linux_attach_lwp/linux_attach_lwp_1 always have the right pid handy already, so they can pass it down along with the lwpid. The only other reason for the "initial" parameter is to error out instead of warn in case of attach failure, when we're first attaching to a process. There are only three callers of linux_attach_lwp/linux_attach_lwp_1, and each wants to print a different warn/error string, so we can just move the error/warn out of linux_attach_lwp_1 to the callers, thus getting rid of the "initial" parameter. There really nothing gdbserver-specific about attaching to two threaded processes, so this adds a new test under gdb.multi/. The test passes cleanly against the native GNU/Linux target, but fails/triggers the bug against GDBserver (before the patch), with the native-extended-remote board (as plain remote doesn't support multi-process). Tested on x86_64 Fedora 17, with the native-extended-gdbserver board. gdb/gdbserver/ 2014-04-25 Pedro Alves <palves@redhat.com> PR server/16255 * linux-low.c (linux_attach_fail_reason_string): New function. (linux_attach_lwp): Delete. (linux_attach_lwp_1): Rename to ... (linux_attach_lwp): ... this. Take a ptid instead of a pid as argument. Remove "initial" parameter. Return int instead of void. Don't error or warn here. (linux_attach): Adjust to call linux_attach_lwp. Call error on failure to attach to the tgid. Call warning when failing to attach to an lwp. * linux-low.h (linux_attach_lwp): Take a ptid instead of a pid as argument. Remove "initial" parameter. Return int instead of void. Don't error or warn here. (linux_attach_fail_reason_string): New declaration. * thread-db.c (attach_thread): Adjust to linux_attach_lwp's interface change. Use linux_attach_fail_reason_string. gdb/ 2014-04-25 Pedro Alves <palves@redhat.com> PR server/16255 * common/linux-ptrace.c (linux_ptrace_attach_warnings): Rename to ... (linux_ptrace_attach_fail_reason): ... this. Remove "warning: " and newline from built string. * common/linux-ptrace.h (linux_ptrace_attach_warnings): Rename to ... (linux_ptrace_attach_fail_reason): ... this. * linux-nat.c (linux_nat_attach): Adjust to use linux_ptrace_attach_fail_reason. gdb/testsuite/ 2014-04-25 Simon Marchi <simon.marchi@ericsson.com> Pedro Alves <palves@redhat.com> PR server/16255 * gdb.multi/multi-attach.c: New file. * gdb.multi/multi-attach.exp: New file.
2014-02-19Rename inferior_list_entry uses from "head" to "entry" for consistency.Doug Evans1-2/+2
* dll.h (struct dll_info): Add comment. * gdbthread.h (struct thread_info): Add comment. (current_ptid): Simplify. * inferiors.c (add_process): Update. (remove_process): Update. * inferiors.h (struct process_info): Rename member "head" to "entry". * linux-low.c (delete_lwp): Update. (add_lwp): Update. (last_thread_of_process_p): Update. (kill_one_lwp_callback, linux_kill): Update. (status_pending_p_callback): Update. (wait_for_sigstop): Update. Simplify read of ptid. (start_step_over): Update. * linux-low.h (ptid_of, pid_of, lwpid_of): Update. (get_lwp_thread): Update. (struct lwp_info): Rename member "head" to "entry". * regcache.h (inferior_list_entry): Delete. * server.c (kill_inferior_callback): Update. (detach_or_kill_inferior_callback): Update. (print_started_pid): Update. (print_attached_pid): Update. (process_serial_event): Simplify read of ptid. * thread-db.c (thread_db_create_event): Update. (thread_db_get_tls_address): Update. * win32-low.c (current_inferior_ptid): Simplify.
2014-01-22 New gdbserver option --debug-format=timestamp.Doug Evans1-14/+14
* NEWS: Mention it. gdbserver/ * configure.ac (AC_CHECK_FUNCS): Add test for gettimeofday. * configure: Regenerate. * config.in: Regenerate. * Makefile.in (SFILES): Add debug.c. (OBS): Add debug.o. * debug.c: New file. * debug.h: New file. * linux-aarch64-low.c (*): Update all debugging printfs to use debug_printf instead of fprintf. * linux-arm-low.c (*): Ditto. * linux-cris-low.c (*): Ditto. * linux-crisv32-low.c (*): Ditto. * linux-m32r-low.c (*): Ditto. * linux-sparc-low.c (*): Ditto. * linux-x86.c (*): Ditto. * linux-low.c (*): Ditto. (linux_wait_1): Add calls to debug_enter, debug_exit. (linux_wait): Remove redundant debugging printf. (stop_all_lwps): Add calls to debug_enter, debug_exit. (linux_resume, unstop_all_lwps): Ditto. * mem-break.c (*): Update all debugging printfs to use debug_printf instead of fprintf. * remote-utils.c (*): Ditto. * thread-db.c (*): Ditto. * server.c #include <ctype.h>, "gdb_vecs.h". (debug_threads): Moved to debug.c. (*): Update all debugging printfs to use debug_printf instead of fprintf. (start_inferior): Replace call to fflush with call to debug_flush. (monitor_show_help): Mention set debug-format. (parse_debug_format_options): New function. (handle_monitor_command): Handle "monitor set debug-format". (gdbserver_usage): Mention --debug-format. (main): Parse --debug-format. * server.h (debug_threads): Declaration moved to debug.h. #include "debug.h". * tracepoint.c (trace_debug_1) [!IN_PROCESS_AGENT]: Add version of trace_debug_1 that uses debug_printf. (tracepoint_look_up_symbols): Update all debugging printfs to use debug_printf instead of fprintf. doc/ * gdb.texinfo (Server): Mention --debug-format=all|none|timestamp. (gdbserver man): Ditto. testsuite/ * gdb.server/server-mon.exp: Add tests for "set debug-format".
2014-01-01Update Copyright year range in all files maintained by GDB.Joel Brobecker1-1/+1
2013-02-12From: Sanimir Agovic <sanimir.agovic@intel.com>Pedro Alves1-1/+1
null ptr check to prevent gdbserver from crashing Evaluating a thread local storage variable in a remote scenario crashes gdbserver if libthread-db could not be loaded. 2013-02-12 Sanimir Agovic <sanimir.agovic@intel.com> gdbserver/ * thread-db.c (thread_db_get_tls_address): NULL pointer check thread_db. testsuite/ * gdb.server/no-thread-db.exp: New file. * gdb.server/no-thread-db.c: New file. * gdb.server/Makefile.in (EXECUTABLES): Add no-thread-db.
2013-01-01Update years in copyright notice for the GDB files.Joel Brobecker1-1/+1
Two modifications: 1. The addition of 2013 to the copyright year range for every file; 2. The use of a single year range, instead of potentially multiple year ranges, as approved by the FSF.
2012-11-09gdb/gdbserver:Yao Qi1-1/+1
2012-11-09 Yao Qi <yao@codesourcery.com> * spu-low.c (current_ptid): Move it to .. * gdbthread.h: ... here. New. * remote-utils.c (read_ptid): Use macro 'current_ptid'. * server.c (myresume, process_serial_event): Likewise. * thread-db.c (thread_db_find_new_threads): Likewise. * tracepoint.c (run_inferior_command): Likewise.
2012-08-08 * gdb_string.h: Moved to ...Doug Evans1-20/+14
* common/gdb_string.h: ... here. * common/vec.h: Remove #ifndef GDBSERVER conditional inclusion of gdb_string.h and gdb_assert.h. gdbserver/ * configure.ac: Add check for strstr. * config.in: Regenerate. * configure: Regenerate. * linux-thread-db.c: #include "gdb_vecs.h". (try_thread_db_load_from_pdir_1): New arg "subdir". All callers updated. (try_thread_db_load_from_pdir): New arg "subdir". All callers updated. (thread_db_load_search): Use a vector to iterate over path elements. Handle text appearing after "$pdir". gdbserver/ * Makefile.in (SFILES): Add gdb_vecs.c. (OBS): Add gdb_vecs.o. (gdb_vecs_h, host_defs_h): New variables. (thread-db.o): Add $(gdb_vecs_h) dependency. (gdb_vecs.o): New rule. * thread-db.c: #include "gdb_vecs.h". (thread_db_load_search): Use a vector to iterate over path elements. Handle text appearing after "$pdir".
2012-01-04Copyright year update in most files of the GDB Project.Joel Brobecker1-2/+1
gdb/ChangeLog: Copyright year update in most files of the GDB Project.
2011-05-262011-05-26 Yao Qi <yao@codesourcery.com>Yao Qi1-1/+1
gdb/ * gdb_thread_db.h: Delete. Move to ... * common/gdb_thread_db.h: ... here. gdb/gdbserver/ * Makefile.in (thread-db.o): Track dependence to common/gdb_thread_db.h. * thread-db.c: include gdb_thread_db.h from right place.
2011-05-13 Support $pdir and $sdir in libthread-db-search-path.Doug Evans1-31/+67
* NEWS: Mention $sdir,$pdir. * gdb_thread_db.h (LIBTHREAD_DB_SEARCH_PATH): Add $sdir:$pdir. * linux-thread-db.c (try_thread_db_load_from_pdir): New function. (try_thread_db_load_from_sdir): New function. (try_thread_db_load_from_dir): New function. (thread_db_load_search): Handle $pdir, $sdir. Remove trying of system directories if search of libthread-db-search-path fails, that is now done via $sdir. (has_libpthread): New function. (thread_db_load): Remove search for libthread_db in directory of libpthread, that is now done via $pdir. gdbserver/ * thread-db.c (try_thread_db_load_from_sdir): New function. (try_thread_db_load_from_dir): New function. (thread_db_load_search): Handle $sdir, ignore $pdir. Remove trying of system directories if search of libthread-db-search-path fails, that is now done via $sdir. doc/ * gdb.texinfo (Threads): Document $sdir,$pdir. (Server): Document $pdir exception.
2011-05-10 * linux-thread-db.c (set_libthread_db_search_path): New function.Doug Evans1-2/+9
(_initialize_thread_db): Add setter for libthread-db-search-path. gdbserver/ * thread-db.c (thread_db_handle_monitor_command): Handle elided path. doc/ * gdb.texinfo (Threads): If an empty path is provided for libthread-db-search-path it is reset to its default value. (Server): Ditto.
2011-01-062011-01-05 Michael Snyder <msnyder@msnyder-server.eng.vmware.com>Michael Snyder1-1/+2
* gdbreplay.c: Shorten lines of >= 80 columns. * linux-low.c: Ditto. * linux-ppc-low.c: Ditto. * linux-s390-low.c: Ditto. * linux-sparc-low.c: Ditto. * linux-x86-low.c: Ditto. * linux-xtensa-low.c: Ditto. * mem-break.c: Ditto. * nto-low.c: Ditto. * regcache.h: Ditto. * remote-utils.c: Ditto. * server.c: Ditto. * server.h: Ditto. * thread-db.c: Ditto. * tracepoint.c: Ditto. * utils.c: Ditto. * win32-low.h: Ditto.
2011-01-01run copyright.sh for 2011.Joel Brobecker1-1/+1
2010-09-01use xsnprintf instead of snprintf.gdbadmin1-2/+2
snprintf is not available on LynxOS, so I changed the calls to snprintf to calls to xsnprintf, which should be strictly equivalent. gdb/gdbserver/ChangeLog: * utils.c (xsnprintf): Make non-static. * server.h: Add xsnprintf declaration. * linux-low.c, nto-low.c, target.c, thread-db.c, tracepoint.c: replace calls to snprintf by calls to xsnprintf throughout.
2010-05-03 gdb/gdbserver/Pedro Alves1-37/+63
* proc-service.c (ps_pglobal_lookup): Use thread_db_look_up_one_symbol. * remote-utils.c (look_up_one_symbol): Add new `may_ask_gdb' parameter. Use it instead of all_symbols_looked_up. * server.h (struct process_info) <all_symbols_looked_up>: Delete field. (all_symbols_looked_up): Don't declare. (look_up_one_symbol): Add new `may_ask_gdb' parameter. * thread-db.c (struct thread_db) <all_symbols_looked_up>: New field. (thread_db_look_up_symbols): Adjust call to look_up_one_symbol. Set all_symbols_looked_up here. (thread_db_look_up_one_symbol): New. (thread_db_get_tls_address): Adjust. (thread_db_load_search, try_thread_db_load_1): Always allocate the thread_db object on the heap, and tentatively set it in the process structure. (thread_db_init): Don't set all_symbols_looked_up here. * linux-low.h (thread_db_look_up_one_symbol): Declare.
2010-05-02 * linux-low.c (linux_kill_one_lwp): Assume the lwp is stopped.Pedro Alves1-11/+55
(linux_kill): Stop all lwps here. Don't delete the main lwp here. (linux_detach_one_lwp): Assume the lwp is stopped. (any_thread_of): Delete. (linux_detach): Stop all lwps here. Don't blindly delete all breakpoints. (delete_lwp_callback): New. (linux_mourn): Delete all lwps of the process that is gone. (linux_wait_1): Don't delete the last lwp of the process here. * mem-break.h (mark_breakpoints_out): Declare. * mem-break.c (mark_breakpoints_out): New. (free_all_breakpoints): Use it. * server.c (handle_target_event): If the process is gone, mark breakpoints out. * thread-db.c (struct thread_db) <create_bp>: New field. (thread_db_enable_reporting): Fix prototype. Store a thread event breakpoint reference in the thread_db struct. (thread_db_load_search): Clear the thread_db object. (try_thread_db_load_1): Ditto. (switch_to_process): New. (disable_thread_event_reporting): Use it. (remove_thread_event_breakpoints): New. (thread_db_detach, thread_db_mourn): Use it.
2010-04-11 GDBserver disconnected tracing support.Pedro Alves1-16/+38
* linux-low.c (linux_remove_process): Delete. (add_lwp): Don't set last_resume_kind here. (linux_kill): Use `mourn'. (linux_detach): Use `thread_db_detach', and `mourn'. (linux_mourn): New. (linux_attach_lwp_1): Adjust comment. (linux_attach): last_resume_kind moved the thread_info; adjust. (status_pending_p_callback): Adjust. (linux_wait_for_event_1): Adjust. (count_events_callback, select_singlestep_lwp_callback) (select_event_lwp_callback, cancel_breakpoints_callback) (db_wants_lwp_stopped, linux_wait_1, need_step_over_p) (proceed_one_lwp): Adjust. (linux_async): Add debug output. (linux_thread_stopped): New. (linux_pause_all): New. (linux_target_ops): Install linux_mourn, linux_thread_stopped and linux_pause_all. * linux-low.h (struct lwp_info): Delete last_resume_kind field. (thread_db_free): Delete declaration. (thread_db_detach, thread_db_mourn): Declare. * thread-db.c (thread_db_init): Use thread_db_mourn. (thread_db_free): Delete, split in two. (disable_thread_event_reporting): New. (thread_db_detach): New. (thread_db_mourn): New. * server.h (struct thread_info) <last_resume_kind>: New field. <attached>: Add comment. <gdb_detached>: New field. (handler_func): Change return type to int. (handle_serial_event, handle_target_event): Ditto. (gdb_connected): Declare. (tracing): Delete. (disconnected_tracing): Declare. (stop_tracing): Declare. * server.c (handle_query) <qSupported>: Report support for disconnected tracing. (queue_stop_reply_callback): Account for running threads. (gdb_wants_thread_stopped): New. (gdb_wants_all_threads_stopped): New. (gdb_reattached_process): New. (handle_status): Clear the `gdb_detached' flag of all processes. In all-stop, stop all threads. (main): Be sure to leave tfind mode. Handle disconnected tracing. (process_serial_event): If the remote connection breaks, or if an exit was forced with "monitor exit", force an event loop exit. Handle disconnected tracing on detach. (handle_serial_event): Adjust. (handle_target_event): If GDB isn't connected, forward events back to the inferior, unless the last process exited, in which case, exit gdbserver. Adjust interface. * remote-utils.c (remote_open): Don't block in accept. Instead register an event loop source on the listen socket file descriptor. Refactor bits into ... (listen_desc): ... this new global. (gdb_connected): ... this new function. (enable_async_notification): ... this new function. (handle_accept_event): ... this new function. (remote_close): Clear remote_desc. * inferiors.c (add_thread): Set the new thread's last_resume_kind. * target.h (struct target_ops) <mourn, thread_stopped, pause_all>: New fields. (mourn_inferior): Define. (target_process_qsupported): Avoid the dangling else problem. (thread_stopped): Define. (pause_all): Define. (target_waitstatus_to_string): Declare. * target.c (target_waitstatus_to_string): New. * tracepoint.c (tracing): Make extern. (disconnected_tracing): New. (stop_tracing): Make extern. Handle tracing stops due to GDB disconnecting. (cmd_qtdisconnected): New. (cmd_qtstatus): Report disconnected tracing status in trace reply. (handle_tracepoint_general_set): Handle QTDisconnected. * event-loop.c (event_handler_func): Change return type to int. (process_event): Bail out if the event handler wants the event loop to stop. (handle_file_event): Ditto. (start_event_loop): Bail out if the event handler wants the event loop to stop. * nto-low.c (nto_target_ops): Adjust. * spu-low.c (spu_wait): Don't remove the process here. (spu_target_ops): Adjust. * win32-low.c (win32_wait): Don't remove the process here. (win32_target_ops): Adjust.
2010-01-01Update copyright year in most headers.Joel Brobecker1-1/+1
Automatic update by copyright.sh.
2009-12-28 * linux-low.c (linux_remove_process): Remove `detaching'Pedro Alves1-0/+20
parameter. Don't release/detach from thread_db here. (linux_kill): Release/detach from thread_db here, ... (linux_detach): ... and here, before actually detaching. (linux_wait_1): ... and here, when a process exits. * thread-db.c (any_thread_of): New. (thread_db_free): Switch the current inferior to a thread of the passed in process.
2009-12-21 * configure.ac: Check for dladdr.Doug Evans1-0/+6
* config.in: Regenerate. * configure: Regenerate. * thread-db.c (dladdr_to_soname): Only define ifdef HAVE_DLADDR. (try_thread_db_load): Update.
2009-12-19 gdb/Doug Evans1-2/+2
* gdb_proc_service.h (psaddr_t): Fix type. * linux-thread-db.c (thread_db_info.td_thr_tls_get_addr_p): Fix signature to match glibc. (thread_db_get_thread_local_address): Use psaddr_t for type of address to match parameter of td_thr_tls_get_addr_p. Cast through psaddr_t instead of (void*) to match parameter of td_thr_tls_get_addr_p. gdbserver/ * gdb_proc_service.h (psaddr_t): Fix type. * thread-db.c (thread_db_info.td_thr_tls_get_addr_p): Fix signature to match glibc.
2009-11-16 * linux-low.c (linux_remove_process): Add `detaching' parameter.Pedro Alves1-13/+13
Pass it to thread_db_free. (linux_kill, linux_detach, linux_wait_1): Adjust to pass the proper `detaching' argument to linux_remove_process. * linux-low.h (thread_db_free): Add `detaching' parameter. * thread-db.c (thread_db_init): Pass false as `detaching' argument to thread_db_free. (thread_db_free): Add `detaching' parameter. Only call td_ta_clear_event if detaching from process.
2009-11-12 * thread-db.c (thread_db_free): Fix typo.Maxim Kuvyrkov1-1/+1
2009-11-12gdb/ChangeLog:Paul Pluzhnikov1-0/+17
2009-11-11 Paul Pluzhnikov <ppluzhnikov@google.com> PR gdb/10838 * linux-thread-db.c (thread_db_info): New member. (disable_thread_event_reporting): Call td_ta_clear_event. gdbserver/ChangeLog: 2009-11-11 Paul Pluzhnikov <ppluzhnikov@google.com> PR gdb/10838 * thread-db.c (thread_db_free): Call td_ta_clear_event.
2009-10-292009-10-29 Paul Pluzhnikov <ppluzhnikov@google.com>Paul Pluzhnikov1-0/+57
* configure.ac: New --with-libthread-db option. * thread-db.c: Allow direct dependence on libthread_db. (thread_db_free): Adjust. * config.in: Regenerate. * configure: Likewise.
2009-10-282009-10-28 Paul Pluzhnikov <ppluzhnikov@google.com>Paul Pluzhnikov1-14/+63
PR gdb/10757 * thread-db.c (attach_thread): New function. (maybe_attach_thread): Return success/failure. (find_new_threads_callback): Adjust. (thread_db_find_new_threads): Loop until no new threads.
2009-10-09doc/Paul Pluzhnikov1-78/+317
2009-10-08 Paul Pluzhnikov <ppluzhnikov@google.com> * gdb.texinfo (Server): Document libthread-db-search-path. gdbserver/ 2009-10-08 Paul Pluzhnikov <ppluzhnikov@google.com> * acinclude.m4: (SRV_CHECK_THREAD_DB, SRV_CHECK_TLS_GET_ADDR): Remove. * configure.ac: Adjust. * linux-low.h (struct process_info_private): Move members to struct thread_db. (thread_db_free, thread_db_handle_monitor_command): New prototype. * linux-low.c (linux_remove_process): Adjust. (linux_wait_for_event_1, linux_look_up_symbols): Likewise. * server.c (handle_query): Move code ... (handle_monitor_command): ... here. New function. * target.h (struct target_ops): New member. * thread-db.c (struct thread_db): New. (libthread_db_search_path): New variable. (thread_db_create_event, thread_db_enable_reporting) (find_one_thread, maybe_attach_thread, find_new_threads_callback) (thread_db_find_new_threads, (thread_db_get_tls_address): Adjust. (try_thread_db_load_1, dladdr_to_soname): New functions. (try_thread_db_load, thread_db_load_search): New functions. (thread_db_init): Search for libthread_db. (thread_db_free): New function. (thread_db_handle_monitor_command): Likewise. * config.in: Regenerate. * configure: Regenerate.
2009-04-03 * inferiors.c (get_thread_process): Make global.Ulrich Weigand1-1/+6
* server.h (get_thread_process): Add prototype. * thread-db.c (find_one_thread): Use get_thread_process instead of current_process. (thread_db_get_tls_address): Do not crash if called when thread layer is not yet initialized.
2009-04-012009-04-01 Pedro Alves <pedro@codesourcery.com>Pedro Alves1-36/+33
Implement the multiprocess extensions, and add linux multiprocess support. * server.h (ULONGEST): Declare. (struct ptid, ptid_t): New. (minus_one_ptid, null_ptid): Declare. (ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp) (ptid_get_tid, ptid_equal, ptid_is_pid): Declare. (struct inferior_list_entry): Change `id' type from unsigned from to ptid_t. (struct sym_cache, struct breakpoint, struct process_info_private): Forward declare. (struct process_info): Declare. (current_process): Declare. (all_processes): Declare. (initialize_inferiors): Declare. (add_thread): Adjust to use ptid_t. (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): Ditto. (add_process, remove_process, find_thread_pid): Declare. (find_inferior_id): Adjust to use ptid_t. (cont_thread, general_thread, step_thread): Change type to ptid_t. (multi_process): Declare. (push_event): Adjust to use ptid_t. (read_ptid, write_ptid): Declare. (prepare_resume_reply): Adjust to use ptid_t. (clear_symbol_cache): Declare. * inferiors.c (all_processes): New. (null_ptid, minus_one_ptid): New. (ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp) (ptid_get_tid, ptid_equal, ptid_is_pid): New. (add_thread): Change unsigned long to ptid. Remove gdb_id parameter. Adjust. (thread_id_to_gdb_id, thread_to_gdb_id): Change unsigned long to ptid. (gdb_id_to_thread): Rename to ... (find_thread_pid): ... this. Change unsigned long to ptid. (gdb_id_to_thread_id, find_inferior_id): Change unsigned long to ptid. (loaded_dll, pull_pid_from_list): Adjust. (add_process, remove_process, find_process_pid) (get_thread_process, current_process, initialize_inferiors): New. * target.h (struct thread_resume) <thread>: Change type to ptid_t. (struct target_waitstatus) <related_pid>: Ditto. (struct target_ops) <kill, detach>: Add `pid' argument. Change return type to int. (struct target_ops) <join>: Add `pid' argument. (struct target_ops) <thread_alive>: Change pid's type to ptid_t. (struct target_ops) <wait>: Add `ptid' field. Change return type to ptid. (kill_inferior, detach_inferior, join_inferior): Add `pid' argument. (mywait): Add `ptid' argument. Change return type to ptid_t. (target_pid_to_str): Declare. * target.c (set_desired_inferior): Adjust to use ptids. (mywait): Add new `ptid' argument. Adjust. (target_pid_to_str): New. * mem-break.h (free_all_breakpoints): Declare. * mem-break.c (breakpoints): Delelete. (set_breakpoint_at, delete_breakpoint, find_breakpoint_at) (check_mem_read, check_mem_write, delete_all_breakpoints): Adjust to use per-process breakpoint list. (free_all_breakpoints): New. * remote-utils.c (struct sym_cache) <name>: Drop `const'. (symbol_cache, all_symbols_looked_up): Delete. (hexchars): New. (ishex, unpack_varlen_hex, write_ptid, hex_or_minus_one, read_ptid): New. (prepare_resume_reply): Change ptid argument's type from unsigned long to ptid_t. Adjust. Implement W;process and X;process. (free_sym_cache, clear_symbol_cache): New. (look_up_one_symbol): Adjust to per-process symbol cache. * * server.c (cont_thread, general_thread, step_thread): Change type to ptid_t. (attached): Delete. (multi_process): New. (last_ptid): Change type to ptid_t. (struct vstop_notif) <ptid>: Change type to ptid_t. (queue_stop_reply, push_event): Change `ptid' argument's type to ptid_t. (discard_queued_stop_replies): Add `pid' argument. (start_inferior): Adjust to use ptids. Adjust to mywait interface changes. Don't reference the `attached' global. (attach_inferior): Adjust to mywait interface changes. (handle_query): Adjust to use ptids. Parse GDB's qSupported features. Handle and report "multiprocess+". Handle "qAttached:PID". (handle_v_cont): Adjust to use ptids. Adjust to mywait interface changes. (handle_v_kill): New. (handle_v_stopped): Adjust to use target_pid_to_str. (handle_v_requests): Allow multiple attaches and runs when multiprocess extensions are in effect. Handle "vKill". (myresume): Adjust to use ptids. (queue_stop_reply_callback): Add `arg' parameter. Handle it. (handle_status): Adjust to discard_queued_stop_replies interface change. (first_thread_of, kill_inferior_callback) (detach_or_kill_inferior_callback, join_inferiors_callback): New. (main): Call initialize_inferiors. Adjust to use ptids, killing and detaching from all inferiors. Handle multiprocess packet variants. * linux-low.h: Include gdb_proc_service.h. (struct process_info_private): New. (struct linux_target_ops) <pid_of>: Use ptid_get_pid. <lwpid_of>: Use ptid_get_lwp. (get_lwp_thread): Adjust. (struct lwp_info): Add `dead' member. (find_lwp_pid): Declare. * linux-low.c (thread_db_active): Delete. (new_inferior): Adjust comment. (inferior_pid): Delete. (linux_add_process): New. (handle_extended_wait): Adjust. (add_lwp): Change unsigned long to ptid. (linux_create_inferior): Add process to processes table. Adjust to use ptids. Don't set new_inferior here. (linux_attach_lwp): Rename to ... (linux_attach_lwp_1): ... this. Add `initial' argument. Handle it. Adjust to use ptids. (linux_attach_lwp): New. (linux_attach): Add process to processes table. Don't set new_inferior here. (struct counter): New. (second_thread_of_pid_p, last_thread_of_process_p): New. (linux_kill_one_lwp): Add `args' parameter. Handle it. Adjust to multiple processes. (linux_kill): Add `pid' argument. Handle it. Adjust to multiple processes. Remove process from process table. (linux_detach_one_lwp): Add `args' parameter. Handle it. Adjust to multiple processes. (any_thread_of): New. (linux_detach): Add `pid' argument, and handle it. Remove process from processes table. (linux_join): Add `pid' argument. Handle it. (linux_thread_alive): Change unsighed long argument to ptid_t. Consider dead lwps as not being alive. (status_pending_p): Rename `dummy' argument to `arg'. Filter out threads we're not interested in. (same_lwp, find_lwp_pid): New. (linux_wait_for_lwp): Change `pid' argument's type from int to ptid_t. Adjust. (linux_wait_for_event): Rename to ... (linux_wait_for_event_1): ... this. Change `pid' argument's type from int to ptid_t. Adjust. (linux_wait_for_event): New. (linux_wait_1): Add `ptid' argument. Change return type to ptid_t. Adjust. Use last_thread_of_process_p. Remove processes that exit from the process table. (linux_wait): Add `ptid' argument. Change return type to ptid_t. Adjust. (mark_lwp_dead): New. (wait_for_sigstop): Adjust to use ptids. If a process exits while stopping all threads, mark its main lwp as dead. (linux_set_resume_request, linux_resume_one_thread): Adjust to use ptids. (fetch_register, usr_store_inferior_registers) (regsets_fetch_inferior_registers) (regsets_store_inferior_registers, linux_read_memory) (linux_write_memory): Inline `inferior_pid'. (linux_look_up_symbols): Adjust to use per-process `thread_db_active'. (linux_request_interrupt): Adjust to use ptids. (linux_read_auxv): Inline `inferior_pid'. (initialize_low): Don't reference thread_db_active. * gdb_proc_service.h (struct ps_prochandle) <pid>: Remove. * proc-service.c (ps_lgetregs): Use find_lwp_pid. (ps_getpid): Return the pid of the current inferior. * thread-db.c (proc_handle, thread_agent): Delete. (thread_db_create_event, thread_db_enable_reporting): Adjust to per-process data. (find_one_thread): Change argument type to ptid_t. Adjust to per-process data. (maybe_attach_thread): Adjust to per-process data and ptids. (thread_db_find_new_threads): Ditto. (thread_db_init): Ditto. * spu-low.c (spu_create_inferior, spu_attach): Add process to processes table. Adjust to use ptids. (spu_kill, spu_detach): Adjust interface. Remove process from processes table. (spu_join, spu_thread_alive): Adjust interface. (spu_wait): Adjust interface. Remove process from processes table. Adjust to use ptids. * win32-low.c (current_inferior_tid): Delete. (current_inferior_ptid): New. (debug_event_ptid): New. (thread_rec): Take a ptid. Adjust. (child_add_thread): Add `pid' argument. Adjust to use ptids. (child_delete_thread): Ditto. (do_initial_child_stuff): Add `attached' argument. Add process to processes table. (child_fetch_inferior_registers, child_store_inferior_registers): Adjust. (win32_create_inferior): Pass 0 to do_initial_child_stuff. (win32_attach): Pass 1 to do_initial_child_stuff. (win32_kill): Adjust interface. Remove process from processes table. (win32_detach): Ditto. (win32_join): Adjust interface. (win32_thread_alive): Take a ptid. (win32_resume): Adjust to use ptids. (get_child_debug_event): Ditto. (win32_wait): Adjust interface. Remove exiting process from processes table.
2009-04-01 Non-stop mode support.Pedro Alves1-5/+5
* server.h (non_stop): Declare. (gdb_client_data, handler_func): Declare. (delete_file_handler, add_file_handler, start_event_loop): Declare. (handle_serial_event, handle_target_event, push_event) (putpkt_notif): Declare. * target.h (enum resume_kind): New. (struct thread_resume): Replace `step' field by `kind' field. (TARGET_WNOHANG): Define. (struct target_ops) <wait>: Add `options' argument. <supports_non_stop, async, start_non_stop>: New fields. (target_supports_non_stop, target_async): New. (start_non_stop): Declare. (mywait): Add `options' argument. * target.c (mywait): Add `options' argument. Print child exit notifications here. (start_non_stop): New. * server.c (non_stop, own_buf, mem_buf): New globals. (struct vstop_notif): New. (notif_queue): New global. (queue_stop_reply, push_event, discard_queued_stop_replies) (send_next_stop_reply): New. (start_inferior): Adjust to use resume_kind. Adjust to mywait interface changes. (attach_inferior): In non-stop mode, don't wait for the target here. (handle_general_set): Handle QNonStop. (handle_query): When handling qC, return the current general thread, instead of the first thread of the list. (handle_query): If the backend supports non-stop mode, include QNonStop+ in the qSupported query response. (handle_v_cont): Adjust to use resume_kind. Handle resume_stop and non-stop mode. (handle_v_attach, handle_v_run): Handle non-stop mode. (handle_v_stopped): New. (handle_v_requests): Report support for vCont;t. Handle vStopped. (myresume): Adjust to use resume_kind. Handle non-stop. (queue_stop_reply_callback): New. (handle_status): Handle non-stop mode. (main): Clear non_stop flag on reconnection. Use the event-loop. Refactor serial protocol handling from here ... (process_serial_event): ... to this new function. When GDB selects any thread, select one here. In non-stop mode, wait until GDB acks all pending events before exiting. (handle_serial_event, handle_target_event): New. * remote-utils.c (remote_open): Install remote_desc in the event loop. (remote_close): Remove remote_desc from the event loop. (putpkt_binary): Rename to... (putpkt_binary_1): ... this. Add `is_notic' argument. Handle it. (putpkt_binary): New as wrapper around putpkt_binary_1. (putpkt_notif): New. (prepare_resume_reply): In non-stop mode, don't change the general_thread. * event-loop.c: New. * Makefile.in (OBJ): Add event-loop.o. (event-loop.o): New rule. * linux-low.h (pid_of): Moved here. (lwpid_of): New. (get_lwp_thread): Use lwpid_of. (struct lwp_info): Delete `lwpid' field. Add `suspended' field. * linux-low.c (pid_of): Delete. (inferior_pid): Use lwpid_of. (linux_event_pipe): New. (target_is_async_p): New. (delete_lwp): New. (handle_extended_wait): Use lwpid_of. (add_lwp): Don't set lwpid field. (linux_attach_lwp): Adjust debug output. Use lwpid_of. (linux_kill_one_lwp): If killing a running lwp, stop it first. Use lwpid_of. Adjust to linux_wait_for_event interface changes. (linux_detach_one_lwp): If detaching from a running lwp, stop it first. Adjust to linux_wait_for_event interface changes. Use lwpid_of. (linux_detach): Don't delete the main lwp here. (linux_join): Use my_waitpid. Avoid signal_pid. Use lwpid_of. (status_pending_p): Don't consider explicitly suspended lwps. (linux_wait_for_lwp): Take an integer pid instead of a lwp_info pointer. Add OPTIONS argument. Change return type to int. Use my_waitpid instead of sleeping. Handle WNOHANG. Use lwpid_of. (linux_wait_for_event): Take an integer pid instead of a lwp_info pointer. Add status pointer argument. Return a pid instead of a status. Use lwpid_of. Adjust to linux_wait_for_lwp interface changes. In non-stop mode, don't switch to a random thread. (linux_wait): Rename to... (linux_wait_1): ... this. Add target_options argument, and handle it. Adjust to use resume_kind. Use lwpid_of. In non-stop mode, don't handle the continue thread. Handle TARGET_WNOHANG. Merge clean exit and signal exit code. Don't stop all threads in non-stop mode. In all-stop mode, only stop all threads when reporting a stop to GDB. Handle explicit thread stop requests. (async_file_flush, async_file_mark): New. (linux_wait): New. (send_sigstop): Use lwpid_of. (wait_for_sigstop): Use lwpid_of. Adjust to linux_wait_for_event interface changes. In non-stop mode, don't switch to a random thread. (linux_resume_one_lwp): Use lwpid_of. (linux_continue_one_thread, linux_queue_one_thread): Merge into ... (linux_resume_one_thread): ... this. Handle resume_stop. In non-stop mode, don't look for pending flag in all threads. (resume_status_pending_p): Don't consider explicitly suspended threads. (my_waitpid): Reimplement. Emulate __WALL. (linux_request_interrupt, linux_read_offsets, linux_xfer_siginfo): Use lwpid_of. (sigchld_handler, linux_supports_non_stop, linux_async) (linux_start_non_stop): New. (linux_target_ops): Register linux_supports_non_stop, linux_async and linux_start_non_stop. (initialize_low): Install SIGCHLD handler. * thread-db.c (thread_db_create_event, find_one_thread) (thread_db_get_tls_address): Use lwpid_of. * win32-low.c (win32_detach): Adjust to use resume_kind. (win32_wait): Add `options' argument. * spu-low.c (spu_resume): Adjust to use resume_kind. (spu_wait): Add `options' argument.
2009-03-22 * i387-fp.c, linux-arm-low.c, linux-cris-low.c,Pedro Alves1-1/+1
linux-crisv32-low.c, linux-i386-low.c, linux-low.c, linux-mips-low.c, linux-s390-low.c, linux-sparc-low.c, linux-x86-64-low.c, linux-xtensa-low.c, proc-service.c, regcache.c, remote-utils.c, server.c, spu-low.c, target.h, thread-db.c, win32-low.c, xtensa-xtregs.c, gdbreplay.c, Makefile.in, configure.ac: Fix whitespace throughout. * configure: Regenerate.
2009-03-17 Rename "process" to "lwp" throughout.Pedro Alves1-22/+22
* linux-low.c (all_processes): Rename to... (all_lwps): ... this. (inferior_pid, handle_extended_wait, get_stop_pc): Adjust. (add_process): Rename to ... (add_lwp): ... this. Adjust. (linux_create_inferior): Adjust. (linux_attach_lwp): Adjust. (linux_attach): Adjust. (linux_kill_one_process): Rename to ... (linux_kill_one_lwp): ... this. Adjust. (linux_kill): Adjust. (linux_detach_one_process): Rename to ... (linux_detach_one_lwp): ... this. Adjust. (linux_detach): Adjust. (check_removed_breakpoint): Adjust. (status_pending_p): Adjust. (linux_wait_for_process): Rename to ... (linux_wait_for_lwp): ... this. Adjust. (linux_wait_for_event): Adjust. (send_sigstop): Adjust. (wait_for_sigstop): Adjust. (stop_all_processes): Rename to ... (stop_all_lwps): ... this. (linux_resume_one_process): Rename to ... (linux_resume_one_lwp): ... this. Adjust. (linux_set_resume_request, linux_continue_one_thread) (linux_queue_one_thread, resume_status_pending_p) (usr_store_inferior_registers, regsets_store_inferior_registers) (linux_request_interrupt, linux_read_offsets, linux_xfer_siginfo): Adjust. * linux-low.h (get_process): Rename to ... (get_lwp): ... this. Adjust. (get_thread_process): Rename to ... (get_thread_lwp): ... this. Adjust. (get_process_thread): Rename to ... (get_lwp_thread): ... this. Adjust. (struct process_info): Rename to ... (struct lwp_info): ... this. (all_processes): Rename to ... (all_lwps): ... this. * proc-service.c (ps_lgetregs): Adjust. * thread-db.c (thread_db_create_event, find_one_thread) (maybe_attach_thread, thread_db_get_tls_address): Adjust.
2009-01-15 * target.h (target_signal_to_string): Make return type const char *.Doug Evans1-1/+1
(target_signal_to_name): Ditto. (target_signal_from_name): Make arg const char *. * thread-db.c (thread_db_err_str): Make return type const char *. * utils.c (perror_with_name): Make arg const char *. * infrun.c (sig_print_info): Update. * signals/signals.c (signals): Make array and struct members const. (target_signal_to_string): Make return type const char *. (target_signal_to_name): Ditto. (target_signal_from_name): Make arg const char *. * gdbserver/gdbreplay.c (perror_with_name): Make arg const char *. * gdbserver/server.h (target_signal_to_name): Make return type const char *.
2009-01-03 Updated copyright notices for most files.Joel Brobecker1-1/+1
2008-12-09 * linux-low.h (struct process_info): Delete member tid, unused.Doug Evans1-2/+0
* thread-db.c (find_one_thread): Update. (maybe_attach_thread): Update.
2008-01-01 Updated copyright notices for most files.Daniel Jacobowitz1-1/+2
2007-12-18 * linux-low.c (linux_wait_for_event): Update messages. Do notDaniel Jacobowitz1-2/+6
reinsert auto-delete breakpoints. * mem-break.c (struct breakpoint): Change return type of handler to int. (set_breakpoint_at): Update handler type. (reinsert_breakpoint_handler): Return 1 instead of calling delete_breakpoint. (reinsert_breakpoint_by_bp): Check for the original breakpoint before setting a new one. (check_breakpoints): Delete auto-delete breakpoints and return 2. * mem-break.h (set_breakpoint_at): Update handler type. * thread-db.c (thread_db_create_event, thread_db_create_event): Update. * win32-low.c (auto_delete_breakpoint): New. (get_child_debug_event): Use it.
2007-10-23 * inferiors.c (change_inferior_id): Delete.Daniel Jacobowitz1-40/+40
(add_pid_to_list, pull_pid_from_list): New. * linux-low.c (PTRACE_SETOPTIONS, PTRACE_GETEVENTMSG) (PTRACE_O_TRACESYSGOOD, PTRACE_O_TRACEFORK, PTRACE_O_TRACEVFORK) (PTRACE_O_TRACECLONE, PTRACE_O_TRACEEXEC, PTRACE_O_TRACEVFORKDONE) (PTRACE_O_TRACEEXIT, PTRACE_EVENT_FORK, PTRACE_EVENT_VFORK) (PTRACE_EVENT_CLONE, PTRACE_EVENT_EXEC, PTRACE_EVENT_VFORK_DONE) (PTRACE_EVENT_EXIT, __WALL): Provide default definitions. (stopped_pids, thread_db_active, must_set_ptrace_flags): New variables. (using_threads): Always set to 1. (handle_extended_wait): New. (add_process): Do not set TID. (linux_create_inferior): Set must_set_ptrace_flags. (linux_attach_lwp): Remove TID argument. Do not check using_threads. Use PTRACE_SETOPTIONS. Call new_thread_notify. Update all callers. (linux_thread_alive): Rename TID argument to LWPID. (linux_wait_for_process): Handle unknown processes. Do not use TID. (linux_wait_for_event): Do not use TID or check using_threads. Update call to dead_thread_notify. Call handle_extended_wait. (linux_create_inferior): Use PTRACE_SETOPTIONS. (send_sigstop): Delete sigstop_sent. (wait_for_sigstop): Avoid TID. (linux_supports_tracefork_flag, linux_tracefork_child, my_waitpid) (linux_test_for_tracefork): New. (linux_lookup_signals): Use thread_db_active and linux_supports_tracefork_flag. (initialize_low): Use thread_db_active and linux_test_for_tracefork. * linux-low.h (get_process_thread): Avoid TID. (struct process_ifo): Move thread_known and tid to the end. Remove sigstop_sent. (linux_attach_lwp, thread_db_init): Update prototypes. * server.h (change_inferior_id): Delete prototype. (add_pid_to_list, pull_pid_from_list): New prototypes. * thread-db.c (thread_db_use_events): New. (find_first_thread): Rename to... (find_one_thread): ...this. Update callers and messages. Do not call fatal. Check thread_db_use_events. Do not call change_inferior_id or new_thread_notify. (maybe_attach_thread): Update. Do not call new_thread_notify. (thread_db_init): Set thread_db_use_events. Check use_events. * utils.c (fatal, warning): Correct message prefix.
2007-08-23 Switch the license of all .c files to GPLv3.Joel Brobecker1-4/+2
Switch the license of all .h files to GPLv3. Switch the license of all .cc files to GPLv3.
2007-07-02 * inferiors.c (change_inferior_id): Add comment.Daniel Jacobowitz1-40/+70
* linux-low.c (check_removed_breakpoint): Add an early prototype. Improve debug output. (linux_attach): Doc update. (linux_detach_one_process, linux_detach): Clean up before releasing each process. (send_sigstop, wait_for_sigstop): Improve comments and debug output. * linux-low.h (struct process_info): Doc improvement. * mem-break.c (delete_all_breakpoints): New. * mem-break.h (delete_all_breakpoints): New prototype. * thread-db.c (find_first_thread): New. (thread_db_create_event): Call it instead of thread_db_find_new_threads. Clean up unused variables. (maybe_attach_thread): Remove first thread handling. (thread_db_find_new_threads): Use find_first_thread. (thread_db_get_tls_address): Likewise.
2007-06-27 * linux-thread-db.c (thread_db_attach): Delete.Daniel Jacobowitz1-0/+29
(thread_db_detach): Typo fix. Call target_mourn_inferior instead of fixing up proc_handle. (have_threads_callback, have_threads): New functions. (thread_db_wait): Remove dead proc_handle.pid check. Only translate PTIDs if we have registered threads. Check for new threads if we have none. (thread_db_create_inferior, thread_db_post_startup_inferior): Delete. (find_new_threads_callback): Only enable event reporting if TID == 0. (same_ptid_callback): New. (thread_db_get_thread_local_address): Check for new threads. (init_thread_db_ops): Don't set to_attach, to_create_inferior, or to_post_startup_inferior. * thread-db.c (thread_db_find_new_threads): Add prototype. (thread_db_create_event): Check for the main thread before adding a new thread. (maybe_attach_thread): Only enable event reporting if TID == 0. (thread_db_get_tls_address): Check for new threads.
2007-01-09Copyright updates for 2007.Daniel Jacobowitz1-2/+1
2006-11-28gdb/gdbserver/Daniel Jacobowitz1-3/+8
* Makefile.in (clean): Remove reg-mips64.c. (reg-mips64.c, reg-mips64.o): New rules. * configure.srv: Handle mips64. Include regset support for mips. * linux-mips-low.c (union mips_register): New. (mips_get_pc, mips_set_pc, mips_reinsert_addr): Use it. (mips_breakpoint, mips_breakpoint_at): Use int. (mips_collect_register, mips_supply_register) (mips_collect_register_32bit, mips_supply_register_32bit) (mips_fill_gregset, mips_store_gregset, mips_fill_fpregset) (mips_store_fpregset, target_regsets): New. * thread-db.c (thread_db_get_tls_address): Use uintptr_t. gdb/ * regformats/reg-mips64.dat: New file.
2006-10-17 * acinclude.m4 (SRV_CHECK_TLS_GET_ADDR): New.Daniel Jacobowitz1-0/+28
* configure.ac: Use it. Define HAVE_TD_THR_TLS_GET_ADDR. * config.in, configure: Regenerated. * inferiors.c (gdb_id_to_thread): New function. (gdb_id_to_thread_id): Use it. * linux-low.c (linux_target_ops): Use thread_db_get_tls_address. * linux-low.h (struct process_info): Add th member. (thread_db_get_tls_address): New prototype. * remote-utils.c (decode_address): Make non-static. * server.c (handle_query): Handle qGetTLSAddr. * server.h (gdb_id_to_thread, decode_address): New prototypes. * target.h (struct target_ops): Add get_tls_address. * thread-db.c (maybe_attach_thread): Save the thread handle. (thread_db_get_tls_address): New.
2006-05-30 * remote-utils.c (all_symbols_looked_up): New variable.Daniel Jacobowitz1-0/+4
(look_up_one_symbol): Check it. * server.h (look_up_one_symbol): New declaration. * thread-db.c (thread_db_init): Set all_symbols_looked_up.