Merge branch 'master' into merge-job
[deliverable/binutils-gdb.git] / gdb / cli / cli-cmds.c
index c2ba3a4238ab64a0a2fa9a2ffb158f12237d50a8..e1204f74ef1aea3840f4c94007cdcaa158551fb8 100644 (file)
@@ -1,6 +1,7 @@
 /* GDB CLI commands.
 
    Copyright (C) 2000-2020 Free Software Foundation, Inc.
+   Copyright (C) 2019-2020 Advanced Micro Devices, Inc. All rights reserved.
 
    This file is part of GDB.
 
@@ -1441,6 +1442,7 @@ static void
 disassemble_command (const char *arg, int from_tty)
 {
   struct gdbarch *gdbarch = get_current_arch ();
+  struct obj_section *section;
   CORE_ADDR low, high;
   const char *name;
   CORE_ADDR pc;
@@ -1492,6 +1494,14 @@ disassemble_command (const char *arg, int from_tty)
     }
 
   pc = value_as_address (parse_to_comma_and_eval (&p));
+
+  /* ROCM: get the gdbarch from the objfile, if found */
+  section = find_pc_overlay (pc);
+  if (section == NULL)
+    section = find_pc_section (pc);
+  if (section != NULL)
+    gdbarch = get_objfile_arch (section->objfile);
+
   if (p[0] == ',')
     ++p;
   if (p[0] == '\0')
This page took 0.023832 seconds and 4 git commands to generate.