aboutsummaryrefslogtreecommitdiff
path: root/gdb
AgeCommit message (Collapse)AuthorFilesLines
2013-07-27gdb/Yao Qi2-87/+155
* mips-linux-nat.c (get_irw_mask): Rename to ... (mips_linux_watch_get_irw_mask): ... this. Rename parameter 'set' to 'n'. Update function comment. All callers changed. (get_reg_mask): Rename parameter 'set' to 'n'. Update function comment. All callers changed. (get_num_valid): Rename to ... (mips_linux_watch_get_num_valid): ... this. Rename parameter 'set' to 'n'. Update function comment. All callers changed. (get_watchlo): Rename to ... (mips_linux_watch_get_watchlo): ... this. Rename parameter 'set' to 'n'. Update function comment. All callers changed. (set_watchlo): Rename to ... (mips_linux_watch_set_watchlo): ... this. Rename parameter 'set' to 'n'. Update function comment. All callers changed. (get_watchhi): Rename to ... (mips_linux_watch_get_watchhi): ... this. Update function comment. All callers changed. (set_watchhi): Rename to ... (mips_linux_watch_set_watchhi): ... this. Update function comment. All callers changed. (mips_linux_read_watch_registers): Update function comment. Add new parameters 'lwpid', 'watch_readback', and 'watch_readback_valid'. Update. (type_to_irw): Rename to ... (mips_linux_watch_type_to_irw): ... this. Update function comment. All callers changed. (fill_mask): Update function comment. (try_one_watch): Rename to ... (mips_linux_watch_try_one_watch): ... this. Change the type of parameter 'irw' from 'unsigned' to 'uint32_t'. (populate_regs_from_watches): Rename to ... (mips_linux_watch_populate_regs): ... this. Add parameter 'current_watches'. All callers changed.
2013-07-27gdb/Yao Qi2-16/+31
* mips-linux-nat.c (MAX_DEBUG_REGISTER): Move it earlier in the code. (PTRACE_SET_WATCH_REGS, enum pt_watch_style): Remove. (struct mips32_watch_regs, struct mips64_watch_regs): Remove. (struct pt_watch_regs): Likewise. [!PTRACE_GET_WATCH_REGS] (PTRACE_SET_WATCH_REGS): New macro. [!PTRACE_GET_WATCH_REGS] (enum pt_watch_style): New. [!PTRACE_GET_WATCH_REGS] (struct mips32_watch_regs): New. [!PTRACE_GET_WATCH_REGS] (struct mips64_watch_regs): New. [!PTRACE_GET_WATCH_REGS] (struct pt_watch_regs): New.
2013-07-27gdb/Yao Qi5-17/+43
* breakpoint.h: Include break-common.h. (enum target_hw_bp_type): Move to ... * common/break-common.h: ... here. New. gdb/gdbserver/ * i386-low.c: Include break-common.h. (enum target_hw_bp_type): Remove.
2013-07-26 * gdb.mi/mi-var-child-f.exp: Pass f90 to gdb_compile insteadKeith Seitz2-8/+23
of f77. Allow for compiler variations of integer types. Use mi_create_varobj. Use mi_list_varobj_children for the immediate children of `array'. Add "has_more" attribute for grandchildren test.
2013-07-26GDB kills itself instead of interrupting inferiorPedro Alves5-7/+121
When GDB is run with IO redirected to a pipe, the 'interrupt' command causes it to kill its own process group instead of the inferior's. The problem manifests itself in async mode, native debugging: $ cat | gdb <file> (gdb) set target-async on (gdb) run & (gdb) interrupt A debugging session is active. Inferior 1 [process 20584] will be killed. Quit anyway? (y or n) [answered Y; input not from terminal] In this case, GDB tells that its stdin isn't a tty and doesn't save the inferior's process group in inflow.c:terminal_init_inferior_with_pgrp. The 'interrupt' command tries to 'kill' the inferior's process group in `inf-ptrace.c:inf_ptrace_stop`, but since that wasn't saved in the first place, GDB kills process group 0, meaning, its own process group. When GDB is used from a frontend, that means killing its own process group including the frontend and possibly the X session. This was originally seen with SublimeGDB: https://github.com/quarnster/SublimeGDB/issues/29. The patch makes GDB save the inferior pgid regardless of having a terminal, as pgid is used not only to reset foreground process group, but also to interrupt the inferior process. It also adds a regression test. Luckily, we can emulate not having a terminal with "set interactive-mode off", avoiding the need of special magic to spawn gdb with a pipe. Tested on x86_64 Fedora 17. gdb/ 2013-07-26 Cyril Nikolaev <cyril@nichtverstehen.de> * inflow.c (terminal_init_inferior_with_pgrp): Save inferior process group regardless of having tty on stdin. gdb/testsuite/ 2013-07-26 Pedro Alves <palves@redhat.com> * gdb.base/interrupt-noterm.c, gdb.base/interrupt-noterm.exp: New files.
2013-07-25 * linux-fork.h (detach_fork): Delete.Doug Evans2-3/+4
2013-07-25remove pop_targetTom Tromey9-28/+25
This patch fixes the target double-close problem (PR remote/15266), and in the process removes pop_target entire (PR remote/15256). The first issue is that pop_target calls target_close. However, it then calls unpush_target, which also calls target_close. This means targets must be able to be closed twice. Not only is this strange, but it also directly contradicts the contract of to_xclose targets. (We currently have just a single such target, and it is never pushed; but I plan to add more, and so this latent bug is triggered.) The second issue is that it seems to me that calling pop_target is often unsafe. This is what cropped up in 15256, where the remote target assumed that it could pop_target -- but there was another target higher on the stack, leading to confusion. But, it is always just as easy to call unpush_target as it is to call pop_target; and it is also safer. So, removing pop_target seemed like an improvement. Finally, this adds an assertion to target_close to ensure that no currently-pushed target can be closed. Built and regtested on x86-64 Fedora 18; both natively and using the native-gdbserver board file. PR remote/15256, PR remote/15266: * bfd-target.c (target_bfd_reopen): Initialize to_magic. * monitor.c (monitor_detach): Use unpush_target. * remote-m32r-sdi.c (m32r_detach): Use unpush_target. * remote-mips.c (mips_detach): Use unpush_target. Don't call mips_close. * remote-sim.c (gdbsim_detach): Use unpush_target. * target.c (pop_target): Remove. (pop_all_targets_above): Don't call target_close. (target_close): Assert that the target is unpushed. * target.h (pop_target): Don't declare. * tracepoint.c (tfile_open): Use unpush_target.
2013-07-25don't call add_target for thread_db_opsTom Tromey4-8/+32
Right now, "help target" will include this line: target multi-thread -- Threads and pthreads support However, it doesn't make sense to invoke "target multi-thread". This patch fixes the problem by not registering the multi-thread target. add_target does some needed initialization of the target_ops, so I broke this out into a new function. It isn't clear to me whether this patch requires a test case or not. I'm not sure whether there are other unregistered targets; but if there are, it seems unlikely that we test for their absence from the help. Built and regtested on x86-64 Fedora 18. * linux-thread-db.c (init_thread_db_ops): Call complete_target_initialization. (_initialize_thread_db): Don't call add_target. * target.c (complete_target_initialization): New function. (add_target_with_completer): Call it. * target.h (complete_target_initialization): Declare.
2013-07-252013-07-25 Mark Kettenis <kettenis@gnu.org>Mark Kettenis4-17/+139
* hppa-tdep.h (enum hppa_regnum): Add members for all space registers. * hppaobsd-tdep.c (HPPAOBSD_SIZEOF_GREGS): Add comment. (HPPANBSD_SIZEOF_GREGS): New define. (hppaobsd_supply_gregset): Handle additional registers. * hppabsd-nat.c (hppabsd_gregset_supplies_p): Adjust to indicate we provide more registers now. (hppabsd_supply_gregset): Supply additional registers. (hppabsd_collect_gregset): Collect additional registers.
2013-07-252013-07-25 Mark Kettenis <kettenis@gnu.org>Mark Kettenis2-0/+22
* hppabsd-tdep.c: Include "dwarf2-frame.h". (hppabsd_dwarf2_frame_init_reg): New function. (hppabsd_init_abi): Hook in the DWARF CFI frame unwinder.
2013-07-25Resue 'z' formatter from mi register display code.Andrew Burgess6-37/+652
http://sourceware.org/ml/gdb-patches/2013-07/msg00236.html gdb/ChangeLog * mi/mi-main.c (output_register): Make MI 'r' format use standard 'z' format code. Remove error for optimized out values, standard code will handle these fine. gdb/testsuite/ChangeLog * gdb.mi/mi-reg-undefined.exp: New file. * gdb.mi/mi-reg-undefined.c: Likewise. * gdb.mi/mi-reg-undefined.S: Likewise.
2013-07-25Add new 'z' format for print command.Andrew Burgess8-2/+43
http://sourceware.org/ml/gdb-patches/2013-07/msg00235.html gdb/ChangeLog * NEWS: Mention new 'z' formatter. * printcmd.c (print_scalar_formatted): Add new 'z' formatter. (_initialize_printcmd): Mention 'z' formatter in help text of the 'x' command. gdb/doc/ChangeLog * gdb.texinfo (Output Formats): Mention the new 'z' formatter. gdb/testsuite/ChangeLog * gdb.base/printcmds.exp (test_print_int_arrays): Add tests for x, z, o, and t output formats. * gdb.base/display.exp: Use 'k' as an undefined format now that 'z' is defined.
2013-07-24 * mips-tdep.c (micromips_deal_with_atomic_sequence): CorrectMaciej W. Rozycki2-1/+6
formatting.
2013-07-24 * boards/native-stdio-gdbserver.exp (${board}_build_remote_cmd): PassDoug Evans2-1/+6
"--" to switch.
2013-07-242013-07-24 Sergio Durigan Junior <sergiodj@redhat.com>Sergio Durigan Junior8-10/+161
* breakpoint.c (create_longjmp_master_breakpoint): Check if probe interface can evaluate arguments. Fallback to the old mode if it cannot. (create_exception_master_breakpoint): Likewise. * elfread.c (elf_can_evaluate_probe_arguments): New function. (struct sym_probe_fns elf_probe_fns): Export function above to the probe interface. * probe.c (can_evaluate_probe_arguments): New function. * probe.h (struct probe_ops) <can_evaluate_probe_arguments>: New function pointer. (can_evaluate_probe_arguments): New function prototype. * solib-svr4.c (svr4_create_solib_event_breakpoints): Check if probe interface can evaluate arguments. Fallback to the old mode if it cannot. * stap-probe.c (stap_get_probe_argument_count): Check if probe interface can evaluate arguments. Warning the user if it cannot. (stap_can_evaluate_probe_arguments): New function. (struct probe_ops stap_probe_ops): Export function above to the probe interface. * symfile.h (struct sym_probe_fns) <can_evaluate_probe_arguments>: New function pointer.
2013-07-24 gdb/Luis Machado12-284/+290
* Makefile.in (SFILES): Add common/target-common.c. Add common/target-common.h to headers. (COMMON_OBS): Add target-common.o. (target-common.o): New target. * linux-nat.h (resume_kind): Move to common/target-common.h. * target.c (target_waitstatus_to_string): Move to common/target-common.c. * target.h: Include target-common.h. (target_waitkind): Move to common/target-common.h. (target_waitstatus): Likewise. (TARGET_WNOHANG): Likewise. * common/target-common.c: New file. * common/target-common.h: New file. gdb/gdbserver/ * Makefile.in (SFILES): /common/target-common.c. (OBS): Add target-common.o. (server_h): Add $(srcdir)/../common/target-common.h. (target-common.o): New target. * server.c (queue_stop_reply_callback): Free status string after use. * target.c (target_waitstatus_to_string): Remove. * target.h: Include target-common.h. (resume_kind): Likewise. (target_waitkind): Likewise. (target_waitstatus): Likewise. (TARGET_WNOHANG): Likewise.
2013-07-24 * dwarf2read.c (lookup_dwo_cutu): Change missing DWO complaint toDoug Evans2-6/+12
a warning.
2013-07-24gdb/testsuite/Yao Qi3-5/+25
* gdb.mi/mi-var-cmd.exp: If host is remote, use ${testfile} on host. * gdb.mi/mi-basics.exp (test_exec_and_symbol_mi_operatons): Likewise. If host is remote, copy ${binfile} to host.
2013-07-23gdb/Yao Qi5-9/+19
* i386-tdep.c (i386_in_stack_tramp_p): Remove unused parameter 'gdbarch'. (i386_stack_tramp_frame_sniffer): Caller update. * i386-linux-tdep.c (i386_linux_core_read_xcr0): Remove parameter 'gdbarch' and 'target'. (i386_linux_core_read_description): Caller update. * amd64-linux-tdep.c (amd64_linux_core_read_description): Likewise. * i386-linux-tdep.h (i386_linux_core_read_xcr0): Update declaration.
2013-07-23 * dwarf2read.c (init_cutu_and_read_dies): Revert patch fromTom Tromey2-14/+24
2013-07-22.
2013-07-23gdb/testsuite/Yao Qi2-3/+8
* gdb.mi/mi-var-cmd.exp: Adjust pattern to match current error message.
2013-07-22Fix the following ChangeLog entry:Jan Kratochvil1-2/+4
2013-07-22 Doug Evans <dje@google.com> gdb/ * exec.h (remove_target_sections): Delete arg abfd. * exec.c (exec_close): Update call to remove_target_sections. (remove_target_sections): Delete arg abfd. * solib.c (update_solib_list): Ditto. (reload_shared_libraries_1): Ditto. (clear_solib): Ditto, and unconditionally call remove_target_sections. * target.h (struct target_section): Rename key to owner. All uses updated.
2013-07-222013-07-22 Doug Evans <dje@google.com>Jan Kratochvil5-19/+31
gdb/ * exec.h (remove_target_sections): Delete arg abfd. * exec.c (remove_target_sections): Delete arg abfd. (exec_close): Update call to remove_target_sections. * solib.c (update_solib_list): Ditto. (reload_shared_libraries_1): Ditto. (clear_solib): Ditto, and unconditionally call remove_target_sections.
2013-07-22fix solib-som.cTom Tromey2-1/+7
som_open_symbol_file_object was leaking a cleanup. * solib-som.c (som_open_symbol_file_object): Call do_cleanups.
2013-07-22fix init_cutu_and_read_diesTom Tromey2-19/+19
init_cutu_and_read_dies creates an outer cleanup and uses its immediately nested inner cleanup conditionally. This seems overly complicated to me; simpler is to just deal with the outer cleanup and drop the inner one. That is what this patch implements. * dwarf2read.c (init_cutu_and_read_dies): Remove 'free_cu_cleanup'. Simplify cleanup handling.
2013-07-22fix dwarf_decode_line_headerTom Tromey2-0/+6
dwarf_decode_line_header has one return that is missing a call to do_cleanups. This patch adds it. This was found using the cleanup checker. * dwarf2read.c (dwarf_decode_line_header): Call do_cleanups on all return paths.
2013-07-222013-07-22 Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com>Ulrich Weigand2-4/+21
* ppc-linux-nat.c (PPC_DEBUG_FEATURE_DATA_BP_DAWR): New define. (ppc_linux_region_ok_for_hw_watchpoint): Add checking to use the new DAWR interface for longer ranges hardware watchpoint (up to 512 bytes).
2013-07-222013-07-22 Phil Muldoon <pmuldoon@redhat.com>Phil Muldoon2-1/+12
* top.c (print_gdb_version): Add help, apropos description and url to online documentation.
2013-07-19gdb/testsuite/gdb.base: Enable disp-step-syscall.exp tests for ARM.Will Newton2-0/+7
disp-step-syscall.exp is not run for ARM targets because ARM syscall instructions have not been added to the list of possible syscall instructions. This patch adds ARM syscall instructions to enable disp-step-syscall.exp tests for ARM targets. Attached patch is tested on ARMv7 and helps pass all disp-step-syscall.exp tests for ARM targets. gdb/testsuite/ChangeLog: 2013-07-19 Omair Javaid <Omair.Javaid@linaro.org> * gdb.base/disp-step-syscall.exp: Add svc and swi syscall instructions and enable disp-step-syscall for arm targets.
2013-07-19gdb/testsuite/gdb.dwarf2: Replace @ with % for ARM compatability.Will Newton5-20/+28
The ARM assembler recognises @ symbol as a comment marker and therefore is unable to assemble some of gdb.dwarf2 testsuite tests. This patch replaces all occurrences of @ symbol with % sign to allow tests stay compatible with both ARM and x86 assembly. This patch has been tested on x86_64 and ARMv7 targets. gdb/testsuite/ChangeLog: 2013-07-19 Omair Javaid <Omair.Javaid@linaro.org> * gdb.dwarf2/fission-reread.S: Replace @ sign with % sign to remove assembler errors on arm. * gdb.dwarf2/mac-fileno.S: Likewise. * gdb.dwarf2/member-ptr-forwardref.S: Likewise. * gdb.dwarf2/pr13961.S: Likewise.
2013-07-192013-07-19 Hui Zhu <hui@codesourcery.com>Hui Zhu4-3/+22
PR gdb/15692 * mi/mi-cmd-break.c (mi_argv_to_format): Handle double quotes. 2013-07-19 Hui Zhu <hui@codesourcery.com> PR gdb/15692 * gdb.mi/mi-dprintf.exp: Add double quotes test.
2013-07-18gdb/Yao Qi6-12/+32
* target.c (update_current_target): Change the default action of 'to_traceframe_info' from tcomplain to return_zero. * target.h (struct target_ops) <to_traceframe_info>: Add more comments. * valops.c (read_value_memory): Call traceframe_available_memory unconditionally. gdb/testsuite/ * gdb.trace/read-memory.exp (test_from_remote): Update test. (teset_from_exec): Likewise.
2013-07-18gdb/testsuite/Yao Qi3-0/+213
* gdb.trace/read-memory.c: New. * gdb.trace/read-memory.exp: New.
2013-07-18gdb/testsuite/Yao Qi2-2/+22
* lib/gdb.exp (gdb_compile_shlib): Pass the tail name of $dest to link options if host is remote. Move the generated file to $dest.a on host if host is remote.
2013-07-18gdb/testsuite/gdb.threads: Ensure TLS tests link against pthreads.Will Newton4-0/+18
On Ubuntu by default the compiler passes --as-needed to ld which means no DT_NEEDED entry is added for libpthread when building the TLS tests. This causes the test to fail as libpthread is required to look up TLS variables. Add calls to pthread_testcancel to make sure libpthread gets linked. gdb/testsuite/ChangeLog: 2013-07-18 Will Newton <will.newton@linaro.org> * gdb.threads/tls-nodebug.c: Call pthread_testcancel to ensure the test is linked against pthreads. * gdb.threads/tls-var-main.c: Likewise. * gdb.threads/tls-shared.c: Likewise.
2013-07-18gdb/testsuite/Yao Qi2-4/+10
* lib/future.exp (gdb_default_target_compile): Use tail name of $destfile as the output name of compile. Move the generated file to $destfile on build.
2013-07-18gdb/testsuite/Yao Qi2-3/+13
* lib/gdb.exp (gdb_compile): Set gdb_saved_set_unbuffered_mode_obj to set_unbuffered_mode_saved.o if host is remote. Invoke remote_download to copy $unbuf_obj to host.
2013-07-18gdb/Yao Qi1-0/+7
Commit the changelog change for my previous commit.
2013-07-18gdb/Yao Qi1-0/+29
* coffread.c (coff_symfile_read): Iterate over minimal symbols, if the name is prefixed by "__imp_" or "_imp_", look for minimal symbol without prefix. If found, set its type to 'mst_solib_trampoline'.
2013-07-17 * NEWS: Mention "set print raw frame-arguments".Doug Evans12-2/+289
* gdbcmd.h (setprintrawlist, showprintrawlist): Declare. * stack.c (print_raw_frame_arguments): New static global. (print_frame_arg): Set opts.raw from print_raw_frame_arguments. (_initialize_stack): New command "set/show print raw frame-arguments". * valprint.c (setprintrawlist, showprintrawlist): New globals. (set_print_raw, show_print_raw): New functions. (_initialize_valprint): New prefix command "set/show print raw". * valprint.h (value_print_options): Improve comments. doc/ * gdb.texinfo (Print Settings): Document "print raw frame-arguments". testsuite/ * gdb.python/py-frame-args.c: New file. * gdb.python/py-frame-args.py: New file. * gdb.python/py-frame-args.exp New file.
2013-07-17 * cli/cli-cmds.c (init_cmd_lists): Delete unnecessary initializationDoug Evans2-21/+3
of all *list variables.
2013-07-17 * gdbcmd.h (togglelist): Delete.Doug Evans4-13/+7
* cli/cli-cmds.c (togglelist): Delete. (init_cmd_lists): Update. * cli/cli-cmds.h (togglelist): Delete.
2013-07-17 * dwarf2read.c (dwarf2_per_objfile_free): ClearTom Tromey2-0/+9
dwarf2_per_objfile.
2013-07-17 * nto-tdep.c (nto_relocate_section_addresses): Update,Doug Evans5-4/+14
target_section.bfd deleted. * ppc64-tdep.c (ppc64_convert_from_func_ptr_addr): Ditto. * s390-tdep.c (s390_load): Ditto. * solib-aix.c (solib_aix_relocate_section_addresses): Ditto.
2013-07-16Check for NULL character before calling strchr.Andrew Burgess4-3/+19
http://sourceware.org/ml/gdb-patches/2013-07/msg00322.html gdb/ChangeLog * common/format.c (parse_format_string): Add checks for NULL character before calling strchr. gdb/testsuite/ChangeLog * gdb.base/printcmds.exp (test_printf): Add tests for format strings with missing format specifier.
2013-07-16 * solist.h (target_so_ops.find_and_open_solib): Clarify usage ofDoug Evans3-3/+10
temp_pathname argument. * nto-tdep.c (nto_find_and_open_solib): Fix setting of temp_pathname when opening the file fails.
2013-07-16 * target.h (struct target_section): Delete member bfd.Doug Evans8-39/+67
All users updated to use the_bfd_section->owner instead. * exec.c (add_to_section_table): Assert bfd is expected value. Remove initialization of target_section.bfd. (remove_target_sections): Update. (section_table_available_memory): Update. (section_table_xfer_memory_partial): Update. (print_section_info): Update. (exec_set_section_address): Update. * record-full.c (record_full_core_xfer_partial): Update. * solib-svr4.c (svr4_relocate_section_addresses): Update. * solib-target.c (solib_target_relocate_section_addresses): Update. * symfile.c (build_section_addr_info_from_section_table): Update. * target.c (memory_xfer_live_readonly_partial): Update. (memory_xfer_partial_1): Update.
2013-07-16simple test suite fix in gdb.adaTom Tromey2-2/+6
This changes one spot in gdb.ada to use standard_testfile. * gdb.ada/info_types.exp: Use standard_testfile.
2013-07-16simple test suite fix in gdb.miTom Tromey2-8/+15
This is another simple test suite change for the parallelization project. This changes mi-basics.exp to avoid the use of subdir and objdir and instead use standard_output_file. There are still some uses of objdir, but as noted in a new comment in the patch, these uses are parallel-safe. * gdb.mi/mi-basics.exp: Use standard_output_file. (test_dir_specification, test_cwd_specification) (test_path_specification): Use testsubdir, not subdir and objdir.
2013-07-16test suite fixlet for gdb.traceTom Tromey2-2/+6
This is a minor fix to clean up the last remaining test suite parallelization issue in gdb.trace. mi-traceframe-changed.exp refers to objdir. This patch changes the code to have the same effect, but avoid using that variable. * gdb.trace/mi-traceframe-changed.exp: Don't use objdir.