This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit] [patch] Fix .debug_macro NOBITS crash (PR 14494)


On Sun, 19 Aug 2012 02:41:23 +0200, Doug Evans wrote:
> On Sat, Aug 18, 2012 at 9:57 AM, Jan Kratochvil
> <jan.kratochvil@redhat.com> wrote:
> > [...]
> > gdb/
> > 2012-08-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
> >
> >         * dwarf2read.c (dwarf2_locate_sections): Move variable aflag here.
> >         Move the SEC_HAS_CONTENTS check here - for any NAMES use.
> >         (dwarf2_locate_sections) <eh_frame>: Move the variable and check from
> >         here.
[...]
> > +  if ((aflag & SEC_HAS_CONTENTS) == 0)
> > +    {
> > +      /* Such section is not usable for the purpose of NAMES.  */
> 
> Hi.
> Nit: "for the purpose of NAMES" doesn't read very well.
> How about just "Such section is not usable." ?
> After all, !SEC_HAS_CONTENTS, no further explanation is needed.

I think section can be and is used in some ways by GDB even if
!SEC_HAS_CONTENTS.  So I chose the "no further explanation is needed" option.


> Ok with me with the suggested comment change.

Checked in:
	http://sourceware.org/ml/gdb-cvs/2012-08/msg00198.html
	http://sourceware.org/ml/gdb-cvs/2012-08/msg00200.html
and for 7.5:
	http://sourceware.org/ml/gdb-cvs/2012-08/msg00199.html


Thanks,
Jan


http://sourceware.org/ml/gdb-cvs/2012-08/msg00198.html

--- src/gdb/ChangeLog	2012/08/27 08:57:59	1.14631
+++ src/gdb/ChangeLog	2012/08/27 16:37:39	1.14632
@@ -1,3 +1,10 @@
+2012-08-27  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	* dwarf2read.c (dwarf2_locate_sections): Move variable aflag here.
+	Move the SEC_HAS_CONTENTS check here - for any NAMES use.
+	(dwarf2_locate_sections) <eh_frame>: Move the variable and check from
+	here.
+
 2012-08-27  Wei-cheng Wang  <cole945@gmail.com>
 
 	* memattr.c (create_mem_region): Fix memory region overlapping
--- src/gdb/dwarf2read.c	2012/08/22 16:12:48	1.701
+++ src/gdb/dwarf2read.c	2012/08/27 16:37:45	1.702
@@ -1710,13 +1710,17 @@
 dwarf2_locate_sections (bfd *abfd, asection *sectp, void *vnames)
 {
   const struct dwarf2_debug_sections *names;
+  flagword aflag = bfd_get_section_flags (abfd, sectp);
 
   if (vnames == NULL)
     names = &dwarf2_elf_names;
   else
     names = (const struct dwarf2_debug_sections *) vnames;
 
-  if (section_is_p (sectp->name, &names->info))
+  if ((aflag & SEC_HAS_CONTENTS) == 0)
+    {
+    }
+  else if (section_is_p (sectp->name, &names->info))
     {
       dwarf2_per_objfile->info.asection = sectp;
       dwarf2_per_objfile->info.size = bfd_get_section_size (sectp);
@@ -1763,13 +1767,8 @@
     }
   else if (section_is_p (sectp->name, &names->eh_frame))
     {
-      flagword aflag = bfd_get_section_flags (abfd, sectp);
-
-      if (aflag & SEC_HAS_CONTENTS)
-        {
-	  dwarf2_per_objfile->eh_frame.asection = sectp;
-          dwarf2_per_objfile->eh_frame.size = bfd_get_section_size (sectp);
-        }
+      dwarf2_per_objfile->eh_frame.asection = sectp;
+      dwarf2_per_objfile->eh_frame.size = bfd_get_section_size (sectp);
     }
   else if (section_is_p (sectp->name, &names->ranges))
     {



http://sourceware.org/ml/gdb-cvs/2012-08/msg00200.html

--- src/gdb/ChangeLog	2012/08/27 16:37:39	1.14632
+++ src/gdb/ChangeLog	2012/08/27 16:43:26	1.14633
@@ -1,5 +1,6 @@
 2012-08-27  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
+	PR gdb/14494.
 	* dwarf2read.c (dwarf2_locate_sections): Move variable aflag here.
 	Move the SEC_HAS_CONTENTS check here - for any NAMES use.
 	(dwarf2_locate_sections) <eh_frame>: Move the variable and check from


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]