[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: assembly programming in Emacs how to
From: |
Ronnie Collinson |
Subject: |
Re: assembly programming in Emacs how to |
Date: |
Fri, 18 Mar 2011 21:50:22 +1300 |
Instead of decompiling to see the generated C code, you can tell GCC
to stop before assembling. gcc -S yourcfile.c, or use an option like
--save-temps to see all phases of compilation, and get the executable
On 3/15/11, Pascal J. Bourguignon <pjb@informatimago.com> wrote:
> 김태윤 <kty1104@gmail.com> writes:
>
>> assembly programming in Emacs how to?
>> I want Emacs to do following things
>
> 0. edit an assembler file.
>
> Just open a file with the .s extension, or add a comment on the first
> line with: -*- mode:asm -*-
>
>
>> 1. assembling
>
> M-x compile RET C-a C-k gcc -o pgm pgm.s RET
>
>> 2. run the just before made program inside Emacs
>
> That would depend on the kind of user interface your program uses, and
> whether you want to run it with debugging or not.
>
> Without debugging:
>
> - a daemon can be launched with:
>
> M-! pgm RET
>
> - a program with dumb terminal I/O (just read and write lines):
>
> M-x shell RET
> pgm RET
>
> - a program with sophisticated terminal I/O (ncurses):
>
> M-x term RET
> pgm RET
>
> M-x terminal-emulator RET
> pgm RET
>
> M-! xterm -e pgm & RET
>
> - a program with GUI:
>
> M-! pgm & RET
>
> See also
> http://groups.google.com/group/gnu.emacs.help/msg/458f28dae283b4da?hl=en
>
>
>
>> 3. debugging with watching flags and registers as like ollydbg or
>> softice
>
> With debugging:
>
> - a daemon, or a program with dumb terminal I/O (just read and write
> lines), or a program with GUI can be launched with:
>
> M-x shell RET
> gdb pgm RET
> run RET
>
>
> - a program with sophisticated terminal I/O (ncurses):
>
> M-x term RET
> gdb pgm RET
> run RET
>
> M-x terminal-emulator RET
> gdb pgm RET
> run RET
>
> M-! xterm -e gdb pgm & RET
> run RET
>
>
> There's also gud:
>
> M-x gud-gdb RET pgm RET
>
> which offers better integration between the debugger and emacs, but I'm
> not sure about the program I/O requirements.
>
>
>
>> 4. decompile executable file for see what assembly codes are made by c
>> but I don't know how to do this.
>
> You may use commands such as objdump, or otool or disasm.
>
>
> --
> __Pascal Bourguignon__ http://www.informatimago.com/
> A bad day in () is better than a good day in {}.
>