gas/
2012-09-23 Richard Sandiford <rdsandiford@googlemail.com>
Maciej W. Rozycki <macro@codesourcery.com>
* config/tc-mips.h (mips_record_label): Delete.
(mips_add_dot_label): Declare.
(tc_new_dot_label): Use it.
* config/tc-mips.c (mips_assembling_insn): New variable.
(md_assemble): Call mips_mark_labels. Set mips_assembling_insn
while the main part of the function is executing.
(mips_compressed_mark_label): New function, split out from...
(mips_compressed_mark_labels): ...here.
(append_insn): Don't call mips_mark_labels here.
(mips_record_label): Make local.
(mips_add_dot_label): New function.
gas/testsuite/
* gas/mips/dot-1.s, gas/mips/dot-1.d, gas/mips/micromips@dot-1.d,
gas/mips/mips16@dot-1.d: New test.
* gas/mips/mips.exp: Run it.
gas/
* config/tc-mips.c (SEXT_16BIT): New macro.
(mips16_immed): Take the reloc type as a parameter. Do not impose
a signed vs. unsigned distinction on the value when a relocation
operator was used.
(mips16_macro_build, mips16_ip, md_convert_frag): Pass the reloc
type to mips16_immed.
(macro): Use SEXT_16BIT.
gas/
* config/tc-mips.c (mips_cl_insn): Remove use_extend and extend.
(MIPS16_EXTEND): New macro.
(mips16_opcode_length): New function.
(insn_length): Use it.
(create_insn): Update after mips_cl_insn change.
(write_compressed_insn): New function.
(install_insn): Use it.
(append_insn): Use insn_length to check for unextended MIPS16
instructions.
(mips16_macro_build): Update call to mips16_immed.
(mips16_ip): Likewise. Use MIPS16_EXTEND to force an extended
instruction.
(mips16_immed): Remove use_extend and extend; install EXTEND
opcodes in the upper 16 bits of *INSN instead. Keep the
instruction extended if it already is. Replace warn, small
and ext with a forced_insn_length-like parameter.
(md_convert_frag): Update call mips16_immed.
Use write_compressed_insn.
Jan Kratochvil [Fri, 21 Sep 2012 20:01:12 +0000 (20:01 +0000)]
gdb/
Fix internal error on canonicalization of clang types.
* cp-name-parser.y (operator): New comment at make_operator call for
new, delete, new[] and delete[].
(exp): Use "sizeof ". Add new comment at make_operator call.
gdb/testsuite/
Fix internal error on canonicalization of clang types.
* gdb.dwarf2/dw2-canonicalize-type.S: New file.
* gdb.dwarf2/dw2-canonicalize-type.exp: New file.
* lib/gdb.exp (gdb_file_cmd): Catch also GDB internal error.
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.