aboutsummaryrefslogtreecommitdiff
path: root/gdb/thread.c
AgeCommit message (Collapse)AuthorFilesLines
2001-07-28Move libgdb library functions to gdb.h (new file).Andrew Cagney1-0/+1
Update everything related to this.
2001-06-132001-06-13 Michael Snyder <msnyder@redhat.com>Michael Snyder1-33/+42
* gdbthread.h (struct thread_info): Add new fields: current_line, current_symtab, step_sp, for saved infrun state. * thread.c (save_infrun_state, load_infrun_state): Save and restore current_line, current_symtab, and step_sp. (add_thread): Rather than adding assignments to initialize the new fields, just use memset (tp, 0, sizeof (*tp). This way future new fields will not be overlooked. * infrun.c (handle_inferior_event): Save and restore save_sp, current_line, and current_symtab when switching threads.
2001-06-022001-06-01 Michael Snyder <msnyder@redhat.com>Michael Snyder1-0/+17
* thread.c (delete_step_resume_breakpoint): New function. Maintain internal consistency of the thread list while deleting a step_resume_breakpoint. * gdbthread.h (delete_step_resume_breakpoint): Export. * breakpoint.c (bpstat_find_step_resume_breakpoint): Make thread-aware: don't return a step_resume_breakpoint for the wrong thread. * infrun.c (wait_for_inferior): Call delete_step_resume_breakpoint instead of delete_breakpoint_current_contents. (fetch_inferior_event): Ditto. (handle_inferior_event): Call delete_step_resume_breakpoint instead of delete_breakpoint.
2001-05-12* thread.c (do_captured_list_thread_ids): Use ui_out_tuple_beginJim Blandy1-2/+2
and ui_out_tuple_end instead of ui_out_list_begin and ui_out_list_end.
2001-05-04Phase 1 of the ptid_t changes.Kevin Buettner1-59/+59
2001-04-172001-04-17 Eirik Fuller <eirik@netapp.com>Michael Snyder1-1/+1
* thread.c (do_captured_thread_select): Allow the argument to the thread command to be an expression rather than a literal integer.
2001-03-06Update/correct copyright notices.Kevin Buettner1-3/+4
2001-03-01Create new file regcache.h. Update all uses.Andrew Cagney1-0/+1
2001-01-262001-01-24 Jeff Holcomb <jeffh@redhat.com>Jeff Holcomb1-3/+3
* remote-udi.c (udi_open): Change strdup to xstrdup. * thread.c (thread_apply_all_command): Change strdup to xstrdup. Update copyright message. * varobj.c (delete_variable_1): Likewise. * gdb_string.h: Remove declaration of strdup. Update copyright message. * config/xm-mpw.h: Likewise. * config/i386/xm-i386mach.h: Likewise. * config/m68k/xm-apollo68b.h: Likewise. * config/m68k/xm-hp300bsd.h: Likewise. * config/rs6000/xm-rs6000.h: Likewise. * config/vax/xm-vaxult.h: Remove declaration of strdup. * config/vax/xm-vaxult2.h: Likewise.
2000-12-15Replace free() with xfree().Kevin Buettner1-5/+5
2000-11-17* thread.c (thread_apply_all_command): Save the command before executing itChristopher Faylor1-0/+16
because it may be modified. Restore the saved command so that the same command is executed on next thread. (thread_apply_command): Same correction.
2000-10-28Protoization.Kevin Buettner1-3/+2
2000-07-30Protoization.Kevin Buettner1-83/+36
2000-07-222000-07-21 Michael Snyder <msnyder@cleaver.cygnus.com>Michael Snyder1-0/+4
* thread.c (thread_apply_all_command): Update thread list first.
2000-07-19 * thread.c (free_thread): New function.Nicholas Duffek1-15/+19
(init_thread_list): Always zero highest_thread_num. Call free_thread() instead of free(). (delete_thread): Move thread cleanup code to free_thread().
2000-06-07Purge last remaining make_cleanup_func.Andrew Cagney1-4/+28
2000-05-28PARAMS removal.Kevin Buettner1-10/+10
2000-02-03import gdb-2000-02-02 snapshotJason Molenda1-0/+51
2000-01-18import gdb-2000-01-17 snapshotJason Molenda1-7/+21
2000-01-11import gdb-2000-01-10 snapshotJason Molenda1-39/+63
1999-09-09import gdb-1999-09-08 snapshotStan Shebs1-1/+1
1999-08-23import gdb-1999-08-23 snapshotJason Molenda1-10/+6
1999-07-07import gdb-1999-07-07 post reformatJason Molenda1-102/+106
1999-06-07import gdb-1999-06-07 snapshotJason Molenda1-66/+0
1999-05-25import gdb-1999-05-25 snapshotJason Molenda1-0/+1
1999-05-05import gdb-19990504 snapshotStan Shebs1-7/+3
1999-04-26import gdb-19990422 snapshotStan Shebs1-2/+3
1999-04-16Initial creation of sourceware repositorygdb-4_18-branchpointStan Shebs1-0/+721
1999-04-16Initial creation of sourceware repositoryStan Shebs1-721/+0
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.