aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>2016-05-03 09:48:12 +0100
committerKyrylo Tkachov <kyrylo.tkachov@arm.com>2016-05-03 09:48:12 +0100
commit386c90348551eb089124d64c9bc6ab17cbefb016 (patch)
tree780608e46e5b64aac453698d09aaed7465fd71b8
parent56d916d008de9b4792d7a1398823e13cacb7a67e (diff)
downloadbinutils-386c90348551eb089124d64c9bc6ab17cbefb016.zip
binutils-386c90348551eb089124d64c9bc6ab17cbefb016.tar.gz
binutils-386c90348551eb089124d64c9bc6ab17cbefb016.tar.bz2
[gdb] Fix -Wparentheses warnings
2016-05-03 Kyrylo Tkachov <kyrylo.tkachov@arm.com> * symfile.c (find_pc_overlay): Add braces to avoid -Wparentheses warning. (find_pc_mapped_section): Likewise. (list_overlays_command): Likewise.
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/symfile.c80
2 files changed, 50 insertions, 37 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 12691cc..901da6f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2016-05-03 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * symfile.c (find_pc_overlay): Add braces to avoid -Wparentheses
+ warning.
+ (find_pc_mapped_section): Likewise.
+ (list_overlays_command): Likewise.
+
2016-04-27 Jan Kratochvil <jan.kratochvil@redhat.com>
* remote.c (remote_start_remote): Detect PACKET_vFile_setfs.support.
diff --git a/gdb/symfile.c b/gdb/symfile.c
index e11c280..64b122b 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -3293,19 +3293,21 @@ find_pc_overlay (CORE_ADDR pc)
struct obj_section *osect, *best_match = NULL;
if (overlay_debugging)
- ALL_OBJSECTIONS (objfile, osect)
- if (section_is_overlay (osect))
- {
- if (pc_in_mapped_range (pc, osect))
+ {
+ ALL_OBJSECTIONS (objfile, osect)
+ if (section_is_overlay (osect))
{
- if (section_is_mapped (osect))
- return osect;
- else
+ if (pc_in_mapped_range (pc, osect))
+ {
+ if (section_is_mapped (osect))
+ return osect;
+ else
+ best_match = osect;
+ }
+ else if (pc_in_unmapped_range (pc, osect))
best_match = osect;
}
- else if (pc_in_unmapped_range (pc, osect))
- best_match = osect;
- }
+ }
return best_match;
}
@@ -3320,9 +3322,11 @@ find_pc_mapped_section (CORE_ADDR pc)
struct obj_section *osect;
if (overlay_debugging)
- ALL_OBJSECTIONS (objfile, osect)
- if (pc_in_mapped_range (pc, osect) && section_is_mapped (osect))
- return osect;
+ {
+ ALL_OBJSECTIONS (objfile, osect)
+ if (pc_in_mapped_range (pc, osect) && section_is_mapped (osect))
+ return osect;
+ }
return NULL;
}
@@ -3338,31 +3342,33 @@ list_overlays_command (char *args, int from_tty)
struct obj_section *osect;
if (overlay_debugging)
- ALL_OBJSECTIONS (objfile, osect)
+ {
+ ALL_OBJSECTIONS (objfile, osect)
if (section_is_mapped (osect))
- {
- struct gdbarch *gdbarch = get_objfile_arch (objfile);
- const char *name;
- bfd_vma lma, vma;
- int size;
-
- vma = bfd_section_vma (objfile->obfd, osect->the_bfd_section);
- lma = bfd_section_lma (objfile->obfd, osect->the_bfd_section);
- size = bfd_get_section_size (osect->the_bfd_section);
- name = bfd_section_name (objfile->obfd, osect->the_bfd_section);
-
- printf_filtered ("Section %s, loaded at ", name);
- fputs_filtered (paddress (gdbarch, lma), gdb_stdout);
- puts_filtered (" - ");
- fputs_filtered (paddress (gdbarch, lma + size), gdb_stdout);
- printf_filtered (", mapped at ");
- fputs_filtered (paddress (gdbarch, vma), gdb_stdout);
- puts_filtered (" - ");
- fputs_filtered (paddress (gdbarch, vma + size), gdb_stdout);
- puts_filtered ("\n");
-
- nmapped++;
- }
+ {
+ struct gdbarch *gdbarch = get_objfile_arch (objfile);
+ const char *name;
+ bfd_vma lma, vma;
+ int size;
+
+ vma = bfd_section_vma (objfile->obfd, osect->the_bfd_section);
+ lma = bfd_section_lma (objfile->obfd, osect->the_bfd_section);
+ size = bfd_get_section_size (osect->the_bfd_section);
+ name = bfd_section_name (objfile->obfd, osect->the_bfd_section);
+
+ printf_filtered ("Section %s, loaded at ", name);
+ fputs_filtered (paddress (gdbarch, lma), gdb_stdout);
+ puts_filtered (" - ");
+ fputs_filtered (paddress (gdbarch, lma + size), gdb_stdout);
+ printf_filtered (", mapped at ");
+ fputs_filtered (paddress (gdbarch, vma), gdb_stdout);
+ puts_filtered (" - ");
+ fputs_filtered (paddress (gdbarch, vma + size), gdb_stdout);
+ puts_filtered ("\n");
+
+ nmapped++;
+ }
+ }
if (nmapped == 0)
printf_filtered (_("No sections are mapped.\n"));
}