gdb says that "disassemble /m" is not a valid command

View: New views
4 Messages — Rating Filter:   Alert me  

gdb says that "disassemble /m" is not a valid command

by Nikos Chantziaras :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm trying to disassemble a C++ function with gdb 6.8.  I've in the
manual at:

   http://sourceware.org/gdb/current/onlinedocs/gdb_9.html#SEC64

that "disassemble /m" should also print the source line together with
the assembly dump.  However, when actually trying it out I get:

   (gdb) disassemble /m
   A syntax error in expression, near `/m'.

Is the documentation out of date?  How do I get source and assembly at
the same time?  "help disassemble" doesn't say anything about "/m" and
neither the gdb info pages.




Re: gdb says that "disassemble /m" is not a valid command

by Thomas Schwinge-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello!

On Wed, Aug 12, 2009 at 07:44:35PM +0300, Nikos Chantziaras wrote:
>   (gdb) disassemble /m
>   A syntax error in expression, near `/m'.
>
> Is the documentation out of date?  How do I get source and assembly at
> the same time?  "help disassemble" doesn't say anything about "/m" and
> neither the gdb info pages.

Your version of GDB is too old, or this feature is too new: it is
available since 2008-05-05 only, whereas GDB 6.8 has been released on
2008-03-27 already.

What you can use, outside of the debugger, is ``objdump -S''.


Regards,
 Thomas


signature.asc (198 bytes) Download Attachment

Re: gdb says that "disassemble /m" is not a valid command

by Nikos Chantziaras :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 08/14/2009 11:22 AM, Thomas Schwinge wrote:

> Hello!
>
> On Wed, Aug 12, 2009 at 07:44:35PM +0300, Nikos Chantziaras wrote:
>>    (gdb) disassemble /m
>>    A syntax error in expression, near `/m'.
>>
>> Is the documentation out of date?  How do I get source and assembly at
>> the same time?  "help disassemble" doesn't say anything about "/m" and
>> neither the gdb info pages.
>
> Your version of GDB is too old

6.8 is the latest release I can find on
http://www.gnu.org/software/gdb/download/




Re: gdb says that "disassemble /m" is not a valid command

by Thomas Schwinge-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello!

On Fri, Aug 14, 2009 at 05:53:16PM +0300, Nikos Chantziaras wrote:

> On 08/14/2009 11:22 AM, Thomas Schwinge wrote:
> >On Wed, Aug 12, 2009 at 07:44:35PM +0300, Nikos Chantziaras wrote:
> >>   (gdb) disassemble /m
> >>   A syntax error in expression, near `/m'.
> >>
> >>Is the documentation out of date?  How do I get source and assembly at
> >>the same time?  "help disassemble" doesn't say anything about "/m" and
> >>neither the gdb info pages.
> >
> >Your version of GDB is too old
>
> 6.8 is the latest release I can find on
> http://www.gnu.org/software/gdb/download/
This is correct, the new release has not yet been done.  If using the
last release, you should have a look at ``the documentation generated
from the last release'' -- see
<http://www.gnu.org/software/gdb/documentation/>.


Regards,
 Thomas


signature.asc (198 bytes) Download Attachment