Use target_read_code in skip_prologue (i386)
authorYao Qi <yao@codesourcery.com>
Fri, 18 Oct 2013 09:36:11 +0000 (17:36 +0800)
committerYao Qi <yao@codesourcery.com>
Tue, 10 Dec 2013 12:27:49 +0000 (20:27 +0800)
commit0865b04a4dec8a458bee54081b5598a6268b0724
tree7b2cdde0ecfc6456086735083c6a8b1a7ebb08dc
parentf15cb84a84613a5017e41ae435312ddcb17877b5
Use target_read_code in skip_prologue (i386)

GDB is able to cache memory accesses requested in target_read_code,
so target_read_code is more efficient than general target_read_memory.

This patch uses target_read_code and its variants to read target
memory in the functions related to i386_skip_prologue.  It improves
the performance when doing 'b foo' (foo is a function) in remote
debugging.

Nowadays, when we set a breakpoint on function f1, GDB will fetch the
code in f1 to determine the start of the function body (say skip the
prologue), it requests read from target many times.  With this patch
applied, the number of RSP 'm' packets are reduced.

gdb:

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

* corefile.c (read_code): New function.
(read_code_integer): New function.
(read_code_unsigned_integer): New function.
* gdbcore.h (read_code): Declare.
(read_code_integer): Declare.
(read_code_unsigned_integer): Declare.
* i386-tdep.c (i386_follow_jump): Call target_read_code instead
of target_read_memory.  Call read_code_unsigned_integer instead
of read_memory_unsigned_integer.
(i386_analyze_struct_return): Likewise.
(i386_skip_probe): Likewise.
(i386_analyze_stack_align): Likewise.
(i386_match_pattern): Likewise.
(i386_skip_noop): Likewise.
(i386_analyze_frame_setup): Likewise.
(i386_analyze_register_saves): Likewise.
(i386_skip_prologue): Likewise.
(i386_skip_main_prologue): Likewise.
(i386_frame_cache_1): Likewise.
gdb/ChangeLog
gdb/corefile.c
gdb/gdbcore.h
gdb/i386-tdep.c
This page took 0.025045 seconds and 4 git commands to generate.