]> git.ipfire.org Git - thirdparty/binutils-gdb.git/log
thirdparty/binutils-gdb.git
10 years agoAutomatic date update in version.in
GDB Administrator [Thu, 12 Feb 2015 00:00:28 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoframefilter quit: New test
Jan Kratochvil [Wed, 11 Feb 2015 13:55:13 +0000 (14:55 +0100)] 
framefilter quit: New test

It definitely does not test all the RETURN_MASK_ERROR cases.  But it tests at
least two of them.

gdb/testsuite/ChangeLog
2015-02-11  Jan Kratochvil  <jan.kratochvil@redhat.com>

* gdb.python/py-framefilter.exp (pagination quit - *): New tests.

10 years agoframefilter quit: Use RETURN_MASK_ERROR
Jan Kratochvil [Wed, 11 Feb 2015 13:51:36 +0000 (14:51 +0100)] 
framefilter quit: Use RETURN_MASK_ERROR

Now when the code is exception safe we can let RETURN_QUIT to pass through as
all the installed cleanups with handle that.

gdb/ChangeLog
2015-02-11  Jan Kratochvil  <jan.kratochvil@redhat.com>

* python/py-framefilter.c (py_print_single_arg, enumerate_locals)
(py_print_frame): Use RETURN_MASK_ERROR.

10 years agoframefilter quit: Make it exception safe
Jan Kratochvil [Wed, 11 Feb 2015 13:45:17 +0000 (14:45 +0100)] 
framefilter quit: Make it exception safe

gdb/ChangeLog
2015-02-11  Jan Kratochvil  <jan.kratochvil@redhat.com>

* python/py-framefilter.c (py_print_frame): Mention RETURN_QUIT in
function comment.  Wrap all function that can throw in cleanups.
(gdbpy_apply_frame_filter): Wrap all function that can throw in
cleanups.

10 years agoframefilter quit: Code cleanup: Avoid gotos
Jan Kratochvil [Wed, 11 Feb 2015 13:42:22 +0000 (14:42 +0100)] 
framefilter quit: Code cleanup: Avoid gotos

goto error patters are sometimes AFAIK used in C for the cases like:
int retval=-1;
if (!(a=malloc())) goto error;
if (!(b=malloc())) goto error_a;
if (!(c=malloc())) goto error_b;
retval=0;
error_c: free(c);
error_b: free(b);
error_a: free(a);
error: return retval;

But here there is single error label with one do_cleanups() which I do not find
it worth the goto complication.  Without goto one can then furher merge code in
the exit paths in the next patches and ... after all it is all the same, just
without a goto.

gdb/ChangeLog
2015-02-11  Jan Kratochvil  <jan.kratochvil@redhat.com>

* python/py-framefilter.c (py_print_frame): Substitute goto error.
Remove the error label.

10 years agoframefilter quit: Code cleanup: Reindentation
Jan Kratochvil [Wed, 11 Feb 2015 13:38:56 +0000 (14:38 +0100)] 
framefilter quit: Code cleanup: Reindentation

Nothing significant but I find code more clear with less deep indentation.

gdb/ChangeLog
2015-02-11  Jan Kratochvil  <jan.kratochvil@redhat.com>

* python/py-framefilter.c (py_print_frame): Put conditional code paths
with goto first, indent the former else codepath left.  Put variable
'elided' to a new inner block.

10 years agoframefilter quit: Obvious whitespacing fixes
Jan Kratochvil [Wed, 11 Feb 2015 13:35:52 +0000 (14:35 +0100)] 
framefilter quit: Obvious whitespacing fixes

gdb/ChangeLog
2015-02-11  Jan Kratochvil  <jan.kratochvil@redhat.com>

* python/py-framefilter.c (py_print_frame): Whitespacing fixes.

10 years agoAutomatic date update in version.in
GDB Administrator [Wed, 11 Feb 2015 00:00:31 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Tue, 10 Feb 2015 00:00:28 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Mon, 9 Feb 2015 00:00:27 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sun, 8 Feb 2015 00:00:32 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sat, 7 Feb 2015 00:00:26 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Fri, 6 Feb 2015 00:00:33 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Thu, 5 Feb 2015 00:00:29 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoSpeed up GDB's TUI output
Doug Evans [Wed, 4 Feb 2015 12:04:30 +0000 (13:04 +0100)] 
Speed up GDB's TUI output

In the TUI mode, we call wrefresh after outputting every single
character.  This results in the I/O becoming very slow.  Fix this by
delaying refreshing the console window until an explicit flush of
gdb_stdout is requested, a write to any other (unbuffered) file is
done.

2015-02-04  Doug Evans  <dje@google.com>
    Pedro Alves  <palves@redhat.com>
    Eli Zaretskii  <eliz@gnu.org>

PR tui/17810
* tui/tui-command.c (tui_refresh_cmd_win): New function.
* tui/tui-command.c (tui_refresh_cmd_win): Declare.
* tui/tui-file.c: #include tui/tui-command.h.
(tui_file_fputs): Refresh command window if stream is not gdb_stdout.
(tui_file_flush): Refresh command window if stream is gdb_stdout.
* tui/tui-io.c (tui_puts): Remove calls to wrefresh, fflush.
(tui_readline_output): Call tui_refresh_cmd_win.
(print_filename): Likewise.
(tui_rl_display_match_list): Likewise.

10 years agoAutomatic date update in version.in
GDB Administrator [Wed, 4 Feb 2015 00:00:27 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agocompile: Filter out -fpreprocessed
Jan Kratochvil [Tue, 3 Feb 2015 17:20:49 +0000 (18:20 +0100)] 
compile: Filter out -fpreprocessed

With global system gcc-5.0 if one also installs ccache (needing a different
patch
https://bugzilla.samba.org/show_bug.cgi?id=11060
for -fplugin=libcc1plugin) it breaks as GDB will read from inferior
DW_AT_producer containing -fpreprocessed (due to ccache used to compile the
inferior).
    <c>   DW_AT_producer    : (indirect string, offset: 0x52): GNU C11 5.0.0 20150114 (Red Hat 5.0.0-0.1) -fpreprocessed -mtune=generic -
march=x86-64 -g

It is wrong that gcc puts -fpreprocessed into DW_AT_producer - fixed it in
trunk GCCs:
https://gcc.gnu.org/ml/gcc-patches/2015-01/msg01495.html
But even with that fix there are already built inferiors out there which GDB
could be compatible (for the 'compile' mode) with.

gdb/ChangeLog
2015-02-03  Jan Kratochvil  <jan.kratochvil@redhat.com>

Filter out inferior gcc option -fpreprocessed.
* compile/compile.c (filter_args): New function.
(get_args): Use it.

10 years agoAutomatic date update in version.in
GDB Administrator [Tue, 3 Feb 2015 00:00:44 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years ago[Ada] Do not re-cache symbol-lookup result found from cache lookup.
Joel Brobecker [Mon, 2 Feb 2015 03:28:12 +0000 (07:28 +0400)] 
[Ada] Do not re-cache symbol-lookup result found from cache lookup.

When ada-lang.c:ada_lookup_symbol_list_worker finds a match in
the symbol cache, it caches the result again, which is unecessary.
This patch fixes the code to avoid that.

gdb/ChangeLog:

        PR gdb/17856:
        * ada-lang.c (ada_lookup_symbol_list_worker): Do not re-cache
        results found in the cache.

Tested on x86_64-linux, no regression.

10 years ago[Ada] pspace_data->sym_cache is always NULL
Joel Brobecker [Mon, 2 Feb 2015 03:20:58 +0000 (07:20 +0400)] 
[Ada] pspace_data->sym_cache is always NULL

The Ada symbol cache has been designed to have one instance of that
of that cache per program space, and for each instance to be created
on-demand. ada_get_symbol_cache is the function responsible for both
lookup and creation on demand.

Unfortunately, ada_get_symbol_cache forgot to store the reference
to newly created caches, thus causing it to:
  - Leak old caches;
  - Allocate a new cache each time the cache is being searched or
    a new entry is to be inserted.

This patch fixes the issue by avoiding the use of the local variable,
which indirectly allowed the bug to happen. We manipulate the reference
in the program-space data instead.

gdb/ChangeLog:

        PR gdb/17854:
        * ada-lang.c (ada_get_symbol_cache): Set pspace_data->sym_cache
        when allocating a new one.

10 years agoAutomatic date update in version.in
GDB Administrator [Mon, 2 Feb 2015 00:00:30 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sun, 1 Feb 2015 00:00:31 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoPR symtab/17855
Joel Brobecker [Sat, 31 Jan 2015 21:04:51 +0000 (13:04 -0800)] 
PR symtab/17855

gdb/ChangeLog:

PR symtab/17855
* symfile.c (clear_symtab_users): Move call to breakpoint_re_set
to end.

10 years agoMake sure TABs are expanded in TUI windows on MS-Windows.
Eli Zaretskii [Sat, 31 Jan 2015 08:47:14 +0000 (10:47 +0200)] 
Make sure TABs are expanded in TUI windows on MS-Windows.

gdb/
2015-01-31  Eli Zaretskii  <eliz@gnu.org>

* tui/tui-io.c (tui_expand_tabs): New function.
(tui_puts, tui_redisplay_readline): Expand TABs into the
appropriate number of spaces.
* tui/tui-regs.c: Include tui-io.h.
(tui_register_format): Call tui_expand_tabs to expand TABs into
the appropriate number of spaces.
* tui/tui-io.h: Add prototype for tui_expand_tabs.

(cherry picked from commit 312809f8838911dabff84d7ad3ccf341307d2b19)

10 years agoAutomatic date update in version.in
GDB Administrator [Sat, 31 Jan 2015 00:00:31 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Fri, 30 Jan 2015 00:01:14 +0000 (00:01 +0000)] 
Automatic date update in version.in

10 years agoPR symtab/17890
Doug Evans [Thu, 29 Jan 2015 18:31:21 +0000 (10:31 -0800)] 
PR symtab/17890

gdb/ChangeLog:

PR symtab/17890
* dwarf2read.c (dwarf_decode_line_header): Punt if version > 4.

10 years agoAutomatic date update in version.in
GDB Administrator [Thu, 29 Jan 2015 00:00:49 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Wed, 28 Jan 2015 00:00:52 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Tue, 27 Jan 2015 00:00:56 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAdd missing comments in rs6000-tdep.c, ppc64-tdep.c and ppc-linux-tdep.c.
Wei-cheng Wang [Mon, 19 Jan 2015 15:34:07 +0000 (23:34 +0800)] 
Add missing comments in rs6000-tdep.c, ppc64-tdep.c and ppc-linux-tdep.c.

gdb/ChangeLog

Backport from mainline:

* ppc-linux-tdep.c (ppc_skip_trampoline_code,
ppc_canonicalize_syscall, ppc_linux_syscall_record,
ppc_linux_record_signal, ppc_init_linux_record_tdep): Add comments.
* ppc64-tdep.c (ppc64_skip_trampoline_code): Likewise.
* rs6000-tdep.c (rs6000_epilogue_frame_cache,
rs6000_epilogue_frame_this_id, rs6000_epilogue_frame_prev_register,
rs6000_epilogue_frame_sniffer, ppc_record_vsr, ppc_process_record_op4,
ppc_process_record_op19, ppc_process_record_op31,
ppc_process_record_op59, ppc_process_record_op60,
ppc_process_record_op63): Likewise.

10 years agoFix format warning in rs6000t-dep.c
Wei-cheng Wang [Sun, 18 Jan 2015 07:20:46 +0000 (15:20 +0800)] 
Fix format warning in rs6000t-dep.c

gdb/ChangeLog

Backport from mainline:

* rs6000-tdep.c (ppc_process_record_op4, ppc_process_record_op19,
ppc_process_record_op31, ppc_process_record_op59,
ppc_process_record_op60, ppc_process_record_op63,
ppc_process_record): Fix -Wformat warning.
* rs6000-tdep.c (rs6000_epilogue_frame_cache, ppc_process_record_op60):
Remove unused variables.

10 years agoSkip-trampoline for PowerPC reverse-stepping.
Wei-cheng Wang [Sat, 17 Jan 2015 06:30:59 +0000 (14:30 +0800)] 
Skip-trampoline for PowerPC reverse-stepping.

gdb/ChangeLog

Backport from mainline:

* ppc-linux-tdep.c (ppc_skip_trampoline_code):
Scan PLT stub backward for reverse debugging.
* ppc64-tdep.c (ppc64_skip_trampoline_code): Likewise.

10 years agoReverse debugging for PowerPC.
Wei-cheng Wang [Sat, 17 Jan 2015 06:30:33 +0000 (14:30 +0800)] 
Reverse debugging for PowerPC.

gdb/ChangeLog

Backport from mainline:

* configure.tgt (powerpc*-*-linux): Add linux-record.o to
gdb_target_obs.
(ppc_linux_record_tdep, ppc64_linux_record_tdep): New for linux syscall
record.
(ppc_canonicalize_syscall, ppc_linux_syscall_record,
ppc_linux_record_signal, ppc_init_linux_record_tdep): New functions.
(ppc_linux_init_abi): Set process_record, process_record_signal.
* ppc-tdep.h (struct gdbarch_tdep): Add ppc_syscall_record and
ppc_linux_record_tdep to gdbarch_tdep.
(ppc_process_record): New declaration.
* rs6000-tdep.c (ppc_record_vsr, ppc_process_record_op4,
ppc_process_record_op19, ppc_process_record_op31,
ppc_process_record_op59, ppc_process_record_op60,
ppc_process_record_op63, ppc_process_record): New functions.

gdb/testsuite/ChangeLog

Backport from mainline:

* lib/gdb.exp (supports_process_record): Return true for
powerpc*-*-linux*.
(supports_reverse): Likewise.

10 years agoEpilogue unwinder for PowerPC.
Wei-cheng Wang [Sat, 17 Jan 2015 06:29:16 +0000 (14:29 +0800)] 
Epilogue unwinder for PowerPC.

gdb/ChangeLog

Backport from mainline:

* rs6000-tdep.c (rs6000_in_function_epilogue_p): Rename to
rs6000_in_function_epilogue_frame_p and add an argument
for frame_info.
(rs6000_epilogue_frame_cache, rs6000_epilogue_frame_this_id,
rs6000_epilogue_frame_prev_register, rs6000_epilogue_frame_sniffer):
New functions.
(rs6000_epilogue_frame_unwind): New.
(rs6000_gdbarch_init): Append epilogue unwinder.

10 years agoAutomatic date update in version.in
GDB Administrator [Mon, 26 Jan 2015 00:02:38 +0000 (00:02 +0000)] 
Automatic date update in version.in

10 years agoFix 100x slowdown regression on DWZ files
Jan Kratochvil [Sun, 25 Jan 2015 07:57:01 +0000 (08:57 +0100)] 
Fix 100x slowdown regression on DWZ files

Since Fedora started to use DWZ DWARF compressor:
http://fedoraproject.org/wiki/Features/DwarfCompressor
GDB has slowed down a lot.  To make it clear - DWZ is DWARF structure
rearrangement, "compressor" does not mean any zlib style data compression.

This patch reduces LibreOffice backtrace from 5 minutes to 3 seconds (100x)
and it also reduces memory consumption 20x.
[ benchmark is at the bottom of this mail ]

Example of DWZ output:
------------------------------------------------------------------------------
  Compilation Unit @ offset 0xc4:
 <0><cf>: Abbrev Number: 17 (DW_TAG_partial_unit)
    <d0>   DW_AT_stmt_list   : 0x0
    <d4>   DW_AT_comp_dir    : (indirect string, offset: 0x6f): /usr/src/debug/gdb-7.7.1/build-x86_64-redhat-linux-gnu/gdb
 <1><d8>: Abbrev Number: 9 (DW_TAG_typedef)
    <d9>   DW_AT_name        : (indirect string, offset: 0x827dc): size_t
    <dd>   DW_AT_decl_file   : 4
    <de>   DW_AT_decl_line   : 212
    <df>   DW_AT_type        : <0xae>

  Compilation Unit @ offset 0xe4:
 <0><ef>: Abbrev Number: 13 (DW_TAG_partial_unit)
    <f0>   DW_AT_stmt_list   : 0x0
    <f4>   DW_AT_comp_dir    : (indirect string, offset: 0x6f): /usr/src/debug/gdb-7.7.1/build-x86_64-redhat-linux-gnu/gdb
 <1><f8>: Abbrev Number: 45 (DW_TAG_typedef)
    <f9>   DW_AT_name        : (indirect string, offset: 0x251): __off_t
    <fd>   DW_AT_decl_file   : 3
    <fe>   DW_AT_decl_line   : 131
    <ff>   DW_AT_type        : <0x68>

  Compilation Unit @ offset 0x62d9f9:
 <0><62da04>: Abbrev Number: 20 (DW_TAG_compile_unit)
[...]
    <62da12>   DW_AT_low_pc  : 0x807e10
    <62da1a>   DW_AT_high_pc     : 134
    <62da1c>   DW_AT_stmt_list   : 0xf557e
 <1><62da20>: Abbrev Number: 7 (DW_TAG_imported_unit)
    <62da21>   DW_AT_import  : <0xcf> [Abbrev Number: 17]
------------------------------------------------------------------------------

One can see all DW_TAG_partial_unit have DW_AT_stmt_list 0x0 which causes
repeated decoding of that .debug_line unit on each DW_TAG_imported_unit.

This was OK before as each DW_TAG_compile_unit has its own .debug_line unit.
But since the introduction of DW_TAG_partial_unit by DWZ one should cache
read-in DW_AT_stmt_list .debug_line units.

Fortunately one does not need to cache whole
        struct linetable *symtab->linetable
and other data from .debug_line mapping PC<->lines
------------------------------------------------------------------------------
 Line Number Statements:
  Extended opcode 2: set Address to 0x45c880
  Advance Line by 25 to 26
  Copy
------------------------------------------------------------------------------
as the only part of .debug_line which GDB needs for DW_TAG_partial_unit is:
------------------------------------------------------------------------------
 The Directory Table:
  ../../gdb
  /usr/include/bits
[...]
 The File Name Table:
  Entry Dir     Time    Size    Name
  1     1 0 0 gdb.c
  2     2 0 0 string3.h
[...]
------------------------------------------------------------------------------
specifically referenced in GDB for DW_AT_decl_file at a single place:
------------------------------------------------------------------------------
              fe = &cu->line_header->file_names[file_index - 1];
              SYMBOL_SYMTAB (sym) = fe->symtab;
------------------------------------------------------------------------------

This is because for some reason DW_TAG_partial_unit never contains PC-related
DWARF information.  I do not know exactly why, the compression ratio is a bit
lower due to it but thanksfully currently it is that way:
dwz.c:
------------------------------------------------------------------------------
        /* These attributes reference code, prevent moving
           DIEs with them.  */
        case DW_AT_low_pc:
        case DW_AT_high_pc:
        case DW_AT_entry_pc:
        case DW_AT_ranges:
          die->die_ck_state = CK_BAD;
+
  /* State of checksum computation.  Not computed yet, computed and
     suitable for moving into partial units, currently being computed
     and finally determined unsuitable for moving into partial units.  */
  enum { CK_UNKNOWN, CK_KNOWN, CK_BEING_COMPUTED, CK_BAD } die_ck_state : 2;
------------------------------------------------------------------------------
I have also verified also real-world Fedora debuginfo files really comply with
that assumption with dwgrep
https://github.com/pmachata/dwgrep
using:
------------------------------------------------------------------------------
dwgrep -e 'entry ?DW_TAG_partial_unit child* ( ?DW_AT_low_pc , ?DW_AT_high_pc , ?DW_AT_ranges )' /usr/lib/debug/**
------------------------------------------------------------------------------

BTW I think GDB already does not support the whole DW_TAG_imported_unit and
DW_TAG_partial_unit usage possibilities as specified by the DWARF standard.
I think GDB would not work if DW_TAG_imported_unit was used in some inner
level and not at the CU level (readelf -wi level <1>) - this is how DWZ is
using DW_TAG_imported_unit.  Therefore I do not think further assumptions
about DW_TAG_imported_unit and DW_TAG_partial_unit usage by DWZ are a problem
for GDB.

One could save the whole .debug_line decoded PC<->lines mapping (and not just
the DW_AT_decl_file table) but:
 * there are some problematic corner cases so one could do it incorrectly
 * there are no real world data to really test such patch extension
 * such extension could be done perfectly incrementally on top of this patch

------------------------------------------------------------------------------

benchmark - on Fedora 20 x86_64 and FSF GDB HEAD:
echo -e 'thread apply all bt\nset confirm no\nq'|./gdb -p `pidof soffice.bin` -ex 'set pagination off' -ex 'maintenance set per-command
space' -ex 'maintenance set per-command symtab' -ex 'maintenance set per-command time'

FSF GDB HEAD ("thread apply all bt"):
Command execution time: 333.693000 (cpu), 335.587539 (wall)
                                          ---sec
Space used: 1736404992 (+1477189632 for this command)
                         ----MB
vs.
THIS PATCH ("thread apply all bt"):
Command execution time: 2.595000 (cpu), 2.607573 (wall)
                                        -sec
Space used: 340058112 (+85917696 for this command)
                        --MB

FSF GDB HEAD ("thread apply all bt full"):
Command execution time: 466.751000 (cpu), 468.345837 (wall)
                                          ---sec
Space used: 2330132480 (+2070974464 for this command)
                         ----MB
vs.
THIS PATCH ("thread apply all bt full"):
Command execution time: 18.907000 (cpu), 18.964125 (wall)
                                         --sec
Space used: 364462080 (+110325760 for this command)
                        ---MB

------------------------------------------------------------------------------

gdb/ChangeLog
2015-01-25  Jan Kratochvil  <jan.kratochvil@redhat.com>

Fix 100x slowdown regression on DWZ files.
* dwarf2read.c (struct dwarf2_per_objfile): Add line_header_hash.
(struct line_header): Add offset and offset_in_dwz.
(dwarf_decode_lines): Add parameter decode_mapping to the declaration.
(free_line_header_voidp): New declaration.
(line_header_hash, line_header_hash_voidp, line_header_eq_voidp): New
functions.
(dwarf2_build_include_psymtabs): Update dwarf_decode_lines caller.
(handle_DW_AT_stmt_list): Use line_header_hash.
(free_line_header_voidp): New function.
(dwarf_decode_line_header): Initialize offset and offset_in_dwz.
(dwarf_decode_lines): New parameter decode_mapping, use it.
(dwarf2_free_objfile): Free line_header_hash.

10 years agoAutomatic date update in version.in
GDB Administrator [Sun, 25 Jan 2015 00:01:19 +0000 (00:01 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sat, 24 Jan 2015 00:00:51 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoLinux: make target_is_async_p return false when async is off
Pedro Alves [Fri, 23 Jan 2015 11:21:56 +0000 (11:21 +0000)] 
Linux: make target_is_async_p return false when async is off

linux_nat_is_async_p currently always returns true, even when the
target is _not_ async.  That confuses
gdb_readline_wrapper/gdb_readline_wrapper_cleanup, which
force-disables target-async while the secondary prompt is active.  As
a result, when gdb_readline_wrapper returns, the target is left async,
even through it was sync to begin with.

That can result in weird bugs, like the one the test added by this
commit exposes.

Ref: https://sourceware.org/ml/gdb-patches/2015-01/msg00592.html

gdb/ChangeLog:
2015-01-23  Pedro Alves  <palves@redhat.com>

* linux-nat.c (linux_is_async_p): New macro.
(linux_nat_is_async_p):
(linux_nat_terminal_inferior): Check whether the target can async
instead of whether it is already async.
(linux_nat_terminal_ours): Don't check whether the target is
async.
(linux_async_pipe): Use linux_is_async_p.

gdb/testsuite/ChangeLog:
2015-01-23  Pedro Alves  <palves@redhat.com>

* gdb.threads/continue-pending-after-query.c: New file.
* gdb.threads/continue-pending-after-query.exp: New file.

10 years agocompile: Fix function pointers
Jan Kratochvil [Fri, 23 Jan 2015 09:52:55 +0000 (10:52 +0100)] 
compile: Fix function pointers

TBH while I always comment reasons for each of the compilation options in
reality I tried them all and chose that combination that needs the most simple
compile/compile-object-load.c (ld.so emulation) implementation.

gdb/ChangeLog
2015-01-23  Jan Kratochvil  <jan.kratochvil@redhat.com>

* compile/compile.c (_initialize_compile): Use -fPIE for compile_args.

gdb/testsuite/ChangeLog
2015-01-23  Jan Kratochvil  <jan.kratochvil@redhat.com>

* gdb.compile/compile.exp (pointer to jit function): New test.

10 years agoFix filename in one of the recent gdb/ChangeLog entries (remove "gdb/").
Joel Brobecker [Fri, 23 Jan 2015 07:13:49 +0000 (08:13 +0100)] 
Fix filename in one of the recent gdb/ChangeLog entries (remove "gdb/").

10 years agoAutomatic date update in version.in
GDB Administrator [Fri, 23 Jan 2015 00:00:52 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agomingw32: fix windows-termcap/curses check
Pedro Alves [Thu, 22 Jan 2015 18:41:33 +0000 (18:41 +0000)] 
mingw32: fix windows-termcap/curses check

When GDB is configured with "--without-tui --with-curses" or "--with-tui",
$prefer_curses is set to yes.  But, that still doesn't mean that curses
will be used.  configure will still search for the curses library, and
continue building without it.  That's done here:

 curses_found=no
 if test x"$prefer_curses" = xyes; then
 ...
   AC_SEARCH_LIBS(waddstr, [ncurses cursesX curses])

   if test "$ac_cv_search_waddstr" != no; then
     curses_found=yes
   fi
 fi

So if waddstr is not found, meaning curses is not really
available, even though it'd be preferred, $prefer_curses is
'yes', but $curses_found is 'no'.

So the right fix to tell whether we're linking with curses is
$curses_found=yes.

gdb/ChangeLog:
2015-01-22  Pedro Alves  <palves@redhat.com>

* configure.ac [*mingw32*]: Check $curses_found instead of
$prefer_curses.
* configure: Regenerate.
* windows-termcap.c: Remove HAVE_CURSES_H, HAVE_NCURSES_H and
HAVE_NCURSES_NCURSES_H checks.

10 years agoFix MinGW TUI build
Eli Zaretskii [Thu, 22 Jan 2015 18:23:12 +0000 (20:23 +0200)] 
Fix MinGW TUI build

gdb/
2015-01-22  Eli Zaretskii  <eliz@gnu.org>

* gdb/tui/tui.c (tui_enable) [__MINGW32__]: If the call to 'newterm'
fails with the 1st arg NULL, try again with "unknown".  Don't test
the "cup" capability: it isn't supported by the Windows port of
ncurses, but the Windows console driver is still capable of
supporting TUI.

(cherry picked from commit 6b8a872ff1038e2b8618ea33bb1113b78f39976d)

10 years agoPartial fix for "make TAGS".
Eli Zaretskii [Thu, 22 Jan 2015 18:05:59 +0000 (20:05 +0200)] 
Partial fix for "make TAGS".

gdb/
2015-01-22  Eli Zaretskii  <eliz@gnu.org>

* Makefile.in (HFILES_NO_SRCDIR): Remove ada-varobj.h.
(ALLDEPFILES): Remove irix5-nat.c.  These two are part of the
reason that "make TAGS" is broken.

(cherry picked from commit 82a864f96aff83edb0c8bb21ead5c28cd10363fe)

10 years agoAutomatic date update in version.in
GDB Administrator [Thu, 22 Jan 2015 00:00:46 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Wed, 21 Jan 2015 00:00:44 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Tue, 20 Jan 2015 00:00:37 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoDon't use windows-termcap.c when linking against a curses library
Eli Zaretskii [Mon, 19 Jan 2015 15:34:29 +0000 (16:34 +0100)] 
Don't use windows-termcap.c when linking against a curses library

gdb/
2015-01-17  Eli Zaretskii  <eliz@gnu.org>

        * configure.ac [*mingw32*]: Only add windows-termcap.o to
        CONFIG_OBS if not building with a curses library.
        * configure: Regenerate.

        * windows-termcap.c: Include defs.h.  Make the whole body empty if
        either one of HAVE_CURSES_H or HAVE_NCURSES_H or
        HAVE_NCURSES_NCURSES_H is defined.

(cherry picked from commit 63413d85873c450fa4ed2494f21fb1a65bdaf554)

10 years agostrerror.c: Do not declare sys_nerr or sys_errlist if already macros
Joel Brobecker [Mon, 19 Jan 2015 15:29:07 +0000 (16:29 +0100)] 
strerror.c: Do not declare sys_nerr or sys_errlist if already macros

This fixes a MinGW warning in libiberty/strerror.c.

2015-01-19  Eli Zaretskii  <eliz@gnu.org>

        * strerror.c <sys_nerr, sys_errlist>: Declare only if they aren't
        macros.

(cherry picked from commit 1f99f6d0689d20db44c0c7d88e8af1ebe900d187)

10 years agoAutomatic date update in version.in
GDB Administrator [Mon, 19 Jan 2015 00:00:33 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sun, 18 Jan 2015 00:01:30 +0000 (00:01 +0000)] 
Automatic date update in version.in

10 years agoAutomatic date update in version.in
GDB Administrator [Sat, 17 Jan 2015 00:00:45 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoReally add a prototype for tui_rehighlight_all.
Eli Zaretskii [Fri, 16 Jan 2015 17:55:40 +0000 (19:55 +0200)] 
Really add a prototype for tui_rehighlight_all.

(cherry picked from commit 2ef60e94e7d10fb9dd5afaf246b960cb4fdf404e)

10 years agoMake setting TUI border attributes take effect immediately
Eli Zaretskii [Fri, 16 Jan 2015 16:24:16 +0000 (18:24 +0200)] 
Make setting TUI border attributes take effect immediately

gdb/
2015-01-16  Eli Zaretskii  <eliz@gnu.org>

     * tui/tui-win.c (tui_rehighlight_all, tui_set_var_cmd): New
     functions.
     (_initialize_tui_win) <border-kind, border-mode>:
     <active-border-mode>: Use tui_set_var_cmd as the "set" function.
     * tui/tui-win.h: Add prototype for tui_rehighlight_all.

(cherry picked from commit 6cdb25f4df143e8d98bd71bf943bbe61c702e239)

10 years agoMake the change of tab size in TUI mode effective immediately
Eli Zaretskii [Fri, 16 Jan 2015 15:54:46 +0000 (17:54 +0200)] 
Make the change of tab size in TUI mode effective immediately

gdb/ChangeLog:
2015-01-16  Eli Zaretskii  <eliz@gnu.org>

    * tui/tui-win.c (tui_set_tab_width_command): Delete and
    recreate the source and the disassembly windows, to show the
    effect of the changed tab size immediately.

(cherry picked from commit cb86fcc13bea494007a103424c8a61f1cb372717)

10 years agoFix TUI-related documentation.
Eli Zaretskii [Fri, 16 Jan 2015 11:31:36 +0000 (13:31 +0200)] 
Fix TUI-related documentation.

tui/tui-win.c (tui_scroll_left_command, tui_scroll_right_command):
Doc fix.
doc/gdb.texinfo (TUI Commands): Document the possible
values of NAME argument to 'winheight' command.  Explain the
effect of 'tabset' setting better.

(cherry picked from commit bf555842fccfc0e2cdc4a2f329df6358f991732c)

10 years agoLeave more space in TUI mode for thread ID.
Eli Zaretskii [Fri, 16 Jan 2015 11:24:20 +0000 (13:24 +0200)] 
Leave more space in TUI mode for thread ID.

gdb/tui/tui-data.h (LINE_PREFIX): Make shorter
(MAX_PID_WIDTH): Enlarge from 14 to 19, to leave enough space for
"Thread NNNNN.XXXX" thread ID notation on Windows.

(cherry picked from commit 9f2850baa3ce341f0ba42bd9519cb3c1bf1287c7)

10 years agoAutomatic date update in version.in
GDB Administrator [Fri, 16 Jan 2015 00:00:34 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoBuild failure in sim/rx/gdb-if.c on windows
Joel Brobecker [Thu, 15 Jan 2015 03:14:45 +0000 (07:14 +0400)] 
Build failure in sim/rx/gdb-if.c on windows

This should fix a build failure reported on x86_64-mingw32 by Daniel
Calcoen due to conflicting declarations of "open".  This patch just
renames the static global in sim/rx/gdb-if.c into "rx_sim_is_open".

sim/rx/ChangeLog:

* gdb-if.c (open): Rename to...
(rx_sim_is_open): This. Replace all uses of "open" by uses of
"rx_sim_is_open" throughout.

Tested by rebuilding on x86_64-linux.

10 years agoAutomatic date update in version.in
GDB Administrator [Thu, 15 Jan 2015 00:00:48 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoMerge include/libiberty.h from GCC
Jan-Benedict Glaw [Wed, 14 Jan 2015 21:10:15 +0000 (22:10 +0100)] 
Merge include/libiberty.h from GCC

This pulls in some missing prototypes and also adds corresponding entries
to the ChangeLog file. Please note that for one function, strverscmp(),
the ChangeLog entry was already there, but the actual prototype wasn't.

  These ChangeLog entries are added:

2014-10-28  Yury Gribov  <y.gribov@samsung.com>

       * libiberty.h (strtol, strtoul, strtoll, strtoull): New prototypes.

2014-10-15  David Malcolm  <dmalcolm@redhat.com>

       * libiberty.h (choose_tmpdir): New prototype.

10 years agoPR17525 - breakpoint commands not executed when program run from -x script
Pedro Alves [Wed, 14 Jan 2015 12:38:47 +0000 (12:38 +0000)] 
PR17525 - breakpoint commands not executed when program run from -x script

Executing a gdb script that runs the inferior (from the command line
with -x), and has it hit breakpoints with breakpoint commands that
themselves run the target, is currently broken on async targets
(Linux, remote).

While we're executing a command list or a script, we force the
interpreter to be sync, which results in some functions nesting an
event loop and waiting for the target to stop, instead of returning
immediately and having the top level event loop handle the stop.

The issue with this bug is simply that bpstat_do_actions misses
checking whether the interpreter is sync.  When we get here, in the
case of executing a script (or, when the interpreter is sync), the
program has already advanced to the next breakpoint, through
maybe_wait_sync_command_done.  We need to process its breakpoints
immediately, just like with a sync target.

Tested on x86_64 Fedora 20.

gdb/
2015-01-14  Pedro Alves  <palves@redhat.com>

PR gdb/17525
* breakpoint.c: Include "interps.h".
(bpstat_do_actions_1): Also check whether the interpreter is
async.

gdb/testsuite/
2015-01-14  Pedro Alves  <palves@redhat.com>
    Joel Brobecker  <brobecker@adacore.com>

PR gdb/17525
* gdb.base/bp-cmds-execution-x-script.c: New file.
* gdb.base/bp-cmds-execution-x-script.exp: New file.
* gdb.base/bp-cmds-execution-x-script.gdb: New file.

10 years agoPR cli/17828: -batch -ex r breaks terminal
Pedro Alves [Wed, 14 Jan 2015 12:38:47 +0000 (12:38 +0000)] 
PR cli/17828: -batch -ex r breaks terminal

Commit d3d4baed (PR python/17372 - Python hangs when displaying
help()) had the side effect of causing 'gdb -batch' to leave the
terminal in the wrong state if the program was run.  E.g,.

 $ echo 'main(){*(int*)0=0;}' | gcc -x c -; ./gdb/gdb -batch -ex r ./a.out
 Program received signal SIGSEGV, Segmentation fault.
 0x00000000004004ff in main ()
 $

If you start typing the next command, seemingly nothing happens - GDB
left the terminal with echo disabled.

The issue is that that "r" ends up in fetch_inferior_event, which
calls reinstall_readline_callback_handler_cleanup, which causes
readline to prep the terminal (raw, echo disabled).  But "-batch"
causes GDB to exit before the top level event loop is first started,
and then nothing de-preps the terminal.

The reinstall_readline_callback_handler_cleanup function's intro
comment mentions:

 "Need to do this as we go back to the event loop, ready to process
 further input."

but the implementation forgets the case of when the interpreter is
sync, which indicates we won't return to the event loop yet, or as in
the case of -batch, we have not started it yet.

The fix is to not install the readline callback in that case.

For the test, in this case, checking that command echo still works is
sufficient.  Comparing stty output before/after running GDB is even
better.  Because stty may not be available, the test tries both ways.
In any case, since expect's spawn (what we use to start gdb) creates a
new pseudo tty, another expect spawn or tcl exec after GDB exits would
not see the wrong terminal settings.  So instead, the test spawns a
shell and runs stty and GDB in it.

Tested on x86_64 Fedora 20.

gdb/
2015-01-14  Pedro Alves  <palves@redhat.com>

PR cli/17828
* infrun.c (reinstall_readline_callback_handler_cleanup): Don't
reinstall if the interpreter is sync.

gdb/testsuite/
2015-01-14  Pedro Alves  <palves@redhat.com>

PR cli/17828
* gdb.base/batch-preserve-term-settings.c: New file.
* gdb.base/batch-preserve-term-settings.exp: New file.

10 years agoAutomatic date update in version.in
GDB Administrator [Wed, 14 Jan 2015 00:00:30 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoBump GDB version number to 7.8.90.DATE-cvs.
Joel Brobecker [Tue, 13 Jan 2015 15:40:53 +0000 (19:40 +0400)] 
Bump GDB version number to 7.8.90.DATE-cvs.

gdb/ChangeLog:

* version.in: Set GDB version number to 7.8.90.DATE-cvs.

10 years agoDocument the GDB 7.8.90 release in gdb/ChangeLog
Joel Brobecker [Tue, 13 Jan 2015 15:40:41 +0000 (19:40 +0400)] 
Document the GDB 7.8.90 release in gdb/ChangeLog

gdb/ChangeLog:

GDB 7.8.90 released.

10 years agogdb/testsuite: Make clean mostlyclean should not delete *.py.
Joel Brobecker [Tue, 13 Jan 2015 14:59:32 +0000 (18:59 +0400)] 
gdb/testsuite: Make clean mostlyclean should not delete *.py.

A sanity-check in my release scripts caught something: After having
created the tarballs, I verify that no checked-in file disappeared
in the process, and lo and behod, it found that the following file
got wiped:

    - gdb/testsuite/dg-extract-results.py:

And it's not part of the tarball either.

I don't understand while we delete all *.py files in gdb/testsuite,
since I don't see a rule that expected to create one. A run of the
testsuite also doesn't seem to be creating .py files there.
I traced this to the following commit, which unfortunately provided
no explanation. Perhaps we used to run some tests in the gdb/testsuite
directory and caused files to be left behind there. Perhaps we still
do today?

In the meantime, Executive Decision: In order to allow me to create
tarballs without losing files, I removed it. It's easy to put something
back if we find out why it might still be needed.

gdb/testsuite/ChangeLog:

        * Makefile.in (clean mostlyclean): Do not delete *.py.

Tested on x86_64-linux by running the src-release.sh script again,
and this time, dg-extract-results.py no longer gets wiped.

10 years agoSet GDB version number to 7.8.90.
Joel Brobecker [Tue, 13 Jan 2015 14:14:09 +0000 (18:14 +0400)] 
Set GDB version number to 7.8.90.

gdb/ChangeLog:

* version.in: Set GDB version number to 7.8.90.

10 years agoSet development mode to "off" by default.
Joel Brobecker [Tue, 13 Jan 2015 12:16:23 +0000 (16:16 +0400)] 
Set development mode to "off" by default.

bfd/ChangeLog:

* development.sh (development): Set to false.

10 years agoBump version to 7.8.90.DATE-cvs.
Joel Brobecker [Tue, 13 Jan 2015 12:15:27 +0000 (16:15 +0400)] 
Bump version to 7.8.90.DATE-cvs.

Now that the GDB 7.9 branch has been created, we can
bump the version number.

gdb/ChangeLog:

GDB 7.9 branch created (92fc2e6978d9a7c8324c7e851dbee59e22ec7a37):
* version.in: Bump version to 7.8.90.DATE-cvs.

10 years ago[ARI] Remove trailing new-line in argument of call to warning. gdb-7.9-branchpoint
Joel Brobecker [Tue, 13 Jan 2015 10:36:34 +0000 (14:36 +0400)] 
[ARI] Remove trailing new-line in argument of call to warning.

gdb/ChangeLog:

        * nat/linux-procfs.c (linux_proc_attach_tgid_threads):
        Remove trailing new-line in argument of call to warning.

10 years ago[ARI] Remove trailing new-line in argument of call to warning.
Joel Brobecker [Tue, 13 Jan 2015 10:35:49 +0000 (14:35 +0400)] 
[ARI] Remove trailing new-line in argument of call to warning.

gdb/ChangeLog:

* linux-nat.c (attach_proc_task_lwp_callback): Remove trailing
new-line in argument of call to "warning".

10 years ago[python/Ada] gdb.lookup_type fails to looking primitive type
Joel Brobecker [Mon, 12 Jan 2015 11:46:34 +0000 (15:46 +0400)] 
[python/Ada] gdb.lookup_type fails to looking primitive type

The following change...

    commit 1994afbf19892c9e614a034fbf1a5233e9addce3
    Date:   Tue Dec 23 07:55:39 2014 -0800
    Subject: Look up primitive types as symbols.

... caused the following regression:

    % gdb
    (gdb) set lang ada
    (gdb) python print gdb.lookup_type('character')
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    gdb.error: No type named character.
    Error while executing Python code.

This is because the language_lookup_primitive_type_as_symbol call
was moved to the la_lookup_symbol_nonlocal hook. A couple of
implementations have been upated accordingly, but the Ada version
has not. This patch fixes this omission.

gdb/ChangeLog:

        * ada-lang.c (ada_lookup_symbol_nonlocal): If name not found
        in static block, then try searching for primitive types.

gdb/testsuite/ChangeLog:

        * gdb.python/py-lookup-type.exp: New file.

10 years agoAutomatic date update in version.in
GDB Administrator [Tue, 13 Jan 2015 00:00:13 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoAppend to input history file instead of overwriting it
Patrick Palka [Mon, 12 Jan 2015 22:51:33 +0000 (17:51 -0500)] 
Append to input history file instead of overwriting it

This patch makes readline append new history lines to the GDB history
file on exit instead of overwriting the entire history file on exit.
This change allows us to run multiple simultaneous GDB sessions without
having each session overwrite the added history of each other session on
exit.

Care must be taken to ensure that the history file doesn't get corrupted
when multiple GDB processes are trying to simultaneously append to and
then truncate it.  Safety is achieved in such a situation by using an
intermediate local history file to mutually exclude multiple processes
from simultaneously performing write operations on the global history
file.

gdb/ChangeLog:

* top.h (gdb_add_history): Declare.
* top.c (command_count): New variable.
(gdb_add_history): New function.
(gdb_safe_append_history): New static function.
(quit_force): Call it.
(command_line_input): Use gdb_add_history instead of
add_history.
* event-top.c (command_line_handler): Likewise.

10 years agoProperly check abbrev size
H.J. Lu [Mon, 12 Jan 2015 21:34:24 +0000 (13:34 -0800)] 
Properly check abbrev size

abbrev_base is independent of abbrev_size.  We should use abbrev_base +
abbrev_size to check abbrev section size.

* dwarf.c (process_debug_info): Properly check abbrev size.

10 years agoAnother fix for memory access errors trigegred by running readelf on a corrupt binary.
Nick Clifton [Mon, 12 Jan 2015 17:28:55 +0000 (17:28 +0000)] 
Another fix for memory access errors trigegred by running readelf on a corrupt binary.

PR binutils/17531
* dwarf.c (display_debug_addr): Use xcalloc to allocate the debug_addr_info
array.  Check for an address_base that is too large.

10 years ago[darwin/gdb] Use <setjmp.h> instead of <machine/setjmp.h>
James Clarke [Mon, 12 Jan 2015 17:13:54 +0000 (21:13 +0400)] 
[darwin/gdb] Use <setjmp.h> instead of <machine/setjmp.h>

The `machine/setjmp.h' header is no longer present on OS X 10.10, and is
non-standard. Instead, `darwin-nat.c' should be using the standard
`setjmp.h' header.

gdb/ChangeLog:

2015-01-12  James Clarke  <jrtc27@jrtc27.com>  (tiny patch)

PR gdb/17046
* darwin-nat.c: Replace <machine/setjmp.h> #include by
<setjmp.h> #include.

10 years agogdb.python/py-prompt.exp: restore GDBFLAGS
Pedro Alves [Mon, 12 Jan 2015 17:10:06 +0000 (17:10 +0000)] 
gdb.python/py-prompt.exp: restore GDBFLAGS

The previous change to py-prompt.exp made it return without restoring
GDBFLAGS, resulting in breaking the following tests:

  $ make check RUNTESTFLAGS="--target_board=native-gdbserver --directory=gdb.python"
  ...
  Running src/gdb/testsuite/gdb.python/py-prompt.exp ...
  Running src/gdb/testsuite/gdb.python/py-section-script.exp ...
  ERROR: (timeout) GDB never initialized after 10 seconds.
  ERROR: no fileid for gdbuild
  ERROR: Couldn't send python print ('test') to GDB.
  ERROR: no fileid for gdbuild
  ERROR: Couldn't send python print (sys.version_info[0]) to GDB.
  ERROR: no fileid for gdbuild
  ERROR: Couldn't send python print (sys.version_info[1]) to GDB.
  ERROR: no fileid for gdbuild
  ERROR: no fileid for gdbuild
  ...

gdb/testsuite/
2015-01-12  Pedro Alves  <palves@redhat.com>

* gdb.python/py-prompt.exp: When the board can't spawn for attach,
restore GDBFLAGS before returning.

10 years agoMore fixes for memory access errors when running readelf on fuzzed binaries.
Nick Clifton [Mon, 12 Jan 2015 16:08:41 +0000 (16:08 +0000)] 
More fixes for memory access errors when running readelf on fuzzed binaries.

PR binutils/17531
* dwarf.c (process_debug_info): Check for abbrev_base being larger
than the section size.
(process_cu_tu_index): Use xcalloc2 to allocate the CU and TU
arrays.
(xcalloc2): New function.  Like xcalloc, but checks for overflow.
* dwarf.h (xcalloc2): Prototype.

10 years agogas: allow labeling of CFI instructions
Jan Beulich [Mon, 12 Jan 2015 14:24:20 +0000 (15:24 +0100)] 
gas: allow labeling of CFI instructions

When runtime patching code (like e.g. done by the Linux kernel) there
may be cases where the set of stack frame alterations differs between
unpatched and patched code. Consequently the corresponding unwind data
needs patching too. Locating the right places within an FDE, however,
is rather cumbersome without a way to insert labels in the resulting
section. Hence this patch introduces a new directive, .cfi_label. Note
that with the way CFI data gets emitted currently (at the end of the
assembly process) this can't support local FB- and dollar-labels.

gas/
2015-01-12  Jan Beulich  <jbeulich@suse.com>

* gas/dw2gencfi.c (cfi_add_label, dot_cfi_label): New.
(cfi_pseudo_table): Add "cfi_label".
(output_cfi_insn): Handle CFI_label.
(select_cie_for_fde): Als terminate CIE when encountering
CFI_label.
* dw2gencfi.h (cfi_add_label): Declare.
(struct cfi_insn_data): New member "sym_name".
(CFI_label): New.
* read.c (read_symbol_name): Drop "static".
* read.h (read_symbol_name): Declare.

gas/testsuite/
2015-01-12  Jan Beulich  <jbeulich@suse.com>

gas/cfi/cfi-label.d, gas/cfi/cfi-label.s: New.
gas/cfi/cfi.exp: Run new tests.

10 years agoFix GDB crash caused by discarding grouped debug sections
Terry Guo [Mon, 12 Jan 2015 11:00:00 +0000 (21:30 +1030)] 
Fix GDB crash caused by discarding grouped debug sections

Keep a group containing just debug sections or the other special
sections we currently mark against garbage collection.

* elflink.c (_bfd_elf_gc_mark_debug_special_section_group): New
function.
(_bfd_elf_gc_mark_extra_sections): Use it.

10 years agoFix build without makeinfo from release binutils tar
Alan Modra [Mon, 12 Jan 2015 09:54:12 +0000 (20:24 +1030)] 
Fix build without makeinfo from release binutils tar

PR 17817
* Makefile.am (aoutx.stamp): cp -p $srcdir/aoutx.texi to keep
timestamps so that makeinfo need not be installed.
(archive.stamp, archures.stamp, bfdt.stamp, cache.stamp,
coffcode.stamp, core.stamp, elf.stamp, elfcode.stamp, mmo.stamp,
format.stamp, libbfd.stamp, bfdio.stamp, bfdwin.stamp,
opncls.stamp, reloc.stamp, section.stamp, syms.stamp, targets.stamp,
init.stamp, hash.stamp, linker.stamp): Similarly.
(bfdver.texi): Use test rather than [ ] in commands.
* Makefile.in: Regenerate.

10 years ago[testsuite patch] Fix new FAIL: py-frame.exp: test Frame.read_register(rip)
Jan Kratochvil [Mon, 12 Jan 2015 10:02:46 +0000 (11:02 +0100)] 
[testsuite patch] Fix new FAIL: py-frame.exp: test Frame.read_register(rip)

for x86_64 -m32 run one gets:

+FAIL: gdb.python/py-frame.exp: test Frame.read_register(rip)

I do not have x32 OS here but the %rip test should PASS there I think.

On Sun, 11 Jan 2015 14:58:06 +0100, Yao Qi wrote:
With your patch applied, this test is skipped on 'x86_64 -m32'.  I
prefer to increasing the test coverage, so how about extending the test
for 'x86_64 -m32'?  I mean test Frame.read_register(eip)...

gdb/testsuite/ChangeLog
2015-01-12  Jan Kratochvil  <jan.kratochvil@redhat.com>

* gdb.python/py-frame.exp (test Frame.read_register(rip)): Use
is_amd64_regs_target and is_x86_like_target.

10 years agoarm: properly range check immediate operands of VSHL and VQSHL
Jan Beulich [Mon, 12 Jan 2015 08:05:19 +0000 (09:05 +0100)] 
arm: properly range check immediate operands of VSHL and VQSHL

These two, other than VQSHLU, didn't have their immediates properly range
checked so far.

(Re-sending unchanged from the original v2 due to never having got an
answer to https://sourceware.org/ml/binutils/2013-04/msg00121.html.)

gas/
2015-01-12  Jan Beulich  <jbeulich@suse.com>

* gas/config/tc-arm.c (do_neon_shl_imm): Check immediate range.
(do_neon_qshl_imm): Likewise.

gas/testsuite/
2015-01-12  Jan Beulich  <jbeulich@suse.com>

* gas/arm/neon-addressing-bad.s: Add test for invalid VSHL,
VQSHL, and VQSHLU immediates.
* gas/arm/neon-addressing-bad.l: Update accordingly.

10 years agoAssorted compiler warning fixes
Alan Modra [Sat, 10 Jan 2015 22:00:33 +0000 (08:30 +1030)] 
Assorted compiler warning fixes

The C standard doesn't guarantee a function pointer can be cast to
void* and vice versa.

binutils/
* prdbg.c (print_debugging_info): Don't use void* for function
pointer param.
* budbg.h (print_debugging_info): Update prototype.
gas/
* read.c (s_altmacro, s_reloc): Make definition static.

10 years agodwarf2read.c (compute_delayed_physnames): Use TYPE_FN_FIELD_PHYSNAME.
Doug Evans [Mon, 12 Jan 2015 00:39:46 +0000 (16:39 -0800)] 
dwarf2read.c (compute_delayed_physnames): Use TYPE_FN_FIELD_PHYSNAME.

gdb/ChangeLog:

* dwarf2read.c (compute_delayed_physnames): Use TYPE_FN_FIELD_PHYSNAME.

10 years agoAutomatic date update in version.in
GDB Administrator [Mon, 12 Jan 2015 00:00:12 +0000 (00:00 +0000)] 
Automatic date update in version.in

10 years agoRequire numeric attributes to specify the form.
Doug Evans [Sun, 11 Jan 2015 23:45:43 +0000 (15:45 -0800)] 
Require numeric attributes to specify the form.

gdb/testsuite/ChangeLog:

* lib/dwarf.exp (Dwarf): Flag an error if a numeric attribute value
is given without an explicit form.
* gdb.dwarf2/arr-subrange.exp: Specify forms for all numeric
attributes.
* gdb.dwarf/corrupt.exp: Ditto.
* gdb.dwarf2/enum-type.exp: Ditto.
* gdb.trace/entry-values.exp: Ditto.
* gdb.trace/unavailable-dwarf-piece.exp: Ditto.

10 years agoTemporarily revert symbol lookup cache.
Doug Evans [Sun, 11 Jan 2015 23:16:26 +0000 (15:16 -0800)] 
Temporarily revert symbol lookup cache.

clear_symtab_users calls breakpoint_re_set before
observer_notify_new_objfile(NULL), and thus symbol lookup
done during breakpoint_re_set will see a stale cache.

Presumably we just need to move the call to observer_notify_new_objfile(NULL)
to before breakpoint_re_set, but need to check for other such issues,
and 7.9 is scheduled to branch tomorrow.

Reverts commits:
b2fb95e006c29e2cbe4b30523879fe3640f906ad
400678a494713abf8f7ea2367f213109a2c4b886
d98b9ccbccf36563dad92f6093a93655b38bc51b
77087adf50cedf78cc216ac6eb3b2863839d713c

gdb/ChangeLog:

* symtab.c (eq_symbol_entry): Use SYMBOL_SEARCH_NAME and
symbol_matches_domain for symbol comparisons.

* symtab.c (symbol_cache_mark_found): Improve function comment.
Rename parameter objfile to objfile_context.
(symbol_cache_mark_not_found): Improve function comment.

Add symbol lookup cache.
* NEWS: Document new options and commands.
* symtab.c (symbol_cache_key): New static global.
(DEFAULT_SYMBOL_CACHE_SIZE, MAX_SYMBOL_CACHE_SIZE): New macros.
(SYMBOL_LOOKUP_FAILED): New macro.
(symbol_cache_slot_state): New enum.
(block_symbol_cache): New struct.
(symbol_cache): New struct.
(new_symbol_cache_size, symbol_cache_size): New static globals.
(hash_symbol_entry, eq_symbol_entry): New functions.
(symbol_cache_byte_size, resize_symbol_cache): New functions.
(make_symbol_cache, free_symbol_cache): New functions.
(get_symbol_cache, symbol_cache_cleanup): New function.
(set_symbol_cache_size, set_symbol_cache_size_handler): New functions.
(symbol_cache_lookup, symbol_cache_clear_slot): New function.
(symbol_cache_mark_found, symbol_cache_mark_not_found): New functions.
(symbol_cache_flush, symbol_cache_dump): New functions.
(maintenance_print_symbol_cache): New function.
(maintenance_flush_symbol_cache): New function.
(symbol_cache_stats): New function.
(maintenance_print_symbol_cache_statistics): New function.
(symtab_new_objfile_observer): New function.
(symtab_free_objfile_observer): New function.
(lookup_static_symbol, lookup_global_symbol): Use symbol cache.
(_initialize_symtab): Init symbol_cache_key.  New parameter
maint symbol-cache-size.  New maint commands print symbol-cache,
print symbol-cache-statistics, flush-symbol-cache.
Install new_objfile, free_objfile observers.

gdb/doc/ChangeLog:

* gdb.texinfo (Symbols): Document new commands
"maint print symbol-cache", "maint print symbol-cache-statistics",
"maint flush-symbol-cache".  Document new option
"maint set symbol-cache-size".

10 years agoPR gdb/15830
Doug Evans [Sun, 11 Jan 2015 22:06:34 +0000 (14:06 -0800)] 
PR gdb/15830

gdb/ChangeLog:

PR gdb/15830
* NEWS: The "maint demangle" command is renamed as "demangle".
* demangle.c: #include cli/cli-utils.h, language.h.
(demangle_command): New function.
(_initialize_demangle): Add new command "demangle".
* maint.c (maintenance_demangle): Stub out.
(_initialize_maint_cmds): Update help text for "maint demangle",
and mark as deprecated.

gdb/doc/ChangeLog:

* gdb.texinfo (Debugging C Plus Plus): Mention "demangle".
(Symbols): Ditto.
(Maintenance Commands): Delete docs for "maint demangle".

gdb/testsuite/ChangeLog:

* gdb.base/maint.exp: Remove references to "maint demangle".
* gdb.cp/demangle.exp: Update.  "maint demangle" -> "demangle".
Add tests for explicitly specifying language to demangle.
* gdb.dlang/demangle.exp: Ditto.

10 years agoFix build on OpenBSD.
Mark Kettenis [Sun, 11 Jan 2015 21:16:11 +0000 (22:16 +0100)] 
Fix build on OpenBSD.

gdb/ChangeLog:

* inf-ptrace.c (inf_ptrace_follow_fork): Adjust now that
inferior_thread is a function.

10 years agosymtab.c (eq_symbol_entry): Use SYMBOL_SEARCH_NAME and symbol_matches_domain.
Doug Evans [Sun, 11 Jan 2015 20:02:23 +0000 (12:02 -0800)] 
symtab.c (eq_symbol_entry): Use SYMBOL_SEARCH_NAME and symbol_matches_domain.

gdb/ChangeLog:

* symtab.c (eq_symbol_entry): Use SYMBOL_SEARCH_NAME and
symbol_matches_domain for symbol comparisons.

10 years agotweak previous entry
Doug Evans [Sun, 11 Jan 2015 19:40:41 +0000 (11:40 -0800)] 
tweak previous entry

10 years agoImprove comments for symbol_cache_mark_{not_,}found.
Doug Evans [Sun, 11 Jan 2015 19:36:36 +0000 (11:36 -0800)] 
Improve comments for symbol_cache_mark_{not_,}found.

gdb/ChangeLog:

* symtab.c (symbol_cache_mark_found): Improve function comment.
Rename parameter objfile to objfile_context.
(symbol_cache_mark_not_found): Ditto.

10 years agoOnly discard space for pc-relative relocs symbols
H.J. Lu [Sun, 11 Jan 2015 16:04:27 +0000 (08:04 -0800)] 
Only discard space for pc-relative relocs symbols

When building PIE, we should only discard space for pc-relative relocs
symbols which turn out to need copy relocs.

bfd/

PR ld/17827
* elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): For PIE,
only discard space for pc-relative relocs symbols which turn
out to need copy relocs.

ld/testsuite/

PR ld/17827
* ld-x86-64/pr17689.out: Updated.
* ld-x86-64/pr17689b.S: Likewise.

* ld-x86-64/pr17827.rd: New file.

* ld-x86-64/x86-64.exp: Run PR ld/17827 test.

10 years agoAdd symbol lookup cache.
Doug Evans [Sun, 11 Jan 2015 06:27:10 +0000 (22:27 -0800)] 
Add symbol lookup cache.

gdb/ChangeLog:

Add symbol lookup cache.
* NEWS: Document new options and commands.
* symtab.c (symbol_cache_key): New static global.
(DEFAULT_SYMBOL_CACHE_SIZE, MAX_SYMBOL_CACHE_SIZE): New macros.
(SYMBOL_LOOKUP_FAILED): New macro.
(symbol_cache_slot_state): New enum.
(block_symbol_cache): New struct.
(symbol_cache): New struct.
(new_symbol_cache_size, symbol_cache_size): New static globals.
(hash_symbol_entry, eq_symbol_entry): New functions.
(symbol_cache_byte_size, resize_symbol_cache): New functions.
(make_symbol_cache, free_symbol_cache): New functions.
(get_symbol_cache, symbol_cache_cleanup): New function.
(set_symbol_cache_size, set_symbol_cache_size_handler): New functions.
(symbol_cache_lookup, symbol_cache_clear_slot): New function.
(symbol_cache_mark_found, symbol_cache_mark_not_found): New functions.
(symbol_cache_flush, symbol_cache_dump): New functions.
(maintenance_print_symbol_cache): New function.
(maintenance_flush_symbol_cache): New function.
(symbol_cache_stats): New function.
(maintenance_print_symbol_cache_statistics): New function.
(symtab_new_objfile_observer): New function.
(symtab_free_objfile_observer): New function.
(lookup_static_symbol, lookup_global_symbol): Use symbol cache.
(_initialize_symtab): Init symbol_cache_key.  New parameter
maint symbol-cache-size.  New maint commands print symbol-cache,
print symbol-cache-statistics, flush-symbol-cache.
Install new_objfile, free_objfile observers.

doc/ChangeLog:

* gdb.texinfo (Symbols): Document new commands
"maint print symbol-cache", "maint print symbol-cache-statistics",
"maint flush-symbol-cache".  Document new option
"maint set symbol-cache-size".

10 years agoAutomatic date update in version.in
GDB Administrator [Sun, 11 Jan 2015 00:00:20 +0000 (00:00 +0000)] 
Automatic date update in version.in