aboutsummaryrefslogtreecommitdiff
path: root/gdb/thread.c
AgeCommit message (Collapse)AuthorFilesLines
1999-01-13 * thread.c: cull duplicate prototypes. Move prototypes to top.Michael Snyder1-55/+32
* serial.c: indentation cleanup. * breakpoint.c: add casts to eliminate compiler warnings.
1999-01-06 * remote.c (record_curthread): Must not modify inferior_pid whenMichael Snyder1-2/+2
called from wait_for_inferior. Instead, if a new thread-id is detected, call add_thread. (MAGIC_NULL_PID): new macro, use instead of the magic number "42000". (remote_find_new_threads): if inferior_pid is unknown, get and use the current thread id. (remote_start_remote): on connecting, attempt to get the current thread id for inferior_pid. (remote_resume): If pid == -1, then resume any-thread (not the current thread specifically). * thread.c (info_threads_command): don't initialize current_pid until after call to FIND_NEW_THREADS (which may change inferior_pid).
1999-01-05Cosmetic and indentation fixes.Michael Snyder1-23/+26
1998-12-31all remaining *.c *.h files from hp merge.David Taylor1-12/+116
1998-11-13 * remote.c (remote_get_threadinfo) : Support for remoteJohn Metzler1-6/+88
multithread debugging. (remote_get_threadlist) : get a partial list of threads (remote_threadlist_iterator) : Step through all the threads (init_remote_threadtests) : Optional builtin unit test commands. * thread.c (bind_target_thread_vector) : Implementa a more dynamic way of accessing target specific thread info functions than FIND_NEW_THREADS. (target_thread_info) : Function to get extended thread information. * gdbthread.h : Export internal data structures corresponding to external detailed thread info response. This is more like a 'ps' command than what might be expected of host based threads. This is for embedded systems.
1998-10-141998-10-14 Jason Molenda (jsm@bugshack.cygnus.com)Jason Molenda1-18/+15
* defs.h: Move _initialize_printcmd, _initialize_stack, _initialize_blockframe out of here and in to their respective .c files. * blockframe.c: Move _initialize_blockframe prototype to here. * printcmd.c: Move _initialize_printcmd prototype to here. * stack.c: Move _initialize_stack prototype to here. * source.c, symtab.h: Move _initialize_source prototype to the .c file. * values.c, value.h: Move _initialize_values prototype to the .c file. * gdbthread.h, thread.c: Move _initialize_thread prototype to the .c file. * breakpoint.c, breakpoint.h: Move _initialize_breakpoint prototype to the .c file. * abug-rom.c alpha-nat.c alpha-tdep.c annotate.c ax-gdb.c bcache.c: Standardize comments for the prototype section of these files. * configure.in: Look in libc for wctype before looking for it in libc. The last one is to fix the GNU ld (~2.9.1) + Solaris 2.6 interaction problem where an empty stub library (libw) causes a core dump when we call vasprintf (e.g. `info br') in the final linked gdb.
1998-10-141998-10-13 Jason Molenda (jsm@bugshack.cygnus.com)Jason Molenda1-2/+4
* blockframe.c (find_pc_sect_partial_function): Add braces to avoid possible nested-if confusion. * breakpoint.c (breakpoint_here_p): Ditto. (breakpoint_inserted_here_p): Ditto. (breakpoint_thread_match): Ditto. * gnu-regex.c: Define _REGEX_RE_COMP only if it isn't already defined. * gnu-regex.h: Define _REGEX_RE_COMP to pick up old compatability prototypes. * symtab.h: Add prototype for _initialize_source. * value.h: Add prototype for _initialize_value. * defs.h: Include sys/types.h or stddef.h to get size_t. (make_cleanup): Add make_cleanup_func typedef and switch to using a prototype for this function. (mfree): Add prototypes for mmalloc, mrealloc, mfree if we aren't using mmalloc. * ax-gdb.c breakpoint.c coffread.c corelow.c dbxread.c dwarf2read.c dwarfread.c elfread.c eval.c exec.c gdbtk-cmds.c gdbtk.c infcmd.c infrun.c mipsread.c nlmread.c os9kread.c parse.c printcmd.c symfile.c symmisc.c symtab.c thread.c top.c tracepoint.c typeprint.c valops.c: Cast parameters passed to make_cleanup to use the new make_cleanup_func typedef. More warning cleanups. There are still a bunch of places where the first argument to make_cleanup is not cast to (make_cleanup_func); these are either due to the function fitting the make_cleanup_func specification already (e.g. free()) or they are in files that weren't compiled when I did my make on a Linux native system. Bwahahaha. You can see them like this: grep make_cleanup\ * | grep -v make_cleanup_func I'll surely go back and clean up the remaining suspicious calls in GDB one of these days. :-)
1998-10-061998-10-06 Jason Molenda (jsm@bugshack.cygnus.com)Jason Molenda1-1/+4
Eliminate a few warnings from the compiler. * breakpoint.h: Add prototype. * breakpoint.c (do_enable_breakpoint): cast mem_cnt, i to (void). * configure.in: Check if strdup declaration is necessary. * configure: Regenerated. * defs.h: Add prototypes. * gdb_string.h: Only define strdup if necessary. * gdbthread.h: Add prototypes. * printcmd.c: Add prototyptes. (disassemble_command): Remove unused variable 'section'. * symtab.c: Add prototypes. * symtab.h: Include gnu-regex.h, add prototype. * thread.c: Add prototype.
1998-08-30Sun Aug 30 00:49:18 1998 Martin M. Hunt <hunt@cygnus.com>Martin Hunt1-1/+2
* gdbtk-cmds.c (Gdbtk_Init): Link C variable gdb_context with tcl variable gdb_context_id. * gdbtk-hooks.c (gdbtk_context_change): Implement new hook called context_hook. Called when threads change. * gdbtk.c: Initialize gdb_context. * gdbtk.h: Declare gdb_context. * infrun (wait_for_inferior): Call context_hook. * thread.c (thread_command): Call context_hook. * defs.h: Declare context_hook.
1997-10-24fix for PR 13618 -- gdb incorrectly reports thread information.David Taylor1-0/+4
If other systems besides nm-sun4sol2 exhibit the problem, they may need definitions of FIND_NEW_THREADS and a corresponding support function.
1997-05-21Wed May 21 16:03:25 1997 Michael Snyder <msnyder@cleaver.cygnus.com>Michael Snyder1-1/+29
* procfs.c (init_procinfo): new function, abstracts some code shared by create_procinfo and do_attach; (procfs_set_inferior_syscall_traps): new function, abstracts some code needed by procfs_init_inferior, do_attach, and procfs_lwp_creation_handler; (procfs_first_available): new function, find any LWP that's runnable; (procfs_thread_alive): replace stub function with real implementation; (procfs_lwp_creation_handler): fix bug starting new child threads; (info_proc): bug fixes and enhancements for the "INFO PROCESSES" command; (close_procinfo_file): call new function "delete_thread" to cleanup GDB's thread database; (proc_init_failed): add new argument "kill", to control whether process is killed (so this function can be shared by create_procinfo and do_attach); (procfs_exit_handler): handle exit from an attached process, and cleanup procinfo handles when the process exits; (procfs_resume, procfs_wait): cleanup after a thread when it exits; (do_attach, do_detach): handle attached processes with multiple threads; plus some general improvements in the diagnostic output. * sol-thread.c (sol_thread_alive): replace stub with real implementation; (thread_to_lwp, lwp_to_thread): enhance to handle threads that may have exited; (sol_thread_attach): add startup setup stuff; (sol_thread_detach): add unpush_target call; (sol_thread_mourn_inferior): add unpush_target call; (sol_thread_wait, sol_thread_resume): enhance to deal with thread exit cleanly; (sol_thread_new_objfile, sol_thread_pid_to_str): detect unsuccessful startup and don't crash; plus some general cleanup. * thread.c (delete_thread): new function, allows targets to notify gdb when a thread is no longer valid. * infrun.c (wait_for_inferior): don't try to detect a new thread on receiving a TARGET_EXITED event.
1997-05-01Thu May 1 11:44:46 1997 Michael Snyder <msnyder@cleaver.cygnus.com>Michael Snyder1-34/+49
* Finalize merge from Hurd folk. Mon Oct 30 16:41:04 1995 Miles Bader <miles@gnu.ai.mit.edu> * thread.c (thread_apply_command, thread_apply_all_command, thread_command): Make sure TP is alive. (thread_alive): New function. Tue Nov 14 14:31:03 1995 Miles Bader <miles@gnu.ai.mit.edu> * infrun.c (sig_print_info): Deal better with long signal names. Wed Nov 22 15:23:35 1995 Miles Bader <miles@gnu.ai.mit.edu> * thread.c (thread_id_to_pid): New function. Fri Dec 1 13:25:25 1995 Miles Bader <miles@gnu.ai.mit.edu> * gnu-nat.c: (set_thread_cmd_list, show_thread_cmd_list, set_thread_default_cmd_list, show_thread_default_cmd_list): New variables. (set_thread_cmd, show_thread_cmd, set_thread_default_cmd, show_thread_default_cmd): New functions. Fri Apr 18 15:20:16 1997 Miles Bader <miles@gnu.ai.mit.edu> * gnu-nat.c (inf_startup): remove TASK parameter. (inf_set_task): replace with new function (inf_set_pid). * gdbthread.h: Add extern decl for thread_cmd_list.
1997-04-29Mon Apr 28 21:25:32 1997 Michael Snyder <msnyder@cleaver.cygnus.com>Michael Snyder1-9/+22
* Makefile.in: Add rule for gnu-nat.o and i386gnu-nat.o (Gnu Hurd) * config/i386/i386gnu.mh: remove rules for [i386]gnu-nat.o, now in Makefile.in (as for other targets); add NATDEPFILE corelow.o to satisfy symbol dependancy in solib.c (core_ops). * target.[ch] conditionalize Mach-specific signals so that they won't show up in non-Mach gdb's! * thread.c: add function thread_id_to_pid; change name of static function "thread_switch" to "switch_to_thread", to avoid conflict with Mach global symbol; move thread_cmd_list to global scope so targets can add their own thread commands. * infrun.c: sig_print_info: allow for long signal names. * gnu-nat.[ch]: tidying up comments. * gnu-nat.c: move several functions to static scope, just for tidy; remove calls to prune_threads and renumber_threads; gnu_wait must not return -1 when inferior exits; attach_to_child will modify inferior_pid in a way that allows fork_inferior to remain unchanged; remove extra arg from startup_inferior; move mach-specific thread commands here from thread.c.
1996-07-26See gdb ChangeLog entry with header:Fred Fish1-4/+20
Thu Jul 25 19:41:31 1996 Fred Fish <fnf@cygnus.com> for a rather huge set of changes. I was going to put them here, but it made cvs dump core. :-(
1996-05-09 * Makefile.in, breakpoint.c, corelow.c, fork-child.c, inflow.c,Stu Grossman1-1/+1
infrun.c, mac-nat.c, procfs.c, remote.c, sol-thread.c, thread.c, win32-nat.c, config/nm-lynx.h: Rename thread.h to gdbthread.h to avoid conflict with Solaris /usr/include/thread.h.
1995-08-02Update FSF address.Fred Fish1-1/+1
1995-07-13 * inftarg.c (child_thread_alive): New function to see if aJeff Law1-6/+1
particular thread is still running. (child_ops): Add child_thread_alive entry. * remote.c (remote_thread_alive): New function to see if a particular thread is still alive. (remote_ops): Add remote_thread_alive. * target.c (dummy_target): Add dummy entry for thread_alive. (cleanup_target): de_fault thread_alive too. (update_current_target): INHERIT thread_alive too. (debug_to_thread_alive): New function. (setup_target_debug): Add debug_to_thread_alive. * target.h (struct target_ops): Add to_thread_alive. (target_thread_alive): Define. * thread.c (info_threads_command): Don't call kill; use target_thread_alive instead. * config/nm-lynx.h (CHILD_THREAD_ALIVE): Define. * gdbserver/low-lynx.c (mythread_alive): New function. (mywait): Don't restart any threads after a new thread notification, let the generic code handle it. * gdbserver/low-sparc.c (mythread_alive): Dummy version. * gdbserver/low-sun3.c (mythread_alive): Likewise. * gdbserver/server.c (main): Handle thread_alive requests. * gdbserver/server.h (mythread_alive): Declare. * corelow.c (core_ops): Add dummy entry for thread_alive. * exec.c (exec_ops): Likewise. * m3-nat.c (m3_ops): Likewise. * monitor.c (monitor_ops): Likewise. * procfs.c (procfs_ops): Likewise. * remote-arc.c (arc_ops): Likewise. * remote-array.c (array_ops): Likewise. * remote-e7000.c (e7000_ops): Likewise. * remote-es.c (es1800_ops, es1800_child_ops): Likewise. * remote-mips.c (mips_ops): Likewise. * remote-pa.c (remote_hppro_ops): Likewise. * remote-sim.c (gdbsim_ops): Likewise. * sparcl-tdep.c (sparclite_ops): Likewise. More lynx-6100 work
1995-07-04 * infrun.c (wait_for_inferior): When switching from one thread toJeff Law1-0/+104
another, save infrun's state for the old thread and load infrun's previous state for the new thread. * thread.c (struct thread_info): Add new fields for thread specific state saved/restored in infrun.c. (add_thread): Initialize new fields. (load_infrun_state): New function. (save_infrun_state): New function. * thread.h (load_infrun_state): Provide external decl. (save_infrun_state): Likewise. More single-stepping patches for lynx-6100.
1994-12-08 * gdbserver/remote-utils.c (write_ok): Write "OK", not "Ok", toJim Kingdon1-1/+9
match stubs and protocol spec. * gdbserver/remote-utils.c (remote_open): Cast to struct sockaddr when passing to function which expects that. The following changes aren't quite enough to make things work with LynxOS (apprently kernel problems). * infrun.c (wait_for_inferior): When resuming new thread, pass pid not -1 for remote case. * thread.c (info_threads_command): Give error if !target_has_stack. * infrun.c (start_remote): Call init_thread_list. * thread.c (info_threads_command): Don't call kill for remote debugging target. * target.c (normal_pid_to_str): Print "thread" not "process" for remote. * remote.c, gdbserver/*: Add 'H', 'S', and 'C' requests, 'X' response, and `thread' part of 'T' response. * gdbserver/*: If program exits, send packet to GDB before exiting. Handle termination with a signal the same as exiting with an exitstatus. * remote.c: Don't try to kill program after getting an 'X' response. * infrun.c (wait_for_inferior): Add comment about kill versus mourn.
1994-10-08 The point of these changes is to avoid reading the frame pointerJim Kingdon1-2/+0
and stack pointer during stepping, to speed things up. A. Changes to not select a frame until we need a selected frame: * blockframe.c (flush_cached_frames): Call select_frame (NULL, -1). * infrun.c (wait_for_inferior): Move call to select_frame back to normal_stop. This reverts a change of 13 Apr 94 (it says Jeff Law, but the change was my idea); the only reason for that change was so we could save and restore the selected frame in wait_for_inferior, and now that flush_cached frames clears the selected frame, that should work OK now. B. Changes to not create a current_frame until we need one: * blockframe.c (get_current_frame): If current_frame is NULL, try to create an innermost frame. * sparc-tdep.c (sparc_pop_frame), infcmd.c (run-stack_dummy), infrun.c (wait_for_inferior), thread.c (thread_switch), convex-tdep.c (set_thread_command), a29k-tdep.c (pop_frame), alpha-tdep.c (alpha_pop_frame), convex-xdep.c (core_file_command), h8300-tdep.c (h8300_pop_frame), h8500-tdep.c (h8300_pop_frame), hppa-tdep.c (hppa_pop_frame), i386-tdep.c (i386_pop_frame), i960-tdep.c (pop_frame), m68k-tdep.c (m68k_pop_frame), mips-tdep.c (mips_pop_frame), rs6000-tdep.c (push_dummy_frame, pop_dummy_frame, pop_frame), sh-tdep.c (pop_frame), config/arm/tm-arm.h (POP_FRAME), config/convex/tm-convex.h (POP_FRAME), config/gould/tm-pn.h (POP_FRAME), config/ns32k/tm-merlin.h (POP_FRAME), config/ns32k/tm-umax.h (POP_FRAME), config/tahoe/tm-tahoe.h (POP_FRAME), config/vax/tm-vax.h (POP_FRAME): Don't call create_new_frame. * corelow.c (core_open), altos-xdep.c (core_file_command), arm-xdep.c (core_file_command), gould-xdep.c (core_file_command), m3-nat.c (select_thread), sun386-nat.c (core_file_command), umax-xdep.c (core_file_command): Don't call create_new_frame; do call flush_cached_frames. * blockframe.c (reinit_frame_cache): Don't call create_new_frame or select_frame. C. Changes to get rid of stop_frame_address and instead only fetch the frame pointer when we need it. * breakpoint.c (bpstat_stop_status): Remove argument frame_address; use FRAME_FP (get_current_frame ()). * infrun.c (wait_for_inferior): Don't pass frame pointer to bpstat_stop_status. * infrun.c (wait_for_inferior): Use FRAME_FP (get_current_frame ()) instead of stop_frame_address. * infrun.c (save_inferior_status, restore_inferior_status), inferior.h (struct inferior_status): Don't save and restore stop_frame_address. * inferior.h, infcmd.c, thread.c (thread_switch), m3-nat.c (select_thread): Remove stop_frame_address and uses thereof. D. Same thing for the stack pointer. * infrun.c (wait_for_inferior): Remove stop_sp and replace uses thereof with read_sp (). E. Change to eliminate one nasty little spot where we were wanting to know the frame pointer from before the current step (idea from GDB 3.5, which saved my ass, because my other ideas of how to fix it were very baroque). * infrun.c: Remove prev_frame_address. * infrun.c (wait_for_inferior, step_over_function): Use step_frame_address instead of prev_frame_address. F. Same basic idea for the stack pointer. * inferior.h, infcmd.c: New variable step_sp. * infcmd.c (step_1, until_next_command): Set it. * infrun.c: Remove prev_sp and replace uses by step_sp. * infrun.c (wait_for_inferior): If we get out of the step range, then set step_sp to the current stack pointer before we start going again.
1993-11-10 gcc -Wall lint:Jim Kingdon1-1/+2
* thread.c: Include "gdbcmd.h" and <ctype.h>. * Makefile.in: Update dependency. * thread.c (thread_command): Remove unused variable p. * values.c (unpack_double): Use len instead of TYPE_LENGTH (type). * valprint.c (print_floating): Correctly check sign bit now that we are using unsigned arithmetic. * symtab.c (find_pc_line_range): Remove unused variables exact_match, ind, and l.
1993-11-05 * inflow.c (terminal_init_inferior): Temporarily use Lynx PIDGETStu Grossman1-4/+126
macro to set process groups. * infptrace.c (child_resume): Temporarily use Lynx PIDGET to specify resumption of all threads. * infrun.c (wait_for_inferior): Fix handling of thread-specific breakpoints for systems where DECR_PC_AFTER_BREAK > 0 (ie: backup PC by the right amount when continuing the thread). * thread.c (thread_apply_command): Add the `thread apply' command to apply a given GDB command to a list of threads.
1993-10-16* breakpoint.c (breakpoint_thread_match break_command_1):Stu Grossman1-0/+28
Thread-specific breakpoint support. * breakpoint.h (struct breakpoint): Add thread id field. * fork-child.c (fork_inferior): Move call to init_thread_list() back a bit so that init_trace_fun can do thread functions. * hppa-tdep.c (restore_pc_queue): Add pid to call to target_wait. * hppab-nat.c (child_resume): Handle default pid. * hppah-nat.c (child_resume): Handle default pid. * i386lynx-nat.c (child_wait): New arg pid. * inflow.c (kill_command): Reset thread list. * infptrace.c (child_resume): Handle default pid. * infrun.c: Thread-specific breakpoint support. * inftarg.c (child_wait): Add pid arg. * osfsolib.c (solib_create_inferior_hook): Add pid to call to target_resume. * procfs.c: Multi-thread support. * remote-bug.c (bug_wait): Add pid arg. * remote-hms.c (hms_wait): Add pid arg. * remote-mips.c (mips_wait): Add pid arg. * remote-mon.c (monitor_wait): Add pid arg. * remote-nindy.c (nindy_wait): Add pid arg. * remote-sim.c (gdbsim_wait): Add pid arg. * remote-udi.c (udi_wait): Add pid arg. * remote-vx.c (vx_wait): Add pid arg. * remote-z8k.c (sim_wait): Add pid arg. * remote.c (remote_wait): Add pid arg. * solib.c (solib_create_inferior_hook): Add pid to call to target_resume. * target.h (struct target_ops): Add pid arg to to_wait and to_notice_signals. * thread.c (valid_thread_id): New func to validate thread #s. * (pid_to_thread_id): New func to do the obvious. * thread.h: Prototypes for above. * coff-solib.c (coff_solib_add): Use nameoffset field to locate filename.
1993-09-25* corelow.c: Add multi thread/process support for core files withStu Grossman1-13/+0
.reg/XXX pseudo-sections. * i386lynx-nat.c thread.h thread.c: Remove unnecessary core file support.
1993-09-13 * inferior.h, infrun.c, thread.c, infcmd.c: Remove all uses ofJim Kingdon1-1/+0
pc_changed. If it was ever set to a non-zero value, it was before GDB 2.8. It doesn't seem to have any useful function.
1993-09-08some gcc lintK. Richard Pixley1-3/+2
1993-08-02 * thread.c (thread_switch): Define as static.Jim Kingdon1-2/+2
(add_thread): Cast return value from xmalloc.
1993-08-02Mon Aug 2 11:30:57 1993 Stu Grossman (grossman at cygnus.com)Stu Grossman1-19/+21
* i386lynx-nat.c, thread.c, thread.h: Update copyrights.
1993-08-02Sun Aug 1 22:58:18 1993 Stu Grossman (grossman at cygnus.com)Stu Grossman1-0/+233
* Makefile.in (CLIBS): Reorder to make Lynx ld happy. * (HFILES): New file thread.h. * (OBS): New file thread.c. * configure.in: Host config for Lynx/386. * fork-child.c (fork_inferior): Call init_thread_list(). * infrun.c (resume): Add pid to invocation of target_resume(). * (wait_for_inferior): Pay attention to pid from target_wait(). Multi-threading code now uses this to determine what to do. * inftarg.c (child_wait): Conditionalize based on CHILD_WAIT macro. Use target_pid_to_str() macro throughout when printing pid. * inferior.h (child_resume): Add pid to prototype. * hppab-nat.c hppah-nat.c infptrace.c (child_resume): Pass in pid as argument, instead of using inferior_pid. * procfs.c (procfs_resume): Pass in pid as argument. Ignored for now. Use target_pid_to_str() macro throughout for printing process id. * remote-adapt.c (adapt_resume): Pass in pid as argument. * remote-eb.c (eb_resume): Pass in pid as argument. * remote-es.c (es1800_resume): Pass in pid as argument. * remote-hms.c (hms_resume): Pass in pid as argument. * remote-mips.c (mips_resume): Pass in pid as argument. * remote-mm.c (mm_resume): Pass in pid as argument. * remote-monitor.c (monitor_resume): Pass in pid as argument. * remote-nindy.c (nindy_resume): Pass in pid as argument. * remote-sa.sparc.c (remote_resume): Pass in pid as argument. * remote-sim.c (rem_resume): Pass in pid as argument. * remote-sp64sim.c (simif_resume): Pass in pid as argument. * remote-st.c (st2000_resume): Pass in pid as argument. * remote-udi.c (udi_resume): Pass in pid as argument. * remote-vx.c (vx_resume): Pass in pid as argument. * remote-z8k.c (rem_resume): Pass in pid as argument. * remote.c (remote_resume): Pass in pid as argument. * solib.c (solid_create_inferior_hook): Pass inferior_pid to target_resume(). * target.c (normal_pid_to_str): New routine to print out process ID normally. * target.h (struct target_ops): Add pid to prototype at to_resume(). (target_resume): Add pid argument. * (target_pid_to_str): Default definition for normal type pids. * thread.c, thread.c: New modules for multi thread/process control.