* [PATCH] [ARC] Allow disassembly if BFD is not available
@ 2016-09-06 12:33 Anton Kolesov
2016-09-14 11:21 ` Nick Clifton
0 siblings, 1 reply; 2+ messages in thread
From: Anton Kolesov @ 2016-09-06 12:33 UTC (permalink / raw)
To: binutils
Cc: Anton Kolesov, Francois Bedard, Claudiu Zissulescu, Cupertino Miranda
When debugger invokes opcodes to get disassembler, sometimes there is no
corresponding BFD instance for the debugged targets, for example if debugger has
connected to remote target and doesn't have an ELF file for an application in
the target CPU. Therefore, in this case it is not possible to determine
extensions present in target. Currently opcodes would simply has a segfault in
this, this patches makes it handle the case gracefully and return a normal
disassembler without any extension information.
opcodes/
* arc-dis.c (arc_get_disassembler): Accept the null abfd gracefully.
---
opcodes/arc-dis.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/opcodes/arc-dis.c b/opcodes/arc-dis.c
index d69a01e..21ad6b1 100644
--- a/opcodes/arc-dis.c
+++ b/opcodes/arc-dis.c
@@ -1238,11 +1238,16 @@ print_insn_arc (bfd_vma memaddr,
disassembler_ftype
arc_get_disassembler (bfd *abfd)
{
- /* Read the extenssion insns and registers, if any. */
- build_ARC_extmap (abfd);
+ /* BFD my be absent, if opcodes is invoked from the debugger that has
+ connected to remote target and doesn't have an ELF file. */
+ if (abfd != NULL)
+ {
+ /* Read the extension insns and registers, if any. */
+ build_ARC_extmap (abfd);
#ifdef DEBUG
- dump_ARC_extmap ();
+ dump_ARC_extmap ();
#endif
+ }
return print_insn_arc;
}
--
2.8.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] [ARC] Allow disassembly if BFD is not available
2016-09-06 12:33 [PATCH] [ARC] Allow disassembly if BFD is not available Anton Kolesov
@ 2016-09-14 11:21 ` Nick Clifton
0 siblings, 0 replies; 2+ messages in thread
From: Nick Clifton @ 2016-09-14 11:21 UTC (permalink / raw)
To: Anton Kolesov, binutils
Cc: Francois Bedard, Claudiu Zissulescu, Cupertino Miranda
Hi Anton,
> opcodes/
> * arc-dis.c (arc_get_disassembler): Accept the null abfd gracefully.
Approved and applied.
Cheers
Nick
-
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-09-14 11:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-06 12:33 [PATCH] [ARC] Allow disassembly if BFD is not available Anton Kolesov
2016-09-14 11:21 ` Nick Clifton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).