Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* "disassemble" shows code, but not with /m
@ 2014-03-19 17:50 Eli Zaretskii
  2014-03-19 18:45 ` Jan Kratochvil
  0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2014-03-19 17:50 UTC (permalink / raw)
  To: gdb

Did anyone bump into something like below with GDB 7.7?
SUBRP is an inline function defined on the header file lisp.h in
Emacs:

  INLINE bool
  SUBRP (Lisp_Object a)
  {
    return PSEUDOVECTORP (a, PVEC_SUBR);
  }


Trying to disassemble it, I get these results:

  (gdb) disassemble 0x10f3110,+30
  Dump of assembler code from 0x10f3110 to 0x10f312e:
     0x010f3110 <SUBRP+0>:        push   %ebp
     0x010f3111 <SUBRP+1>:        mov    %esp,%ebp
     0x010f3113 <SUBRP+3>:        sub    $0x8,%esp
     0x010f3116 <SUBRP+6>:        movl   $0xa,0x4(%esp)
     0x010f311e <SUBRP+14>:       mov    0x8(%ebp),%eax
     0x010f3121 <SUBRP+17>:       mov    %eax,(%esp)
     0x010f3124 <SUBRP+20>:       call   0x10f306f <PSEUDOVECTORP>
     0x010f3129 <SUBRP+25>:       leave
     0x010f312a <SUBRP+26>:       ret
     0x010f312b <COMPILEDP+0>:    push   %ebp
     0x010f312c <COMPILEDP+1>:    mov    %esp,%ebp
  End of assembler dump.
  (gdb) disassemble 0x10f3110
  Dump of assembler code for function SUBRP:
     0x010f3110 <+0>:     push   %ebp
     0x010f3111 <+1>:     mov    %esp,%ebp
     0x010f3113 <+3>:     sub    $0x8,%esp
     0x010f3116 <+6>:     movl   $0xa,0x4(%esp)
     0x010f311e <+14>:    mov    0x8(%ebp),%eax
     0x010f3121 <+17>:    mov    %eax,(%esp)
     0x010f3124 <+20>:    call   0x10f306f <PSEUDOVECTORP>
     0x010f3129 <+25>:    leave
     0x010f312a <+26>:    ret
  End of assembler dump.
  (gdb) disassemble 'lisp.h'::SUBRP
  Dump of assembler code for function SUBRP:
     0x010f3110 <+0>:     push   %ebp
     0x010f3111 <+1>:     mov    %esp,%ebp
     0x010f3113 <+3>:     sub    $0x8,%esp
     0x010f3116 <+6>:     movl   $0xa,0x4(%esp)
     0x010f311e <+14>:    mov    0x8(%ebp),%eax
     0x010f3121 <+17>:    mov    %eax,(%esp)
     0x010f3124 <+20>:    call   0x10f306f <PSEUDOVECTORP>
     0x010f3129 <+25>:    leave
     0x010f312a <+26>:    ret
  End of assembler dump.

But:

  (gdb) disassemble /m 0x10f3110
  Dump of assembler code for function SUBRP:
  End of assembler dump.
  (gdb) disassemble /m 0x10f3110,+30
  Dump of assembler code from 0x10f3110 to 0x10f312e:
  End of assembler dump.
  (gdb) disassemble /m 'lisp.h'::SUBRP
  Dump of assembler code for function SUBRP:
  End of assembler dump.
  (gdb)

IOW, the /m switch somehow inhibits the disassembly.  FWIW, using x/i
for the respective addresses shows the instructions just fine.

Is this a bug?


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

end of thread, other threads:[~2014-03-19 19:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-19 17:50 "disassemble" shows code, but not with /m Eli Zaretskii
2014-03-19 18:45 ` Jan Kratochvil
2014-03-19 19:04   ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox