aboutsummaryrefslogtreecommitdiff
path: root/gdb
AgeCommit message (Collapse)AuthorFilesLines
2011-12-272011-12-27 Mark Kettenis <kettenis@gnu.org>Mark Kettenis2-0/+65
* inf-ptrace.c [PT_IO && PIOD_READ_AUXV] (inf_ptrace_xfer_partial): Implement TARGET_OBJECT_AUXV. (inf_ptrace_auxv_parse): New function. (inf_ptrace_target): Initialize to_auxv_parse field.
2011-12-27gdb/testsuite/Jan Kratochvil3-6/+18
* gdb.python/py-finish-breakpoint.c (test_exec_exit): Change the parameter to self_exec, adjust the function. (main): Check for argv[1] "exit". Use argv[0] for test_exec_exit. * gdb.python/py-finish-breakpoint.exp (set var self_exec = 0): New test. (set var do_exit = 0): Remove test. (newline at end of file): Add one.
2011-12-27New function ada-lang.c:should_use_wild_match...Joel Brobecker2-10/+30
... to avoid code duplication. gdb/ChangeLog: * ada-lang.c (should_use_wild_match): New function. (ada_lookup_simple_minsym): Use should_use_wild_match. Minor simplification. Add comment. (ada_lookup_symbol_list): Use should_use_wild_match. Minor simplification.
2011-12-27remove use of sprintf in py-finishbreakpoint.c...Joel Brobecker2-1/+6
... and replace it with call to xsnprintf, following GDB's coding rules. gdb/ChangeLog: * py-finishbreakpoint.c (bpfinishpy_init): Replace call to sprintf by call to xsnprintf.
2011-12-27Ignore data minimal symbols for breakpoint linespecsJoel Brobecker6-0/+176
gdb/ChangeLog: * linespec.c (struct collect_minsyms) [list_mode]: New field. (add_minsym): Ignore data symbols if not in list mode. (search_minsyms_for_name): Set local.list_mode. gdb/testsuite/ChangeLog: * gdb.base/dmsym.c, gdb.base/dmsym_main.c, gdb.base/dmsym.exp: New files.
2011-12-27Improve gdb_realpath for Windows hostsJoel Brobecker2-0/+23
On Windows hosts, gdb_realpath is just an xstrdup. This makes filename comparisons on Windows very chancy. Normally, we would normalize both paths, and then compare. But since the normalization doesn't do anything, two equivalent names on Windows might not match. This can happen when trying to insert a breakpoint using the fullpath of a file. For instance, if the compiler generated debug info that says that the compilation directory is: `c:\\some\\double\\slashes\\dir', then trying to insert a breakpoint on `c:/some/double/slashes/dir/foo.c:4' does not work: (gdb) b c:/some/double/slashes/dir/foo.c:4 No source file named c:/some/double/slashes/dir/foo.c:4. (gdb) b c:\some\double\slashes\dir\foo.c:4 No source file named c:\some\double\slashes\dir\foo.c:4. This fixes the problem by enhancing gdb_realpath on Windows hosts. The code is inspired from libiberty's lrealpath. gdb/ChangeLog: * utils.c (gdb_realpath): Add better support for Windows hosts.
2011-12-27*** empty log message ***gdbadmin1-1/+1
2011-12-26gdb/testsuite/Jan Kratochvil2-0/+15
Fix racy FAILs. * gdb.threads/fork-thread-pending.c (barrier): New variable. (thread_function, thread_forker): Call pthread_barrier_wait for it. (main): Call pthread_barrier_init for it.
2011-12-26gdb/testsuite/Jan Kratochvil6-23/+23
Fix double send_gdb leading to racy FAILs. * gdb.base/break.exp (set silent break bp_location1): Replace 3x send_gdb and gdb_expect by gdb_test. * gdb.base/fileio.exp: Replace 2x send_gdb by gdb_exit and sleep. * gdb.base/foll-vfork.exp (vfork_and_exec_child_follow_to_main_bp) (vfork_and_exec_child_follow_through_step): Use gdb_test_no_output instead of send_gdb. Twice. * gdb.base/sepdebug.exp (set silent break bp_location1): Replace 3x send_gdb and gdb_expect by gdb_test. * gdb.mi/mi-nsmoribund.exp: Replace 3x send_gdb by mi_gdb_test.
2011-12-26*** empty log message ***gdbadmin1-1/+1
2011-12-25*** empty log message ***gdbadmin1-1/+1
2011-12-24gdb/testsuite/Jan Kratochvil2-1/+5
* gdb.linespec/linespec.exp: Compile using {c++}.
2011-12-24*** empty log message ***gdbadmin1-1/+1
2011-12-23gdb/testsuite/Jan Kratochvil2-2/+28
* gdb.cp/templates.exp (test_template_typedef): Import gdb_prompt. (print destructor of template typedef): Extend it for gcc/51668 XFAIL. (verify GCC PR debug/51668): New test.
2011-12-23 Introduce gdb.FinishBreakpoint in PythonKevin Pouget23-69/+1329
* Makefile.in (SUBDIR_PYTHON_OBS): Add py-finishbreakpoint.o. (SUBDIR_PYTHON_SRCS): Add python/py-finishbreakpoint.c. Add build rule for this file. * infcmd.c (print_return_value): Split to create get_return_value. (get_return_value): New function based on print_return_value. Handle case where stop_registers are not set. * inferior.h (get_return_value): New prototype. * python/py-breakpoint.c (bppy_pending_object): Make non-static. (gdbpy_breakpoint_created): Set is_py_finish_bp is necessary. (struct breakpoint_object): Move to python-internal.h (BPPY_REQUIRE_VALID): Likewise. (BPPY_SET_REQUIRE_VALID): Likewise. (gdbpy_breakpoint_created): Initialize is_finish_bp. (gdbpy_should_stop): Add pre/post hooks before/after calling stop method. * python/python-internal.h (breakpoint_object_type): Add as extern. (bppy_pending_object): Likewise. (typedef struct breakpoint_object) Removed. (struct breakpoint_object): Moved from py-breakpoint.c. Add field is_finish_bp. (BPPY_REQUIRE_VALID): Moved from py-breakpoint.c. (BPPY_SET_REQUIRE_VALID): Likewise. (frame_object_to_frame_info): New prototype. (gdbpy_initialize_finishbreakpoints): New prototype. (bpfinishpy_is_finish_bp): Likewise. (bpfinishpy_pre_stop_hook): Likewise. (bpfinishpy_post_stop_hook): Likewise. * python/py-finishbreakpoint.c: New file. * python/py-frame.c(frame_object_to_frame_info): Make non-static and accept PyObject instead of frame_object. (frapy_is_valid): Don't cast to frame_object. (frapy_name): Likewise. (frapy_type): Likewise. (frapy_unwind_stop_reason): Likewise. (frapy_pc): Likewise. (frapy_block): Likewise. (frapy_function): Likewise. (frapy_older): Likewise. (frapy_newer): Likewise. (frapy_find_sal): Likewise. (frapy_read_var): Likewise. (frapy_select): Likewise. * python/python.c (gdbpy_is_stopped_at_finish_bp): New noop function. (_initialize_python): Add gdbpy_initialize_finishbreakpoints. * python/python.h: Include breakpoint.h (gdbpy_is_stopped_at_finish_bp): New prototype. doc/ * gdb.texinfo (Finish Breakpoints in Python): New subsection. (Python API): Add menu entry for Finish Breakpoints. testsuite/ * Makefile.in (EXECUTABLES): Add py-finish-breakpoint and py-finish-breakpoint2 (MISCALLANEOUS): Add py-events-shlib.so and py-events-shlib-nodebug.so * gdb.python/py-breakpoint.exp (mult_line): Define and use variable instead of line number. * gdb.python/py-finish-breakpoint.c: New file. * gdb.python/py-finish-breakpoint.exp: New file. * gdb.python/py-finish-breakpoint.py: New file. * gdb.python/py-finish-breakpoint2.cc: New file. * gdb.python/py-finish-breakpoint2.exp: New file. * gdb.python/py-finish-breakpoint2.py: New file.
2011-12-23gdb/testsuite/Jan Kratochvil2-1/+4
Fix compatibility with gcc-4.7. * gdb.python/py-frame-inline.c (f): Use inline for __always_inline__.
2011-12-23gdb/testsuite/Jan Kratochvil2-14/+23
Partial fix of compatibility with gcc-4.7. * gdb.cp/templates.exp (ptype T5<int>, ptype t5i): Turn all PASS cases into XFAIL "new without size_t". Permit size_t for the KFAIL case. Add comment to add a PASS case in the future.
2011-12-23*** empty log message ***gdbadmin1-1/+1
2011-12-22 PR python/12533:Tom Tromey5-10/+50
* value.h (release_value_or_incref): Declare. * value.c (struct value) <released>: New field. (free_all_values, release_value, value_release_to_mark): Update 'released'. (release_value_or_incref): New function. * python/py-value.c (valpy_new): Use release_value_or_incref. (value_to_value_object): Likewise. * varobj.c (install_new_value): Move value_incref earlier.
2011-12-22 * value.c (struct value) <modifiable, lazy, optimized_out,Tom Tromey2-35/+44
initialized, stack>: Now bitfields. Move to top. <reference_count>: Move earlier.
2011-12-22 * minsyms.h: Rearrange. Document header and all functions.Tom Tromey3-70/+196
* minsyms.c: Move some comments to minsyms.h.
2011-12-22*** empty log message ***gdbadmin1-1/+1
2011-12-21 * symtab.h: Include minsyms.h.Tom Tromey5-95/+150
(prim_record_minimal_symbol, prim_record_minimal_symbol_full) (prim_record_minimal_symbol_and_info, msymbol_hash_iw) (msymbol_hash, SYMBOL_HASH_NEXT, msymbol_objfile) (lookup_minimal_symbol, lookup_minimal_symbol_text) (lookup_minimal_symbol_solib_trampoline) (lookup_minimal_symbol_by_pc_name, lookup_minimal_symbol_by_pc) (iterate_over_minimal_symbols, lookup_minimal_symbol_and_objfile) (lookup_minimal_symbol_by_pc_section) (lookup_solib_trampoline_symbol_by_pc) (init_minimal_symbol_collection) (make_cleanup_discard_minimal_symbols, install_minimal_symbols) (msymbols_sort): Move to minsyms.h. * objfiles.c (terminate_minimal_symbol_table): Move to minsyms.c. * minsyms.c (terminate_minimal_symbol_table): Move from objfiles.c. * minsyms.h: New file.
2011-12-21 * hppa-hpux-tdep.c (hppa64_hpux_search_dummy_call_sequence): UseTom Tromey3-9/+11
ALL_OBJFILE_MSYMBOLS. (hppa_hpux_find_dummy_bpaddr): Likewise. * jit.c (jit_object_close_impl): Use terminate_minimal_symbol_table.
2011-12-21 * elfread.c (elf_symtab_read): Put the filename in the filenameTom Tromey2-5/+10
bcache.
2011-12-21 * symtab.h (struct minimal_symbol) <filename>: Now const.Tom Tromey2-1/+5
2011-12-21gdb/Ulrich Weigand4-3/+16
PR tdep/12797 * arm-tdep.c (arm_return_value): Handle complex types. gdb/testsuite/ PR tdep/12797 * gdb.base/callfuncs.exp: Remove KFAIL.
2011-12-21* ppc-linux-nat.c (create_watchpoint_request): Only use rangedAndreas Schwab2-1/+7
watchpoints when supported.
2011-12-21gdb/Jan Kratochvil2-3/+30
* symfile.c (objfilep): New typedef and new DEF_VEC_P. (reread_symbols): Remove variable reread_one, new variables new_objfiles, all_cleanups and ix. Use new_objfiles instead of reread_one. Push changed objfiles to new_objfiles, call observer_notify_new_objfile for them later.
2011-12-21Use symbol search name in expand_symtabs_matching_via_partial...Joel Brobecker4-6/+14
We are iterating over all symbols in a partial symtab that would match a given name, so we should match the partial symbols search name against the given name rather than using the natural name. In C++, that does not make a difference, but it does in Ada, because Ada searches using the symbol encoded name... We also update the generation of the .gdb_index file to match this change in the search. Although technically an incompatible change, we do not increment the gdb_index version number, because Ada is the only language where it would make a difference - except that this feature is not supported for Ada. gdb/ChangeLog: * psymtab.c (expand_symtabs_matching_via_partial): Match the partial symbols using their SYMBOL_SEARCH_NAME. * symfile.h (struct quick_symbol_functions): Udate the documentation of expand_symtabs_matching. * dwarf2read.c (write_psymbols): Use SYMBOL_SEARCH_NAME instead of SYMBOL_NATURAL_NAME in index entry.
2011-12-21Add handling for unqualified Ada operators in linespecsJoel Brobecker2-0/+23
This patch enhances the linespec parser to recognize unqualified operator names in linespecs. This allows the user to insert a breakpoint on operator "+" as follow, for instance: (gdb) break "+" Previously, it was possible to insert such a breakpoint, but one had to fully qualify the function name. For instance: (gdb) break ops."+" gdb/ChangeLog: * linespec.c (locate_first_half): Add handling of Ada operators when the current language is Ada.
2011-12-21missing check against overlay_debugging in objfiles.cJoel Brobecker2-1/+6
This fixes a problem where the debugger is trying to locate a minimal symbol from its address, when the symbol is inside a section whose VMA is different from its LMA. We have a program that was built on ppc-elf using a linker script such that data sections are placed in ROM, and then loaded onto RAM at execution. So their VMA addresses are indeed different from their LMA address. Unfortunately, there is one place where GDB gets slightly confused into thinking that these data sections are overlayed, while it's not the case here. This show up when trying to print the list of Ada tasks, where GDB is unable to determine their names, and thus prints a generic `Ravenscar task' instead: (gdb) info tasks ID TID P-ID Pri State Name 1 1d580 127 Delay Sleep Ravenscar task 2 183f8 127 Delay Sleep Ravenscar task * 3 13268 127 Runnable Ravenscar task We expected: (gdb) info tasks ID TID P-ID Pri State Name 1 1d580 127 Delay Sleep environment_task 2 183f8 127 Delay Sleep raven2 * 3 13268 127 Runnable raven1 The name of the task is determined by looking up the symbol table using the task ID, which is the address where the symbol is defined. So, ada-tasks calls... msym = lookup_minimal_symbol_by_pc (task_id); ... which in turn first tries to determine the section associated to this address (find_pc_section), which itself uses a map of sections to find it. The map itself is recomputed every time objfiles are loaded/changed by `update_section_map'. And `update_section_map' relies on `insert_section_p' to determine whether the section should be inserted in the map or not. This is where things get interesting for us, because `insert_section_p' simply rejects overlay sections: if (lma != 0 && lma != bfd_section_vma (abfd, section) && (bfd_get_file_flags (abfd) & BFD_IN_MEMORY) == 0) /* This is an overlay section. IN_MEMORY check is needed to avoid discarding sections from the "system supplied DSO" (aka vdso) on some Linux systems (e.g. Fedora 11). */ return 0; However, it shouldn't reject our section in this case, since overlay debugging is off. The fix is to add a check that overlay debugging is active before rejecting the section. This is similar to what is done in `section_is_overlay' (which takes obj_section objects), for instance. gdb/Changelog: * objfiles.c (insert_section_p): Do not detect overlay sections if overlay debugging is off.
2011-12-21[Ada] Breakpoints on task bodiesJoel Brobecker8-0/+157
Consider the following declaration: package Pck is task Dummy_Task is entry Start; end Dummy_Task; end Pck; Inserting a breakpoint on the body of that task does not currently work: (gdb) b pck.dummy_task "pck.dummy_task" is not a function Make breakpoint pending on future shared library load? (y or [n]) n What happens here is that the compiler generates two symbols: (a) Symbol `pck__dummy_task' which is a *variable* referencing the task; (b) Symbol `pck__dummy_taskTKB' which is the subprogram implementing the body of the task. The symbol lookup only finds the variable before of the TKB suffix in the subprogram name. This patch fixes the problem by adjusting the ada-lang.c:is_name_suffix routine to recognize "TKB" suffixes. But that's not enough, because the search in the symtab is performed via the block dictionary, using a hashing algorithm. So, for the search to find `pck__dummy_taskTKB', I had to modify the hashing function to ignore TKB suffixes as well. gdb/ChangeLog: * ada-lang.c (is_name_suffix): Add handling of "TKB" suffixes. Update function documentation. * dictionary.c (dict_hash): Ignore "TKB" suffixes in hash computation. gdb/testsuite/ChangeLog: * gdb.ada/task_bp: New testcase.
2011-12-21*** empty log message ***gdbadmin1-1/+1
2011-12-202011-12-20 Pedro Alves <alves.ped@gmail.com>Pedro Alves4-1/+41
Jan Kratochvil <jan.kratochvil@redhat.com> * linux-nat.c (add_lwp): Don't call linux_nat_new_thread on the first LWP. * amd64-linux-nat.c (update_debug_registers_callback): Instantiate `lwp->arch_private' if NULL. (amd64_linux_prepare_to_resume): Do nothing if `lwp->arch_private' is NULL. * i386-linux-nat.c (update_debug_registers_callback): Instantiate `lwp->arch_private' if NULL. (i386_linux_prepare_to_resume): Do nothing if `lwp->arch_private' is NULL.
2011-12-20 * python/py-auto-load.c (info_auto_load_scripts): Pass address ofDoug Evans2-3/+10
scripts vector to collect_matching_scripts. (collect_matching_scripts): Update.
2011-12-20*** empty log message ***gdbadmin1-1/+1
2011-12-19gdb/Jan Kratochvil5-22/+49
* symfile.c (reread_symbols): Move free_objfile_separate_debug, preserve_values, sym_finish and clear_objfile_data calls before BFD close. Move free_objfile_separate_debug as the very first call. New comment on the ordering. gdb/testsuite/ * gdb.base/reread.exp: If srcfile2 fails to build retry it with -DNO_SECTIONS. * gdb.base/reread2.c <!NO_SECTIONS>: New sections block.
2011-12-19 * s390-tdep.c (s390_push_dummy_call): Set addressing mode bitUlrich Weigand2-2/+13
in return PSWA.
2011-12-19 * symtab.h (add_minsym_to_hash_table): Don't declare.Tom Tromey3-5/+6
* minsyms.c (add_minsym_to_hash_table): Now static.
2011-12-19gdb/testsuite/Jan Kratochvil3-2/+16
* gdb.cp/ptype-cv-cp.exp (ptype v_volatile_const_my_int): Make PR gcc/45997 XFAIL conditional for gcc <= 4.5. * gdb.python/py-type.exp (python print ttype.template_argument(2)): Change PR gcc/41736 to the more specific PR gcc/46955. Make it conditional for gcc <= 4.5.
2011-12-19gdb/doc/Jan Kratochvil7-10/+69
* gdbint.texinfo (Testsuite): Describe KFAIL and XFAIL in Writing tests. gdb/testsuite/ * gdb.cp/ptype-cv-cp.exp (ptype v_volatile_const_my_int): Replace KFAIL by XFAIL. * gdb.cp/static-method.exp (info addr A::func()) (list static-method.cc:xxx::(anonymous namespace)::A::func) (list 'static-method.cc:xxx::(anonymous namespace)::A::func') (list 'static-method.cc':'xxx::(anonymous namespace)::A::func') (list static-method.cc:'xxx::(anonymous namespace)::A::func'): Likewise. * gdb.cp/temargs.exp (test value of F in k2_m, test type of F in k3_m) (test value of F in k3_m): Likewise. * gdb.python/py-type.exp (python print ttype.template_argument(2)): Likewise.
2011-12-19gdb/testsuite/Jan Kratochvil4-370/+11
* gdb.threads/attach-stopped.exp (continue (*: attach2 continue)) (*: attach2 stop interrupt, *: attach2, exit leaves process sleeping): Remove. * gdb.threads/attachstop-mt.c: Remove. * gdb.threads/attachstop-mt.exp: Remove.
2011-12-19try ignoring bad PLT entries in ELF symbol tablesJoel Brobecker2-0/+23
Comment says it all: /* On ia64-hpux, we have discovered that the system linker adds undefined symbols with nonzero addresses that cannot be right (their address points inside the code of another function in the .text section). This creates problems when trying to determine which symbol corresponds to a given address. We try to detect those buggy symbols by checking which section we think they correspond to. Normally, PLT symbols are stored inside their own section, and the typical name for that section is ".plt". So, if there is a ".plt" section, and yet the section name of our symbol does not start with ".plt", we ignore that symbol. */ gdb/ChangeLog: * elfread.c (elf_symtab_read): Ignore undefined symbols with nonzero addresses if they do not correspond to a .plt section when one is available in the objfile.
2011-12-19*** empty log message ***gdbadmin1-1/+1
2011-12-18gdb/gdbserver/Jan Kratochvil2-3/+11
* linux-low.c (linux_create_inferior): Put empty if clause for write. Revert: 2011-12-18 Hui Zhu <teawater@gmail.com> * linux-low.c (linux_create_inferior): Save return value to ret.
2011-12-182011-12-18 Hui Zhu <teawater@gmail.com>Hui Zhu2-2/+7
* linux-low.c (linux_create_inferior): Save return value to ret.
2011-12-18*** empty log message ***gdbadmin1-1/+1
2011-12-17* cp-name-parser.y (cp_merge_demangle_parse_infos): Don't useAndreas Schwab2-3/+5
obstack_empty_p.
2011-12-17* amd64obsd-tdep.c (amd64obsd_init_abi): Don't setMark Kettenis2-4/+21
regset_from_core_section. (amd64obsd_core_init_abi): New function that sets regset_from_core_section. (_initialize_amd64obsd_tdep): Use amd64obsd_core_init_abi for traditional core dumps.