aboutsummaryrefslogtreecommitdiff
path: root/gdb/arm-tdep.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/arm-tdep.c')
-rw-r--r--gdb/arm-tdep.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 5450056..f4c2e04 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -18,7 +18,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-#include <ctype.h>
#include "extract-store-integer.h"
#include "frame.h"
@@ -1669,7 +1668,7 @@ arm_analyze_load_stack_chk_guard(CORE_ADDR pc, struct gdbarch *gdbarch,
ldr Rn, .Label
....
- .Lable:
+ .Label:
.word __stack_chk_guard
Since ldr/str is a very popular instruction, we can't use them as
@@ -2504,15 +2503,15 @@ static const registry<bfd>::key<arm_exidx_data> arm_exidx_data_key;
static struct obj_section *
arm_obj_section_from_vma (struct objfile *objfile, bfd_vma vma)
{
- for (obj_section *osect : objfile->sections ())
- if (bfd_section_flags (osect->the_bfd_section) & SEC_ALLOC)
+ for (obj_section &osect : objfile->sections ())
+ if (bfd_section_flags (osect.the_bfd_section) & SEC_ALLOC)
{
bfd_vma start, size;
- start = bfd_section_vma (osect->the_bfd_section);
- size = bfd_section_size (osect->the_bfd_section);
+ start = bfd_section_vma (osect.the_bfd_section);
+ size = bfd_section_size (osect.the_bfd_section);
if (start <= vma && vma < start + size)
- return osect;
+ return &osect;
}
return NULL;
@@ -9642,13 +9641,20 @@ show_disassembly_style_sfunc (struct ui_file *file, int from_tty,
const char *options = get_disassembler_options (gdbarch);
const char *style = "";
int len = 0;
- const char *opt;
+ const char *opt = options;
- FOR_EACH_DISASSEMBLER_OPTION (opt, options)
- if (startswith (opt, "reg-names-"))
+ if (opt)
+ while (1)
{
- style = &opt[strlen ("reg-names-")];
- len = strcspn (style, ",");
+ const char *opt_end = strchr (opt, ',');
+ if (startswith (opt, "reg-names-"))
+ {
+ style = &opt[strlen ("reg-names-")];
+ len = opt_end ? opt_end - style : 99;
+ }
+ if (!opt_end)
+ break;
+ opt = opt_end + 1;
}
gdb_printf (file, "The disassembly style is \"%.*s\".\n", len, style);
@@ -11015,9 +11021,7 @@ static void arm_analyze_prologue_test ();
}
#endif
-void _initialize_arm_tdep ();
-void
-_initialize_arm_tdep ()
+INIT_GDB_FILE (arm_tdep)
{
long length;
int i, j;