Re: Creating Assembly Code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Sep 23, 2001 at 08:12:06AM +0200, Tinga Shilo wrote:

> I have an oops output that I'd like to understand.
> The oops output shows something like MyFunc+34/78
> The ksymoops man page explains the "34" and "78" properly.
> 
> How can I see exactly where in my code this is ?
> I want to see my source code along with the assembler code
> 
> After some digging, I added in my Makefile the following lines
>     %.s: %.c
>      $(CC) $(CPPFLAGS) $(CFLAGS) -g -S $^
> 
>     %.x: %.s
>      as -a $^ > $@

I assume 34 is the byte offset in the machine code, in that case, you can either
use objdump on the file, or something like addr2line on the elf object file is
useful. Personally, I'd just ndisasm it, as that's the best dissassembler I know
about

> That almost does it, but not quite.
> What am I missing ?
> Is there a better way to produce this output ?
> BTW: Which line in the source code should be considered as the base for
> "+34" ?

Usially for me, knowing the function is enough to find the bug, but addr2line
can be useful.

-- 

Mark Zealey (aka JALH on irc.openprojects.net: #zealos and many more)
mark@itsolve.co.uk

UL++++>$ G!>(GCM/GCS/GS/GM) dpu? s:-@ a16! C++++>$ P++++>+++++$ L+++>+++++$
!E---? W+++>$ N- !o? !w--- O? !M? !V? !PS !PE--@ PGP+? r++ !t---?@ !X---?
!R- b+ !tv b+ DI+ D+? G+++ e>+++++ !h++* r!-- y--

(www.geekcode.com)
-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux