[Mono-bugs] [Bug 510031] New: stepping into a native code which links against libs without .bss or .text sections causes error and prevents debugging.

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Jun 4 12:40:35 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=510031


           Summary: stepping into a native code which links against libs
                    without .bss or .text sections causes error and
                    prevents debugging.
    Classification: Mono
           Product: Mono: Debugger
           Version: SVN
          Platform: x86
        OS/Version: Ubuntu
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: backend
        AssignedTo: martin at novell.com
        ReportedBy: tom_hindle at sil.org
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.10)
Gecko/2009042523 Ubuntu/9.04 (jaunty) Firefox/3.0.10

For example libicudata.so.38.1 on my system:

>:/usr/lib$ readelf libicudata.so.38.1 -S

Section Headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf
Al
  [ 0]                   NULL            00000000 000000 000000 00      0   0 
0
  [ 1] .hash             HASH            000000d4 0000d4 000028 04   A  3   0 
4
  [ 2] .gnu.hash         GNU_HASH        000000fc 0000fc 000030 04   A  3   0 
4
  [ 3] .dynsym           DYNSYM          0000012c 00012c 000050 10   A  4   1 
4
  [ 4] .dynstr           STRTAB          0000017c 00017c 000036 00   A  0   0 
1
  [ 5] .rodata           PROGBITS        000001b8 0001b8 ad52a0 00   A  0   0 
8
  [ 6] .dynamic          DYNAMIC         00ad6f84 ad5f84 000070 08  WA  4   0 
4
  [ 7] .got.plt          PROGBITS        00ad6ff4 ad5ff4 00000c 04  WA  0   0 
4
  [ 8] .gnu_debuglink    PROGBITS        00000000 ad6000 000018 00      0   0 
1
  [ 9] .shstrtab         STRTAB          00000000 ad6018 00004e 00      0   0 
1

Contains no .bss or .text sections.

This is not an issue with stepping into libicudata.so (as it contains no .text
;) )

but if I attempt to step into (or just run from the debugger) any native code
that links against libicudata.so then debugging fails as it "Can't find bfd
section"


We fixed this by changing backend/arch/Bfd.cs:

 Section text = GetSectionByName (".text", true);
-                                       Section bss = GetSectionByName (".bss",
true);
-
-                                       if (!base_address.IsNull)


+                                       Section text = GetSectionByName
(".text", false);
+                                       Section bss = GetSectionByName (".bss",
false);
+
+                                       if (text != null && bss != null) {
+                                               if (!base_address.IsNull)


Which seems to work, but not sure if its correct.


Reproducible: Always

Steps to Reproduce:
1.
2.
3.

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list