external/binutils.git
10 years agogold/
Roland McGrath [Fri, 11 Oct 2013 21:02:43 +0000 (21:02 +0000)]
gold/
* gold-threads.h (Once): Conditionalize member was_run_lock_ on
[ENABLE_THREADS && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4], matching
its only use.
* gold-threads.cc (Once::Once): Likewise conditionalize initializer.

10 years agotestsuite/ChangeLog:
Ulrich Weigand [Fri, 11 Oct 2013 18:50:56 +0000 (18:50 +0000)]
testsuite/ChangeLog:

2013-10-11  Andreas Arnez  <arnez@linux.vnet.ibm.com>

* gdb.arch/s390-multiarch.exp: New file.
* gdb.arch/s390-multiarch.c: New file.

10 years agogold/
Roland McGrath [Fri, 11 Oct 2013 17:38:32 +0000 (17:38 +0000)]
gold/
* archive.h: Use struct rather than class for forward declaration
of Read_symbols_data.

10 years ago * Makefile.in (GDBFLAGS): New variable.
Doug Evans [Fri, 11 Oct 2013 17:32:30 +0000 (17:32 +0000)]
* Makefile.in (GDBFLAGS): New variable.
(run): New rule.

10 years agobinutils/
Roland McGrath [Fri, 11 Oct 2013 17:24:26 +0000 (17:24 +0000)]
binutils/
* winduni.c (languages): Use \345 (octal syntax) rather than
literal non-ASCII/non-UTF8 character in string literal.

10 years agobinutils/
Roland McGrath [Fri, 11 Oct 2013 17:10:58 +0000 (17:10 +0000)]
binutils/
* readelf.c (print_dynamic_symbol): Use array subscript syntax
rather than addition syntax with string literal.

10 years agoChangeLog entries for the previous commit.
Joel Brobecker [Fri, 11 Oct 2013 14:06:40 +0000 (14:06 +0000)]
ChangeLog entries for the previous commit.

git-related mistake (added the files to the index, but forgot to
commit --amend them before pushing the commit)

10 years agoDocument the -catch-assert and -catch-exception new GDB/MI commands.
Joel Brobecker [Fri, 11 Oct 2013 13:51:27 +0000 (13:51 +0000)]
Document the -catch-assert and -catch-exception new GDB/MI commands.

This patch adds documentation for the new GDB/MI commands "-catch-assert"
and "-catch-exception", meant to provide the same functionality as
the "catch assert", "catch exception" and "catch exception unhandled"
CLI commands.

In the GDB Manual, there was already a section for catchpoint comments,
so that seemed like a natural place to document the new commands. But
commands related to a given concept seem to have traditionally been
organized alphabetically, and I didn't want future commands to break
down logical pairing of various commands. For instance, "-catch-load"
and "-catch-unload" are quite "distant" from each other, and it is easy
to imagine a new comment which would alphabetically fall in between,
causing them to be separated. So I introduced subsections to prevent
that from happening.

gdb/ChangeLog:

        * NEWS: Add entry documenting the new "-catch-assert" and
        "-catch-exception" GDB/MI commands.

gdb/doc/ChangeLog:

        * gdb.texinfo (Shared Library GDB/MI Catchpoint Commands):
        New subsection inside which the "-catch-load" and "-catch-unload"
        commands documentation is now placed.
        (Ada Exception GDB/MI Catchpoint Commands): New subsection
        documenting the "-catch-assert" and "-catch-exception" new
        GDB/MI commands.

10 years agoAdjust gdb.ada/mi_catch_ex.exp to use GDB/MI catch commands...
Joel Brobecker [Fri, 11 Oct 2013 13:49:36 +0000 (13:49 +0000)]
Adjust gdb.ada/mi_catch_ex.exp to use GDB/MI catch commands...

... in place of the CLI "catch ..." commands.  The latter were used
because the GDB/MI equivalents were not available at the time.

gdb/testsuite/ChangeLog:

        * gdb.ada/mi_catch_ex.exp: Adjusts all "catch ..." tests to
        use the appropriate GDB/MI command instead, and verify
        the test output.

10 years agoNew GDB/MI commands to catch Ada exceptions
Joel Brobecker [Fri, 11 Oct 2013 13:48:19 +0000 (13:48 +0000)]
New GDB/MI commands to catch Ada exceptions

This patch introduces two new GDB/MI commands implementing the equivalent
of the "catch exception" and  "catch assert" GDB/CLI commands.

gdb/ChangeLog:

        * breakpoint.h (init_ada_exception_breakpoint): Add parameter
        "enabled".
        * breakpoint.c (init_ada_exception_breakpoint): Add parameter
        "enabled".  Set B->ENABLE_STATE accordingly.
        * ada-lang.h (ada_exception_catchpoint_kind): Move here from
        ada-lang.c.
        (create_ada_exception_catchpoint): Add declaration.
        * ada-lang.c (ada_exception_catchpoint_kind): Move to ada-lang.h.
        (create_ada_exception_catchpoint): Make non-static. Add new
        parameter "disabled". Use it in call to
        init_ada_exception_breakpoint.
        (catch_ada_exception_command): Add parameter "enabled" in call
        to create_ada_exception_catchpoint.
        (catch_assert_command): Likewise.

        * mi/mi-cmds.h (mi_cmd_catch_assert, mi_cmd_catch_exception):
        Add declarations.
        * mi/mi-cmds.c (mi_cmds): Add the "catch-assert" and
        "catch-exception" commands.
        * mi/mi-cmd-catch.c: Add #include "ada-lang.h".
        (mi_cmd_catch_assert, mi_cmd_catch_exception): New functions.

10 years agoAdd "ada_" prefix to enum ada_exception_catchpoint_kind
Joel Brobecker [Fri, 11 Oct 2013 13:45:27 +0000 (13:45 +0000)]
Add "ada_" prefix to enum ada_exception_catchpoint_kind

This is in preparation for making that type public, in order to be
able to use make create_ada_exception_catchpoint public as well,
making it usable from the GDB/MI implementation.

gdb/ChangeLog:

        * ada-lang.c (enum ada_exception_catchpoint_kind): Renames
        "enum exception_catchpoint_kind".  Replace the "ex_" prefix
        of all its enumerates with "ada_".  Update the rest of this
        file throughout.

10 years agoRework a bit Ada exception catchpoint support (in prep for GDB/MI)
Joel Brobecker [Fri, 11 Oct 2013 13:44:11 +0000 (13:44 +0000)]
Rework a bit Ada exception catchpoint support (in prep for GDB/MI)

This patch reworks a bit how the different steps required to insert
an Ada exception catchpoints are organized. They used to be:

  1. Call a "decode" function which does:
        1.a.  Parse the command and its arguments
        1.b.  Create a SAL & OPS from some of those arguments

  2. Call create_ada_exception_catchpoint using SAL as well
     as some of the arguments extracted above.

The bulk of the change consists in integrating step (1.b) into
step (2) in order to turn create_ada_exception_catchpoint into
a function whose arguments are all user-level concepts. This
paves the way from a straightforward implementation of the equivalent
commands in the GDB/MI interpreter.

gdb/ChangeLog:

        * ada-lang.c (ada_decode_exception_location): Delete.
        (create_ada_exception_catchpoint): Remove arguments "sal",
        "addr_string" and "ops".  Add argument "ex_kind" instead.
        Adjust implementation accordingly, calling ada_exception_sal
        to get the entities it no longer gets passed as arguments.
        Document the function's arguments.
        (catch_ada_exception_command): Use catch_ada_exception_command_split
        instead of ada_decode_exception_location, and update call to
        create_ada_exception_catchpoint.
        (catch_ada_assert_command_split): Renames
        ada_decode_assert_location.  Remove parameters "addr_string" and
        "ops", and now returns void.  Adjust implementation accordingly.
        Update the function documentation.
        (catch_assert_command): Use catch_ada_assert_command_split
        instead of ada_decode_assert_location.  Update call to
        create_ada_exception_catchpoint.

10 years agoFix dates (wrong month) in the last 2 ChangeLog entries.
Joel Brobecker [Fri, 11 Oct 2013 13:42:06 +0000 (13:42 +0000)]
Fix dates (wrong month) in the last 2 ChangeLog entries.

10 years agowarn if "source" fails to open the file when from_tty == 0
Joel Brobecker [Fri, 11 Oct 2013 08:23:11 +0000 (08:23 +0000)]
warn if "source" fails to open the file when from_tty == 0

Consider the following example:

    % gdb -q -batch -ex 'source nonexistant-file'
    [nothing]

One would have at least expected the debugger to warn about
not finding the file, similar to the error shown when using
a more interactive mode. Eg:

    (gdb) source nonexistant-file
    nonexistant-file: No such file or directory.

Not raising an error appears to be intentional, presumably in order
to prevent this situation from stoping the execution of a GDB script.
But the lack of at least a warning makes it harder for a user to
diagnose any issue, if the file was expected to be there and readable.

This patch adds a warning in that case:

    % gdb -q -batch -ex 'source nonexistant-file'
    warning: nonexistant-file: No such file or directory.

gdb/ChangeLog:

        * utils.h (perror_warning_with_name): Add declaration.
        * utils.c (perror_warning_with_name): New function.
        * cli/cli-cmds.c (source_script_with_search): Add call to
        perror_warning_with_name if from_tty is nul.

gdb/testsuite/ChangeLog:

        * gdb.base/source-nofile.gdb: New file.
        * gdb.base/source.exp: Add two tests verifying the behavior when
        the "source" command is given a non-existant filename.

10 years agonew function perror_string extracted out of throw_perror_with_name.
Joel Brobecker [Fri, 11 Oct 2013 08:20:10 +0000 (08:20 +0000)]
new function perror_string extracted out of throw_perror_with_name.

The main purpose of this patch is to extract the part of
throw_perror_with_name that computes a string providing the system
error message combined with a prefix string.  This will become useful
later on to provide a routine which prints a warning using that
perror_string, rather than throwing an error.

gdb/ChangeLog:

        * utils.c (perror_string): New function, extracted out of
        throw_perror_with_name.
        (throw_perror_with_name): Rework to use perror_string.

10 years agogdb/testsuite/
Yao Qi [Fri, 11 Oct 2013 07:27:46 +0000 (07:27 +0000)]
gdb/testsuite/

* gdb.mi/mi-catch-load.c: Remove the include of "dlfcn.h".
 [__WIN32__]: Include "windows.h" and define macro 'dlopen'
 and 'dlclose'.
[!__WIN32__]: Include "dlfcn.h".
* gdb.mi/mi-catch-load.exp: Set up kfail.

10 years ago * Removed short_hand field from opcode table and
Sean Keys [Fri, 11 Oct 2013 04:55:42 +0000 (04:55 +0000)]
 * Removed short_hand field from opcode table and
     refactored assembler/disassember accordingly.
     Testsuite checkout OK.

10 years agoAdjust gdb/doc/ChangeLog re "set/show remotebaud" renaming...
Joel Brobecker [Fri, 11 Oct 2013 04:50:26 +0000 (04:50 +0000)]
Adjust gdb/doc/ChangeLog re "set/show remotebaud" renaming...

... adding the node names, to be more explicit about which nodes
were affected by this change.

10 years agogdb/
Yao Qi [Fri, 11 Oct 2013 03:01:09 +0000 (03:01 +0000)]
gdb/

Typo fix in my previous commit.

10 years agogdb/
Yao Qi [Fri, 11 Oct 2013 02:54:44 +0000 (02:54 +0000)]
gdb/

* remote.c (discard_pending_stop_replies_in_queue): Update
declaration.
(struct stop_reply) <rs>: New field.
(remove_stop_reply_of_remote_state): New function.
(discard_pending_stop_replies_in_queue): Add parameter 'rs'.
Callers update.  Pass remove_stop_reply_of_remote_state to
QUEUE_iterate.
(remote_parse_stop_reply): Initialize field 'rs'.

10 years ago * gas/xgate/all_insns.d: Add com macro insn test.
Sean Keys [Fri, 11 Oct 2013 01:41:49 +0000 (01:41 +0000)]
* gas/xgate/all_insns.d: Add com macro insn test.
* gas/xgate/all_insns.s: Add com macro insn test.

10 years agoopcodes/
Roland McGrath [Fri, 11 Oct 2013 00:58:29 +0000 (00:58 +0000)]
opcodes/
* i386-dis.c (oappend_maybe_intel): New function.
(OP_ST, OP_STi, append_seg, OP_I, OP_I64, OP_sI, OP_ESreg): Use it.
(OP_C, OP_T, CMP_Fixup, OP_EX_VexImmW): Likewise.
(VCMP_Fixup, VPCMP_Fixup, PCLMUL_Fixup): Likewise.

10 years agodaily update
Alan Modra [Thu, 10 Oct 2013 23:00:05 +0000 (23:00 +0000)]
daily update

10 years agold/
Roland McGrath [Thu, 10 Oct 2013 22:50:40 +0000 (22:50 +0000)]
ld/
* ldmisc.c (vfinfo): Use Boolean ? "" : ":" in place of ":" + Boolean.
It silences some compilers' warnings and is much less bizarre to read.

10 years agoopcodes/
Roland McGrath [Thu, 10 Oct 2013 17:43:37 +0000 (17:43 +0000)]
opcodes/
* cr16-opc.c (REG): Cast NAME to 'reg' enum type to suppress
possible compiler warnings when the union's initializer is
actually meant for the 'preg' enum typed member.
* crx-opc.c (REG): Likewise.

10 years agoopcodes/
Roland McGrath [Thu, 10 Oct 2013 17:19:49 +0000 (17:19 +0000)]
opcodes/
* v850-dis.c (v850_cacheop_codes, v850_prefop_codes):
Remove duplicate const qualifier.

10 years agogas/
Jan Beulich [Thu, 10 Oct 2013 12:22:41 +0000 (12:22 +0000)]
gas/
2013-10-10  Jan Beulich <jbeulich@suse.com>

* tc-i386-intel.c (i386_intel_simplify_register): Suppress base/index
swapping for bndmk, bndldx, and bndstx.

10 years agogdb/aarch64-linux-tdep.c: Call linux_init_abi.
Will Newton [Thu, 10 Oct 2013 10:40:42 +0000 (10:40 +0000)]
gdb/aarch64-linux-tdep.c: Call linux_init_abi.

If we are running on a Linux platform we should call linux_init_abi
in order to get all the useful hooks it enables.

gdb/ChangeLog:

2013-10-10  Will Newton  <will.newton@linaro.org>

* aarch64-linux-tdep.c (aarch64_linux_init_abi): Call
linux_init_abi.

10 years ago2013-10-10 Andreas Arnez <arnez@linux.vnet.ibm.com>
Andreas Krebbel [Thu, 10 Oct 2013 09:54:13 +0000 (09:54 +0000)]
2013-10-10  Andreas Arnez  <arnez@linux.vnet.ibm.com>

* lib/gdb.exp (gdb_core_cmd): Replace fixed string "re-load
generated corefile" by argument "$test".

10 years agoRemove unnecessary @w{} in gdb.texinfo
Joel Brobecker [Thu, 10 Oct 2013 06:00:41 +0000 (06:00 +0000)]
Remove unnecessary @w{} in gdb.texinfo

gdb/doc/ChangeLog:

        * gdb.texinfo (Connecting): Remove unnecessary @w{}.

10 years agoRename "set/show remotebaud" command into "set/show serial baud"
Joel Brobecker [Thu, 10 Oct 2013 05:50:20 +0000 (05:50 +0000)]
Rename "set/show remotebaud" command into "set/show serial baud"

This patch renames the "set/show remotebaud" commands into
"set/show serial baud", and moves its implementation into serial.c.
It also moves the "baud_rate" global from top.c to serial.c, where
the new code is being added (the alternative was to add an include
of target.h).

And to facilitate the transition to the new setting name, this
patch also preserves the old commands, and marks them as deprecated
to alert the users of the change.

gdb/ChangeLog:

        * cli/cli-cmds.c (show_baud_rate): Moved to serial.c as
        serial_baud_show_cmd.
        (_initialize_cli_cmds): Delete the code creating the
        "set/show remotebaud" commands.
        * serial.c (baud_rate): Move here from top.c.
        (serial_baud_show_cmd): Move here from cli/cli-cmds.c.
        (_initialize_serial): Create "set/show serial baud" commands.
        Add "set/show remotebaud" command aliases.
        * top.c (baud_rate): Moved to serial.c.
        * NEWS: Document the new "set/show serial baud" commands,
        replacing "set/show remotebaud".

gdb/doc/ChangeLog:

        * gdb.texinfo: Replace "set remotebaud" and "show remotebaud"
        by "set serial baud" and "show serial baud" (resp) throughout.

10 years agodaily update
Alan Modra [Wed, 9 Oct 2013 23:00:04 +0000 (23:00 +0000)]
daily update

10 years agosim/erc32/ChangeLog:
Sergio Durigan Junior [Wed, 9 Oct 2013 21:42:11 +0000 (21:42 +0000)]
sim/erc32/ChangeLog:
2013-10-09  Sergio Durigan Junior  <sergiodj@redhat.com>

PR sim/16018:
* float.c (set_fsr): Add missing "break" statements.  Reindent
code.

10 years agobfd/
Roland McGrath [Wed, 9 Oct 2013 19:40:04 +0000 (19:40 +0000)]
bfd/
* elf64-alpha.c (elf64_alpha_relax_tls_get_addr): Cast switch
expression to int to silence over-eager compiler warnings.

10 years agold/
Roland McGrath [Wed, 9 Oct 2013 18:16:18 +0000 (18:16 +0000)]
ld/
* emultempl/elf32.em (id_note_section_size): Use ATTRIBUTE_UNUSED
rather than a dummy assignment for unused parameter.
* plugin.c (get_input_file, release_input_file): Likewise.

10 years agobfd/
Roland McGrath [Wed, 9 Oct 2013 18:02:48 +0000 (18:02 +0000)]
bfd/
* xcofflink.c (_bfd_xcoff_bfd_final_link): Don't touch EREL in
loop that doesn't use (or initialize) it.

10 years agobfd/
Roland McGrath [Wed, 9 Oct 2013 17:54:32 +0000 (17:54 +0000)]
bfd/
* elfxx-tilegx.c (tilegx32_plt_tail_entry, tilegx32_plt_tail_entry):
Move second const qualifier so it applies to the pointer.

10 years agoStop using errno values around target_xfer interfaces and memory errors.
Pedro Alves [Wed, 9 Oct 2013 17:00:00 +0000 (17:00 +0000)]
Stop using errno values around target_xfer interfaces and memory errors.

target_read_memory & friends build on top of target_read (thus on top
of the target_xfer machinery), but turn all errors to EIO, an errno
value.  I think we'd better convert all these to return a
target_xfer_error too, like target_xfer_partial in a previous patch.
The patch starts by doing that.

(The patch does not add a enum target_xfer_error value for '0'/no
error, and likewise does not change the return type of several of
these functions to enum target_xfer_error, because different functions
return '0' with different semantics.)

I audited the tree for memory_error calls, EIO checks, places where
GDB hardcodes 'errno = EIO', and also for strerror calls.  What I
found is that nowadays there's really no need to handle random errno
values, other than the EIOs gdb itself hardcodes.  No doubt errno
values would appear in common code back in the day when
target_xfer_memory was the main interface to access memory, but
nowadays, any errno value that deprecated interface could return is
just absorved by default_xfer_partial:

      else if (xfered == 0 && errno == 0)
/* "deprecated_xfer_memory" uses 0, cross checked against
           ERRNO as one indication of an error.  */
return 0;
      else
return -1;

There are two places in the code that check for EIO and print "out of
bounds", and defer to strerror for other errors.  That's
c-lang.c:c_get_string, and valprint.c.:val_print_string.  AFAICT, the
strerror branch can never be reached nowadays, as the only error
possible to get at those points is EIO, given that it's GDB itself
that set that errno value (in target_read_memory, etc.).

breakpoint.c:insert_bp_location always prints the error val as if an
errno, returned by target_insert_breakpoint, with strerr.  Now the
error here is either always EIO for mem-break.c targets (again
hardcoded by the target_read_memory/target_write_memory functions), so
this always prints "Input/output error" or similar (depending on
host), or, for remote targets (and probably others), this gem:

  Error accessing memory address 0x80200400: Unknown error -1.

This patch makes these 3 places print the exact same error
memory_error prints.  This changes output, but I think this is better,
for making memory error output consistent with other commands, and, it
means we have a central place to tweak for memory errors.

E.g., this changes:

 Cannot insert breakpoint 1.
 Error accessing memory address 0x5fc660: Input/output error.

to:

 Cannot insert breakpoint 1.
 Cannot access memory at address 0x5fc660

Which I find pretty much acceptable.

Surprisingly, only py-prettyprint.exp had a regression, for needing an
adjustment.  I also grepped the testsuite for the old errors, and
found no other hits.

Now that errno values aren't used anywhere in any of these memory
access related routines, I made memory_error itself take a
target_xfer_error instead of an errno.  The new
target_xfer_memory_error function added recently is no longer
necessary, and is thus removed.

Tested on x86_64 Fedora 17, native and gdbserver.

gdb/
2013-10-09  Pedro Alves  <palves@redhat.com>

* breakpoint.c (insert_bp_location): Use memory_error_message to
build the memory error string.
* c-lang.c: Include "gdbcore.h".
(c_get_string): Use memory_error to throw error.
(target_xfer_memory_error): Delete.
(memory_error_message): New, factored out from
target_xfer_memory_error.
(memory_error): Change parameter type to target_xfer_error.
Rewrite.
(read_memory): Use memory_error instead of
target_xfer_memory_error.
* gdbcore.h: Include "target.h".
(memory_error): Change parameter type to target_xfer_error.
(memory_error_message): Declare function.
* target.c (target_read_memory, target_read_stack)
(target_write_memory, target_write_raw_memory): Return
TARGET_XFER_E_IO on error.  Adjust comments.
(get_target_memory): Pass TARGET_XFER_E_IO to memory_error,
instead of EIO.
* target.h (target_read, target_insert_breakpoint)
(target_remove_breakpoint): Adjust comments.
* valprint.c (partial_memory_read): Rename parameter, and adjust
comment.
(val_print_string): Use memory_error_message to build the memory
error string.

gdb/testsuite/
2013-10-09  Pedro Alves  <palves@redhat.com>

* gdb.python/py-prettyprint.exp (run_lang_tests): Adjust expected
output.

10 years agoFix typo in previous delta.
Nick Clifton [Wed, 9 Oct 2013 16:37:44 +0000 (16:37 +0000)]
Fix typo in previous delta.

10 years ago PR gprof/16027
Nick Clifton [Wed, 9 Oct 2013 16:34:30 +0000 (16:34 +0000)]
PR gprof/16027
* source.c (annotate_source): Close ifp.
* corefile.c (read_function_mappings): Close file.

10 years ago PR ld/16028
Nick Clifton [Wed, 9 Oct 2013 16:30:02 +0000 (16:30 +0000)]
PR ld/16028
* ldmain.c (add_keepsyms_file): Close file at end of function.

10 years ago PR binutils/16022
Nick Clifton [Wed, 9 Oct 2013 16:24:43 +0000 (16:24 +0000)]
PR binutils/16022
* elf32-rx.c (rx_dump_symtab): Add missing break statements.

10 years ago PR binutils/16023
Nick Clifton [Wed, 9 Oct 2013 16:21:26 +0000 (16:21 +0000)]
PR binutils/16023
* debug.c (debug_type_samep): Add missing break statement.

10 years ago PR binutils/16024
Nick Clifton [Wed, 9 Oct 2013 16:17:23 +0000 (16:17 +0000)]
PR binutils/16024
* objdump.c (usage): Mark as a no-return function.
(main): Add comment explaining why a break statement is not
needed.

10 years ago PR gas/16025
Nick Clifton [Wed, 9 Oct 2013 16:10:11 +0000 (16:10 +0000)]
PR gas/16025
* config/tc-epiphany.c (md_convert_frag): Add missing break
statement.

10 years agoMinor O_CLOEXEC optimization, "regression" fix
Jan Kratochvil [Wed, 9 Oct 2013 16:00:54 +0000 (16:00 +0000)]
Minor O_CLOEXEC optimization, "regression" fix

gdb/
2013-10-09  Jan Kratochvil  <jan.kratochvil@redhat.com>

* common/filestuff.c (gdb_fopen_cloexec): Remove initialization of
result variable.  Rename variable fopen_e_ever_failed to
fopen_e_ever_failed_einval.  Retry fopen only for errno EINVAL.

10 years agomonitor.c: Don't install a deprecated_xfer_memory method.
Pedro Alves [Wed, 9 Oct 2013 15:55:17 +0000 (15:55 +0000)]
monitor.c: Don't install a deprecated_xfer_memory method.

This removes another yet instance of a deprecated_xfer_memory user.

Tested by building a --enable-targets=all gdb, on x86-64 Fedora 17.

gdb/
2013-10-09  Pedro Alves  <palves@redhat.com>

* monitor.c (monitor_write_memory, monitor_write_memory_bytes)
(monitor_write_memory_longlongs, monitor_write_memory_block):
Constify 'myaddr' parameter.
(monitor_xfer_memory): Adjust interface as monitor_xfer_partial
helper.
(monitor_xfer_partial): New function.
(init_base_monitor_ops): Don't install a deprecated_xfer_memory
hook.  Install a to_xfer_partial hook.

10 years ago PR gas/16026
Nick Clifton [Wed, 9 Oct 2013 15:52:32 +0000 (15:52 +0000)]
PR gas/16026
* config/tc-mn10200.c (md_convert_frag): Add missing break
statement.

10 years ago * opncls.c (get_alt_debug_link_info_shim): Update type of 'len'.
Tom Tromey [Wed, 9 Oct 2013 15:50:39 +0000 (15:50 +0000)]
* opncls.c (get_alt_debug_link_info_shim): Update type of 'len'.

10 years ago PR ld/16021
Nick Clifton [Wed, 9 Oct 2013 15:44:27 +0000 (15:44 +0000)]
PR ld/16021
* elf32-rl78.c (rl78_dump_symtab): Delete.
(rl78_get_reloc): Delete.

10 years agoUniquefy gdb.base/catch-syscall.exp test names.
Pedro Alves [Wed, 9 Oct 2013 14:31:35 +0000 (14:31 +0000)]
Uniquefy gdb.base/catch-syscall.exp test names.

catch-syscall.exp has a series of duplicated output in gdb.sum.  This
patch makes sure all test names are unique, using with_test_prefix.

Tested on x86_64 Fedora 17.

gdb/testsuite/
2013-10-09  Pedro Alves  <palves@redhat.com>

* gdb.base/catch-syscall.exp (test_catch_syscall_without_args)
(test_catch_syscall_with_args, test_catch_syscall_with_many_args)
(test_catch_syscall_with_wrong_args)
(test_catch_syscall_restarting_inferior)
(test_catch_syscall_fail_nodatadir)
(test_catch_syscall_without_args_noxml)
(test_catch_syscall_with_args_noxml)
(test_catch_syscall_with_wrong_args_noxml): Use with_test_prefix.

10 years agobfd
Tom Tromey [Wed, 9 Oct 2013 14:26:26 +0000 (14:26 +0000)]
bfd
* bfd-in2.h: Rebuild.
* opncls.c (bfd_get_alt_debug_link_info): Change type of
buildid_len to bfd_size_type.
gdb
* dwarf2read.c (dwarf2_get_dwz_file): Update for type change in
bfd_get_alt_debug_link_info.

10 years ago * dwarf.c (add64): New function.
Nick Clifton [Wed, 9 Oct 2013 14:06:00 +0000 (14:06 +0000)]
* dwarf.c (add64): New function.
(read_and_display_attr_value): Add CU offset in to the value
displayed for a DW_AT_ref8 attribute.

10 years agoNew flag OBJF_NOT_FILENAME
Jan Kratochvil [Wed, 9 Oct 2013 13:22:36 +0000 (13:22 +0000)]
New flag OBJF_NOT_FILENAME

gdb/
2013-10-09  Jan Kratochvil  <jan.kratochvil@redhat.com>

New flag OBJF_NOT_FILENAME.
* auto-load.c (auto_load_objfile_script): Check also OBJF_NOT_FILENAME.
* jit.c (jit_object_close_impl): Use OBJF_NOT_FILENAME for
allocate_objfile.
(jit_bfd_try_read_symtab): Use OBJF_NOT_FILENAME for
symbol_file_add_from_bfd.
* jv-lang.c (get_dynamics_objfile): Use OBJF_NOT_FILENAME for
allocate_objfile.
* objfiles.c (allocate_objfile): Assert OBJF_NOT_FILENAME if NAME is
NULL.
* objfiles.h (OBJF_NOT_FILENAME): New.

10 years agobfd/ChangeLog
Sergio Durigan Junior [Wed, 9 Oct 2013 05:23:23 +0000 (05:23 +0000)]
bfd/ChangeLog
2013-10-09  Sergio Durigan Junior  <sergiodj@redhat.com>

PR binutils/15993
* elf32-m32c.c (dump_symtab): Add missing "break;" statement on each
"case".  Reindent "switch" statements.

10 years agodaily update
Alan Modra [Tue, 8 Oct 2013 23:00:05 +0000 (23:00 +0000)]
daily update

10 years agofix PR symtab/15597
Tom Tromey [Tue, 8 Oct 2013 19:56:15 +0000 (19:56 +0000)]
fix PR symtab/15597

This patch fixes gdb PR symtab/15597.

The bug is that the .gnu_debugaltlink section includes the build-id of
the alt file, but gdb does not use it.

This patch fixes the problem by changing gdb to do what it ought to
always have done: verify the build id of the file found using the
filename in .gnu_debugaltlink; and if that does not match, try to find
the correct debug file using the build-id and debug-file-directory.

This patch touches BFD.  Previously, gdb had its own code for parsing
.gnu_debugaltlink; I changed it to use the BFD functions after those
were introduced.  However, the BFD functions are incorrect -- they
assume that .gnu_debugaltlink is formatted like .gnu_debuglink.
However, it it is not.  Instead, it consists of a file name followed
by the build-id -- no alignment, and the build-id is not a CRC.

Fixing this properly is a bit of a pain.  But, because
separate_alt_debug_file_exists just has a FIXME for the build-id case,
I did not fix it properly.  Instead I introduced a hack.  This leaves
BFD working just as well as it did before my patch.

I'm willing to do something better here but I could use some guidance
as to what.  It seems that the build-id code in BFD is largely punted
on.

FWIW gdb is the only user of bfd_get_alt_debug_link_info outside of
BFD itself.

I moved the build-id logic out of elfread.c and into a new file.
This seemed cleanest to me.

Writing a test case was a bit of a pain.  I added a couple new
features to the DWARF assembler to handle this.

Built and regtested on x86-64 Fedora 18.

* bfd-in2.h: Rebuild.
* opncls.c (bfd_get_alt_debug_link_info): Add buildid_len
parameter.  Change type of buildid_out.  Update.
(get_alt_debug_link_info_shim): New function.
(bfd_follow_gnu_debuglink): Use it.

* Makefile.in (SFILES): Add build-id.c.
(HFILES_NO_SRCDIR): Add build-id.h.
* build-id.c: New file, largely from elfread.c.  Modified
most functions.
* build-id.h: New file.
* dwarf2read.c (dwarf2_get_dwz_file): Update for change to
bfd_get_alt_debug_link_info.  Verify dwz file's build-id.
Search for dwz file using build-id.
* elfread.c (build_id_bfd_get, build_id_verify)
(build_id_to_debug_filename, find_separate_debug_file): Remove.

* gdb.dwarf2/dwzbuildid.exp: New file.
* lib/dwarf.exp (Dwarf::_section): Add "flags" and "type"
parameters.
(Dwarf::_defer_output): Change "section" parameter to
"section_spec"; update.
(Dwarf::gnu_debugaltlink, Dwarf::_note, Dwarf::build_id): New
procs.

10 years ago* elf32-m68k.c (elf_m68k_size_dynamic_sections): Add DT_DEBUG also
Andreas Schwab [Tue, 8 Oct 2013 15:57:24 +0000 (15:57 +0000)]
* elf32-m68k.c (elf_m68k_size_dynamic_sections): Add DT_DEBUG also
for PIE executables.

10 years agogas/
Jan Beulich [Tue, 8 Oct 2013 15:21:58 +0000 (15:21 +0000)]
gas/
2013-10-08  Jan Beulich <jbeulich@suse.com>

* tc-i386.c (check_word_reg): Remove misplaced "else".
(check_long_reg): Restore symmetry with check_word_reg.

10 years agoopcodes/
Jan Beulich [Tue, 8 Oct 2013 15:12:59 +0000 (15:12 +0000)]
opcodes/
2013-10-08  Jan Beulich <jbeulich@suse.com>

* i386-opc.tbl (invlpg): Use Anysize instead of Unspecified.
(clflush): Use Anysize instead of Byte|Unspecified.
(prefetch*): Likewise.
* i386-tbl.h: Re-generate.

10 years ago2013-10-08 Jan-Benedict Glaw <jbglaw@lug-owl.de>
Jan-Benedict Glaw [Tue, 8 Oct 2013 14:14:12 +0000 (14:14 +0000)]
2013-10-08  Jan-Benedict Glaw  <jbglaw@lug-owl.de>

* configure.ac: Update from GCC.
* configure: Regenerate.

10 years ago[Ada] psymbol search failure due to comparison function discrepancy
Joel Brobecker [Tue, 8 Oct 2013 11:18:58 +0000 (11:18 +0000)]
[Ada] psymbol search failure due to comparison function discrepancy

Upon trying to print the value of a variant record, a user noticed
the following problem:

        (gdb) print rt
        warning: Unknown upper bound, using 1.
        warning: Unknown upper bound, using 1.
        $1 = (a => ((a1 => (4), a2 => (4)), (a1 => (8), a2 => (8))))

The expected output is:

        (gdb) print rt
        $1 = (a => ((a1 => (4, 4), a2 => (8, 8)), (a1 => (4, 4),
              a2 => (8, 8))))

The problems comes from the fact that components "a1" and "a2" are
defined as arrays whose upper bound is dynamic.  To determine the value
of that upper bound, GDB relies on the GNAT encoding and searches
for the parallel ___U variable.  Unfortunately, the search fails
while doing a binary search inside the partial symtab of the unit
where the array and its bound (and therefore the parallel ___U variable)
are defined.

It fails because partial symbols are sorted using strcmp_iw_ordered,
while Ada symbol lookups are performed using a different comparison
function (ada-lang.c:compare_names). The two functions are supposed
to be compatible, but a change performed in April 2011 modified
strcmp_iw_ordered, introducing case-sensitivity issues. As a result,
the two functions would now disagree when passed the following
two arguments:

  string1="common__inner_arr___SIZE_A_UNIT"
  string2="common__inner_arr__T4s___U"

The difference starts at "_SIZE_A_UNIT" vs "T4s___U". So, it's mostly
a matter of comparing '_' with 'T'.

On the one hand, strcmp_iw_ordered would return -1, while compare_names
returned 11. The change that made all the difference is that
strcmp_iw_ordered now performs a case-insensitive comparison,
and only resorts to case-sentitive comparison if the first comparison
finds an equality. This changes everything, because while 'T' (84)
and 't' (116) are on opposite sides of '_' (95).

This patch aims at restoring the compatibility between the two
functions, by adding case-sensitivity handling in the Ada comparison
function.

gdb/ChangeLog:

        * ada-lang.c (compare_names_with_case): Renamed from
        compare_names, adding a new parameter "casing" and its handling.
        New function documentation.
        (compare_names): New function, implemented using
        compare_names_with_case.

10 years agoAdd missing ChangeLog entry.
Joel Brobecker [Tue, 8 Oct 2013 11:04:21 +0000 (11:04 +0000)]
Add missing ChangeLog entry.

10 years ago[Ada] Remove unnecessary ada_exception_sal advance declaration.
Joel Brobecker [Tue, 8 Oct 2013 10:52:18 +0000 (10:52 +0000)]
[Ada] Remove unnecessary ada_exception_sal advance declaration.

gdb/ChangeLog:

        * ada-lang.c (ada_exception_sal): Remove advance declaration.

10 years agogdb.ada/mi_catch_ex.exp: Make test names unique.
Joel Brobecker [Tue, 8 Oct 2013 10:25:22 +0000 (10:25 +0000)]
gdb.ada/mi_catch_ex.exp: Make test names unique.

gdb/testsuite/ChangeLog:

        * gdb.ada/mi_catch_ex.exp: Make "mi_execute_to" test names unique.

10 years agogas/
Jan Beulich [Tue, 8 Oct 2013 08:55:41 +0000 (08:55 +0000)]
gas/
2013-10-08  Jan Beulich <jbeulich@suse.com>

* gas/config/tc-arm.c (do_t_push_pop): Honor inst.size_req. Simplify
LR/PC check.

gas/testsuite/
2013-10-08  Jan Beulich <jbeulich@suse.com>

* gas/arm/thumb-w-good.s: Add PUSH.W and POP.W tests.
* gas/arm/thumb-w-good.d: Update accordingly.

10 years ago * config/tc-msp430.c (msp430_operands): Accept "<foo>.a" as an alias
Nick Clifton [Tue, 8 Oct 2013 08:06:35 +0000 (08:06 +0000)]
* config/tc-msp430.c (msp430_operands): Accept "<foo>.a" as an alias
for "<foo>a".  Issue error messages for unrecognised or corrrupt
size extensions.

* gas/msp430/bad.s: New test: Checks erroneous size extensions.
* gas/msp430/bad.d: New test command file.
* gas/msp430/bad.l: New file: Expected error messages.
* gas/msp430/msp430.exp: Run the new test.
* gas/msp430/msp430x.s: Add "<foo>.a" aliases of "<foo>a"
instructions.
* gas/msp430/msp430x.d: Update expected disassembly.

10 years agodaily update
Alan Modra [Mon, 7 Oct 2013 23:00:04 +0000 (23:00 +0000)]
daily update

10 years agomove the demangled_names_hash into the per-BFD
Tom Tromey [Mon, 7 Oct 2013 19:40:38 +0000 (19:40 +0000)]
move the demangled_names_hash into the per-BFD

This moves the demangled_names_hash from the objfile into the per-BFD
object.  This is part of the objfile splitting project.

The demangled names hash is independent of the program space.  And, it
is needed by the symbol tables.  Both of these things indicate that it
must be pushed into the per-BFD object, which this patch does.

Built and regtested on x86-64 Fedora 18.

* objfiles.c (free_objfile_per_bfd_storage): Delete the
demangled_names_hash.
(free_objfile): Don't delete the demangled_names_hash.
* objfiles.h (struct objfile_per_bfd_storage)
<demangled_names_hash>: New field.
(struct objfile) <demangled_names_hash>: Move to
objfile_per_bfd_storage.
* symfile.c (reread_symbols): Don't delete the
demangled_names_hash.
* symtab.c (create_demangled_names_hash): Update.
(symbol_set_names): Update.

10 years agodon't share per-BFD data if relocations are needed
Tom Tromey [Mon, 7 Oct 2013 19:31:13 +0000 (19:31 +0000)]
don't share per-BFD data if relocations are needed

Right now we always share per-BFD data across objfiles, if there is a
BFD.  This works fine.  However, we're going to start sharing more
data, and sometimes this data will come directly from sections of the
BFD.  If such a section has SEC_RELOC set, then the data coming from
that section will not be truly sharable -- the section will be
program-space-dependent, and re-read by gdb for each objfile.

This patch disallows per-BFD sharing in this case.  This is a bit
"heavy" in that we could in theory examine each bit of shared data for
suitability.  However, that is more complicated, and SEC_RELOC is rare
enough that I think we needn't bother.

Note that the "no sharing" case is equivalent to "gdb works as it
historically did".  That is, the sharing is a new(-ish) optimization.

Built and regtested on x86-64 Fedora 18.

* gdb_bfd.c (struct gdb_bfd_data) <relocation_computed,
needs_relocations>: New fields.
(gdb_bfd_requires_relocations): New function.
* gdb_bfd.h (gdb_bfd_requires_relocations): Declare.
* objfiles.c (get_objfile_bfd_data): Disallow sharing if
the BFD needs relocations applied.

10 years ago * lib/mi-support.exp (varobj_tree::walk_tree): Set _root_idx
Tom Tromey [Mon, 7 Oct 2013 19:10:45 +0000 (19:10 +0000)]
* lib/mi-support.exp (varobj_tree::walk_tree): Set _root_idx
to 0.

10 years ago2013-10-07 Chao-ying Fu <Chao-ying.Fu@imgtec.com>
Chao-ying Fu [Mon, 7 Oct 2013 18:03:24 +0000 (18:03 +0000)]
2013-10-07  Chao-ying Fu  <Chao-ying.Fu@imgtec.com>

* gas/mips/micromips@virt64.d: Fix dmfgc0 and dmtgc0.

10 years ago2013-10-07 Chao-ying Fu <Chao-ying.Fu@imgtec.com>
Chao-ying Fu [Mon, 7 Oct 2013 18:02:47 +0000 (18:02 +0000)]
2013-10-07  Chao-ying Fu  <Chao-ying.Fu@imgtec.com>

* micromips-opc.c (micromips_opcodes): Fix dmfgc0 and dmtgc0.

10 years agogold/
Cary Coutant [Mon, 7 Oct 2013 17:08:34 +0000 (17:08 +0000)]
gold/
PR gold/16010
* testsuite/Makefile.am (icf_test): Fix dependencies.
(icf_safe_test): Likewise.
(icf_safe_so_test): Likewise.
(large_symbol_alignment): Add empty _LDADD rule.
* testsuite/Makefile.in: Regenerate.

10 years ago[DOC] Mention what happens when the thread of a thread-specific breakpoint disappears.
Pedro Alves [Mon, 7 Oct 2013 11:13:08 +0000 (11:13 +0000)]
[DOC] Mention what happens when the thread of a thread-specific breakpoint disappears.

We recently made GDB auto-delete thread-specific breakpoints when the
corresponding thread is removed from the thread list, but we hadn't
mentioned it in the manual.

gdb/
2013-10-07  Pedro Alves  <palves@redhat.com>

PR breakpoints/11568
* gdb.texinfo (Thread-Specific Breakpoints): Mention what happens
when the thread is removed from the thread list.

10 years agoThread-specific breakpoints: say "no longer in the thread list" instead of "gone".
Pedro Alves [Mon, 7 Oct 2013 11:00:23 +0000 (11:00 +0000)]
Thread-specific breakpoints: say "no longer in the thread list" instead of "gone".

It seems "gone" may confuse people, while that was exactly what it was
trying to avoid.  Switch to saying "no longer in the thread list",
which is really the predicate GDB uses.

gdb/
2013-10-07  Pedro Alves  <palves@redhat.com>

PR breakpoints/11568
* breakpoint.c (remove_threaded_breakpoints): Say "no longer in
the thread list" instead of "gone".

10 years agoThis patch adds a new convenience variable called "$_exitsignal", which
Sergio Durigan Junior [Mon, 7 Oct 2013 05:34:11 +0000 (05:34 +0000)]
This patch  adds a new convenience variable called "$_exitsignal", which
will hold the signal number when the inferior terminates due to the
uncaught signal.

I've made modifications on infrun.c:handle_inferior_event such that
$_exitcode gets cleared when the inferior signalled, and vice-versa.
This assumption was made because the variables are mutually
exclusive, i.e., when the inferior terminates because of an uncaught
signal it is not possible for it to return.  I have also made modifications
such that when a corefile is loaded, $_exitsignal gets set to the uncaught
signal that "killed" the inferior, and $_exitcode is cleared.

The patch also adds a NEWS entry, documentation bits, and a testcase.  The
documentation entry explains how to use $_exitsignal and $_exitcode in a
GDB script, by making use of the new $_isvoid convenience function.

gdb/
2013-10-06  Sergio Durigan Junior  <sergiodj@redhat.com>

* NEWS: Mention new convenience variable $_exitsignal.
* corelow.c (core_open): Reset exit convenience variables.  Set
$_exitsignal to the uncaught signal which generated the corefile.
* infrun.c (handle_inferior_event): Reset exit convenience
variables.  Set $_exitsignal for TARGET_WAITKIND_SIGNALLED.
(clear_exit_convenience_vars): New function.
* inferior.h (clear_exit_convenience_vars): New prototype.

gdb/testsuite/
2013-10-06  Sergio Durigan Junior  <sergiodj@redhat.com>

* gdb.base/corefile.exp: Test whether $_exitsignal is set and
$_exitcode is void when opening a corefile.
* gdb.base/exitsignal.exp: New file.
* gdb.base/segv.c: Likewise.
* gdb.base/normal.c: Likewise.

gdb/doc/
2013-10-06  Sergio Durigan Junior  <sergiodj@redhat.com>

* gdb.texinfo (Convenience Variables): Document $_exitsignal.
Update entry for $_exitcode.

10 years agodaily update
Alan Modra [Sun, 6 Oct 2013 23:00:05 +0000 (23:00 +0000)]
daily update

10 years agogdb/
Yao Qi [Sun, 6 Oct 2013 03:28:57 +0000 (03:28 +0000)]
gdb/

* varobj.h: Add comments to enum varobj_languages.

10 years agodaily update
Alan Modra [Sat, 5 Oct 2013 23:00:05 +0000 (23:00 +0000)]
daily update

10 years ago(dwarf2_section_info): Comment tweaks missed in previous checkin.
Doug Evans [Sat, 5 Oct 2013 02:10:29 +0000 (02:10 +0000)]
(dwarf2_section_info): Comment tweaks missed in previous checkin.

10 years ago Add support for DWP file format version 2.
Doug Evans [Sat, 5 Oct 2013 01:44:17 +0000 (01:44 +0000)]
Add support for DWP file format version 2.
* NEWS: Mention support for DWP file format version 2.
* dwarf2read.c (dwarf2_section_info): Convert asection field to a
union of asection, containing_section.  New fields virtual_offset
and is_virtual.  Change type of readin filed from int to char.
(dwo_sections, dwo_file): Tweak comments.
(dwp_v2_section_ids): New enum.
(dwp_sections): New fields abbrev, info, line, loc, macinfo, macro,
str_offsets, types.
(virtual_v1_dwo_sections): Renamed from virtual_dwo_sections.
All uses updated.
(virtual_v2_dwo_sections): New struct.
(dwp_hash_table): New fields version, nr_columns.  Change type of
section_pool field to a union.
(dwp_file): New field version.
(dwarf2_has_info): Check for virtual sections.
(get_containing_section): New function.
(get_section_bfd_owner, get_section_bfd_section): Call it.
(dwarf2_locate_sections): Update.
(dwarf2_section_empty_p): Update.
(dwarf2_read_section): Handle virtual sections.
(locate_dwz_sections): Update.
(create_dwp_hash_table): Document and handle V2 format.
(locate_v1_virtual_dwo_sections): Renamed from
locate_virtual_dwo_sections and update.  All callers updated.
(create_dwo_unit_in_dwp_v1): Renamed from create_dwo_in_dwp.
Delete arg htab.  Rename arg section_index to unit_index.
All callers updated.
(MAX_NR_V1_DWO_SECTIONS): Renamed from MAX_NR_DWO_SECTIONS.
All uses updated.
(create_dwp_v2_section, create_dwo_unit_in_dwp_v2): New functions.
(lookup_dwo_unit_in_dwp): Add V2 support.
(dwarf2_locate_dwo_sections): Update.
(dwarf2_locate_common_dwp_sections): Renamed from
dwarf2_locate_dwp_sections and update.  All callers updated.
(dwarf2_locate_v2_dwp_sections): New function.
(open_and_init_dwp_file): Add V2 support.
(read_str_index): New locals str_section, str_offsets_section.

10 years agodaily update
Alan Modra [Sat, 5 Oct 2013 00:00:05 +0000 (00:00 +0000)]
daily update

10 years ago[gas/]
Kyrylo Tkachov [Fri, 4 Oct 2013 15:26:18 +0000 (15:26 +0000)]
[gas/]
2013-10-04  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

* config/tc-arm.c (do_t_mvn_tst): Use narrow form for tst when
possible.

[gas/testsuite/]
2013-10-04  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

* gas/arm/thumb2_it.s: Add test for narrow tst.
* gas/arm/thumb2_it.d: Update expected output.
* gas/arm/thumb2_it_auto.d: Likewise.

10 years agoClean up ptid.h/ptid.c.
Pedro Alves [Fri, 4 Oct 2013 10:04:14 +0000 (10:04 +0000)]
Clean up ptid.h/ptid.c.

The ptid_t contructors, accessors and predicates are documented in
_three_ places, and each place uses a different wording.

E.g, the descriptions in the .c file of the new ptid_lwp_p, ptid_tid_p
weren't updated in the final revision like the descriptions in the .h
file were.  Clearly, switching to a style that has a single central
description avoids such issues.

Worse, some of the existing descriptions are plain wrong, such as:

  /* Attempt to find and return an existing ptid with the given PID, LWP,
     and TID components.  If none exists, create a new one and return
     that.  */
  ptid_t ptid_build (int pid, long lwp, long tid);

The function does nothing that complicated.  It's just a simple
constructor.

So this gets rid of all the unnecessary descriptions, leaving only the
ones near the function declarations in the header file, and
fixes/clarifies those that remain.

gdb/
2013-10-04  Pedro Alves  <palves@redhat.com>

* common/ptid.c (null_ptid, minus_one_ptid, ptid_build)
(pid_to_ptid, ptid_get_pid, ptid_get_lwp, ptid_get_tid)
(ptid_equal, ptid_is_pid, ptid_lwp_p, ptid_tid_p): Replace
describing comments with references to ptid.h.
* common/ptid.h: Remove intro description of constructors,
accessors and predicates.
(struct ptid): Reformat.
(minus_one_ptid, ptid_build, pid_to_ptid, ptid_get_pid)
(ptid_get_lwp, ptid_get_tid, ptid_equal, ptid_is_pid): Change
describing comments.

10 years agoFix syntax error in aix-thread.c:sync_threadlists
Joel Brobecker [Fri, 4 Oct 2013 08:56:09 +0000 (08:56 +0000)]
Fix syntax error in aix-thread.c:sync_threadlists

This patch fixes a small typo after the BUILD_THREAD -> ptid_build
conversion.

gdb/ChangeLog:

        * aix-thread.c (sync_threadlists): Add missing ')' in call
        to ptid_build.

10 years agoFix build failure in procfs.c after MERGEPID -> ptid_build conversion.
Joel Brobecker [Fri, 4 Oct 2013 08:53:27 +0000 (08:53 +0000)]
Fix build failure in procfs.c after MERGEPID -> ptid_build conversion.

gdb/ChangeLog:

        * procfs.c (procfs_init_inferior): Fix typo causing the build
        to fail.

10 years agoRemove unnecessary cast in aix-thread.c:ptrace32.
Joel Brobecker [Fri, 4 Oct 2013 08:52:24 +0000 (08:52 +0000)]
Remove unnecessary cast in aix-thread.c:ptrace32.

We're casting "addr" into "addr_ptr", but this variable is actually
a parameter with that very same type...

gdb/ChangeLog:

        * aix-thread.c (ptrace32): Remove cast to addr_ptr.

10 years agoAdd support for --start option in -exec-run GDB/MI command.
Joel Brobecker [Fri, 4 Oct 2013 08:35:31 +0000 (08:35 +0000)]
Add support for --start option in -exec-run GDB/MI command.

gdb/ChangeLog:

        * mi/mi-main.c (run_one_inferior): Add function description.
        Make ARG a pointer to an integer whose value determines whether
        we should "run" or "start" the program.
        (mi_cmd_exec_run): Add handling of the "--start" option.
        Reject all other command-line options.
        * NEWS: Add entry for "-exec-run"'s new "--start" option.

gdb/doc/ChangeLog:

        * gdb.texinfo (GDB/MI Program Execution): Document "-exec-run"'s
        new "--start" option.

gdb/testsuite/ChangeLog:

        * gdb.mi/mi-start.c, gdb.mi/mi-start.exp: New files.

10 years agoMove pending_event to remote_notif_state.
Yao Qi [Fri, 4 Oct 2013 07:42:06 +0000 (07:42 +0000)]
Move pending_event to remote_notif_state.

This patch moves pending_event to remote_notif_state.  All pending
events are destroyed in remote_notif_state_xfree.  However,
discard_pending_stop_replies release pending event too, so the pending
event of stop notification is released twice, we need some refactor
here.  We add a new function discard_pending_stop_replies_in_queue
which only discard events in stop_reply_queue, and let
remote_notif_state_xfree release pending event for all notif_client.

After this change, discard_pending_stop_replies is only attached to
ifnerior_exit observer, so the INF can't be NULL any more.  The
NULL checking is removed too.

gdb:

2013-10-04  Yao Qi  <yao@codesourcery.com>

* remote-notif.h (REMOTE_NOTIF_ID): New enum.
(struct notif_client) <pending_event>: Moved
to struct remote_notif_state.
<id>: New field.
(struct remote_notif_state) <pending_event>: New field.
(notif_event_xfree): Declare.
* remote-notif.c (handle_notification): Adjust.
(notif_event_xfree): New function.
(do_notif_event_xfree): Call notif_event_xfree.
(remote_notif_state_xfree): Call notif_event_xfree to free
each element in field pending_event.
* remote.c (discard_pending_stop_replies): Remove declaration.
(discard_pending_stop_replies_in_queue): Declare.
(remote_close): Call discard_pending_stop_replies_in_queue
instead of discard_pending_stop_replies.
(remote_start_remote): Adjust.
(stop_reply_xfree): Call notif_event_xfree.
(notif_client_stop): Adjust initialization.
(remote_notif_remove_all): Rename it to ...
(remove_stop_reply_for_inferior): ... this.  Update comments.
Don't check INF is NULL.
(discard_pending_stop_replies): Return early if notif_state is
NULL.  Adjust.  Don't check INF is NULL.
(remote_notif_get_pending_events): Adjust.
  (discard_pending_stop_replies_in_queue): New function.
(remote_wait_ns): Likewise.

10 years agoMove notif_queue and remote_async_get_pending_events_token to remote_state
Yao Qi [Fri, 4 Oct 2013 07:32:56 +0000 (07:32 +0000)]
Move notif_queue and remote_async_get_pending_events_token to remote_state

This patch also removes notif_xfree, and don't pass it QUEUE_alloc, because
we don't have to free notif_client when the remote_notif_state is freed.

gdb:

2013-10-04  Yao Qi  <yao@codesourcery.com>

* remote-notif.c (DECLARE_QUEUE_P): Remove.
(notif_queue): Remove.
(remote_notif_process): Add one parameter 'notif_queue'.
Update comments.  Callers update.
(remote_async_get_pending_events_token): Remove.
(remote_notif_register_async_event_handler): Remove.
(remote_notif_unregister_async_event_handler): Remove.
(handle_notification): Add parameter 'notif_queue'.  Update
comments.  Callers update.
(notif_xfree): Remove.
(remote_notif_state_allocate): New function.
(remote_notif_state_xfree): New function.
(_initialize_notif): Remove code to allocate queue.
* remote-notif.h (DECLARE_QUEUE_P): Moved from remote-notif.c.
(struct remote_notif_state): New.
(handle_notification): Update declaration.
(remote_notif_process): Likewise.
(remote_notif_register_async_event_handler): Remove.
(remote_notif_unregister_async_event_handler): Remove.
(remote_notif_state_allocate): Declare.
(remote_notif_state_xfree): Declare.
* remote.c (struct remote_state) <notif_state>: New field.
(remote_close): Don't call
remote_notif_unregister_async_event_handler.  Call
remote_notif_state_xfree.
(remote_open_1): Don't call
remote_notif_register_async_event_handler.  Call
remote_notif_state_allocate.

10 years agoFix FIXME: xstrdup should not be here
Yao Qi [Fri, 4 Oct 2013 07:16:44 +0000 (07:16 +0000)]
Fix FIXME: xstrdup should not be here

Hi,

This FIXME goes into my eyes, when I am about to modify something here,

  /* Name is allocated by name_of_child.  */
  /* FIXME: xstrdup should not be here.  */

This FIXME was introduced in the python pretty-pretter patches.

  Python pretty-printing [6/6]
  https://sourceware.org/ml/gdb-patches/2009-05/msg00467.html

create_child_with_value is called in two paths,

 1. varobj_list_children -> create_child -> create_child_with_value,
 2. install_dynamic_child -> install_dynamic_child -> varobj_add_child
    -> create_child_with_value

In path #1, 'name' is allocated by name_of_child, as the original
comment said, we don't have to duplicate NAME in
create_child_with_value.  In path #2, 'name' is got from
PyArg_ParseTuple, and we have to duplicate NAME.

This patch removes the call to xstrdup in create_child_with_value
and call xstrudp in update_dynamic_varobj_children (path #2).

gdb:

2013-10-04  Yao Qi  <yao@codesourcery.com>

* varobj.c (create_child_with_value): Remove 'const' from the
type of parameter 'name'.
(varobj_add_child): Likewise.
(install_dynamic_child): Remove 'const' from the type of
parameter 'name'.
(varobj_add_child): Likewise.
(create_child_with_value): Likewise.  Update comments.  Don't
duplicate 'name'.
(update_dynamic_varobj_children): Duplicate 'name'
and pass it to install_dynamic_child.

10 years agodaily update
Alan Modra [Fri, 4 Oct 2013 00:00:04 +0000 (00:00 +0000)]
daily update

10 years ago2013-10-04 Jan-Benedict Glaw <jbglaw@lug-owl.de>
Jan-Benedict Glaw [Thu, 3 Oct 2013 22:02:45 +0000 (22:02 +0000)]
2013-10-04  Jan-Benedict Glaw  <jbglaw@lug-owl.de>

* configure: Regenerate.

10 years agoaarch64: Add support for GNU indirect functions.
Will Newton [Thu, 3 Oct 2013 14:46:09 +0000 (14:46 +0000)]
aarch64: Add support for GNU indirect functions.

Add support for STT_GNU_IFUNC symbols to the AArch64 bfd backend. The tests
are ported from the ld-ifunc tests but are enabled for cross builds so can
be run easily without hardware or a simulator.

bfd/ChangeLog:

2013-10-03  Will Newton  <will.newton@linaro.org>

* configure: Regenerate.
* configure.in: Build elf-ifunc.o for AArch64.
* elfnn-aarch64.c: Include objalloc.h.
(elfNN_aarch64_local_htab_hash): New function.
(elfNN_aarch64_local_htab_eq): New function.
(elfNN_aarch64_get_local_sym_hash): New function.
(elfNN_aarch64_link_hash_table_create): Initialize local STT_GNU_IFUNC
symbol hash.
(elfNN_aarch64_hash_table_free): Free local STT_GNU_IFUNC symbol hash.
(elfNN_aarch64_final_link_relocate): Add sym argument.  Add support
for handling STT_GNU_IFUNC symbols.
(elfNN_aarch64_gc_sweep_hook): Add support for garbage collecting
references to STT_GNU_IFUNC symbols.
(elfNN_aarch64_adjust_dynamic_symbol): Add support for handling
STT_GNU_IFUNC symbols.
(elfNN_aarch64_check_relocs): Add support for handling STT_GNU_IFUNC
symbols.  Ensure we don't increase plt.refcount from -1 to 0.
(elfNN_aarch64_post_process_headers): Call _bfd_elf_set_osabi.
(elfNN_aarch64_is_function_type): Remove function.
(elfNN_aarch64_allocate_dynrelocs): Handle STT_GNU_IFUNC symbols.
(elfNN_aarch64_allocate_ifunc_dynrelocs): New function.
(elfNN_aarch64_allocate_local_dynrelocs): New function.
(elfNN_aarch64_allocate_local_ifunc_dynrelocs): New function.
(elfNN_aarch64_size_dynamic_sections): Call
elfNN_aarch64_allocate_local_dynrelocs.
(elfNN_aarch64_create_small_pltn_entry): Add info argument.
Add support for creating .iplt entries for STT_GNU_IFUNC symbols.
(elfNN_aarch64_finish_dynamic_symbol): Add support for handling
STT_GNU_IFUNC symbols and .iplt.
(elfNN_aarch64_finish_local_dynamic_symbol): New function.
(elfNN_aarch64_finish_dynamic_sections): Call
elfNN_aarch64_finish_local_dynamic_symbol.

ld/ChangeLog:

2013-10-03  Will Newton  <will.newton@linaro.org>

* emulparams/aarch64elf.sh: Add IREL_IN_PLT.
* emulparams/aarch64elf32.sh: Likewise.

ld/testsuite/ChangeLog:

2013-10-03  Will Newton  <will.newton@linaro.org>

* ld-ifunc/ifunc.exp: Enable ifunc tests for AArch64.
* ld-aarch64/aarch64-elf.exp: Run ifunc tests.
* ld-aarch64/ifunc-1-local.d: New file.
* ld-aarch64/ifunc-1-local.s: Likewise.
* ld-aarch64/ifunc-1.d: Likewise.
* ld-aarch64/ifunc-1.s: Likewise.
* ld-aarch64/ifunc-10.d: Likewise.
* ld-aarch64/ifunc-10.s: Likewise.
* ld-aarch64/ifunc-11.d: Likewise.
* ld-aarch64/ifunc-11.s: Likewise.
* ld-aarch64/ifunc-12.d: Likewise.
* ld-aarch64/ifunc-12.s: Likewise.
* ld-aarch64/ifunc-13.d: Likewise.
* ld-aarch64/ifunc-13a.s: Likewise.
* ld-aarch64/ifunc-13b.s: Likewise.
* ld-aarch64/ifunc-14a.d: Likewise.
* ld-aarch64/ifunc-14a.s: Likewise.
* ld-aarch64/ifunc-14b.d: Likewise.
* ld-aarch64/ifunc-14b.s: Likewise.
* ld-aarch64/ifunc-14c.d: Likewise.
* ld-aarch64/ifunc-14c.s: Likewise.
* ld-aarch64/ifunc-14d.d: Likewise.
* ld-aarch64/ifunc-14e.d: Likewise.
* ld-aarch64/ifunc-14f.d: Likewise.
* ld-aarch64/ifunc-15.d: Likewise.
* ld-aarch64/ifunc-15.s: Likewise.
* ld-aarch64/ifunc-16.d: Likewise.
* ld-aarch64/ifunc-16.s: Likewise.
* ld-aarch64/ifunc-17a.d: Likewise.
* ld-aarch64/ifunc-17a.s: Likewise.
* ld-aarch64/ifunc-17b.d: Likewise.
* ld-aarch64/ifunc-17b.s: Likewise.
* ld-aarch64/ifunc-18a.d: Likewise.
* ld-aarch64/ifunc-18a.s: Likewise.
* ld-aarch64/ifunc-18b.d: Likewise.
* ld-aarch64/ifunc-18b.s: Likewise.
* ld-aarch64/ifunc-19a.d: Likewise.
* ld-aarch64/ifunc-19a.s: Likewise.
* ld-aarch64/ifunc-19b.d: Likewise.
* ld-aarch64/ifunc-19b.s: Likewise.
* ld-aarch64/ifunc-2-local.d: Likewise.
* ld-aarch64/ifunc-2-local.s: Likewise.
* ld-aarch64/ifunc-2.d: Likewise.
* ld-aarch64/ifunc-2.s: Likewise.
* ld-aarch64/ifunc-20.d: Likewise.
* ld-aarch64/ifunc-20.s: Likewise.
* ld-aarch64/ifunc-3.s: Likewise.
* ld-aarch64/ifunc-3a.d: Likewise.
* ld-aarch64/ifunc-3b.d: Likewise.
* ld-aarch64/ifunc-4.d: Likewise.
* ld-aarch64/ifunc-4.s: Likewise.
* ld-aarch64/ifunc-4a.d: Likewise.
* ld-aarch64/ifunc-5-local.s: Likewise.
* ld-aarch64/ifunc-5.s: Likewise.
* ld-aarch64/ifunc-5a-local.d: Likewise.
* ld-aarch64/ifunc-5a.d: Likewise.
* ld-aarch64/ifunc-5b-local.d: Likewise.
* ld-aarch64/ifunc-5b.d: Likewise.
* ld-aarch64/ifunc-5r-local.d: Likewise.
* ld-aarch64/ifunc-6.s: Likewise.
* ld-aarch64/ifunc-6a.d: Likewise.
* ld-aarch64/ifunc-6b.d: Likewise.
* ld-aarch64/ifunc-7.s: Likewise.
* ld-aarch64/ifunc-7a.d: Likewise.
* ld-aarch64/ifunc-7b.d: Likewise.
* ld-aarch64/ifunc-7c.d: Likewise.
* ld-aarch64/ifunc-8.d: Likewise.
* ld-aarch64/ifunc-8a.s: Likewise.
* ld-aarch64/ifunc-8b.s: Likewise.
* ld-aarch64/ifunc-9.d: Likewise.
* ld-aarch64/ifunc-9.s: Likewise.

10 years ago2013-10-03 Phil Muldoon <pmuldoon@redhat.com>
Phil Muldoon [Thu, 3 Oct 2013 14:43:32 +0000 (14:43 +0000)]
2013-10-03  Phil Muldoon  <pmuldoon@redhat.com>

* python/py-value.c (convert_value_from_python): Move PyInt_Check
conversion logic to occur after PyLong_Check.  Comment on order
change significance.
* python/py-arch.c (archpy_disassemble): Comment on order of
conversion for integers and longs.

10 years agoAlways run the PTRACE_O_TRACESYSGOOD tests even if PTRACE_O_TRACEFORK is not supported.
Pedro Alves [Thu, 3 Oct 2013 10:13:34 +0000 (10:13 +0000)]
Always run the PTRACE_O_TRACESYSGOOD tests even if PTRACE_O_TRACEFORK is not supported.

If enabling PTRACE_O_TRACEFORK fails, we never test for
PTRACE_O_TRACESYSGOOD support.  Before PTRACE_O_TRACESYSGOOD is checked,
we have:

  /* First, set the PTRACE_O_TRACEFORK option.  If this fails, we
     know for sure that it is not supported.  */
  ret = ptrace (PTRACE_SETOPTIONS, child_pid, (PTRACE_TYPE_ARG3) 0,
(PTRACE_TYPE_ARG4) PTRACE_O_TRACEFORK);

  if (ret != 0)
    {
      ret = ptrace (PTRACE_KILL, child_pid, (PTRACE_TYPE_ARG3) 0,
    (PTRACE_TYPE_ARG4) 0);
      if (ret != 0)
{
  warning (_("linux_check_ptrace_features: failed to kill child"));
  return;
}

      ret = my_waitpid (child_pid, &status, 0);
      if (ret != child_pid)
warning (_("linux_check_ptrace_features: failed "
   "to wait for killed child"));
      else if (!WIFSIGNALED (status))
warning (_("linux_check_ptrace_features: unexpected "
   "wait status 0x%x from killed child"), status);

      return; <<<<<<<<<<<<<<<<<
    }

Note that early return.  If PTRACE_O_TRACEFORK isn't supported, we're
not checking PTRACE_O_TRACESYSGOOD.  This didn't use to be a problem
before the unification of this whole detection business in
linux-ptrace.c.  Before, the sysgood detection was completely
separate:

static void
linux_test_for_tracesysgood (int original_pid)
{
  int ret;
  sigset_t prev_mask;

  /* We don't want those ptrace calls to be interrupted.  */
  block_child_signals (&prev_mask);

  linux_supports_tracesysgood_flag = 0;

  ret = ptrace (PTRACE_SETOPTIONS, original_pid, 0, PTRACE_O_TRACESYSGOOD);
  if (ret != 0)
    goto out;

  linux_supports_tracesysgood_flag = 1;
out:
  restore_child_signals_mask (&prev_mask);
}

So we need to get back the decoupling somehow.  I think it's cleaner
to split the seperate feature detections to separate functions.  This
patch does that.  The new functions are named for their counterparts
that existed before this code was moved to linux-ptrace.c.

Note I've used forward declarations for the new functions to make the
patch clearer, as otherwise the patch would look like I'd be adding a
bunch of new code.  A reorder can be done in a follow up patch.

Tested on x86_64 Fedora 17.

gdb/
2013-10-03  Pedro Alves  <palves@redhat.com>

* common/linux-ptrace.c (linux_check_ptrace_features): Factor out
the PTRACE_O_TRACESYSGOOD and PTRACE_O_TRACEFORK to separate
functions.  Always test for PTRACE_O_TRACESYSGOOD even if
PTRACE_O_TRACEFORK is not supported.
(linux_test_for_tracesysgood): New function.
(linux_test_for_tracefork): New function, factored out from
linux_check_ptrace_features, and also don't kill child_pid here.

10 years ago2013-10-03 Tristan Gingold <gingold@adacore.com>
Tristan Gingold [Thu, 3 Oct 2013 09:46:36 +0000 (09:46 +0000)]
2013-10-03  Tristan Gingold  <gingold@adacore.com>

* i386-darwin-nat.c (i386_darwin_dr_set): Fix argument type.
Remove verbose error reporting.  Use detected state to
thread_set_state call.
(i386_darwin_dr_get): Fix return type.  Remove verbose error
report.
Remove trailing spaces.

10 years agodaily update
Alan Modra [Thu, 3 Oct 2013 00:00:04 +0000 (00:00 +0000)]
daily update

10 years agogdb/testsuite/
Yufeng Zhang [Wed, 2 Oct 2013 18:09:26 +0000 (18:09 +0000)]
gdb/testsuite/

* gdb.trace/entry-values.exp: Modify regular expression to scan for
'bl' instruction instead of 'call' for ARM and AArch64 targets.