aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver
AgeCommit message (Collapse)AuthorFilesLines
2009-07-31 * linux-ppc-low.c (INSTR_SC, NR_spu_run): Define.Ulrich Weigand2-7/+97
(parse_spufs_run): New function. (ppc_get_pc, ppc_set_pc): Detect and handle SPU PC. (ppc_breakpoint_at): Handle SPU breakpoints.
2009-07-31ChangeLog:Ulrich Weigand2-1/+109
* linux-nat.c: Include <sys/vfs.h>. (SPUFS_MAGIC): Define. (spu_enumerate_spu_ids): New function. (linux_proc_xfer_spu): New function. (linux_xfer_partial): Handle TARGET_OBJECT_SPU. (iterate_over_spus): New function. (struct linux_spu_corefile_data): New data type. (linux_spu_corefile_callback): New function. (linux_spu_make_corefile_notes): New function. (linux_nat_make_corefile_notes): Call it. * corelow.c (struct spuid_list): New data type. (add_to_spuid_list): New function. (core_xfer_partial): Handle TARGET_OBJECT_SPU. gdbserver/ChangeLog: * linux-low.c: Include <sys/stat.h> and <sys/vfs.h>. (SPUFS_MAGIC): Define. (spu_enumerate_spu_ids): New function. (linux_qxfer_spu): New function. (linux_target_ops): Install linux_qxfer_spu.
2009-07-31ChangeLog:Ulrich Weigand4-4/+36
* features/Makefile: Allow sub-platform specific expedite settings. (WHICH): Add rs6000/powerpc-cell32l and rs6000/powerpc-cell64l. (rs6000/powerpc-cell32l-expedite): Define. (rs6000/powerpc-cell64l-expedite): Likewise. * features/rs6000/powerpc-cell32l.xml: New file. * features/rs6000/powerpc-cell64l.xml: New file. * features/rs6000/powerpc-cell32l.c: New generated file. * features/rs6000/powerpc-cell64l.c: New generated file. * regformats/rs6000/powerpc-cell32l.dat: New generated file. * regformats/rs6000/powerpc-cell64l.dat: New generated file. * config/djgpp/fnchange.lst: Add mappings for new files. * ppc-linux-tdep.h (tdesc_powerpc_cell32l): Add prototype. (tdesc_powerpc_cell64l): Likewise. * ppc-linux-tdep.c: Include "features/rs6000/powerpc-cell32l.c" and "features/rs6000/powerpc-cell64l.c". (_initialize_ppc_linux_tdep): Initialize target descriptions. (ppc_linux_spu_section): New function. (ppc_linux_core_read_description): Detect Cell/B.E. core files. * ppc-linux-nat.c (PPC_FEATURE_CELL): Define. (ppc_linux_read_description): Detect Cell/B.E. architecture. * rs6000-tdep.c (rs6000_gdbarch_init): Do not trust BFD wordsize if exec file is not PowerPC architecture. gdbserver/ChangeLog: * configure.srv (powerpc*-*-linux*): Add powerpc-cell32l.o and powerpc-cell64l.o to srv_regobj. Add rs6000/powerpc-cell32l.xml and rs6000/powerpc-cell64l.xml to srv_xmlfiles. * Makefile.in (powerpc-cell32l.o, powerpc-cell32l.c): New rules. (powerpc-cell64l.o, powerpc-cell64l.c): Likewise. (clean): Handle powerpc-cell32l.c and powerpc-cell64l.c. * linux-ppc-low.c (PPC_FEATURE_CELL): Define. (init_registers_powerpc_cell32l): Add prototype. (init_registers_powerpc_cell64l): Likewise. (ppc_arch_setup): Detect Cell/B.E. architecture.
2009-07-30sim/Ralf Wildenhues2-0/+5
* Makefile.in (datarootdir): New variable. sim/common/ * Makefile.in (datarootdir): New variable. sim/igen/ * Makefile.in (datarootdir): New variable. sim/ppc/ * Makefile.in (datarootdir): New variable. readline/ * Makefile.in (datarootdir): New variable. * doc/Makefile.in (datarootdir): New variable. * shlib/Makefile.in (datarootdir): New variable. gdb/gdbserver/ * Makefile.in (datarootdir): New variable.
2009-07-28 * NEWS: Mention ARM VFP support.Daniel Jacobowitz5-14/+189
* target-descriptions.c (tdesc_register_type): Make public. (tdesc_unnumbered_register): New function. (tdesc_register_reggroup_p): Allow missing pseudo_register_reggroup_p. * target-descriptions.h (tdesc_register_type): Declare. (tdesc_unnumbered_register): Declare. * arm-tdep.c (arm_neon_quad_read, arm_neon_quad_write): New functions. (arm_push_dummy_call): Use arm_neon_quad_write. (arm_neon_double_type, arm_neon_quad_type): New functions. (arm_register_type): Handle VFP and NEON registers. Override the types of double-precision registers for NEON. Disable FPA registers if they are not present. (arm_dwarf_reg_to_regnum): Add current VFP and NEON register numbers. (arm_return_value): Use arm_neon_quad_write and arm_neon_quad_read. (arm_register_name): Handle VFP single and NEON quad registers. (arm_pseudo_read, arm_pseudo_write): New functions. (arm_gdbarch_init): Check for VFP and NEON in the target description. Assign numbers to double-precision registers. Register VFP and NEON pseudo registers. Remove a shadowed "i" variable. * arm-tdep.h (enum gdb_regnum): Add ARM_D0_REGNUM and ARM_D31_REGNUM. (struct gdbarch_tdep): Add have_neon_pseudos, have_neon, have_vfp_registers, have_vfp_pseudos, neon_double_type, and neon_quad_type. * features/Makefile: Make expedite settings only architecture specific. (WHICH): Add new ARM descriptions. * features/arm-with-neon.xml, features/arm-with-vfpv2.c, features/arm-with-vfpv3.c, features/arm-vfpv2.xml, features/arm-vfpv3.xml, features/arm-with-vfpv2.xml, features/arm-with-vfpv3.xml, features/arm-with-neon.c: New files. * regformats/arm-with-neon.dat, regformats/arm-with-vfpv2.dat, regformats/arm-with-vfpv3.dat: Generate. doc/ * gdb.texinfo (ARM Features): Document org.gnu.gdb.arm.vfp and org.gnu.gdb.arm.neon. gdbserver/ * linux-low.c (linux_write_memory): Update debugging output. * Makefile.in (clean): Add new descriptions. (arm-with-vfpv2.o, arm-with-vfpv2.c, arm-with-vfpv3.o) (arm-with-vfpv3.c, arm-with-neon.o, arm-with-neon.c): New rules. * configure.srv: Add new files for arm*-*-linux*. * linux-arm-low.c: Add new declarations. (PTRACE_GETVFPREGS, PTRACE_SETVFPREGS): Define if undefined. (arm_hwcap, HWCAP_VFP, HWCAP_IWMMXT, HWCAP_NEON, HWCAP_VFPv3) (HWCAP_VFPv3D16): New. (arm_fill_wmmxregset, arm_store_wmmxregset): Check HWCAP_IWMMXT instead of __IWMMXT__. (arm_fill_vfpregset, arm_store_vfpregset, arm_get_hwcap) (arm_arch_setup): New. (target_regsets): Remove #ifdef. Add VFP regset. (the_low_target): Use arm_arch_setup. testsuite/ * gdb.base/float.exp: Handle VFP registers.
2009-07-28 * linux-low.c (linux_kill_one_lwp): Adjust kernel workaround to skipDaniel Jacobowitz2-1/+6
the main thread again.
2009-07-06 Adding Neutrino gdbserver.Aleksandar Ristovski8-0/+1154
* configure: Regenerated. * configure.ac: Add case for srv_qnx and set LIBS accordingly. * configure.srv (i[34567]86-*-nto*): New target. * nto-low.c, nto-low.h, nto-x86-low.c: New files. * remote-utils.c [__QNX__]: Include sys/iomgr.h (nto_comctrl) [__QNX__]: New function. (enable_async_io, disable_async_io) [__QNX__]: Call nto_comctrl.
2009-07-05Ooops. Fix date.Pedro Alves1-1/+1
2009-07-05 * configure.srv (i[34567]86-*-mingw32ce*): Add i386-low.o toPedro Alves2-1/+6
srv_tgtobj.
2009-07-04 * win32-i386-low.c (i386_get_thread_context): Handle systems thatPedro Alves3-9/+52
don't support CONTEXT_EXTENDED_REGISTERS. (i386_win32_breakpoint, i386_win32_breakpoint_len): New. (the_low_target): Install them. * win32-low.c (get_child_debug_event): Handle WaitForDebugEvent failing with ERROR_PIPE_NOT_CONNECTED.
2009-06-30 Add h/w watchpoint support to x86-linux, win32-i386.Doug Evans2-0/+686
* Makefile.in (SFILES): Add i386-low.c (i386_low_h): Define. (i386-low.o): Add dependencies. (linux-x86-low.o): Add i386-low.h dependency. (win32-i386-low.o): Ditto. * i386-low.c: New file. * i386-low.h: New file. * configure.srv (i[34567]86-*-cygwin*): Add i386-low.o to srv_tgtobj. (i[34567]86-*-linux*, i[34567]86-*-mingw*, x86_64-*-linux*): Ditto. * linux-low.c (linux_add_process): Initialize arch_private. (linux_remove_process): Free arch_private. (add_lwp): Initialize arch_private. (delete_lwp): Free arch_private. (linux_resume_one_lwp): Call the_low_target.prepare_to_resume if provided. * linux-low.h (process_info_private): New member arch_private. (lwp_info): New member arch_private. (linux_target_ops): New members new_process, new_thread, prepare_to_resume. (ptid_of): New macro. * linux-x86-low.c: Include stddef.h, i386-low.h. (arch_process_info): New struct. (arch_lwp_info): New struct. (x86_linux_dr_get, x86_linux_dr_set): New functions. (i386_dr_low_set_addr, i386_dr_low_set_control): New functions. (i386_dr_low_get_status): New function. (x86_insert_point, x86_remove_point): New functions. (x86_stopped_by_watchpoint): New function. (x86_stopped_data_address): New function. (x86_linux_new_process, x86_linux_new_thread): New functions. (x86_linux_prepare_to_resume): New function. (the_low_target): Add entries for insert_point, remove_point, stopped_by_watchpoint, stopped_data_address, new_process, new_thread, prepare_to_resume. * server.c (debug_hw_points): New global. (monitor_show_help): Document set debug-hw-points. (handle_query): Process "set debug-hw-points". * server.h (debug_hw_points): Declare. (paddress): Declare. * utils.c (NUMCELLS, CELLSIZE): New macros. (get_sell, xsnprintf, paddress): New functions. * win32-arm-low.c (the_low_target): Add entries for insert_point, remove_point, stopped_by_watchpoint, stopped_data_address. * win32-i386-low.c: Include i386-low.h. (debug_reg_state): Replaces dr. (i386_dr_low_set_addr, i386_dr_low_set_control): New functions. (i386_dr_low_get_status): New function. (i386_insert_point, i386_remove_point): New functions. (i386_stopped_by_watchpoint): New function. (i386_stopped_data_address): New function. (i386_initial_stuff): Update. (get_thread_context,set_thread_context,i386_thread_added): Update. (the_low_target): Add entries for insert_point, remove_point, stopped_by_watchpoint, stopped_data_address. * win32-low.c (win32_insert_watchpoint): New function. (win32_remove_watchpoint): New function. (win32_stopped_by_watchpoint): New function. (win32_stopped_data_address): New function. (win32_target_ops): Add entries for insert_watchpoint, remove_watchpoint, stopped_by_watchpoint, stopped_data_address. * win32-low.h (win32_target_ops): New members insert_point, remove_point, stopped_by_watchpoint, stopped_data_address.
2009-06-30 Add h/w watchpoint support to x86-linux, win32-i386.Doug Evans13-36/+558
* Makefile.in (SFILES): Add i386-low.c (i386_low_h): Define. (i386-low.o): Add dependencies. (linux-x86-low.o): Add i386-low.h dependency. (win32-i386-low.o): Ditto. * i386-low.c: New file. * i386-low.h: New file. * configure.srv (i[34567]86-*-cygwin*): Add i386-low.o to srv_tgtobj. (i[34567]86-*-linux*, i[34567]86-*-mingw*, x86_64-*-linux*): Ditto. * linux-low.c (linux_add_process): Initialize arch_private. (linux_remove_process): Free arch_private. (add_lwp): Initialize arch_private. (delete_lwp): Free arch_private. (linux_resume_one_lwp): Call the_low_target.prepare_to_resume if provided. * linux-low.h (process_info_private): New member arch_private. (lwp_info): New member arch_private. (linux_target_ops): New members new_process, new_thread, prepare_to_resume. (ptid_of): New macro. * linux-x86-low.c: Include stddef.h, i386-low.h. (arch_process_info): New struct. (arch_lwp_info): New struct. (x86_linux_dr_get, x86_linux_dr_set): New functions. (i386_dr_low_set_addr, i386_dr_low_set_control): New functions. (i386_dr_low_get_status): New function. (x86_insert_point, x86_remove_point): New functions. (x86_stopped_by_watchpoint): New function. (x86_stopped_data_address): New function. (x86_linux_new_process, x86_linux_new_thread): New functions. (x86_linux_prepare_to_resume): New function. (the_low_target): Add entries for insert_point, remove_point, stopped_by_watchpoint, stopped_data_address, new_process, new_thread, prepare_to_resume. * server.c (debug_hw_points): New global. (monitor_show_help): Document set debug-hw-points. (handle_query): Process "set debug-hw-points". * server.h (debug_hw_points): Declare. (paddress): Declare. * utils.c (NUMCELLS, CELLSIZE): New macros. (get_sell, xsnprintf, paddress): New functions. * win32-arm-low.c (the_low_target): Add entries for insert_point, remove_point, stopped_by_watchpoint, stopped_data_address. * win32-i386-low.c: Include i386-low.h. (debug_reg_state): Replaces dr. (i386_dr_low_set_addr, i386_dr_low_set_control): New functions. (i386_dr_low_get_status): New function. (i386_insert_point, i386_remove_point): New functions. (i386_stopped_by_watchpoint): New function. (i386_stopped_data_address): New function. (i386_initial_stuff): Update. (get_thread_context,set_thread_context,i386_thread_added): Update. (the_low_target): Add entries for insert_point, remove_point, stopped_by_watchpoint, stopped_data_address. * win32-low.c (win32_insert_watchpoint): New function. (win32_remove_watchpoint): New function. (win32_stopped_by_watchpoint): New function. (win32_stopped_data_address): New function. (win32_target_ops): Add entries for insert_watchpoint, remove_watchpoint, stopped_by_watchpoint, stopped_data_address. * win32-low.h (win32_target_ops): New members insert_point, remove_point, stopped_by_watchpoint, stopped_data_address.
2009-06-25 * server.c (process_serial_event): Re-return unsupported, notPedro Alves6-51/+62
error, if the type isn't recognized. Re-allow supporting only insert or remove packets. Also call require_running for breakpoints. Add missing break statement to default case. Tidy. * target.h (struct target_ops): Rename insert_watchpoint to insert_point, and remove_watchpoint to remove_point. * linux-low.h (struct linux_target_ops): Likewise. * linux-low.c (linux_insert_watchpoint): Rename to ... (linux_insert_point): ... this. Adjust. (linux_remove_watchpoint): Rename to ... (linux_remove_point): ... this. Adjust. (linux_target_ops): Adjust. * linux-crisv32-low.c (cris_insert_watchpoint): Rename to ... (cris_insert_point): ... this. (cris_remove_watchpoint): Rename to ... (cris_remove_point): ... this. (the_low_target): Adjust.
2009-06-24 * server.c (handle_v_kill): Pass signal_pid toPierre Muller2-2/+9
kill_inferior if multi_process is zero.
2009-06-23* server.c (process_serial_event): Add support for Z0 and Z1 packet.Aleksandar Ristovski3-53/+50
* target.h (target_ops): Comment for *_watchpoint to make it clear the functions can get types '0' and '1'.
2009-06-22 * linux-low.c (usr_fetch_inferior_registers): Remove check for regno 0.Aleksandar Ristovski6-8/+13
* proc-service.c (ps_lgetregs): Pass -1 to fetch all registers. * regcache.c (get_regcache): Likewise. * spu-low.c (spu_fetch_registers): Remove 0 to -1 conversion. * win32-low.c (child_fetch_inferior_registers): Remove check for regno 0.
2009-06-192009-06-19 Aleksandar Ristovski <aristovski@qnx.com>Pedro Alves4-3/+35
Pedro Alves <pedro@codesourcery.com> * target.h (struct target_ops) <supports_multi_process>: New callback. (target_supports_multi_process): New. * server.c (handle_query): Even if GDB reports support, only enable multi-process if the target also supports it. Report multi-process support only if the target backend supports it. * linux-low.c (linux_supports_multi_process): New function. (linux_target_ops): Install it as target_supports_multi_process callback.
2009-05-24gdb:Doug Evans6-8/+13
Global renaming of find_thread_pid to find_thread_ptid. * gdbthread.h (find_thread_ptid): Renamed from find_thread_pid. * thread.c (find_thread_ptid): Renamed from find_thread_pid. All callers updated. gdbserver: Global renaming of find_thread_pid to find_thread_ptid. * server.h (find_thread_ptid): Renamed from find_thread_pid. * inferiors.c (find_thread_ptid): Renamed from find_thread_pid. All callers updated.
2009-05-24 * linux-low.c (handle_extended_wait): Use linux_resume_one_lwpDoug Evans2-6/+13
to resume the newly created thread, don't call ptrace (PTRACE_CONT) directly.
2009-05-24 * linux-low.c (get_stop_pc): Print pc if debug_threads.Doug Evans2-11/+26
(check_removed_breakpoint, linux_wait_for_lwp): Ditto. (linux_resume_one_lwp): Ditto.
2009-05-24 * linux-low.c (linux_resume_one_lwp): Change type of first argDoug Evans2-15/+18
from struct inferior_list_entry * to struct lwp_info *. All callers updated.
2009-05-13 * linux-x86-low.c: Don't include assert.h.Doug Evans2-3/+9
(x86_siginfo_fixup): Use fatal, not assert. (x86_arch_setup): Fix comment.
2009-05-13(linux_test_for_tracefork): Back out turd from previous check-in.Doug Evans1-2/+0
2009-05-12 Biarch support for i386/amd64 gdbserver.Doug Evans8-407/+790
* Makefile.in (SFILES): Remove linux-i386-low.c, linux-x86-64-low.c. Add linux-x86-low.c. (linux-i386-low.o, linux-x86-64-low.o): Delete. (linux-x86-low.o): Add. * linux-x86-64-low.c: Delete. * linux-i386-low.c: Delete. * linux-x86-low.c: New file. * configure.srv (i?86-linux srv_tgtobj): Replace linux-i386-low.o with linux-x86-low.o. (x86_64-linux srv_tgtobj): Replace linux-x86-64-low.o with linux-x86-low.o. (x86_64-linux srv_regobj): Add reg-i386-linux.o. * linux-low.c: Include ansidecl.h, elf/common.h, elf/external.h. (linux_child_pid_to_exec_file): New function. (elf_64_header_p, elf_64_file_p): New functions. (siginfo_fixup): New function. (linux_xfer_siginfo): New local inf_siginfo. Call siginfo_fixup to give target a chance to convert layout. * linux-low.h (linux_target_ops): New member siginfo_fixup. (linux_child_pid_to_exec_file, elf_64_file_p): Declare.
2009-05-07 * linux-low.c (regsets_fetch_inferior_registers): Fix memory leak.Doug Evans2-0/+9
(regsets_store_inferior_registers): Ditto.
2009-05-06Fix braino.Pedro Alves1-1/+1
2009-05-06 PR server/10048Pedro Alves3-13/+30
* linux-low.c (must_set_ptrace_flags): Delete. (linux_create_inferior): Set `lwp->must_set_ptrace_flags' instead of the global. (linux_attach_lwp_1): Don't set PTRACE_SETOPTIONS here. Set `lwp->must_set_ptrace_flags' instead. (linux_wait_for_event_1): If ptrace options here. (linux_wait_1): ... not here.
2009-04-30 * inferiors.c (started_inferior_callback): New function.Doug Evans4-5/+119
(attached_inferior_callback): New function. (have_started_inferiors_p, have_attached_inferiors_p): New functions. * server.c (print_started_pid, print_attached_pid): New functions. (detach_or_kill_for_exit): New function. (main): Call it instead of for_each_inferior (kill_inferior_callback). * server.h (have_started_inferiors_p): Declare. (have_attached_inferiors_p): Declare.
2009-04-30 * inferiors.c (remove_process): Fix memory leak, free process.Doug Evans3-3/+25
* linux-low.c (linux_remove_process): New function. (linux_kill): Call it instead of remove_process. (linux_detach, linux_wait_1): Ditto.
2009-04-192009-04-19 Danny Backx <dannybackx@users.sourceforge.net>Pedro Alves2-0/+13
* configure.srv: Add x86 Windows CE target.
2009-04-03 * inferiors.c (get_thread_process): Make global.Ulrich Weigand4-2/+17
* 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-03 * remote-utils.c (prepare_resume_reply): Null-terminate packet.Ulrich Weigand3-23/+49
* spu-low.c (current_tid): Rename to ... (current_ptid): ... this. (fetch_ppc_register, fetch_ppc_memory, store_ppc_memory, spu_proc_xfer_spu, spu_resume, spu_request_interrupt): Use ptid_get_lwp (current_ptid) instead of current_tid. (spu_kill, spu_detach, spu_join, spu_wait): Use pid argument instead of current_tid. Use find_process_pid to verify pid argument is valid. Pass proper argument to remove_process. (spu_thread_alive): Compare current_ptid instead of current_tid. (spu_resume): Likewise.
2009-04-03 * linux-low.c (usr_store_inferior_registers): Declare local `pid'Pedro Alves2-0/+6
variable.
2009-04-012009-04-01 Pedro Alves <pedro@codesourcery.com>Pedro Alves16-457/+1585
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 Alves13-667/+2119
* 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-04-01 Decouple target code from remote protocol.Pedro Alves9-232/+329
* target.h (enum target_waitkind): New. (struct target_waitstatus): New. (struct target_ops) <wait>: Return an unsigned long. Take a target_waitstatus pointer instead of a char pointer. (mywait): Likewise. * target.c (mywait): Change prototype to return an unsigned long. Take a target_waitstatus pointer instead of a char pointer. Adjust. * server.h (thread_from_wait, old_thread_from_wait): Delete declarations. (prepare_resume_reply): Change prototype to take a target_waitstatus. * server.c (thread_from_wait, old_thread_from_wait): Delete. (last_status, last_ptid): New. (start_inferior): Remove "statusptr" argument. Adjust. Return a pid instead of a signal. (attach_inferior): Remove "status" and "signal" parameters. Adjust. (handle_query): For qGetTLSAddr, parse the thread id with strtol, not as an address. (handle_v_cont, handle_v_attach, handle_v_run, handle_v_kill) (handle_v_requests, myresume): Remove "status" and "signal" parameters. Adjust. (handle_status): New. (main): Delete local `status'. Adjust. * remote-utils.c: Include target.h. (prepare_resume_reply): Change prototype to take a target_waitstatus. Adjust. * linux-low.c (linux_wait): Adjust to new target_ops->wait interface. * spu-low.c (spu_wait): Adjust. * win32-low.c (enum target_waitkind, struct target_waitstatus): Delete. (win32_wait): Adjust.
2009-04-01 * target.h (struct thread_resume): Delete leave_stopped member.Pedro Alves6-63/+89
(struct target_ops): Add a `n' argument to the `resume' callback. * server.c (start_inferior): Adjust. (handle_v_cont, myresume): Adjust. * linux-low.c (check_removed_breakpoint): Adjust to resume interface change, and to removed leave_stopped field. (resume_ptr): Delete. (struct thread_resume_array): New. (linux_set_resume_request): Add new `arg' parameter. Adjust to resume interface change. (linux_continue_one_thread, linux_queue_one_thread) (resume_status_pending_p): Check if the resume field is NULL instead of checking the leave_stopped member. (linux_resume): Adjust to the target resume interface change. * spu-low.c (spu_resume): Adjust to the target resume interface change. * win32-low.c (win32_detach, win32_resume): Ditto.
2009-04-01gdb/gdbserver/Pedro Alves2-16/+36
* linux-low.c (linux_wait_for_event): Don't clear the `stepping' flag. (wait_for_sigstop): Don't leave a finished single-step SIGTRAP pending. (linux_continue_one_thread): Only preserve the stepping flag if there's a pending breakpoint. gdb/testsuite/ * gdb.threads/pending-step.c, gdb.threads/pending-step.exp: New.
2009-03-31 * server.c (main): After the inferior having exited, callPedro Alves2-0/+6
remote_close before exiting gdbserver.
2009-03-25gdb/Thiago Jung Bauermann2-5/+20
Fix size of FPSCR in Power 7 processors. * ppc-linux-nat.c (PPC_FEATURE_ARCH_2_05): Remove #define. (PPC_FEATURE_HAS_DFP): New #define. (ppc_linux_read_description): Check for DFP feature instead of ISA 2.05 to decide on size of the FPSCR. gdbserver/ Fix size of FPSCR in Power 7 processors. * linux-ppc-low.c (PPC_FEATURE_ARCH_2_05): Remove #define. (PPC_FEATURE_HAS_DFP): New #define. (ppc_arch_setup): Check for DFP feature instead of ISA 2.05 to decide on size of the FPSCR.
2009-03-23 * server.c (handle_query) Whitespace and formatting.Pedro Alves2-10/+12
2009-03-22 * i387-fp.c, linux-arm-low.c, linux-cris-low.c,Pedro Alves25-271/+285
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-22 * inferiors.c (find_inferior): Make it safe for the callbackPedro Alves2-1/+9
function to delete the currently iterated inferior.
2009-03-22 * Makefile.in (linuw_low_h): Move higher.Pedro Alves2-3/+8
(thread-db.o): Depend on $(linux_low_h).
2009-03-17 Rename "process" to "lwp" throughout.Pedro Alves5-209/+257
* 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-03-142009-03-14 Pedro Alves <pedro@codesourcery.com>Pedro Alves2-0/+11
gdb/ * remote.c (PACKET_qAttached): New. (remote_query_attached): New. (remote_add_inferior): Add new `attached' argument. Handle it. (remote_notice_new_inferior, remote_start_remote): Adjust to pass -1 to remote_add_inferior in new parameter. (extended_remote_attach_1): Adjust to pass 1 to remote_add_inferior in the new parameter. (extended_remote_create_inferior_1): Adjust to pass 0 to remote_add_inferior in the new parameter. (_initialize_remote): Add "set/show remote query-attached-packet" commands. 2009-03-14 Pedro Alves <pedro@codesourcery.com> gdb/gdbserver/ * server.c (handle_query): Handle "qAttached". 2009-03-14 Pedro Alves <pedro@codesourcery.com> gdb/doc/ * gdb.texinfo (Remote Configuration): Document query-attached. (General Query Packets): Document qAttached.
2009-03-13 * Makefile.in, hostio-errno.c, errno.c, xtensa-xtregs.c: Change toNathan Sidwell5-12/+12
GPLv3, update license URL.
2009-03-02Clean up last entry.Doug Evans1-1/+1
2009-03-02 * Makefile.in (GDB_CFLAGS): Add -I$(srcdir)/common.Doug Evans3-10/+13
(init.c): signals/ -> common/. (signals.o): Update. * target.h (target_signal_to_string,target_signal_to_string) (target_signal_from_name,target_signal_to_host_p) (target_signal_from_host,target_signal_to_host): Move to ... * common/gdb_signals.h: ... here. New file. * common/signals.c: Moved here from signals/signals.c. #include gdb_signals.h, remove #include of target.h in gdb case. (target_signal_from_command,default_target_signal_to_host) (default_target_signal_from_host): Move inside #ifndef GDBSERVER. * gdbserver/Makefile.in (INCLUDE_CFLAGS): Add -I$(srcdir)/../common. (server_h): Add gdb_signals.h. (signals.o): Update. * server.h (target_signal_from_host,target_signal_to_host_p) (target_signal_to_host,target_signal_to_name): Moved to gdb_signals.h.
2009-02-14 * remote-utils.c (getpkt): Also generate remote-debugPierre Muller2-0/+13
information if noack_mode is set.