Commit Graph

84451 Commits

Author SHA1 Message Date
GDB Administrator
e566c9815c Automatic date update in version.in 2015-12-14 00:00:42 +00:00
GDB Administrator
afd74256f0 Automatic date update in version.in 2015-12-13 00:00:33 +00:00
GDB Administrator
6e93b9b3fd Automatic date update in version.in 2015-12-12 00:00:37 +00:00
GDB Administrator
0e585e0288 Automatic date update in version.in 2015-12-11 00:00:39 +00:00
GDB Administrator
56a0f7539e Automatic date update in version.in 2015-12-10 00:00:31 +00:00
GDB Administrator
fa8ff6905a Automatic date update in version.in 2015-12-09 00:00:27 +00:00
GDB Administrator
17c80a94c0 Automatic date update in version.in 2015-12-08 00:00:48 +00:00
GDB Administrator
2ed260f268 Automatic date update in version.in 2015-12-07 00:00:44 +00:00
GDB Administrator
7201fd7c2a Automatic date update in version.in 2015-12-06 00:00:37 +00:00
Joel Brobecker
40dfe024f9 Bump GDB version number to 7.10.1.DATE-cvs.
gdb/ChangeLog:

	* version.in: Set GDB version number to 7.10.1.DATE-cvs.
2015-12-05 16:34:00 +01:00
Joel Brobecker
bf7e6b0598 Document the GDB 7.10.1 release in gdb/ChangeLog
gdb/ChangeLog:

	GDB 7.10.1 released.
2015-12-05 16:29:06 +01:00
Joel Brobecker
c2bb526a22 Set GDB version number to 7.10.1.
gdb/ChangeLog:

	* version.in: Set GDB version number to 7.10.1.
gdb-7.10.1-release
2015-12-05 16:16:46 +01:00
GDB Administrator
9234ef44bf Automatic date update in version.in 2015-12-05 00:00:34 +00:00
GDB Administrator
92e6983be1 Automatic date update in version.in 2015-12-04 00:00:40 +00:00
GDB Administrator
bdaeeefd84 Automatic date update in version.in 2015-12-03 00:00:35 +00:00
Yao Qi
87a8c81ef0 Fix regression by Do not skip prologue for asm (.S) files
Patch "Do not skip prologue for asm (.S) files" [1] changes GDB's
behaviour on which test gdb.arch/thumb-singlestep.exp depends, so
it causes the fail below:

 (gdb) si^M
 37              blx     foo^M
 (gdb) FAIL: gdb.arch/thumb-singlestep.exp: step into foo

the test assumes the program will stop at the instruction after "push"
but it doesn't.  The fix to this fail is to do one more single step.

[1] https://sourceware.org/ml/gdb-patches/2015-06/msg00561.html

gdb/testsuite:

2015-12-02  Yao Qi  <yao.qi@linaro.org>

	* gdb.arch/thumb-singlestep.exp: Do one more single step.
2015-12-02 09:32:34 +00:00
GDB Administrator
01382ffd00 Automatic date update in version.in 2015-12-02 00:00:32 +00:00
GDB Administrator
c8b5fa335e Automatic date update in version.in 2015-12-01 00:00:39 +00:00
GDB Administrator
1fdd609138 Automatic date update in version.in 2015-11-30 00:00:35 +00:00
GDB Administrator
121ed3f9e2 Automatic date update in version.in 2015-11-29 00:00:41 +00:00
Pedro Alves
9a2752c7f0 Adjust GDB to demangler API change
Before commit 3a8724032abf, DEMANGLE_COMPONENT_CAST was used for both
casts and conversion operators.  We now have
DEMANGLE_COMPONENT_CONVERSION for the latter.

gdb/ChangeLog:
2014-11-28  Pedro Alves  <palves@redhat.com>

	* cp-name-parser.y (conversion_op): Use
	DEMANGLE_COMPONENT_CONVERSION instead of DEMANGLE_COMPONENT_CAST.
2015-11-28 17:11:45 +00:00
Pedro Alves
49037e4a12 PR other/61321 - demangler crash on casts in template parameters
The fix for bug 59195:

 [C++ demangler handles conversion operator incorrectly]
 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59195

unfortunately makes the demangler crash due to infinite recursion, in
case of casts in template parameters.

For example, with:

 template<int> struct A {};
 template <typename Y> void function_temp(A<sizeof ((Y)(999))>) {}
 template void function_temp<int>(A<sizeof (int)>);

The 'function_temp<int>' instantiation above mangles to:

  _Z13function_tempIiEv1AIXszcvT_Li999EEE

The demangler parses this as:

typed name
  template
    name 'function_temp'
    template argument list
      builtin type int
  function type
    builtin type void
    argument list
      template                          (*)
        name 'A'
        template argument list
          unary operator
            operator sizeof
            unary operator
              cast
                template parameter 0    (**)
              literal
                builtin type int
                name '999'

And after the fix for 59195, due to:

 static void
 d_print_cast (struct d_print_info *dpi, int options,
	       const struct demangle_component *dc)
 {
 ...
   /* For a cast operator, we need the template parameters from
      the enclosing template in scope for processing the type.  */
   if (dpi->current_template != NULL)
     {
       dpt.next = dpi->templates;
       dpi->templates = &dpt;
       dpt.template_decl = dpi->current_template;
     }

when printing the template argument list of A (what should be "<sizeof
(int)>"), the template parameter 0 (that is, "T_", the '**' above) now
refers to the first parameter of the the template argument list of the
'A' template (the '*' above), exactly what we were already trying to
print.  This leads to infinite recursion, and stack exaustion.  The
template parameter 0 should actually refer to the first parameter of
the 'function_temp' template.

Where it reads "for the cast operator" in the comment in d_print_cast
(above), it's really talking about a conversion operator, like:

  struct A { template <typename U> explicit operator U(); };

We don't want to inject the template parameters from the enclosing
template in scope when processing a cast _expression_, only when
handling a conversion operator.

The problem is that DEMANGLE_COMPONENT_CAST is currently ambiguous,
and means _both_ 'conversion operator' and 'cast expression'.

Fix this by adding a new DEMANGLE_COMPONENT_CONVERSION component type,
which does what DEMANGLE_COMPONENT_CAST does today, and making
DEMANGLE_COMPONENT_CAST just simply print its component subtree.

I think we could instead reuse DEMANGLE_COMPONENT_CAST and in
d_print_comp_inner still do:

 @@ -5001,9 +5013,9 @@ d_print_comp_inner (struct d_print_info *dpi, int options,
        d_print_comp (dpi, options, dc->u.s_extended_operator.name);
        return;

     case DEMANGLE_COMPONENT_CAST:
       d_append_string (dpi, "operator ");
 -     d_print_cast (dpi, options, dc);
 +     d_print_conversion (dpi, options, dc);
       return;

leaving the unary cast case below calling d_print_cast, but seems to
me that spliting the component types makes it easier to reason about
the code.

g++'s testsuite actually generates three symbols that crash the
demangler in the same way.  I've added those as tests in the demangler
testsuite as well.

And then this fixes PR other/61233 too, which happens to be a
demangler crash originally reported to GDB, at:
https://sourceware.org/bugzilla/show_bug.cgi?id=16957

Bootstrapped and regtested on x86_64 Fedora 20.

Also ran this through GDB's testsuite.  GDB will require a small
update to use DEMANGLE_COMPONENT_CONVERSION in one place it's using
DEMANGLE_COMPONENT_CAST in its sources.

libiberty/
2015-11-27  Pedro Alves  <palves@redhat.com>

        PR other/61321
        PR other/61233
        * demangle.h (enum demangle_component_type)
        <DEMANGLE_COMPONENT_CONVERSION>: New value.
        * cp-demangle.c (d_demangle_callback, d_make_comp): Handle
        DEMANGLE_COMPONENT_CONVERSION.
        (is_ctor_dtor_or_conversion): Handle DEMANGLE_COMPONENT_CONVERSION
        instead of DEMANGLE_COMPONENT_CAST.
        (d_operator_name): Return a DEMANGLE_COMPONENT_CONVERSION
        component if handling a conversion.
        (d_count_templates_scopes, d_print_comp_inner): Handle
        DEMANGLE_COMPONENT_CONVERSION.
        (d_print_comp_inner): Handle DEMANGLE_COMPONENT_CONVERSION instead
        of DEMANGLE_COMPONENT_CAST.
        (d_print_cast): Rename as ...
        (d_print_conversion): ... this.  Adjust comments.
        (d_print_cast): Rewrite - simply print the left subcomponent.
        * cp-demint.c (cplus_demangle_fill_component): Handle
        DEMANGLE_COMPONENT_CONVERSION.

        * testsuite/demangle-expected: Add tests.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231020 138bc75d-0d04-0410-961f-82ee72b054a4
2015-11-28 17:11:45 +00:00
Jason Merrill
d65faac094 Implement N4514, C++ Extensions for Transactional Memory.
gcc/
	* builtins.def (BUILT_IN_ABORT): Add transaction_pure attribute.
gcc/c-family/
	* c-common.c (c_common_reswords): Add C++ TM TS keywords.
	(c_common_attribute_table): Add transaction_safe_dynamic.
	transaction_safe now affects type identity.
	(handle_tm_attribute): Handle transaction_safe_dynamic.
	* c-common.h (enum rid): Add RID_ATOMIC_NOEXCEPT,
	RID_ATOMIC_CANCEL, RID_SYNCHRONIZED.
	(OBJC_IS_CXX_KEYWORD): Add RID_SYNCHRONIZED.
	(D_TRANSMEM): New.
	* c-cppbuiltin.c (c_cpp_builtins): Define __cpp_transactional_memory.
	* c-pretty-print.c (pp_c_attributes_display): Don't print
	transaction_safe in C++.
gcc/c/
	* c-parser.c (c_lex_one_token): Handle @synchronized.
	* c-decl.c (match_builtin_function_types): A declaration of a built-in
	can change whether the function is transaction_safe.
gcc/cp/
	* cp-tree.h (struct cp_declarator): Add tx_qualifier field.
	(BCS_NORMAL, BCS_TRANSACTION): New enumerators.
	* lex.c (init_reswords): Limit TM kewords to -fgnu-tm.
	* parser.c (cp_lexer_get_preprocessor_token): Fix @synchronized.
	(make_call_declarator): Take tx_qualifier.
	(cp_parser_tx_qualifier_opt): New.
	(cp_parser_lambda_declarator_opt): Use it.
	(cp_parser_direct_declarator): Likewise.
	(cp_parser_statement): Handle atomic_noexcept, atomic_cancel.
	(cp_parser_compound_statement): Change in_try parameter to bcs_flags.
	(cp_parser_std_attribute): Map optimize_for_synchronized to
	transaction_callable.
	(cp_parser_transaction): Take the token.  Handle atomic_noexcept.
	* lambda.c (maybe_add_lambda_conv_op): Handle transaction-safety.
	* call.c (enum conversion_kind): Add ck_tsafe.
	(standard_conversion): Handle transaction-safety conversion.
	(convert_like_real, resolve_address_of_overloaded_function): Likewise.
	(check_methods): Diagnose transaction_safe_dynamic on non-virtual
	function.
	(look_for_tm_attr_overrides): Don't inherit transaction_safe_dynamic.
	* cvt.c (tx_safe_fn_type_p, tx_unsafe_fn_variant)
	(can_convert_tx_safety): New.
	* typeck.c (composite_pointer_type): Handle transaction-safety.
	* name-lookup.h (enum scope_kind): Add sk_transaction.
	* name-lookup.c (begin_scope): Handle it.
	* semantics.c (begin_compound_stmt): Pass it.
	* decl.c (check_previous_goto_1): Check it.
	(struct named_label_entry): Add in_transaction_scope.
	(poplevel_named_label_1): Set it.
	(check_goto): Check it.
	(duplicate_decls): A specialization can be transaction_safe
	independently of its template.
	(grokdeclarator): Handle tx-qualifier.
	* rtti.c (ptr_initializer): Handle transaction-safe.
	* search.c (check_final_overrider): Check transaction_safe_dynamic.
	Don't check transaction_safe.
	* mangle.c (write_function_type): Mangle transaction_safe here.
	(write_CV_qualifiers_for_type): Not here.
	(write_type): Preserve transaction_safe when stripping attributes.
	* error.c (dump_type_suffix): Print transaction_safe.
libiberty/
	* cp-demangle.c (d_cv_qualifiers): Dx means transaction_safe.
	(cplus_demangle_type): Let d_cv_qualifiers handle it.
	(d_dump, d_make_comp, has_return_type, d_encoding)
	(d_count_templates_scopes, d_print_comp_inner)
	(d_print_mod_list, d_print_mod, d_print_function_type)
	(is_ctor_or_dtor): Handle DEMANGLE_COMPONENT_TRANSACTION_SAFE.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@228462 138bc75d-0d04-0410-961f-82ee72b054a4
2015-11-28 17:11:44 +00:00
Ian Lance Taylor
99eda040d8 Demangler: Fix constructor names with ABI tags
The symbol _ZNSt8ios_base7failureB5cxx11C1EPKcRKSt10error_code, which
appears in libstdc++, was being demangled as

std::ios_base::failure[abi:cxx11]::cxx11(char const*, std::error_code const&)

That is clearly incorrect: std::ios_base::failure does not have a
method cxx11, and anyhow if you look closely at the mangled name you
will see that it is supposed to be a constructor.  This patch fixes
the demangler to generate the correct demangling, namely

std::ios_base::failure[abi:cxx11]::failure(char const*, std::error_code const&)

Bootstrapped and ran libiberty and libstdc++-v3 tests on
x86_64-unknown-linux-gnu.

2015-08-15  Ian Lance Taylor  <iant@google.com>

	* cp-demangle.c (d_abi_tags): Preserve di->last_name across any
	ABI tags.
2015-11-28 17:07:32 +00:00
Mikhail Maltsev
fde0a3e549 Fix several crashes of C++ demangler on fuzzed input.
libiberty/
	* cp-demangle.c (d_dump): Fix syntax error.
	(d_identifier): Adjust type of len to match d_source_name.
	(d_expression_1): Fix out-of-bounds access.  Check code variable for
	NULL before dereferencing it.
	(d_find_pack): Do not recurse for FIXED_TYPE, DEFAULT_ARG and NUMBER.
	(d_print_comp_inner): Add NULL pointer check.
	* cp-demangle.h (d_peek_next_char): Define as inline function when
	CHECK_DEMANGLER is defined.
	(d_advance): Likewise.
	* testsuite/demangle-expected: Add new testcases.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@225727 138bc75d-0d04-0410-961f-82ee72b054a4
2015-11-28 16:59:46 +00:00
GDB Administrator
1dc1927e25 Automatic date update in version.in 2015-11-28 00:00:34 +00:00
GDB Administrator
c4c83242ea Automatic date update in version.in 2015-11-27 00:00:38 +00:00
Markus Metzger
bab694b7f9 btrace: diagnose "record btrace pt" without libipt
If GDB has been configured without libipt support, i.e. HAVE_LIBIPT is
undefined, and is running on a system that supports Intel(R) Processor Trace,
GDB will run into an internal error when trying to decode the trace.

    (gdb) record btrace
    (gdb) s
    usage (name=0x7fffffffe954 "fib-64")
        at src/fib.c:12
    12          fprintf(stderr, "usage: %s <num>\n", name);
    (gdb) info record
    Active record target: record-btrace
    Recording format: Intel(R) Processor Trace.
    Buffer size: 16kB.
    gdb/btrace.c:971: internal-error: Unexpected branch trace format.
    A problem internal to GDB has been detected,
    further debugging may prove unreliable.
    Quit this debugging session? (y or n)

This requires a system with Linux kernel 4.1 or later running on a 5th
Generation Intel Core processor or later.

The issue is documented as PR 19297.

When trying to enable branch tracing, in addition to checking the target
support for the requested branch tracing format, also check whether GDB
supports. it.

gdb/
	* btrace.c (btrace_enable): Check whether HAVE_LIBIPT is defined.
2015-11-26 13:16:13 +01:00
GDB Administrator
70341a0320 Automatic date update in version.in 2015-11-26 00:00:32 +00:00
GDB Administrator
757295aed8 Automatic date update in version.in 2015-11-25 00:00:31 +00:00
GDB Administrator
866aba2f3f Automatic date update in version.in 2015-11-24 00:00:30 +00:00
GDB Administrator
8a71ab1dd3 Automatic date update in version.in 2015-11-23 00:00:31 +00:00
GDB Administrator
99f3bd8149 Automatic date update in version.in 2015-11-22 00:00:35 +00:00
GDB Administrator
8bcab5edb2 Automatic date update in version.in 2015-11-21 00:01:00 +00:00
GDB Administrator
c17e7b9386 Automatic date update in version.in 2015-11-20 00:00:37 +00:00
GDB Administrator
1cc835f4ed Automatic date update in version.in 2015-11-19 00:00:45 +00:00
GDB Administrator
2739eb3359 Automatic date update in version.in 2015-11-18 00:00:37 +00:00
GDB Administrator
89f5b69dd8 Automatic date update in version.in 2015-11-17 00:00:40 +00:00
GDB Administrator
8b593a34ee Automatic date update in version.in 2015-11-16 00:00:31 +00:00
GDB Administrator
28098f2c59 Automatic date update in version.in 2015-11-15 00:00:34 +00:00
GDB Administrator
483ec498cb Automatic date update in version.in 2015-11-14 00:00:33 +00:00
GDB Administrator
47400476a2 Automatic date update in version.in 2015-11-13 00:00:32 +00:00
GDB Administrator
978461c7af Automatic date update in version.in 2015-11-12 00:00:40 +00:00
GDB Administrator
dc544175c0 Automatic date update in version.in 2015-11-11 00:00:32 +00:00
GDB Administrator
15aa89a588 Automatic date update in version.in 2015-11-10 00:00:31 +00:00
GDB Administrator
64ab977fde Automatic date update in version.in 2015-11-09 00:00:45 +00:00
GDB Administrator
59925580b7 Automatic date update in version.in 2015-11-08 00:00:38 +00:00
GDB Administrator
0e3adc94fa Automatic date update in version.in 2015-11-07 00:00:35 +00:00
GDB Administrator
40430ae983 Automatic date update in version.in 2015-11-06 00:00:31 +00:00
GDB Administrator
890a027361 Automatic date update in version.in 2015-11-05 00:00:36 +00:00