Tom Tromey [Thu, 20 Sep 2012 20:54:11 +0000 (20:54 +0000)]
* NEWS: Update.
* python/python.c (finalize_python): New function.
(_initialize_python): Make a final cleanup.
testsuite
* gdb.python/python.exp: Test atexit.register.
Thomas Schwinge [Wed, 19 Sep 2012 11:10:54 +0000 (11:10 +0000)]
gdb/
* sh-tdep.c (sh_register_convert_to_virtual)
(sh_register_convert_to_raw): Add a gdbarch parameter. Update
all callers. Just do a memcpy if not the little-endian case.
Alan Modra [Wed, 19 Sep 2012 02:51:09 +0000 (02:51 +0000)]
* ld-scripts/assign-loc.d: New file. Test for assigning absolute
symbol to location counter.
* ld-scripts/assign-loc.t: New file. Linker script for above test.
* ld-scripts/expr.exp: Add new assignment test.
* elflink.c (_bfd_elf_merge_symbol): Add an argument to return
if the old symbol is weak.
(_bfd_elf_add_default_symbol): Update _bfd_elf_merge_symbol
call.
(elf_link_add_object_symbols): Don't update symbol type from a
weak definition. Update symbol type from a common symbol when
overriding a weak symbol.
ld/testsuite/
PR ld/14591
* ld-elf/comm-data.exp (run_ld_link_tests): Add comm-data3a and
comm-data3b tests.
Joel Brobecker [Tue, 18 Sep 2012 16:52:19 +0000 (16:52 +0000)]
wrong language used when re-setting breakpoint
The debugger sometimes fails to re-set a breakpoint as follow,
causing it to become disabled:
(gdb) b nested_sub
Breakpoint 1 at 0x401cec: file foo.adb, line 7.
(gdb) b do_nothing
Breakpoint 2 at 0x401cdc: file pck.adb, line 4.
(gdb) run
Starting program: /[...]/foo
Error in re-setting breakpoint 1: Function "nested_sub" not defined.
Breakpoint 2, pck.do_nothing () at pck.adb:4
4 null;
This only happens on machines where the debug-file-directory is
a valid directory name.
The reason behind the error is that the linespec code that re-sets
the breakpoints uses the current_language global when iterating
over a symtab's symbols. However, the that global gets switched from
Ada to C during the startup phase, probably as a side-effect of stopping
in some system code for which debugging info is available. The fix
is to make sure that we use the correct language.
gdb/ChangeLog:
* linespec.c (iterate_over_all_matching_symtabs): Use the correct
language when iterating over symbols.
Yao Qi [Tue, 18 Sep 2012 12:09:28 +0000 (12:09 +0000)]
gdb/doc:
* gdb.texinfo (GDB/MI Async Records): Document new MI
notifications '=tsv-created' and '=tsv-deleted'.
* observer.texi (GDB Observers): New observer tsv_created and
tsv_deleted.
Jan Kratochvil [Mon, 17 Sep 2012 18:27:58 +0000 (18:27 +0000)]
gdb/
* common/linux-ptrace.c: Change __i386__ to __i386__ || __x86_64__.
(linux_ptrace_test_ret_to_nx): Extend comment for x86_64. Change
__i386__ to __i386__ || __x86_64__. Extend code also for __x86_64__.
Extend code also for PaX support. Convert all gdb_assert to warning
calls.
Jan Kratochvil [Mon, 17 Sep 2012 18:26:06 +0000 (18:26 +0000)]
gdb/
Implement auto-load user conveniences suggested by Doug Evans.
* auto-load.c: Include top.h.
(file_is_auto_load_safe): New variable advice_printed. Print advice.
(_initialize_auto_load): New variable scripts_directory_help. Mention
GDBPY_AUTO_FILE_NAME and GDB_AUTO_FILE_NAME for set auto-load
scripts-directory. Document in online help one can use also files for
set auto-load safe-path.
* python/py-auto-load.c: (GDBPY_AUTO_FILE_NAME): Move it from here ...
* python/python.h (GDBPY_AUTO_FILE_NAME): ... to here.
Richard Earnshaw [Mon, 17 Sep 2012 17:43:42 +0000 (17:43 +0000)]
2012-09-17 Yufeng Zhang <yufeng.zhang@arm.com>
* aarch64-asm.c (aarch64_ins_imm_half): Remove ATTRIBUTE_UNUSED from
the parameter 'inst'.
(aarch64_ins_addr_simm): Add ATTRIBUTE_UNUSED to the parameter 'inst'.
(convert_mov_to_movewide): Change to assert (0) when
aarch64_wide_constant_p returns FALSE.
Walter Lee [Mon, 17 Sep 2012 10:53:38 +0000 (10:53 +0000)]
Fix computation of got relocations for when .got.plt section is merged
with .got.
* elf32-tilepro.c (tilepro_elf_relocate_section): Fix computation
of got relocations for when .got.plt section is merged with .got.
* elfxx-tilegx.c (tilegx_elf_relocate_section): Ditto.
Jan Kratochvil [Mon, 17 Sep 2012 07:15:48 +0000 (07:15 +0000)]
gdb/
PR 14119
* frame.c (skip_inlined_frames): Skip also TAILCALL_FRAME frames.
(frame_pop): Drop also TAILCALL_FRAME frames.
* infcmd.c (finish_command): Ignore also TAILCALL_FRAME frames.
gdb/testsuite/
PR 14119
* gdb.arch/amd64-tailcall-ret.S: New file.
* gdb.arch/amd64-tailcall-ret.c: New file.
* gdb.arch/amd64-tailcall-ret.exp: New file.
* gdb.reverse/amd64-tailcall-reverse.S: New file.
* gdb.reverse/amd64-tailcall-reverse.c: New file.
* gdb.reverse/amd64-tailcall-reverse.exp: New file.
Jan Kratochvil [Mon, 17 Sep 2012 07:09:35 +0000 (07:09 +0000)]
gdb/
PR 14548
* infrun.c (handle_inferior_event): Do not reverse-continue back to the
function start if we are already at function start. Both for
reverse-next and for reverse-step into function without line number
info.
gdb/testsuite/
PR 14548
* gdb.reverse/singlejmp-reverse-nodebug.S: New file.
* gdb.reverse/singlejmp-reverse-nodebug.c: New file.
* gdb.reverse/singlejmp-reverse.S: New file.
* gdb.reverse/singlejmp-reverse.c: New file.
* gdb.reverse/singlejmp-reverse.exp: New file.
Jan Kratochvil [Mon, 17 Sep 2012 07:03:14 +0000 (07:03 +0000)]
gdb/
Code cleanup - rename 'inline' depth to 'artificial' depth.
* breakpoint.c (set_momentary_breakpoint): Rename at a caller to
frame_id_artificial_p, extend the comment.
* dwarf2-frame-tailcall.c (tailcall_frame_this_id): Rename at a user.
* frame.c (fprint_frame_id): Rename at a user, change debug output
text to "artificial=".
(skip_inlined_frames): Rename to ...
(skip_artificial_frames): ... here. Extend the comment.
(get_stack_frame_id, frame_unwind_caller_id): Rename at a caller.
(frame_id_inlined_p): Rename to ...
(frame_id_artificial_p): ... here. Rename at a user.
(frame_id_eq, frame_id_inner, frame_unwind_caller_pc)
(frame_unwind_caller_pc_if_available, frame_unwind_caller_arch): Rename
at a user.
* frame.h (struct frame_id): Rename inline_depth to artificial_depth.
Extend the comment.
(frame_id_inlined_p): Rename to ...
(frame_id_artificial_p): ... here.
* inline-frame.c (inline_frame_this_id): Rename at a user.
Refactor Python "gdb" module into a proper Python package, by introducing
a new "_gdb" module for code implemented in C, and using reload/__import__
instead of exec.
gdb/
* python/lib/gdb/__init__.py: Import * from _gdb.
(GdbOutputFile, sys.stdout, GdbOutputErrorFile, sys.stderr,
prompt_hook, sys.argv): Moved from finish_python_initialization.
(pretty_printers, PYTHONDIR): Moved from _initialize_python.
(packages, auto_load_packages): New list and function replacing
module_dict and auto-loading code, using __file__ instead of
gdb.PYTHONDIR and reload/__import__ instead of exec.
(GdbSetPythonDirectory): Replacing function of the same name
from finish_python_initialization, using reload/__import__ instead
of exec, as well as call auto_load_packages.
* python/py-prettyprint.c (find_pretty_printer_from_gdb): Check
gdb_python_module and not gdb_module.
* python/python-internal.h (gdb_python_module): Declare.
* python/python.c (gdb_python_module): New global.
(before_prompt_hook): Check gdb_python_module and not gdb_module.
(_initialize_python): Rename gdb module to _gdb.
Move gdb.PYTHONDIR and gdb.pretty_printer to lib/gdb/__init__.py.
(finish_python_initialization): Move Python code to
lib/gdb/__init__.py; instead, set up sys.path and import gdb into
__main__.
gdb/testsuite/
* gdb.python/python.exp (Test stderr location): Update module
location of GDB-specific sys.stderr.
(Test stdout location): Ditto for sys.stdout.
Jan Kratochvil [Thu, 13 Sep 2012 17:35:35 +0000 (17:35 +0000)]
gdb/doc/
* gdbint.texinfo (Defining Other Architecture Features): Clarify *pcptr
encoding for gdbarch_breakpoint_from_pc, bp_addr for
gdbarch_push_dummy_call and bp_addr for gdbarch_push_dummy_code.
Pedro Alves [Thu, 13 Sep 2012 14:35:16 +0000 (14:35 +0000)]
2012-09-13 Pedro Alves <palves@redhat.com>
* Makefile.in (COMMON_OBS): Add registry.o.
* registry.c: New file.
* registry.h (struct registry_container): Declare.
(registry_data_callback): New typedef.
(struct registry_data, struct registry_data_registration, struct
registry_data_registry): New type.
(register_data_with_cleanup, registry_alloc_data)
(registry_callback_adaptor, registry_clear_data)
(registry_container_free_data, registry_set_data, registry_data):
Declare.
(DEFINE_REGISTRY): Refactor structures and functions as shims over
the new common structures and functions.
(DECLARE_REGISTRY): Declare struct TAG ## _data. Use the tagged
callback typedefs.
Alan Modra [Wed, 12 Sep 2012 22:43:54 +0000 (22:43 +0000)]
* target-reloc.h (scan_relocs): Call scan.local for relocs
against symbols in discarded sections. Pass is_discarded
param.
* arm.cc, * i386.cc, * sparc.cc, * x86_64.cc (Target_*::Scan::local):
Add is_discarded param.
* powerpc (Target_powerpc::Scan::local): Likewise. Use
is_discarded to flag opd entry as discarded. Don't emit dyn
relocs on such entries.
(Target_powerpc::Scan::global): Similarly detect and handle
such opd entries.
(Powerpc_relobj): Replace opd_ent_shndx_ and opd_ent_off_ with
opd_ent_. Update all uses.
(Powerpc_relobj::get_opd_discard, set_opd_discard): New functions.
(Target_powerpc::relocate_section): Zero out discarded opd
entry relocs.
Mike Wrighton [Wed, 12 Sep 2012 20:01:10 +0000 (20:01 +0000)]
* gdb/remote.c (remote_insert_hw_breakpoint): Throw exception if
there is an error inserting hardware breakpoints and use the
error message from the target.
* gdb/breakpoint.c (insert_bp_location, insert_breakpoint_locations):
Catch this exception and print the error message contained within. Do not
print the default hardware error breakpoint message in this case.
* gdb.base/help.exp: Remove testing of individual command help text,
too much of a maintenance burden. Instead, test the functionality
of "help" itself.
Ian Lance Taylor [Wed, 12 Sep 2012 18:29:18 +0000 (18:29 +0000)]
PR gold/14570
* output.cc: Rename Output_data_got template parameter from size
to got_size for all functions. Compile all variants of
Output_data_got.
(Output_data_got::Got_entry::write): Correct use of size for
symbol value. Use local_is_tls rather than casting to
Sized_relobj_file.
* object.h (class Object): Add local_is_tls and do_local_is_tls.
(class Sized_relobj_file): Add do_local_is_tls.
* incremental.h (class Sized_relobj_incr): Add do_local_is_tls.
Richard Earnshaw [Wed, 12 Sep 2012 16:25:51 +0000 (16:25 +0000)]
2012-09-11 Chris Schlumberger-Socha <chris.schlumberger-socha@arm.com>
bfd/
* bfd-in2.h: Regenerated.
* elf64-aarch64.c
(elf64_aarch64_howto_table): Add R_AARCH64_GOT_LD_PREL19 reloc to HOWTO.
(elf64_aarch64_reloc_map): Add reloc entry.
(aarch64_resolve_relocation): Likewise.
(bfd_elf_aarch64_put_addend): Likewise.
(aarch64_reloc_got_type): Likewise.
(elf64_aarch64_final_link_relocate): Likewise.
(lf64_aarch64_check_relocs): Likewise.
(elf64_aarch64_check_relocs): New case for R_AARCH64_ADR_PREL_LO21
reloc.
* libbfd.h: Regenerated.
* reloc.c (R_AARCH64_GOT_LD_PREL19): New reloc.
gas/
* config/tc-aarch64.c
(reloc_table): Add reloc to table entry.
(parse_address_main): Add support for #:<reloc_op>:<symbol>.
(parse_operands): Check for unused reloc.
(md_apply_fix): New case for reloc.
(aarch64_force_relocation): Likewise.
gas/testsuite
* gas/aarch64/reloc-insn.d
(BFD_RELOC_AARCH64_GOT_LD_PREL19): Add expected asm for new reloc test.
* gas/aarch64/reloc-insn.s
(BFD_RELOC_AARCH64_GOT_LD_PREL19): Add test for reloc.
include/
* elf/aarch64.h (R_AARCH64_GOT_LD_PREL19): New reloc.
ld/testsuite
* ld-aarch64/aarch64-elf.exp: New reloc tests.
* ld-aarch64/emit-relocs-309-low-bad.d: New file. Expected asm for test
failure (lower bound overflow).
* ld-aarch64/emit-relocs-309-low.d: New file. Expected asm for test
success (lower bound).
* ld-aarch64/emit-relocs-309-up-bad.d: New file. Expected asm for test
failure (upper bound overflow).
* ld-aarch64/emit-relocs-309-up.d: New file. Expected asm for test
success (upper bound).
* ld-aarch64/emit-relocs-309.s: New file. Asm for new reloc tests.