[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.
This commit is contained in:
parent
a1da4399c7
commit
b631e59ba0
|
@ -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-05-02 Eli Zaretskii <eliz@gnu.org>
|
2016-05-02 Eli Zaretskii <eliz@gnu.org>
|
||||||
|
|
||||||
* windows-nat.c (_initialize_check_for_gdb_ini): Fix off-by-one
|
* windows-nat.c (_initialize_check_for_gdb_ini): Fix off-by-one
|
||||||
|
|
|
@ -3285,19 +3285,21 @@ find_pc_overlay (CORE_ADDR pc)
|
||||||
struct obj_section *osect, *best_match = NULL;
|
struct obj_section *osect, *best_match = NULL;
|
||||||
|
|
||||||
if (overlay_debugging)
|
if (overlay_debugging)
|
||||||
ALL_OBJSECTIONS (objfile, osect)
|
{
|
||||||
if (section_is_overlay (osect))
|
ALL_OBJSECTIONS (objfile, osect)
|
||||||
{
|
if (section_is_overlay (osect))
|
||||||
if (pc_in_mapped_range (pc, osect))
|
|
||||||
{
|
{
|
||||||
if (section_is_mapped (osect))
|
if (pc_in_mapped_range (pc, osect))
|
||||||
return osect;
|
{
|
||||||
else
|
if (section_is_mapped (osect))
|
||||||
|
return osect;
|
||||||
|
else
|
||||||
|
best_match = osect;
|
||||||
|
}
|
||||||
|
else if (pc_in_unmapped_range (pc, osect))
|
||||||
best_match = osect;
|
best_match = osect;
|
||||||
}
|
}
|
||||||
else if (pc_in_unmapped_range (pc, osect))
|
}
|
||||||
best_match = osect;
|
|
||||||
}
|
|
||||||
return best_match;
|
return best_match;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3312,9 +3314,11 @@ find_pc_mapped_section (CORE_ADDR pc)
|
||||||
struct obj_section *osect;
|
struct obj_section *osect;
|
||||||
|
|
||||||
if (overlay_debugging)
|
if (overlay_debugging)
|
||||||
ALL_OBJSECTIONS (objfile, osect)
|
{
|
||||||
if (pc_in_mapped_range (pc, osect) && section_is_mapped (osect))
|
ALL_OBJSECTIONS (objfile, osect)
|
||||||
return osect;
|
if (pc_in_mapped_range (pc, osect) && section_is_mapped (osect))
|
||||||
|
return osect;
|
||||||
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -3330,31 +3334,33 @@ list_overlays_command (char *args, int from_tty)
|
||||||
struct obj_section *osect;
|
struct obj_section *osect;
|
||||||
|
|
||||||
if (overlay_debugging)
|
if (overlay_debugging)
|
||||||
ALL_OBJSECTIONS (objfile, osect)
|
{
|
||||||
|
ALL_OBJSECTIONS (objfile, osect)
|
||||||
if (section_is_mapped (osect))
|
if (section_is_mapped (osect))
|
||||||
{
|
{
|
||||||
struct gdbarch *gdbarch = get_objfile_arch (objfile);
|
struct gdbarch *gdbarch = get_objfile_arch (objfile);
|
||||||
const char *name;
|
const char *name;
|
||||||
bfd_vma lma, vma;
|
bfd_vma lma, vma;
|
||||||
int size;
|
int size;
|
||||||
|
|
||||||
vma = bfd_section_vma (objfile->obfd, osect->the_bfd_section);
|
vma = bfd_section_vma (objfile->obfd, osect->the_bfd_section);
|
||||||
lma = bfd_section_lma (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);
|
size = bfd_get_section_size (osect->the_bfd_section);
|
||||||
name = bfd_section_name (objfile->obfd, osect->the_bfd_section);
|
name = bfd_section_name (objfile->obfd, osect->the_bfd_section);
|
||||||
|
|
||||||
printf_filtered ("Section %s, loaded at ", name);
|
printf_filtered ("Section %s, loaded at ", name);
|
||||||
fputs_filtered (paddress (gdbarch, lma), gdb_stdout);
|
fputs_filtered (paddress (gdbarch, lma), gdb_stdout);
|
||||||
puts_filtered (" - ");
|
puts_filtered (" - ");
|
||||||
fputs_filtered (paddress (gdbarch, lma + size), gdb_stdout);
|
fputs_filtered (paddress (gdbarch, lma + size), gdb_stdout);
|
||||||
printf_filtered (", mapped at ");
|
printf_filtered (", mapped at ");
|
||||||
fputs_filtered (paddress (gdbarch, vma), gdb_stdout);
|
fputs_filtered (paddress (gdbarch, vma), gdb_stdout);
|
||||||
puts_filtered (" - ");
|
puts_filtered (" - ");
|
||||||
fputs_filtered (paddress (gdbarch, vma + size), gdb_stdout);
|
fputs_filtered (paddress (gdbarch, vma + size), gdb_stdout);
|
||||||
puts_filtered ("\n");
|
puts_filtered ("\n");
|
||||||
|
|
||||||
nmapped++;
|
nmapped++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (nmapped == 0)
|
if (nmapped == 0)
|
||||||
printf_filtered (_("No sections are mapped.\n"));
|
printf_filtered (_("No sections are mapped.\n"));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue