• R/O
  • HTTP
  • SSH
  • HTTPS

List of commits

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


users/palves/jit-speedup
RSS
Rev. Time Author
22f83b9 users/palves/jit-speedup 2016-09-19 23:44:43 Pedro Alves

lookup_minimal_symbol_text

Noticed that create_exception_master_breakpoint could be using the
cheaper lookup_minimal_symbol_text instead of lookup_minimal_symbol.

14ca73f 2016-09-19 23:44:42 Pedro Alves

More O(N) elimination

069ed21 2016-09-19 23:44:42 Pedro Alves

Incremental breakpoint_re_set for solib_add

Finaly enable per-objfile breakpoint_re_set for solibs

794d02d 2016-09-19 23:44:42 Pedro Alves

breakpoint_re_set probes

2d0689c 2016-09-19 23:44:42 Pedro Alves

find_function_start_sal

2c1994e 2016-09-19 23:44:42 Pedro Alves

Incremental breakpoint_re_set for linespec

When you have a pending breakpoint, the next bottleneck is
breakpoint_re_set again.

$ time $g --batch -q -ex "run" -ex "c" -iex "set breakpoint pending on" -iex "b mainasdfasdf" --args ./testsuite/outputs/gdb.base/jit/jit-main ./testsuite/outputs/gdb.base/jit/jit-solib.so 8000
No symbol table is loaded. Use the "file" command.
Breakpoint 1 (mainasdfasdf) pending.
/home/pedro/gdb/mygit/src/gdb/testsuite/gdb.base/jit-main.c:164: libname = ./testsuite/outputs/gdb.base/jit/jit-solib.so, count = 8000
[Inferior 1 (process 25753) exited normally]
The program is not being run.

real 0m31.738s
user 0m29.221s
sys 0m2.827s

This implement per-objfile re-set for linespece-based breakpoints.

- Hoist out plt locations when we find other breakpoint locations

It's what the linespec code does if we let it look up in the whole
program space.

- Check that the sals the linespec code returns match the search scope

- Address locations always use a program_space-wide search scope

- Fix exception.exp - we may only find the probe interface after seeing __cxa_begin_catch on other objfiles

- validate_sals

31ac74b 2016-09-19 23:44:42 Pedro Alves

Incremental breakpoint_re_set for longjmp, etc. master breakpoints

perf shows the next bottleneck is breakpoint_re_set.

Even when you don't have user-visible pending breakpoints, gdb still
needs to re-set _internal_ breakpoints on every objfile loaded.
Specifically, time is spent re-setting the longjmp/terminate,
etc. master breakpoints of _all_ objfiles...

So start implementing limiting breakpoint_re_set to the objfile that
was just loaded. Introduce a struct sym_search_scope and generalize
the ALL_SEARCH_OBJFILES approach added by a previous patch.

Then when an objfile is loaded, pass a sym_search_scope to
breakpoint_re_set that indicates that the scope is a single objfile.
For cases where we want to reset the whole program space, we pass a
sym_search_scope to breakpoint_re_set that indicates that the scope is
the whole program space (i.e., all objfiles in that program space).

Then we need to plumb passing that sym_search_scope to all the
breakpoint_ops->re_set methods. In the internal breakpoints
implementation, it's used to know to only delete the master breakpoint
of the just re-loaded objfile, leaving others alone. Other breakpoint
types are left to subsequent patches.

This is another huge speed up for the normal case you don't have
pending breakpoints.

Note we need to store the objfile a breakpoint location is set at in
bp_location, in order to be able to know whether we should re-set it
or not when a single-objfile re-set comes along. And that requires
passing down the objfile the internal breakpoint was set at in the
first place, thus the create_*_breakpoint changes in this patch.

0d2b53c 2016-09-19 23:44:42 Pedro Alves

Defer breakpoint_re_set until after main program+initial solibs are loaded

Fixes execl tests

This defers breakpoint_re_set until we've loaded all the main program
and the initial solibs.

Good on its own anyway, but fixes an issue with breakpoint_re_set
limited to a single objfile later in the series.

5fc9325 2016-09-19 23:44:42 Pedro Alves

Use symfile_add_flags in solib_add

The main reason here is being able to tell solib_add to defer
breakpoint re-set. (Not used in this patch yet).

e14ac25 2016-09-19 23:44:42 Pedro Alves

Don't run forever in execl-update-breakpoint.exp

8f15b2c 2016-09-19 23:44:42 Pedro Alves

objfile_data

The perf profile now shows objfile_data at the top. It's not that
that function is expensive. It's that it's called _a lot_ of times.

Whenever we register/unregister a JIT objfile, we iterate over the
whole list of existing objfiles, and call objfile_data on each,
through jit_find_objf_with_entry_addr.

Get rid of that O(N) loop by keeping a list of JIT objfiles on the
side, sorted by addr and using a binary search for the look up
instead.

7877d8a 2016-09-19 23:44:41 Pedro Alves

Stale objfile_unlink comment

07cd4b97 added the internal_error

The next bootleneck is adding/removing objfiles from the list of
objfiles... The problem is that we iterate over the list looking for
the tail objfile every single time. When we have thousands of
objfiles, that's costly.

So keep a tail pointer to the list instead.

893297f 2016-09-19 23:44:41 Pedro Alves

ALL_SEARCH_OBJFILES

The next bottleneck is that the minsym lookup code always iterates
over _all_ objfiles, even when we know which objfile to do the look up
in...

Introduce a macro that knows to get to the right search scope
objfiles.

9cbe8d2 2016-09-19 23:44:41 Pedro Alves

Avoid creating a frame in internal stops

This speeds up JIT library loading by ${a lot}.

5cd42e9 2016-09-19 23:44:41 Pedro Alves

Get rid of sections sorting with qsort and use an incrementally updated addrmap instead

This gives a massive speed up. The problem with the qsort is that we
qsort for any one of the thousands of jit loads/unloads, and when you
have thousands of objfiles, that gets very slow. In this scenario,
we're constantly adding/removing a handfull of obj_sections to a set
of thousands of already-sorted obj_sections. It's much cheaper to do
an incremental update.

I'm using a mutable addrmap for this, but I needed to add a new
primitive that allowed updating a region's object, to handle the case
of overlapping sections. The only primitive available, only allows
setting a value to a currently-NULL region.

55a083f 2016-09-19 23:44:33 Pedro Alves

More fixing C++ and PLTs: static

763ac59 2016-09-19 23:44:04 Pedro Alves

Fix C++ and PLTs (PR 17201, PR17199 ?)

2387dd9 2016-09-19 14:46:50 Alan Modra

nm handling of synthetic symbols

Symbol sorting means we can't assume that the last n symbols are
synthetic.

* nm.c (print_symbol): Remove is_synthetic param. Test sym->flags
instead.
(print_size_symbols, print_symbols): Adjust to suit, deleting
now unused synth_count param and fromsynth var.
(display_rel_file): Adjust, localizing synth_count.

bc1e6c8 2016-09-19 13:17:29 Sergio Durigan Junior

Consolidate target_mourn_inferior between GDB and gdbserver

This patch consolidates the API of target_mourn_inferior between GDB
and gdbserver, in my continuing efforts to make sharing the
fork_inferior function possible between both.

GDB's version of the function did not care about the inferior's ptid
being mourned, but gdbserver's needed to know this information. Since
it actually makes sense to pass the ptid as an argument, instead of
depending on a global value directly (which GDB's version did), I
decided to make the generic API to accept it. I then went on and
extended all calls being made on GDB to include a ptid argument (which
ended up being inferior_ptid most of the times, anyway), and now we
have a more sane interface.

On GDB's side, after talking to Pedro a bit about it, we decided that
just an assertion to make sure that the ptid being passed is equal to
inferior_ptid would be enough for now, on the GDB side. We can remove
the assertion and perform more operations later if we ever pass
anything different than inferior_ptid.

Regression tested on our BuildBot, everything OK.

I'd appreciate a special look at gdb/windows-nat.c's modification
because I wasn't really sure what to do there. It seemed to me that
maybe I should build a ptid out of the process information there, but
then I am almost sure the assertion on GDB's side would trigger.

gdb/ChangeLog:
2016-09-19 Sergio Durigan Junior <sergiodj@redhat.com>

* darwin-nat.c (darwin_kill_inferior): Adjusting call to
target_mourn_inferior to include ptid_t argument.
* fork-child.c (startup_inferior): Likewise.
* gnu-nat.c (gnu_kill_inferior): Likewise.
* inf-ptrace.c (inf_ptrace_kill): Likewise.
* infrun.c (handle_inferior_event_1): Likewise.
* linux-nat.c (linux_nat_attach): Likewise.
(linux_nat_kill): Likewise.
* nto-procfs.c (interrupt_query): Likewise.
(procfs_interrupt): Likewise.
(procfs_kill_inferior): Likewise.
* procfs.c (procfs_kill_inferior): Likewise.
* record.c (record_mourn_inferior): Likewise.
* remote-sim.c (gdbsim_kill): Likewise.
* remote.c (remote_detach_1): Likewise.
(remote_kill): Likewise.
* target.c (target_mourn_inferior): Change declaration to accept
new ptid_t argument; use gdb_assert on it.
* target.h (target_mourn_inferior): Move function prototype from
here...
* target/target.h (target_mourn_inferior): ... to here. Adjust it
to accept new ptid_t argument.
* windows-nat.c (get_windows_debug_event): Adjusting call to
target_mourn_inferior to include ptid_t argument.

gdb/gdbserver/ChangeLog:
2016-09-19 Sergio Durigan Junior <sergiodj@redhat.com>

* server.c (start_inferior): Call target_mourn_inferior instead of
mourn_inferior; pass ptid_t argument to it.
(resume): Likewise.
(handle_target_event): Likewise.
* target.c (target_mourn_inferior): New function.
* target.h (mourn_inferior): Delete macro.

73cca75 2016-09-19 09:00:21 GDB Administrator

Automatic date update in version.in

9368949 2016-09-19 08:30:30 Pedro Alves

gdb/s390: Fix build breakage due to std::min/std::max usage without header

[...]
.../gdb/s390-linux-nat.c: In function 'void s390_prepare_to_resume(lwp_info*)':
.../gdb/s390-linux-nat.c:703:20: error: 'min' is not a member of 'std'
watch_lo_addr = std::min (watch_lo_addr, area->lo_addr);
[...]

gdb/ChangeLog:
2016-09-18 Pedro Alves <palves@redhat.com>

* s390-linux-nat.c: Include <algorithm>.

768adc0 2016-09-19 07:56:01 Pedro Alves

gdb: Fix std::{min, max}-related build breakage on 32-bit hosts

Building on a 32-bit host fails currently with errors like:

.../src/gdb/exec.c: In function ‘target_xfer_status section_table_read_available_memory(gdb_byte*, ULONGEST, ULONGEST, ULONGEST*)’:
.../src/gdb/exec.c:801:54: error: no matching function for call to ‘min(ULONGEST, long unsigned int)’
end = std::min (offset + len, r->start + r->length);
^
In file included from /usr/include/c++/5.3.1/algorithm:61:0,
from .../src/gdb/exec.c:46:
/usr/include/c++/5.3.1/bits/stl_algobase.h:195:5: note: candidate: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)
min(const _Tp& __a, const _Tp& __b)
^
/usr/include/c++/5.3.1/bits/stl_algobase.h:195:5: note: template argument deduction/substitution failed:
.../src/gdb/exec.c:801:54: note: deduced conflicting types for parameter ‘const _Tp’ (‘long long unsigned int’ and ‘long unsigned int’)
end = std::min (offset + len, r->start + r->length);
^
In file included from /usr/include/c++/5.3.1/algorithm:61:0,
from .../src/gdb/exec.c:46:
/usr/include/c++/5.3.1/bits/stl_algobase.h:243:5: note: candidate: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)
min(const _Tp& __a, const _Tp& __b, _Compare __comp)
^

The problem is that the std::min/std::max function templates use the
same type for both parameters. When the argument types are different,
the compiler can't automatically deduce which template specialization
to pick from the arguments' types.

Fix that by specifying the specialization we want explicitly.

gdb/ChangeLog:
2016-09-18 Pedro Alves <palves@redhat.com>

* breakpoint.c (hardware_watchpoint_inserted_in_range): Explicitly
specify the std:min/std::max specialization.
* exec.c (section_table_read_available_memory): Likewise.
* remote.c (remote_read_qxfer): Likewise.
* target.c (simple_verify_memory): Likewise.

498f644 2016-09-18 09:00:23 GDB Administrator

Automatic date update in version.in

7f3c5ec 2016-09-17 17:50:37 Eli Zaretskii

Improve MinGW support in Readline

These changes were already accepted upstream in Readline,
but GDB did not yet import a newer Readline version.

readline/Changelog.gdb:

* util.c: Include rlshell.h.
(_rl_tropen) [_WIN32 && !__CYGWIN__]: Open the trace file in the
user's temporary directory.
* tcap.h [HAVE_NCURSES_TERMCAP_H]: Include ncurses/termcap.h.
* input.c (w32_isatty) [_WIN32 && !__CYGWIN__]: New function, to
replace isatty that is not reliable enough on MS-Windows.
(isatty) [_WIN32 && !__CYGWIN__]: Redirect to w32_isatty.
(rl_getc): Call _getch, not getch, which could be an ncurses
function when linked with ncurses, in which case getch will return
EOF for any keystroke, because there's no curses window.
* tilde.c (tilde_expand_word) [_WIN32]:
* histfile.c (history_filename) [_WIN32]: Windows-specific
environment variable to replace HOME if that is undefined.
* funmap.c (default_funmap): Compile rl_paste_from_clipboard on
all Windows platforms, not just Cygwin.
* readline.h (rl_paste_from_clipboard): Include declaration for
all Windows platforms.
* display.c (insert_some_chars, delete_chars): Don't use the
MinGW-specific code if linked with ncurses.
* configure.in:
* config.h.in: Support ncurses/termcap.h. The configure script
was updated accordingly.
* complete.c [_WIN32 && !__CYGWIN__]: Initialize
_rl_completion_case_fold to 1.
(printable_part, rl_filename_completion_function)
[_WIN32 && !__CYGWIN__]: Handle the drive letter.

a3fa21c 2016-09-17 09:00:23 GDB Administrator

Automatic date update in version.in

cd94f6d 2016-09-17 04:44:29 Simon Marchi

Introduce cleanup to restore current_uiout

Make a globally available cleanup from a pre-existing one in infrun.c.
This is used in a following patch.

gdb/ChangeLog:

* infrun.c (restore_current_uiout_cleanup): Move to ui-out.c.
(print_stop_event): Use make_cleanup_restore_current_uiout.
* python/python.c (execute_gdb_command): Likewise.
* ui-out.c (restore_current_uiout_cleanup): Move from infrun.c.
(make_cleanup_restore_current_uiout): New function definition.
* ui-out.h (make_cleanup_restore_current_uiout): New function
declaration.
* utils.c (do_restore_ui_out): Remove.
(make_cleanup_restore_ui_out): Remove.
* utils.h (make_cleanup_restore_ui_out): Remove.

325fac5 2016-09-17 03:55:17 Pedro Alves

gdb: Use std::min and std::max throughout

Otherwise including <string> or some other C++ header is broken.
E.g.:

In file included from /opt/gcc/include/c++/7.0.0/bits/char_traits.h:39:0,
from /opt/gcc/include/c++/7.0.0/string:40,
from /home/pedro/gdb/mygit/cxx-convertion/src/gdb/infrun.c:68:
/opt/gcc/include/c++/7.0.0/bits/stl_algobase.h:243:56: error: macro "min" passed 3 arguments, but takes just 2
min(const _Tp& __a, const _Tp& __b, _Compare __comp)
^
/opt/gcc/include/c++/7.0.0/bits/stl_algobase.h:265:56: error: macro "max" passed 3 arguments, but takes just 2
max(const _Tp& __a, const _Tp& __b, _Compare __comp)
^
In file included from .../src/gdb/infrun.c:21:0:

To the best of my grepping abilities, I believe I adjusted all min/max
calls.

gdb/ChangeLog:
2016-09-16 Pedro Alves <palves@redhat.com>

* defs.h (min, max): Delete.
* aarch64-tdep.c: Include <algorithm> and use std::min and
std::max throughout.
* aarch64-tdep.c: Likewise.
* alpha-tdep.c: Likewise.
* amd64-tdep.c: Likewise.
* amd64-windows-tdep.c: Likewise.
* arm-tdep.c: Likewise.
* avr-tdep.c: Likewise.
* breakpoint.c: Likewise.
* btrace.c: Likewise.
* ctf.c: Likewise.
* disasm.c: Likewise.
* doublest.c: Likewise.
* dwarf2loc.c: Likewise.
* dwarf2read.c: Likewise.
* environ.c: Likewise.
* exec.c: Likewise.
* f-exp.y: Likewise.
* findcmd.c: Likewise.
* ft32-tdep.c: Likewise.
* gcore.c: Likewise.
* hppa-tdep.c: Likewise.
* i386-darwin-tdep.c: Likewise.
* i386-tdep.c: Likewise.
* linux-thread-db.c: Likewise.
* lm32-tdep.c: Likewise.
* m32r-tdep.c: Likewise.
* m88k-tdep.c: Likewise.
* memrange.c: Likewise.
* minidebug.c: Likewise.
* mips-tdep.c: Likewise.
* moxie-tdep.c: Likewise.
* nds32-tdep.c: Likewise.
* nios2-tdep.c: Likewise.
* nto-procfs.c: Likewise.
* parse.c: Likewise.
* ppc-sysv-tdep.c: Likewise.
* probe.c: Likewise.
* record-btrace.c: Likewise.
* remote.c: Likewise.
* rs6000-tdep.c: Likewise.
* rx-tdep.c: Likewise.
* s390-linux-nat.c: Likewise.
* s390-linux-tdep.c: Likewise.
* ser-tcp.c: Likewise.
* sh-tdep.c: Likewise.
* sh64-tdep.c: Likewise.
* source.c: Likewise.
* sparc-tdep.c: Likewise.
* symfile.c: Likewise.
* target-memory.c: Likewise.
* target.c: Likewise.
* tic6x-tdep.c: Likewise.
* tilegx-tdep.c: Likewise.
* tracefile-tfile.c: Likewise.
* tracepoint.c: Likewise.
* valprint.c: Likewise.
* value.c: Likewise.
* xtensa-tdep.c: Likewise.
* cli/cli-cmds.c: Likewise.
* compile/compile-object-load.c: Likewise.

8193ade 2016-09-17 02:25:55 Andreas Arnez

S390: Hardware breakpoint support

Add hardware breakpoint support for S390 targets.

gdb/ChangeLog:

* s390-linux-nat.c (PER_BIT, PER_EVENT_BRANCH, PER_EVENT_IFETCH)
(PER_EVENT_STORE, PER_EVENT_NULLIFICATION)
(PER_CONTROL_BRANCH_ADDRESS, PER_CONTROL_SUSPENSION)
(PER_CONTROL_ALTERATION): New macros.
(struct s390_debug_reg_state) <break_areas>: New member.
(s390_forget_process): Free break_areas as well.
(s390_linux_new_fork): Copy break_areas as well.
(s390_prepare_to_resume): Install hardware breakpoints.
(s390_can_use_hw_breakpoint): Indicate support for hardware
breakpoints.
(s390_insert_hw_breakpoint, s390_remove_hw_breakpoint): New
linux_nat target methods.
(_initialize_s390_nat): Register them.

gdb/testsuite/ChangeLog:

* lib/gdb.exp: No longer skip hardware breakpoint tests on s390.

0e00e96 2016-09-17 02:25:55 Andreas Arnez

linux-nat: Add function lwp_is_stepping

Add the function lwp_is_stepping which indicates whether the given LWP
is currently single-stepping. This is a common interface, usable from
native GDB as well as from gdbserver.

gdb/gdbserver/ChangeLog:

* linux-low.c (lwp_is_stepping): New function.

gdb/ChangeLog:

* nat/linux-nat.h (lwp_is_stepping): New declaration.
* linux-nat.c (lwp_is_stepping): New function.

169fe0d 2016-09-17 02:25:55 Andreas Arnez

S390: Enable "maint set show-debug-regs"

Implement a new function for dumping the S390 "debug
registers" (actually, the PER info) and invoke it at appropriate places.
Respect the variable show_debug_regs and make it settable by the user.

gdb/ChangeLog:

* s390-linux-nat.c (gdbcmd.h): New include.
(s390_show_debug_regs): New function.
(s390_stopped_by_watchpoint): Call it, if show_debug_regs is set.
(s390_prepare_to_resume): Likewise.
(_initialize_s390_nat): Register the command "maint set
show-debug-regs".