This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/5] arc: Set section to ".text" when disassembling
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: Anton Kolesov <Anton dot Kolesov at synopsys dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, Francois Bedard <Francois dot Bedard at synopsys dot com>
- Date: Wed, 15 Feb 2017 22:27:16 +0000
- Subject: Re: [PATCH 2/5] arc: Set section to ".text" when disassembling
- Authentication-results: sourceware.org; auth=none
- References: <20170214100130.29194-1-Anton.Kolesov@synopsys.com> <20170214100130.29194-2-Anton.Kolesov@synopsys.com>
On Tue, Feb 14, 2017 at 10:01 AM, Anton Kolesov
<Anton.Kolesov@synopsys.com> wrote:
> +
> + /* ARC disassembler requires that info->section is valid - it will be used to
> + access program headers of ELF files that is needed to distinguish between
> + ARC EM and HS (ARC600, ARC700 and ARC v2 can be distinguished by BFD's
> + `mach` attribute). Without this information disassembler will default to
> + ARC EM for ARC v2 targets, and it will not recognize instructions specific
> + to ARC HS, for example, double-word store and load. */
> + if (exec_bfd != NULL)
> + info->section = bfd_get_section_by_name (exec_bfd, ".text");
info->section should be valid, but why must it be ".text"? Can I disassembly
instructions in .plt section? How about using find_pc_section (addr) to get
the right section? like mep_gdb_print_insn.
--
Yao (齐尧)