Opened 5 years ago

Last modified 2 years ago

#11596 assigned bug

Debugger: no disassembly for functions written in assembly

Reported by: jua Owned by: anevilyak
Priority: normal Milestone: R1
Component: Applications/Debugger Version: R1/Development
Keywords: Cc: bonefish
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

Debugger doesn't show disassembly when stepping from C code into a function written in assembly, the source view simply goes blank. The attached example program, which calls a useless little assembly function, can be used to reproduce it.

Attachments (1)

dbg-asm-test.zip (7.8 KB ) - added by jua 5 years ago.

Download all attachments as: .zip

Change History (6)

by jua, 5 years ago

Attachment: dbg-asm-test.zip added

comment:1 by anevilyak, 5 years ago

Owner: set to anevilyak
Status: newassigned

comment:2 by anevilyak, 5 years ago

Cc: bonefish added

There seems to be something going on in the debug APIs as far as this one is concerned. The debug symbol iterator never actually returns that particular symbol, though it returns all the others listed by objdump. I'm not seeing anything unusual about it though, so I'm a bit puzzled as to what's going on there. Will dig into it further, but in the meantime, ideas welcome.

comment:3 by anevilyak, 5 years ago

Found the reason:

00000850 g .text 00000000 assembly_function

The symbol isn't actually flagged as a function in this case. Consequently, NextSymbol() skips it. Not sure of a good way around that though.

comment:4 by jua, 5 years ago

Indeed, setting the symbol type to function and specifying a size via NASM ELF-specific directives makes it work. So it would be reasonable to mark this bug as invalid (although it works in gdb, so the question would be, does it make sense to be more tolerant about symbols in this case).

comment:5 by pulkomandy, 2 years ago

I have a similar problem with code generated by JIT in WebKit. I suspect there is no symbol at all in that case, but it should still be possible to disassemble the code.

26MB core file: http://pulkomandy.tk/drop/core_jit.xz

Note: See TracTickets for help on using tickets.