public inbox for archer-commits@sourceware.org help / color / mirror / Atom feed
From: jkratoch@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] archer-jankratochvil-watchpoint3: Merge branch 'f-cleanup-fork-multifix' into archer-jankratochvil-watchpoint3 Date: Tue, 24 Jan 2012 14:19:00 -0000 [thread overview] Message-ID: <20120124141937.7847.qmail@sourceware.org> (raw) The branch, archer-jankratochvil-watchpoint3 has been updated via 0d1f36cdfdab40bbb8ba6de77c33b4c31e2fbd4c (commit) via 48cbc17cb0dee68d5e3bfff5afbbe2dcede2c553 (commit) via 75412c4ef4f0b398cc7ac0cbc680e2dc4b6a1842 (commit) via 5fbb49acff2a0deafd56b37f408998a6896a2109 (commit) via 2b1a2b7c56aee9e92d446ca4d9177993c33c4a67 (commit) via 7b869d6eba3bbf50cfa0f5ea9bf5e0984bdf087f (commit) via 2bfeecf636f5790a7e850e11c7936c4d9814d8ef (commit) via acdbd4298bc47103b8b12cbe8185d442a8d60af2 (commit) via 501a4a2cb44a4851fd83a6c315a39587a9841cbe (commit) via 6c42f69deca598dcd99fa94b598b56367f811e07 (commit) via 1e1e25773d4b2e697c33795ac28bb73a17eda6b4 (commit) via ef91baefe4cc042cbd272fb1953cc75b1af19142 (commit) via 99ffd3e69abb4c0ce285577931f29b53d947176b (commit) via 0e48219c65a37bf1b8855881b3b2c3f362defedd (commit) via f715ea2c9f96348a287c29e6d9619a8ce2a66f83 (commit) via f31d5ba21d7c2ffe290d0e41b8d2703f9ca0aa7a (commit) via 1ace069643a34f84b1c555c01e728b9d0865c748 (commit) via c7ace98603ceb642c66e03595c79089b35674d3f (commit) via 7d249f1c6358c5494c24458238675b7ed92f54ff (commit) via 247a6fbfda881aa9423535c33a6844616647c3b6 (commit) via e45e48a58cc293da96922eea1c149a98450343ee (commit) via 78a9133bb56807476f928df323c6a46459a4cc01 (commit) via 6ac081eef86d773aad9d6982323e1f192e7b6e63 (commit) via 431676a00b6847cb19f3bc8dad1674c45310e6e5 (commit) via 28772da2396a4d50efcdd181b76c53911e8dbde5 (commit) via b3b45e475a0561e54082cae1b5025056ad0590d3 (commit) via 75eb9ef090c2f4836280ae7f17b05bc1b27cc66a (commit) via 475df95b6ad865d01dd26dad88438e2b8e9318d5 (commit) via 544ce285e4bbbea66b65d11fdc72863a2d288975 (commit) via 8e1399302ea757c66289d9847cd33b95a89fed81 (commit) from b84a6a01b09b38dde9f5937ac12f45cc31b313a6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 0d1f36cdfdab40bbb8ba6de77c33b4c31e2fbd4c Merge: b84a6a0 48cbc17 Author: Jan Kratochvil <jan.kratochvil@redhat.com> Date: Tue Jan 24 15:19:25 2012 +0100 Merge branch 'f-cleanup-fork-multifix' into archer-jankratochvil-watchpoint3 commit 48cbc17cb0dee68d5e3bfff5afbbe2dcede2c553 Merge: acdbd42 75412c4 Author: Jan Kratochvil <jan.kratochvil@redhat.com> Date: Tue Jan 24 15:18:41 2012 +0100 Merge branch 'f-cleanup-fork' into f-cleanup-fork-multifix commit 75412c4ef4f0b398cc7ac0cbc680e2dc4b6a1842 Merge: 5fbb49a 2b1a2b7 Author: Jan Kratochvil <jan.kratochvil@redhat.com> Date: Tue Jan 24 15:18:40 2012 +0100 Merge branch 'f-cleanup' into f-cleanup-fork commit 5fbb49acff2a0deafd56b37f408998a6896a2109 Merge: 501a4a2 2bfeecf Author: Jan Kratochvil <jan.kratochvil@redhat.com> Date: Tue Jan 24 15:18:35 2012 +0100 Merge commit '2bfeecf636f5790a7e850e11c7936c4d9814d8ef' into f-cleanup-fork commit 2b1a2b7c56aee9e92d446ca4d9177993c33c4a67 Merge: 6c42f69 7b869d6 Author: Jan Kratochvil <jan.kratochvil@redhat.com> Date: Tue Jan 24 15:17:51 2012 +0100 Merge branch 'f' into f-cleanup commit 7b869d6eba3bbf50cfa0f5ea9bf5e0984bdf087f Author: Jan Kratochvil <jan.kratochvil@redhat.com> Date: Tue Jan 24 13:49:53 2012 +0000 gdb/ Fix watchpoints to be specific for each inferior. * breakpoint.c (watchpoint_in_thread_scope): Verify also current_program_space. * i386-nat.c (i386_inferior_data_cleanup): New. (i386_inferior_data_get): Replace variable inf_data_local by an inferior_data call. (i386_use_watchpoints): Initialize i386_inferior_data. * linux-nat.c (linux_nat_iterate_watchpoint_lwps): Use INFERIOR_PTID specific iterate_over_lwps. gdb/testsuite/ Fix watchpoints to be specific for each inferior. * gdb.multi/watchpoint-multi.c: New file. * gdb.multi/watchpoint-multi.exp: New file. commit 2bfeecf636f5790a7e850e11c7936c4d9814d8ef Author: Jan Kratochvil <jan.kratochvil@redhat.com> Date: Tue Jan 24 13:46:50 2012 +0000 gdb/ Fix watchpoints across inferior fork. * amd64-linux-nat.c (update_debug_registers_callback): Update the comment for linux_nat_iterate_watchpoint_lwps. (amd64_linux_dr_set_control, amd64_linux_dr_set_addr): Use linux_nat_iterate_watchpoint_lwps. (amd64_linux_prepare_to_resume): New comment on Linux kernel. * i386-linux-nat.c (update_debug_registers_callback): Update the comment for linux_nat_iterate_watchpoint_lwps. (i386_linux_dr_set_control, i386_linux_dr_set_addr): Use linux_nat_iterate_watchpoint_lwps. (i386_linux_prepare_to_resume): New comment on Linux kernel. * i386-nat.c: Include inferior.h. (dr_mirror): Remove. (i386_inferior_data, struct i386_inferior_data) (i386_inferior_data_get): New. (i386_debug_reg_state): Use i386_inferior_data_get. (i386_cleanup_dregs, i386_update_inferior_debug_regs) (i386_insert_watchpoint, i386_remove_watchpoint) (i386_stopped_data_address, i386_insert_hw_breakpoint) (i386_remove_hw_breakpoint): New variable state, use i386_debug_reg_state instead of DR_MIRROR. * linux-nat.c (delete_lwp): New declaration. (num_lwps): Move here from downwards. (delete_lwp_cleanup): New. (linux_child_follow_fork): Create new child_lp, call linux_nat_new_thread and linux_nat_prepare_to_resume before calling PTRACE_DETACH. (num_lwps): Move upwards. (linux_nat_iterate_watchpoint_lwps): New. * linux-nat.h (linux_nat_iterate_watchpoint_lwps_ftype): New. (linux_nat_iterate_watchpoint_lwps_ftype): New declaration. gdb/testsuite/ Fix watchpoints across inferior fork. * gdb.threads/watchpoint-fork-child.c: New file. * gdb.threads/watchpoint-fork-mt.c: New file. * gdb.threads/watchpoint-fork-parent.c: New file. * gdb.threads/watchpoint-fork-st.c: New file. * gdb.threads/watchpoint-fork.exp: New file. * gdb.threads/watchpoint-fork.h: New file. commit acdbd4298bc47103b8b12cbe8185d442a8d60af2 Merge: 1e1e257 501a4a2 Author: Jan Kratochvil <jan.kratochvil@redhat.com> Date: Tue Jan 24 14:40:56 2012 +0100 Merge branch 'f-cleanup-fork' into f-cleanup-fork-multifix commit 501a4a2cb44a4851fd83a6c315a39587a9841cbe Author: Jan Kratochvil <jan.kratochvil@redhat.com> Date: Tue Jan 24 14:39:26 2012 +0100 . commit 6c42f69deca598dcd99fa94b598b56367f811e07 Merge: 3c79350 99ffd3e Author: Jan Kratochvil <jan.kratochvil@redhat.com> Date: Tue Jan 24 14:35:33 2012 +0100 Merge branch 'f' into f-cleanup commit 1e1e25773d4b2e697c33795ac28bb73a17eda6b4 Merge: d196843 ef91bae Author: Jan Kratochvil <jan.kratochvil@redhat.com> Date: Tue Jan 24 14:35:33 2012 +0100 Merge branch 'f-cleanup-fork' into f-cleanup-fork-multifix commit ef91baefe4cc042cbd272fb1953cc75b1af19142 Merge: 4639f9c 6c42f69 Author: Jan Kratochvil <jan.kratochvil@redhat.com> Date: Tue Jan 24 14:35:33 2012 +0100 Merge branch 'f-cleanup' into f-cleanup-fork commit 99ffd3e69abb4c0ce285577931f29b53d947176b Author: gdbadmin <gdbadmin@sourceware.org> Date: Tue Jan 24 11:35:39 2012 +0000 GDB 7.4 released. commit 0e48219c65a37bf1b8855881b3b2c3f362defedd Author: Alan Modra <amodra@bigpond.net.au> Date: Tue Jan 24 01:22:37 2012 +0000 daily update commit f715ea2c9f96348a287c29e6d9619a8ce2a66f83 Author: gdbadmin <gdbadmin@sourceware.org> Date: Tue Jan 24 00:00:33 2012 +0000 *** empty log message *** ----------------------------------------------------------------------- Summary of changes: bfd/ChangeLog | 12 +++ bfd/elf-bfd.h | 24 +++++-- bfd/elf.c | 35 ++++++++-- bfd/elf64-ppc.c | 21 ++++++- bfd/elfxx-target.h | 7 ++- bfd/version.h | 2 +- gdb/ChangeLog | 79 ++++++++++++++++++++++ gdb/cli/cli-cmds.c | 11 +++ gdb/gdbserver/ChangeLog | 10 +++ gdb/gdbserver/linux-low.c | 3 +- gdb/gdbserver/server.c | 27 +++++--- gdb/i386-nat.c | 11 ++-- gdb/inf-child.c | 2 +- gdb/linux-tdep.c | 12 ++- gdb/target.c | 8 +- gdb/testsuite/ChangeLog | 24 +++++++ gdb/testsuite/gdb.base/call-signal-resume.exp | 4 +- gdb/testsuite/gdb.python/py-finish-breakpoint.py | 2 +- gdb/testsuite/gdb.threads/watchpoint-fork-mt.c | 2 +- gdb/testsuite/gdb.threads/watchpoint-fork.exp | 5 ++ gdb/top.c | 24 ++++--- gdb/top.h | 2 +- gdb/utils.c | 4 +- gdb/version.in | 2 +- libiberty/ChangeLog | 4 + libiberty/configure | 2 +- 26 files changed, 274 insertions(+), 65 deletions(-) First 500 lines of diff: diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 994a1ce..23c33a1 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,15 @@ +2012-01-23 Alan Modra <amodra@gmail.com> + + * elf-bfd.h: Formatting. + (struct elf_backend_data): Add "maybe_function_sym". + (_bfd_elf_maybe_function_sym): Declare. + * elfxx-target.h (elf_backend_maybe_function_sym): Define. + (elfNN_bed): Init new field. + * elf.c (elf_find_function): Use maybe_function_sym. + (_bfd_elf_maybe_function_sym): New function. + * elf64-ppc.c (elf_backend_maybe_function_sym): Define. + (ppc64_elf_maybe_function_sym): New function. + 2012-01-20 Francois Gouget <fgouget@codeweavers.com> PR binutils/13534 diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index c7846e1..98948a9 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -1,6 +1,6 @@ /* BFD back-end data structures for ELF files. Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 + 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. Written by Cygnus Support. @@ -1221,6 +1221,11 @@ struct elf_backend_data /* Return TRUE if type is a function symbol type. */ bfd_boolean (*is_function_type) (unsigned int type); + /* Return TRUE if symbol may be a function. Set *CODE_SEC and *CODE_VAL + to the function's entry point. */ + bfd_boolean (*maybe_function_sym) (const elf_symbol_type *sym, + asection **code_sec, bfd_vma *code_off); + /* Used to handle bad SHF_LINK_ORDER input. */ bfd_error_handler_type link_order_error_handler; @@ -1413,14 +1418,14 @@ struct bfd_elf_section_data void *sec_info; }; -#define elf_section_data(sec) ((struct bfd_elf_section_data*)(sec)->used_by_bfd) +#define elf_section_data(sec) ((struct bfd_elf_section_data*)(sec)->used_by_bfd) #define elf_linked_to_section(sec) (elf_section_data(sec)->linked_to) -#define elf_section_type(sec) (elf_section_data(sec)->this_hdr.sh_type) -#define elf_section_flags(sec) (elf_section_data(sec)->this_hdr.sh_flags) -#define elf_group_name(sec) (elf_section_data(sec)->group.name) -#define elf_group_id(sec) (elf_section_data(sec)->group.id) -#define elf_next_in_group(sec) (elf_section_data(sec)->next_in_group) -#define elf_fde_list(sec) (elf_section_data(sec)->fde_list) +#define elf_section_type(sec) (elf_section_data(sec)->this_hdr.sh_type) +#define elf_section_flags(sec) (elf_section_data(sec)->this_hdr.sh_flags) +#define elf_group_name(sec) (elf_section_data(sec)->group.name) +#define elf_group_id(sec) (elf_section_data(sec)->group.id) +#define elf_next_in_group(sec) (elf_section_data(sec)->next_in_group) +#define elf_fde_list(sec) (elf_section_data(sec)->fde_list) #define elf_sec_group(sec) (elf_section_data(sec)->sec_group) #define xvec_get_elf_backend_data(xvec) \ @@ -2197,6 +2202,9 @@ extern bfd_boolean _bfd_elf_map_sections_to_segments extern bfd_boolean _bfd_elf_is_function_type (unsigned int); +extern bfd_boolean _bfd_elf_maybe_function_sym (const elf_symbol_type *, + asection **, bfd_vma *); + extern int bfd_elf_get_default_section_type (flagword); extern void bfd_elf_lookup_section_flags diff --git a/bfd/elf.c b/bfd/elf.c index 35007cd..9c9ba75 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -1,7 +1,7 @@ /* ELF executable support for BFD. Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 + 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -7406,6 +7406,8 @@ elf_find_function (bfd *abfd, { elf_symbol_type *q; unsigned int type; + asection *code_sec; + bfd_vma code_off; q = (elf_symbol_type *) *p; @@ -7418,15 +7420,13 @@ elf_find_function (bfd *abfd, state = file_after_symbol_seen; continue; default: - if (!bed->is_function_type (type)) - break; - case STT_NOTYPE: - if (bfd_get_section (&q->symbol) == section - && q->symbol.value >= low_func - && q->symbol.value <= offset) + if (bed->maybe_function_sym (q, &code_sec, &code_off) + && code_sec == section + && code_off >= low_func + && code_off <= offset) { func = (asymbol *) q; - low_func = q->symbol.value; + low_func = code_off; filename = NULL; if (file != NULL && (ELF_ST_BIND (q->internal_elf_sym.st_info) == STB_LOCAL @@ -9690,3 +9690,22 @@ _bfd_elf_is_function_type (unsigned int type) return (type == STT_FUNC || type == STT_GNU_IFUNC); } + +/* Return TRUE iff the ELF symbol SYM might be a function. Set *CODE_SEC + and *CODE_OFF to the function's entry point. */ + +bfd_boolean +_bfd_elf_maybe_function_sym (const elf_symbol_type *sym, + asection **code_sec, bfd_vma *code_off) +{ + unsigned int type = ELF_ST_TYPE (sym->internal_elf_sym.st_info); + if (type == STT_NOTYPE + || type == STT_FUNC + || type == STT_GNU_IFUNC) + { + *code_sec = sym->symbol.section; + *code_off = sym->symbol.value; + return TRUE; + } + return FALSE; +} diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index 7ffbe0e..a51115e 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -105,6 +105,7 @@ static bfd_vma opd_entry_value #define elf_backend_gc_sweep_hook ppc64_elf_gc_sweep_hook #define elf_backend_adjust_dynamic_symbol ppc64_elf_adjust_dynamic_symbol #define elf_backend_hide_symbol ppc64_elf_hide_symbol +#define elf_backend_maybe_function_sym ppc64_elf_maybe_function_sym #define elf_backend_always_size_sections ppc64_elf_func_desc_adjust #define elf_backend_size_dynamic_sections ppc64_elf_size_dynamic_sections #define elf_backend_init_index_section _bfd_elf_init_2_index_sections @@ -5528,7 +5529,8 @@ opd_entry_value (asection *opd_sec, Elf_Internal_Rela *lo, *hi, *look; bfd_vma val; - /* No relocs implies we are linking a --just-symbols object. */ + /* No relocs implies we are linking a --just-symbols object, or looking + at a final linked executable with addr2line or somesuch. */ if (opd_sec->reloc_count == 0) { char buf[8]; @@ -5631,6 +5633,23 @@ opd_entry_value (asection *opd_sec, return val; } +/* Return TRUE iff the ELF symbol SYM might be a function. Set *CODE_SEC + and *CODE_OFF to the function's entry point. */ + +static bfd_boolean +ppc64_elf_maybe_function_sym (const elf_symbol_type *sym, + asection **code_sec, bfd_vma *code_off) +{ + if (_bfd_elf_maybe_function_sym (sym, code_sec, code_off)) + { + if (strcmp (sym->symbol.section->name, ".opd") == 0) + opd_entry_value (sym->symbol.section, sym->symbol.value, + code_sec, code_off); + return TRUE; + } + return FALSE; +} + /* Return true if symbol is defined in a regular object file. */ static bfd_boolean diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h index 96ecce3..5a6cae0 100644 --- a/bfd/elfxx-target.h +++ b/bfd/elfxx-target.h @@ -1,6 +1,6 @@ /* Target definitions for NN-bit ELF Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 + 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -655,6 +655,10 @@ #define elf_backend_is_function_type _bfd_elf_is_function_type #endif +#ifndef elf_backend_maybe_function_sym +#define elf_backend_maybe_function_sym _bfd_elf_maybe_function_sym +#endif + #ifndef elf_match_priority #define elf_match_priority \ (ELF_ARCH == bfd_arch_unknown ? 2 : ELF_OSABI == ELFOSABI_NONE ? 1 : 0) @@ -750,6 +754,7 @@ static struct elf_backend_data elfNN_bed = elf_backend_merge_symbol, elf_backend_hash_symbol, elf_backend_is_function_type, + elf_backend_maybe_function_sym, elf_backend_link_order_error_handler, elf_backend_relplt_name, ELF_MACHINE_ALT1, diff --git a/bfd/version.h b/bfd/version.h index 8753259..82b9845 100644 --- a/bfd/version.h +++ b/bfd/version.h @@ -1,4 +1,4 @@ -#define BFD_VERSION_DATE 20120120 +#define BFD_VERSION_DATE 20120124 #define BFD_VERSION @bfd_version@ #define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@ #define REPORT_BUGS_TO @report_bugs_to@ diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 847cff9..bc1ea09 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,82 @@ +2012-01-24 Jan Kratochvil <jan.kratochvil@redhat.com> + + Fix watchpoints to be specific for each inferior. + * breakpoint.c (watchpoint_in_thread_scope): Verify also + current_program_space. + * i386-nat.c (i386_inferior_data_cleanup): New. + (i386_inferior_data_get): Replace variable inf_data_local by an + inferior_data call. + (i386_use_watchpoints): Initialize i386_inferior_data. + * linux-nat.c (linux_nat_iterate_watchpoint_lwps): Use INFERIOR_PTID + specific iterate_over_lwps. + +2012-01-24 Jan Kratochvil <jan.kratochvil@redhat.com> + + Fix watchpoints across inferior fork. + * amd64-linux-nat.c (update_debug_registers_callback): Update the + comment for linux_nat_iterate_watchpoint_lwps. + (amd64_linux_dr_set_control, amd64_linux_dr_set_addr): Use + linux_nat_iterate_watchpoint_lwps. + (amd64_linux_prepare_to_resume): New comment on Linux kernel. + * i386-linux-nat.c (update_debug_registers_callback): Update the + comment for linux_nat_iterate_watchpoint_lwps. + (i386_linux_dr_set_control, i386_linux_dr_set_addr): Use + linux_nat_iterate_watchpoint_lwps. + (i386_linux_prepare_to_resume): New comment on Linux kernel. + * i386-nat.c: Include inferior.h. + (dr_mirror): Remove. + (i386_inferior_data, struct i386_inferior_data) + (i386_inferior_data_get): New. + (i386_debug_reg_state): Use i386_inferior_data_get. + (i386_cleanup_dregs, i386_update_inferior_debug_regs) + (i386_insert_watchpoint, i386_remove_watchpoint) + (i386_stopped_data_address, i386_insert_hw_breakpoint) + (i386_remove_hw_breakpoint): New variable state, use + i386_debug_reg_state instead of DR_MIRROR. + * linux-nat.c (delete_lwp): New declaration. + (num_lwps): Move here from downwards. + (delete_lwp_cleanup): New. + (linux_child_follow_fork): Create new child_lp, call + linux_nat_new_thread and linux_nat_prepare_to_resume before calling + PTRACE_DETACH. + (num_lwps): Move upwards. + (linux_nat_iterate_watchpoint_lwps): New. + * linux-nat.h (linux_nat_iterate_watchpoint_lwps_ftype): New. + (linux_nat_iterate_watchpoint_lwps_ftype): New declaration. + +2012-01-24 Joel Brobecker <brobecker@adacore.com> + + GDB 7.4 released. + +2012-01-23 Pedro Alves <palves@redhat.com> + + * top.c (caution): Rename to ... + (confirm): ... this. + (show_caution): Rename to ... + (show_confirm): ... this. + (quit_cover): Adjust. + (init_main): Adjust. + * top.h (caution): Rename to ... + (confirm): ... this. + * utils.c (internal_vproblem, defaulted_query): Adjust. + +2012-01-23 Pedro Alves <palves@redhat.com> + + * top.c (caution): Update comment. + (execute_command): Don't consider the current value of `caution'. + +2012-01-23 Jan Kratochvil <jan.kratochvil@redhat.com> + + * cli/cli-cmds.c (find_and_open_script): Handle failure of fdopen. + +2012-01-23 Ulrich Weigand <ulrich.weigand@linaro.org> + + * inf-child.c: Include "gdb_stat.h" instead of <sys/stat.h>. + * linux-tdep.c (linux_info_proc): Avoid ARI coding style warning. + * target.c (target_fileio_pwrite): Remove buffer address from + debug output. + (target_fileio_pread): Likewise. + 2012-01-20 Ulrich Weigand <ulrich.weigand@linaro.org> * NEWS: Document remote "info proc" and "generate-core-file". diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c index c38167a..91421aa 100644 --- a/gdb/cli/cli-cmds.c +++ b/gdb/cli/cli-cmds.c @@ -513,6 +513,17 @@ find_and_open_script (const char *script_file, int search_path, do_cleanups (old_cleanups); *streamp = fdopen (fd, FOPEN_RT); + if (*streamp == NULL) + { + int save_errno = errno; + + close (fd); + if (full_pathp) + xfree (*full_pathp); + errno = save_errno; + return 0; + } + return 1; } diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 0cb67da..57ac46d 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,13 @@ +2012-01-23 Pedro Alves <palves@redhat.com> + + * server.c (main): Avoid yet another case of infinite loop while + detaching/killing after a longjmp. + +2012-01-20 Jan Kratochvil <jan.kratochvil@redhat.com> + + Code cleanup. + * linux-low.c (linux_wait_for_event_1): Use ptid_is_pid. + 2012-01-20 Ulrich Weigand <ulrich.weigand@linaro.org> * hostio.c (handle_readlink): New function. diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index dc79748..99ae54e 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -1579,8 +1579,7 @@ linux_wait_for_event (ptid_t ptid, int *wstat, int options) /* Check for a lwp with a pending status. */ - if (ptid_equal (ptid, minus_one_ptid) - || ptid_equal (pid_to_ptid (ptid_get_pid (ptid)), ptid)) + if (ptid_equal (ptid, minus_one_ptid) || ptid_is_pid (ptid)) { event_child = (struct lwp_info *) find_inferior (&all_lwps, status_pending_p_callback, &ptid); diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c index 3080a0c..c1788a9 100644 --- a/gdb/gdbserver/server.c +++ b/gdb/gdbserver/server.c @@ -2727,13 +2727,10 @@ main (int argc, char *argv[]) inferiors, we'd end up here again, stuck in an infinite loop trap. Be sure that if that happens, we exit immediately instead. */ - if (setjmp (toplevel)) - { - fprintf (stderr, "Detach or kill failed. Exiting\n"); - exit (1); - } - - detach_or_kill_for_exit (); + if (setjmp (toplevel) == 0) + detach_or_kill_for_exit (); + else + fprintf (stderr, "Detach or kill failed. Exiting\n"); exit (1); } @@ -2779,8 +2776,20 @@ main (int argc, char *argv[]) if (exit_requested || run_once) { - detach_or_kill_for_exit (); - exit (0); + /* If something fails and longjmps while detaching or + killing inferiors, we'd end up here again, stuck in an + infinite loop trap. Be sure that if that happens, we + exit immediately instead. */ + if (setjmp (toplevel) == 0) + { + detach_or_kill_for_exit (); + exit (0); + } + else + { + fprintf (stderr, "Detach or kill failed. Exiting\n"); + exit (1); + } } fprintf (stderr, diff --git a/gdb/i386-nat.c b/gdb/i386-nat.c index 846b2b8..753de67 100644 --- a/gdb/i386-nat.c +++ b/gdb/i386-nat.c @@ -176,10 +176,10 @@ static const struct inferior_data *i386_inferior_data; /* Per-inferior data. */ struct i386_inferior_data - { - /* Copy of i386 hardware debug registers for performance reasons. */ - struct i386_debug_reg_state state; - }; +{ + /* Copy of i386 hardware debug registers for performance reasons. */ + struct i386_debug_reg_state state; +}; /* Per-inferior hook for register_inferior_data_with_cleanup. */ @@ -236,8 +236,7 @@ i386_inferior_data_get (void) the forked off process. */ detached_inf_pid = ptid_get_pid (inferior_ptid); - memcpy (&detached_inf_data_local, inf_data, - sizeof (detached_inf_data_local)); + detached_inf_data_local = *inf_data; } return &detached_inf_data_local; diff --git a/gdb/inf-child.c b/gdb/inf-child.c index 2271824..96c1157 100644 --- a/gdb/inf-child.c +++ b/gdb/inf-child.c @@ -26,6 +26,7 @@ #include "target.h" #include "inferior.h" #include "gdb_string.h" +#include "gdb_stat.h" #include "inf-child.h" #include "gdb/fileio.h" @@ -33,7 +34,6 @@ #include <sys/param.h> /* for MAXPATHLEN */ #endif #include <sys/types.h> -#include <sys/stat.h> #include <fcntl.h> #include <unistd.h> diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c index 421518a..3ab98c7 100644 --- a/gdb/linux-tdep.c +++ b/gdb/linux-tdep.c @@ -402,7 +402,6 @@ linux_info_proc (struct gdbarch *gdbarch, char *args, { struct cleanup *cleanup = make_cleanup (xfree, data); const char *p = data; - const char *ep; ULONGEST val; printf_filtered (_("Process: %s\n"), @@ -410,10 +409,15 @@ linux_info_proc (struct gdbarch *gdbarch, char *args, while (*p && isspace (*p)) p++; - if (*p == '(' && (ep = strchr (p, ')')) != NULL) + if (*p == '(') { - printf_filtered ("Exec file: %.*s\n", (int) (ep - p - 1), p + 1); - p = ep + 1; + const char *ep = strchr (p, ')'); + if (ep != NULL) + { + printf_filtered ("Exec file: %.*s\n", + (int) (ep - p - 1), p + 1); + p = ep + 1; + } } while (*p && isspace (*p)) diff --git a/gdb/target.c b/gdb/target.c index c64a9d8..ad304bc 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -3258,9 +3258,9 @@ target_fileio_pwrite (int fd, const gdb_byte *write_buf, int len, hooks/post-receive -- Repository for Project Archer.
next reply other threads:[~2012-01-24 14:19 UTC|newest] Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-01-24 14:19 jkratoch [this message] -- strict thread matches above, loose matches on Subject: below -- 2012-01-30 16:58 jkratoch 2012-01-20 20:16 jkratoch 2012-01-20 11:07 jkratoch 2012-01-20 1:30 jkratoch 2012-01-20 1:20 jkratoch 2012-01-05 9:18 jkratoch 2012-01-02 22:43 jkratoch 2012-01-02 16:46 jkratoch 2012-01-02 15:19 jkratoch 2011-12-26 23:24 jkratoch 2011-12-26 22:04 jkratoch 2011-12-26 20:32 jkratoch 2011-12-26 19:28 jkratoch
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20120124141937.7847.qmail@sourceware.org \ --to=jkratoch@sourceware.org \ --cc=archer-commits@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).