This is the mail archive of the gdb-testers@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Reuse buffers across gdb_pretty_print_insn calls


*** TEST RESULTS FOR COMMIT 8b172ce7c9435095d14e0bd98cd431bb9584e95e ***

Author: Pedro Alves <palves@redhat.com>
Branch: master
Commit: 8b172ce7c9435095d14e0bd98cd431bb9584e95e

Reuse buffers across gdb_pretty_print_insn calls

gdb_pretty_print_insn allocates and destroys a couple local buffers
each time it is called, which can be many times when disassembling a
region of memory.  Avoid that overhead by adding a new class that
holds the buffers and making gdb_pretty_print_insn a method of that
class, so that the buffers can be reused across calls.

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

	* disasm.c (gdb_pretty_print_insn): Rename to ...
	(gdb_pretty_print_disassembler::pretty_print_insn): ... this.
	Remove gdbarch parameter.  Adapt to clear the object's buffers
	instead of allocating new buffers, and to print using the object's
	gdb_disassembler instead of calling gdb_print_insn.
	(dump_insns): Use gdb_pretty_print_disassembler.
	* disasm.h (gdb_pretty_print_insn): Delete declaration.
	(gdb_pretty_print_disassembler): New class.
	* record-btrace.c (btrace_insn_history): Use
	gdb_pretty_print_disassembler.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]