public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug cli/12444] New: disassemble /m errors on inlined code?
@ 2011-01-26 19:42 mjw at redhat dot com
  2011-01-26 19:50 ` [Bug cli/12444] " mjw at redhat dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: mjw at redhat dot com @ 2011-01-26 19:42 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=12444

           Summary: disassemble /m errors on inlined code?
           Product: gdb
           Version: archer
            Status: NEW
          Severity: normal
          Priority: P2
         Component: cli
        AssignedTo: unassigned@sourceware.org
        ReportedBy: mjw@redhat.com


Currently debugging, so not much details, but while trying to disassemble with
source line numbers of a large c++ method with inlined code (which is why I
wanted to see the disassembly with source lines) I got:

(gdb) disassemble /m
Dump of assembler code for function
copier<elfutils::dwarf_edit>::pending_entry::final(copier<elfutils::dwarf_edit>*,
Dwarf_Off, Dwarf_Off):
Line number 0 out of range; /home/mark/src/elfutils/libdw/c++/output-values.cc
has 85 lines.

Will try to get a simpler testcase if I find the time.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug cli/12444] disassemble /m errors on inlined code?
  2011-01-26 19:42 [Bug cli/12444] New: disassemble /m errors on inlined code? mjw at redhat dot com
@ 2011-01-26 19:50 ` mjw at redhat dot com
  2011-10-10 12:30 ` aburgess at broadcom dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: mjw at redhat dot com @ 2011-01-26 19:50 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=12444

--- Comment #1 from Mark Wielaard <mjw at redhat dot com> 2011-01-26 19:50:00 UTC ---
Uploaded the binary here:
http://fedorapeople.org/~mjw/dwarf_edit_output

It was generated from the elfutils project (dwarf git branch):
http://git.fedorahosted.org/git/?p=elfutils.git

$ gdb dwarf_edit_output 
GNU gdb (GDB) Fedora (7.2-36.fc14)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /tmp/dwarf_edit_output...done.
(gdb) (gdb) disassemble /m 0x00000000004bd3c4
Dump of assembler code for function
copier<elfutils::dwarf_edit>::pending_entry::final(copier<elfutils::dwarf_edit>*,
Dwarf_Off, Dwarf_Off):
Line number 0 out of range; /home/mark/src/elfutils/libdw/c++/output-values.cc
has 85 lines.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug cli/12444] disassemble /m errors on inlined code?
  2011-01-26 19:42 [Bug cli/12444] New: disassemble /m errors on inlined code? mjw at redhat dot com
  2011-01-26 19:50 ` [Bug cli/12444] " mjw at redhat dot com
@ 2011-10-10 12:30 ` aburgess at broadcom dot com
  2011-10-10 12:43 ` aburgess at broadcom dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: aburgess at broadcom dot com @ 2011-10-10 12:30 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=12444

--- Comment #2 from Andrew Burgess <aburgess at broadcom dot com> 2011-10-10 12:30:01 UTC ---
Created attachment 5970
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5970
Simple example of this issue

I also ran into this issue, though my example is not an inline function I
believe it's the same cause.
I've attached merged-test.tar.bz2, which contains the test, to run just,

$ tar -xjvf merged-test.tar.bz2
$ cd merged-test
$ make test
Testing merged files...
gdb -x cmds.gdb merged.x
GNU gdb (GDB) 7.1-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from
/home/andrew/merge-file-issue2/merged-test/merged.x...done.
+disassemble /m main
Dump of assembler code for function main:
3    {
   0x080483b4 <+0>:    push   %ebp
   0x080483b5 <+1>:    mov    %esp,%ebp
   0x080483b7 <+3>:    and    $0xfffffff0,%esp

4      return function ();
   0x080483ba <+6>:    call   0x80483c3 <function>

5    }
   0x080483bf <+11>:    mov    %ebp,%esp
   0x080483c1 <+13>:    pop    %ebp
   0x080483c2 <+14>:    ret    

End of assembler dump.
+disassemble /m function
Dump of assembler code for function function:
/home/andrew/merge-file-issue2/merged-test/cmds.gdb:4: Error in sourced command
file:
Line number 0 out of range; foo.c has 7 lines.
(gdb)

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug cli/12444] disassemble /m errors on inlined code?
  2011-01-26 19:42 [Bug cli/12444] New: disassemble /m errors on inlined code? mjw at redhat dot com
  2011-01-26 19:50 ` [Bug cli/12444] " mjw at redhat dot com
  2011-10-10 12:30 ` aburgess at broadcom dot com
@ 2011-10-10 12:43 ` aburgess at broadcom dot com
  2013-10-24  4:15 ` a3at.mail at gmail dot com
  2015-08-15  4:53 ` xdje42 at gmail dot com
  4 siblings, 0 replies; 6+ messages in thread
From: aburgess at broadcom dot com @ 2011-10-10 12:43 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=12444

--- Comment #3 from Andrew Burgess <aburgess at broadcom dot com> 2011-10-10 12:42:43 UTC ---
Created attachment 5971
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5971
Another example of this issue.

I have another test that is failing I believe for the same underlying cause,
though the failure is slightly different in this case. In this test a single
merged.c file includes foo.c and bar.c. If I try to disassemble with source
code functions from foo.c or bar.c then no source lines are found/printed.

To run the test,

$ tar -xjvf merged-test-2.tar.bz2
$ cd merged-test-2
$ make test
Testing merged files...
gdb -x cmds.gdb merged.x
GNU gdb (GDB) 7.1-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from
/home/andrew/merge-file-issue/merged-test-2/merged.x...done.
+disassemble /m main
Dump of assembler code for function main:
   0x080483b4 <+0>:    push   %ebp
   0x080483b5 <+1>:    mov    %esp,%ebp
   0x080483b7 <+3>:    and    $0xfffffff0,%esp
   0x080483ba <+6>:    call   0x80483c3 <function>
   0x080483bf <+11>:    mov    %ebp,%esp
   0x080483c1 <+13>:    pop    %ebp
   0x080483c2 <+14>:    ret    
End of assembler dump.
+disassemble /m function
Dump of assembler code for function function:
   0x080483c3 <+0>:    push   %ebp
   0x080483c4 <+1>:    mov    %esp,%ebp
   0x080483c6 <+3>:    mov    $0x5,%eax
   0x080483cb <+8>:    pop    %ebp
   0x080483cc <+9>:    ret    
End of assembler dump.
+quit
Testing unmerged files...
gdb -x cmds.gdb unmerged.x
GNU gdb (GDB) 7.1-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from
/home/andrew/merge-file-issue/merged-test-2/unmerged.x...done.
+disassemble /m main
Dump of assembler code for function main:
3    {
   0x080483c0 <+0>:    push   %ebp
   0x080483c1 <+1>:    mov    %esp,%ebp
   0x080483c3 <+3>:    and    $0xfffffff0,%esp

4      return function ();
   0x080483c6 <+6>:    call   0x80483b4 <function>

5    }
   0x080483cb <+11>:    mov    %ebp,%esp
   0x080483cd <+13>:    pop    %ebp
   0x080483ce <+14>:    ret    

End of assembler dump.
+disassemble /m function
Dump of assembler code for function function:
3    {
   0x080483b4 <+0>:    push   %ebp
   0x080483b5 <+1>:    mov    %esp,%ebp

4      return 5;
   0x080483b7 <+3>:    mov    $0x5,%eax

5    }
   0x080483bc <+8>:    pop    %ebp
   0x080483bd <+9>:    ret    

End of assembler dump.
+quit


In the first case ("Testing merged files...") the disassembly for "main" and
"function" contain no source lines. In the second case ("Testing unmerged
files...") the disassembly for "main" and "function" do contain the source
lines.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug cli/12444] disassemble /m errors on inlined code?
  2011-01-26 19:42 [Bug cli/12444] New: disassemble /m errors on inlined code? mjw at redhat dot com
                   ` (2 preceding siblings ...)
  2011-10-10 12:43 ` aburgess at broadcom dot com
@ 2013-10-24  4:15 ` a3at.mail at gmail dot com
  2015-08-15  4:53 ` xdje42 at gmail dot com
  4 siblings, 0 replies; 6+ messages in thread
From: a3at.mail at gmail dot com @ 2013-10-24  4:15 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=12444

Azat <a3at.mail at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |a3at.mail at gmail dot com

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug cli/12444] disassemble /m errors on inlined code?
  2011-01-26 19:42 [Bug cli/12444] New: disassemble /m errors on inlined code? mjw at redhat dot com
                   ` (3 preceding siblings ...)
  2013-10-24  4:15 ` a3at.mail at gmail dot com
@ 2015-08-15  4:53 ` xdje42 at gmail dot com
  4 siblings, 0 replies; 6+ messages in thread
From: xdje42 at gmail dot com @ 2015-08-15  4:53 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=12444

Doug Evans <xdje42 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |xdje42 at gmail dot com
         Resolution|---                         |FIXED

--- Comment #4 from Doug Evans <xdje42 at gmail dot com> ---
I tested this with trunk, and didn't see the bug, so I'm guessing it's fixed
now.
I don't know which patch fixed it.

[Which isn't to say /m is useful with inlined code,
just that "make test" worked for me.]

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-08-15  4:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-26 19:42 [Bug cli/12444] New: disassemble /m errors on inlined code? mjw at redhat dot com
2011-01-26 19:50 ` [Bug cli/12444] " mjw at redhat dot com
2011-10-10 12:30 ` aburgess at broadcom dot com
2011-10-10 12:43 ` aburgess at broadcom dot com
2013-10-24  4:15 ` a3at.mail at gmail dot com
2015-08-15  4:53 ` xdje42 at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).