Home - Waterfall Grid T-Grid Console Builders Recent Builds Buildslaves Changesources - JSON API - About

Console View


Tags: MAIL TEST aarch32 aarch64 aix c-build-m64 cc-with-index debian fedora freebsd i686 index m32 m64 native-extended-gdbserver native-extended-gdbserver-m32 native-extended-gdbserver-m64 native-gdbserver native-gdbserver-m32 native-gdbserver-m64 power8 ppc64be ppc64le rhel s390x ubuntu x86_64
Legend:   Passed Failed Warnings Failed Again Running Exception Offline No data

MAIL TEST aarch32 aarch64 aix c-build-m64 cc-with-index debian fedora freebsd i686 index m32 m64 native-extended-gdbserver native-extended-gdbserver-m32 native-extended-gdbserver-m64 native-gdbserver native-gdbserver-m32 native-gdbserver-m64 power8 ppc64be ppc64le rhel s390x ubuntu x86_64
e60eb2880368...
Yao Qi
[ARM] Mark USER_SPECIFIED_MACHINE_TYPE in disassemble_info.flags
opcodes/arm-dis.c:print_insn may update disassemble_info.mach to
bfd_mach_arm_unknown unless USER_SPECIFIED_MACHINE_TYPE is marked.
When default_print_insn is called for the first time,
disassemble_info.mach is correctly set in GDB, but arm-dis.c:print_insn
sets it to bfd_mach_arm_unknown.  Then, when default_print_insn is
called again (in a loop), it triggers the assert.

The patch fixes the assert by marking USER_SPECIFIED_MACHINE_TYPE so that
opcodes won't reset disassemble_info.mach.

gdb:

2017-08-18  Yao Qi  <yao.qi@linaro.org>

PR tdep/21818
* arm-tdep.c (gdb_print_insn_arm): Mark
USER_SPECIFIED_MACHINE_TYPE if exec_bfd isn't NULL.
e3e41d588adb...
Tom Tromey
Change gdb_abspath to return a unique_xmalloc_ptr
This changes gdb_abspath to return a unique_xmalloc_ptr, and fixes up
the callers.  This allows the removal of a cleanup, and also puts
ownership rules into the API, where they belong.

ChangeLog
2017-08-22  Tom Tromey  <tom@tromey.com>

* compile/compile.c (compile_file_command): Use
gdb::unique_xmalloc_ptr, std::string.
* utils.c (gdb_abspath): Change return type.
* source.c (openp): Update.
* objfiles.c (allocate_objfile): Update.
* main.c (set_gdb_data_directory): Update.
* utils.h (gdb_abspath): Return a gdb::unique_xmalloc_ptr.
e3c2f928b8f9...
Alexander Fedotov
[PowerPC VLE] Add LSP (Lightweight Signal Processing) instruction support
include/
* opcode/ppc.h (PPC_OPCODE_LSP): New define.
opcodes/
* ppc-opc.c (insert_evuimm2_ex0): New function.
(extract_evuimm2_ex0): Likewise.
(insert_evuimm4_ex0): Likewise.
(extract_evuimm4_ex0): Likewise.
(insert_evuimm8_ex0): Likewise.
(extract_evuimm8_ex0): Likewise.
(insert_evuimm_lt16): Likewise.
(extract_evuimm_lt16): Likewise.
(insert_rD_rS_even): Likewise.
(extract_rD_rS_even): Likewise.
(insert_off_lsp): Likewise.
(extract_off_lsp): Likewise.
(RD_EVEN): New operand.
(RS_EVEN): Likewise.
(RSQ): Adjust.
(EVUIMM_LT16): New operand.
(HTM_SI): Adjust.
(EVUIMM_2_EX0): New operand.
(EVUIMM_4): Adjust.
(EVUIMM_4_EX0): New operand.
(EVUIMM_8): Adjust.
(EVUIMM_8_EX0): New operand.
(WS): Adjust.
(VX_OFF): New operand.
(VX_LSP): New macro.
(VX_LSP_MASK): Likewise.
(VX_LSP_OFF_MASK): Likewise.
(PPC_OPCODE_LSP): Likewise.
(vle_opcodes): Add LSP opcodes.
* ppc-dis.c (ppc_mopt): Add PPC_OPCODE_LSP flag to "vle" entry.
gas/
* testsuite/gas/ppc/lsp-checks.d,
* testsuite/gas/ppc/lsp-checks.l,
* testsuite/gas/ppc/lsp-checks.s: New test.
* testsuite/gas/ppc/lsp.d,
* testsuite/gas/ppc/lsp.s: New test.
* testsuite/gas/ppc/ppc.exp: Run new tests.
de25939739ff...
Nick Clifton
Fix buffer overrun parsing a corrupt tekhex binary.
PR binutils/21962
* tekhex.c (getsym): Fix check for source pointer walking off the
end of the input buffer.
dd66b39984d2...
GDB Administrator
Automatic date update in version.in
d7dec582d122...
GDB Administrator
Automatic date update in version.in
c973d0aa4a2c...
Pedro Alves
Fix type casts losing typedefs and reimplement "whatis" typedef stripping
(Ref: https://sourceware.org/ml/gdb/2017-06/msg00020.html)

Assuming int_t is a typedef to int:

typedef int int_t;

gdb currently loses this expression's typedef:

(gdb) p (int_t) 0
$1 = 0
(gdb) whatis $1
type = int

or:

(gdb) whatis (int_t) 0
type = int

or, to get "whatis" out of the way:

(gdb) maint print type (int_t) 0
...
name 'int'
code 0x8 (TYPE_CODE_INT)
...

This prevents a type printer for "int_t" kicking in, with e.g.:

(gdb) p (int_t) 0

From the manual, we can see that that "whatis (int_t) 0" command
invocation should have printed "type = int_t":

If @var{arg} is a variable or an expression, @code{whatis} prints its
literal type as it is used in the source code.  If the type was
defined using a @code{typedef}, @code{whatis} will @emph{not} print
the data type underlying the @code{typedef}.
(...)
If @var{arg} is a type name that was defined using @code{typedef},
@code{whatis} @dfn{unrolls} only one level of that @code{typedef}.

That one-level stripping is currently done here, in
gdb/eval.c:evaluate_subexp_standard, handling OP_TYPE:

...
    else if (noside == EVAL_AVOID_SIDE_EFFECTS)
{
  struct type *type = exp->elts[pc + 1].type;

  /* If this is a typedef, then find its immediate target.  We
    use check_typedef to resolve stubs, but we ignore its
    result because we do not want to dig past all
    typedefs.  */
  check_typedef (type);
  if (TYPE_CODE (type) == TYPE_CODE_TYPEDEF)
    type = TYPE_TARGET_TYPE (type);
  return allocate_value (type);
}

However, this stripping is reachable in both:

#1 - (gdb) whatis (int_t)0    # ARG is an expression with a cast to
                                # typedef type.
#2 - (gdb) whatis int_t        # ARG is a type name.

while only case #2 should strip the typedef.  Removing that code from
evaluate_subexp_standard is part of the fix.  Instead, we make the
"whatis" command implementation itself strip one level of typedefs
when the command argument is a type name.

We then run into another problem, also fixed by this commit:
value_cast always drops any typedefs of the destination type.

With all that fixed, "whatis (int_t) 0" now works as expected:

(gdb) whatis int_t
type = int
(gdb) whatis (int_t)0
type = int_t

value_cast has many different exit/convertion paths, for handling many
different kinds of casts/conversions, and most of them had to be
tweaked to construct the value of the right "to" type.  The new tests
try to exercise most of it, by trying castin of many different
combinations of types.  With:

$ make check TESTS="*/whatis-ptype*.exp */gnu_vector.exp */dfp-test.exp"

... due to combinatorial explosion, the testsuite results for the
tests above alone grow like:

- # of expected passes            246
+ # of expected passes            3811

You'll note that the tests exposed one GCC buglet, filed here:

  Missing DW_AT_type in DW_TAG_typedef of "typedef of typedef of void"
  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81267

gdb/ChangeLog:
2017-08-21  Pedro Alves  <palves@redhat.com>

* eval.c (evaluate_subexp_standard) <OP_TYPE>: Don't dig past
typedefs.
* typeprint.c (whatis_exp): If handling "whatis", and expression
is OP_TYPE, strip one typedef level.  Otherwise don't strip
typedefs here.
* valops.c (value_cast): Save "to" type before resolving
stubs/typedefs.  Use that type as resulting value's type.

gdb/testsuite/ChangeLog:
2017-08-21  Pedro Alves  <palves@redhat.com>

* gdb.base/dfp-test.c
(d32_t, d64_t, d128_t, d32_t2, d64_t2, d128_t2, v_d32_t, v_d64_t)
(v_d128_t, v_d32_t2, v_d64_t2, v_d128_t2): New.
* gdb.base/dfp-test.exp: Add whatis/ptype/cast tests.
* gdb.base/gnu_vector.exp: Add whatis/ptype/cast tests.
* gdb.base/whatis-ptype-typedefs.c: New.
* gdb.base/whatis-ptype-typedefs.exp: New.
* gdb.python/py-prettyprint.c (int_type, int_type2): New typedefs.
(an_int, an_int_type, an_int_type2): New globals.
* gdb.python/py-prettyprint.exp (run_lang_tests): Add tests
involving typedefs and cast expressions.
* gdb.python/py-prettyprint.py (class pp_int_typedef): New.
(lookup_typedefs_function): New.
(typedefs_pretty_printers_dict): New.
(top level): Register lookup_typedefs_function in
gdb.pretty_printers.
bf223d3e808e...
Pedro Alves
Handle function aliases better (PR gdb/19487, errno printing)
(Ref: https://sourceware.org/ml/gdb/2017-06/msg00048.html)

This patch improves GDB support for function aliases defined with
__attribute__ alias.  For example, in the test added by this commit,
there is no reference to "func_alias" in the debug info at all, only
to "func"'s definition:

$ nm  ./testsuite/outputs/gdb.base/symbol-alias/symbol-alias  | grep " func"
00000000004005ae t func
00000000004005ae T func_alias

$ readelf -w ./testsuite/outputs/gdb.base/symbol-alias/symbol-alias | grep func -B 1 -A 8
<1><db>: Abbrev Number: 5 (DW_TAG_subprogram)
    <dc>  DW_AT_name        : (indirect string, offset: 0x111): func
    <e0>  DW_AT_decl_file  : 1
    <e1>  DW_AT_decl_line  : 27
    <e2>  DW_AT_prototyped  : 1
    <e2>  DW_AT_type        : <0xf8>
    <e6>  DW_AT_low_pc      : 0x4005ae
    <ee>  DW_AT_high_pc    : 0xb
    <f6>  DW_AT_frame_base  : 1 byte block: 9c        (DW_OP_call_frame_cfa)
    <f8>  DW_AT_GNU_all_call_sites: 1

So all GDB knows about "func_alias" is from the minsym (elf symbol):

(gdb) p func_alias
$1 = {<text variable, no debug info>} 0x4005ae <func>
(gdb) ptype func_alias
type = int ()

(gdb) p func
$2 = {struct S *(void)} 0x4005ae <func>
(gdb) ptype func
type = struct S {
    int field1;
    int field2;
} *(void)

The result is that calling func_alias from the command line produces
incorrect results.

This is similar (though not exactly the same) to the glibc
errno/__errno_location/__GI___errno_location situation.  On glibc,
errno is defined like this:

  extern int *__errno_location (void);
  #define errno (*__errno_location ())

with __GI___errno_location being an internal alias for
__errno_location.  On my system's libc (F23), I do see debug info for
__errno_location, in the form of name vs linkage name:

<1><95a5>: Abbrev Number: 18 (DW_TAG_subprogram)
    <95a6>  DW_AT_external    : 1
    <95a6>  DW_AT_name        : (indirect string, offset: 0x2c26): __errno_location
    <95aa>  DW_AT_decl_file  : 1
    <95ab>  DW_AT_decl_line  : 24
    <95ac>  DW_AT_linkage_name: (indirect string, offset: 0x2c21): __GI___errno_location
    <95b0>  DW_AT_prototyped  : 1
    <95b0>  DW_AT_type        : <0x9206>
    <95b4>  DW_AT_low_pc      : 0x20f40
    <95bc>  DW_AT_high_pc    : 0x11
    <95c4>  DW_AT_frame_base  : 1 byte block: 9c      (DW_OP_call_frame_cfa)
    <95c6>  DW_AT_GNU_all_call_sites: 1

however that doesn't matter in practice, because GDB doesn't record
demangled names anyway, and so we end up with the exact same situation
covered by the testcase.

So the fix is to make the expression parser find a debug symbol for
the same address as the just-found minsym, when a lookup by name
didn't find a debug symbol by name.  We now get:

(gdb) p func_alias
$1 = {struct S *(void)} 0x4005ae <func>
(gdb) p __errno_location
$2 = {int *(void)} 0x7ffff6e92830 <__errno_location>

I've made the test exercise variable aliases too, for completeness.
Those already work correctly, because unlike for function aliases, GCC
emits debug information for variable aliases.

Tested on GNU/Linux.

gdb/ChangeLog:
2017-08-21  Pedro Alves  <palves@redhat.com>

PR gdb/19487
* c-exp.y (variable production): Handle function aliases.
* minsyms.c (msymbol_is_text): New function.
* minsyms.h (msymbol_is_text): Declare.
* symtab.c (find_function_alias_target): New function.
* symtab.h (find_function_alias_target): Declare.

gdb/testsuite/ChangeLog:
2017-08-21  Pedro Alves  <palves@redhat.com>

PR gdb/19487
* gdb.base/symbol-alias.c: New.
* gdb.base/symbol-alias2.c: New.
* gdb.base/symbol-alias.exp: New.
ba7139188c75...
Alex Lindsay
Synthetic symbol leak in elf_read_minimal_symbols
Detected this leak with valgrind memcheck:

==30840== 194 bytes in 1 blocks are definitely lost in loss record 9,138 of 10,922
==30840==    at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==30840==    by 0x80DF82: bfd_malloc (libbfd.c:193)
==30840==    by 0x80E12D: bfd_zmalloc (libbfd.c:278)
==30840==    by 0x819E80: elf_x86_64_get_synthetic_symtab (elf64-x86-64.c:6835)
==30840==    by 0x4F7B01: elf_read_minimal_symbols(objfile*, int, elfinfo const*) (elfread.c:1124)
==30840==    by 0x4F7CE7: elf_symfile_read(objfile*, enum_flags<symfile_add_flag>) (elfread.c:1182)
==30840==    by 0x7557FC: read_symbols(objfile*, enum_flags<symfile_add_flag>) (symfile.c:861)
==30840==    by 0x755EE1: syms_from_objfile_1(objfile*, section_addr_info*, enum_flags<symfile_add_flag>) (symfile.c:1062)

We perform a dynamic allocation in
elf64-x86-64.c:elf_x86_64_get_synthetic_symtab

  s = *ret = (asymbol *) bfd_zmalloc (size);

that appear to never get freed.

gdb:

2017-08-17  Alex Lindsay  <alexlindsay239@gmail.com>

* elfread.c (elf_read_minimal_symbols): xfree synthsyms.
b270e6f9e098...
Tom Tromey
Change install_breakpoint to take a std::unique_ptr
This changes install_breakpoint to take a std::unique_ptr rvalue-ref
argument.  This makes it clear that install_breakpoint takes ownership
of the pointer, and prevents bugs like the one fixed by the previous
patch.

ChangeLog
2017-08-22  Tom Tromey  <tom@tromey.com>

* breakpoint.h (install_breakpoint): Update.
* breakpoint.c (add_solib_catchpoint): Update.
(install_breakpoint): Change argument to a std::unique_ptr.
(create_fork_vfork_event_catchpoint): Use std::unique_ptr.
(create_breakpoint_sal, create_breakpoint): Update.
(watch_command_1, catch_exec_command_1)
(strace_marker_create_breakpoints_sal): Use std::unique_ptr.
(add_to_breakpoint_chain): Change argument to a std::unique_ptr.
Return the breakpoint.
(set_raw_breakpoint_without_location, set_raw_breakpoint)
(new_single_step_breakpoint): Update.
* break-catch-throw.c (handle_gnu_v3_exceptions): Use
std::unique_ptr.
* break-catch-syscall.c (create_syscall_event_catchpoint): Use
std::unique_ptr.
* break-catch-sig.c (create_signal_catchpoint): Use
std::unique_ptr.
* ada-lang.c (create_ada_exception_catchpoint): Use
std::unique_ptr.
b0cba12e07cc...
Pedro Alves
Plug source_command leak
The heap-allocated 'old_source_verbose' local was accidentally left
behind by commit 2ec845e75876 ("More uses of scoped_restore").

Valgrind caught it, like:

==20123== 8 bytes in 1 blocks are definitely lost in loss record 4,609 of 13,785
==20123==    at 0x4C2A988: calloc (vg_replace_malloc.c:711)
==20123==    by 0x60A2F8: xcalloc (common-utils.c:84)
==20123==    by 0x4CDBE5: build_command_line(command_control_type, char const*) (cli-script.c:159)
==20123==    by 0x4CDC32: get_command_line(command_control_type, char const*) (cli-script.c:172)
==20123==    by 0x5230F1: python_command(char*, int) (python.c:421)
==20123==    by 0x4C61AD: do_cfunc(cmd_list_element*, char*, int) (cli-decode.c:106)
==20123==    by 0x4C911F: cmd_func(cmd_list_element*, char*, int) (cli-decode.c:1902)
==20123==    by 0x7CA79E: execute_command(char*, int) (top.c:650)
==20123==    by 0x695A0C: command_handler(char*) (event-top.c:590)
==20123==    by 0x7CA33F: read_command_file(_IO_FILE*) (top.c:461)
==20123==    by 0x4D0C3A: script_from_file(_IO_FILE*, char const*) (cli-script.c:1584)
==20123==    by 0x4C2727: source_script_from_stream(_IO_FILE*, char const*, char const*) (cli-cmds.c:589)

gdb/ChangeLog:
2017-08-17  Pedro Alves  <palves@redhat.com>

* cli/cli-cmds.c (source_command): Delete 'old_source_verbose'
local.
af3881e61290...
John Baldwin
Correct earlier ChangeLog entry for fbsd_add_threads.
8ed6baa92895...
GDB Administrator
Automatic date update in version.in
8dfb7cbf8401...
H.J. Lu
Update PR ld/21964 tests
* testsuite/ld-elf/pr21964-1a.c (foo): Renamed to ...
(foo1): This.
* testsuite/ld-elf/pr21964-1b.c: Rewrite.
* testsuite/ld-elf/pr21964-1c.c: New file.
* testsuite/ld-elf/pr21964-2c.c: Likewise.
* testsuite/ld-elf/pr21964-2a.c (foo): Renamed to ...
(foo1): This.
* testsuite/ld-elf/pr21964-2b.c: Rewrite.
* testsuite/ld-elf/shared.exp: Update PR ld/21964 tests.
86dcbf50fe5f...
Yao Qi
Remove some GDB specific stuff from selftest.c
The next patch moves selftest.c to common/selftest.c, so that GDBserver
can use it as well.  However selftest.c uses something isn't "portable" on
GDB and GDBserver.

First, this patch removes QUIT.  I don't expect that we type ctrl-c during
self/unit tests, and each test shouldn't take long time.  Secondly, I
replace exception_fprintf and printf_filtered with debug_printf.  Verified
that unit tests still catch fails.

gdb:

2017-08-18  Yao Qi  <yao.qi@linaro.org>

* selftest.c (run_tests): Don't call QUIT.  Call debug_printf
instead of exception_fprintf and printf_filtered.
7f3d21db922a...
H.J. Lu
Update testsuite/ld-x86-64/plt-main-bnd.dd
2017-08-20  A. Wilcox  <awilfox@adelielinux.org>

PR ld/21976
* testsuite/ld-x86-64/plt-main-bnd.dd: Accept '_' in symbol
name.
791d819a5164...
GDB Administrator
Automatic date update in version.in
7649770c8e52...
Yao Qi
Put selftests api into selftests namespace
This patch changes register_self_test to selftests::register_test,
and run_self_tests to selftest::run_tests.

gdb:

2017-08-18  Yao Qi  <yao.qi@linaro.org>

* selftest.c (register_self_test): Rename it to
selftests::register_test.
(run_self_tests): selftest::run_tests.
* selftest.h: Update declarations.
* selftest-arch.c (register_self_test_foreach_arch): Rename it to
selftests::register_test_foreach_arch.
* selftest-arch.h: Update declaration.
* aarch64-tdep.c: Update.
* arm-tdep.c: Likewise.
* disasm-selftests.c: Likewise.
* dwarf2loc.c: Likewise.
* dwarf2-frame.c: Likewise.
* findvar.c: Likewise.
* gdbarch-selftests.c: Likewise.
* maint.c (maintenance_selftest): Likewise.
* regcache.c: Likewise.
* rust-exp.y: Likewise.
* selftest-arch.c: Likewise.
* unittests/environ-selftests.c: Likewise.
* unittests/function-view-selftests.c: Likewise.
* unittests/offset-type-selftests.c: Likewise.
* unittests/optional-selftests.c: Likewise.
* unittests/scoped_restore-selftests.c: Likewise.
* utils-selftests.c: Likewise.
714da62f64ef...
Nick Clifton
Add test of V2 GNU build attribute notes.
* testsuite/binutils-all/note-3-64.s: New test.  Checks assembly
and decoding of version2 GNU build attribute notes.
* testsuite/binutils-all/note-3-32.s: New test.  32-bit version of
the above test.
* testsuite/binutils-all/note-3-64.d: New test driver.
* testsuite/binutils-all/note-3-32.d: New test driver.
* testsuite/binutils-all/objcopy.exp: Run the new test.
* readelf.c (is_64bit_abs_reloc): Add R_SPARC_64.
6d580b635f89...
Yao Qi
GDBserver self tests
This patch uses GDB self test in GDBserver.  The self tests are run if
GDBserver is started with option --selftest.

gdb:

2017-08-18  Yao Qi  <yao.qi@linaro.org>

* NEWS: Mention GDBserver's new option "--selftest".
* Makefile.in (SFILES): Remove selftest.c, add common/selftest.c.
* selftest.c: Move it to common/selftest.c.
* selftest.h: Move it to common/selftest.h.
* selftest-arch.c (reset): New function.
(tests_with_arch): Call reset.

gdb/gdbserver:

2017-08-18  Yao Qi  <yao.qi@linaro.org>

* Makefile.in (OBS): Add selftest.o.
* configure.ac: AC_DEFINE GDB_SELF_TEST if $development.
* configure, config.in: Re-generated.
* server.c: Include common/sefltest.h.
(captured_main): Handle option --selftest.

gdb/testsuite:

2017-08-18  Yao Qi  <yao.qi@linaro.org>

* gdb.server/unittest.exp: New.

gdb/doc:

2017-08-18  Yao Qi  <yao.qi@linaro.org>

* gdb.texinfo (Server): Document "--selftest".
67d888f5c801...
Palmer Dabbelt
RISC-V: Mark "c.nop" as an alias
This fixes "-M noaliases" disassembly for "c.nop", which is an alias for
"c.addi x0, 0".

opcodes/ChangeLog

2017-08-01  Palmer Dabbelt  <palmer@dabbelt.com>

        * riscv-opc.c (riscv_opcodes): Mark "c.nop" as an alias.
56f376452497...
Tom Tromey
Change psymtab_search_name to return a unique_xmalloc_ptr
This changes psymtab_search_name to return a unique_xmalloc_ptr and
fixes up its one caller.  This allows the removal of some cleanups.

ChangeLog
2017-08-22  Tom Tromey  <tom@tromey.com>

* psymtab.c (psymtab_search_name): Return a unique_xmalloc_ptr.
(lookup_partial_symbol): Update.
545bc2b377db...
Szabolcs Nagy