unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Following Assembly Language Step-by-Step using emacs
@ 2013-07-06 23:08 Robert Webb Jr
  0 siblings, 0 replies; 3+ messages in thread
From: Robert Webb Jr @ 2013-07-06 23:08 UTC (permalink / raw)
  To: help-gnu-emacs

Hi.
Thanks for taking the time to look at my question.
I am new to linux and new to programming.
The text I am learning assembly (and introductory programming) from uses
kdb and insight.
I am using Ubuntu 12.04 LTS. kdb was not working right and Insight is
extinct. So after a great deal of tail-chasing I discovered
emacs23.
After another round of chasing tail, I got emacs into many-windows mode so
that I can follow along with the text.
Except for one little thing.
The text says that when debugging with kdb, there should be an arrow in the
fringe area of the source code that indicates which line is about to be
executed.
From what I've read, I think emacs should do this too - but all I can get
is the hex memory address of the line being executed (I think) in the gud
buffer (upper left-hand window).
So basically, I don't know exactly where I'm at in the source code when I'm
stepping through the instructions.
Am I supposed to just count the hex addresses in the gud buffer and keep
track that way?
Seems not too smart.
Here is the program that I'm debugging:

;  Executable name : EATSYSCALL
;  Version         : 1.0
;  Created date    : 1/7/2009
;  Last update     : 2/18/2009
;  Author          : Jeff Duntemann
;  Description     : A simple program in assembly for Linux, using NASM
2.05,
;    demonstrating the use of Linux INT 80H syscalls to display text.
;
;  Build using these commands:
;    nasm -f elf -g -F stabs eatsyscall.asm
;    ld -o eatsyscall eatsyscall.o
;

SECTION .data            ; Section containing initialised data

    EatMsg: db "Eat at Joe's!",10
    EatLen: equ $-EatMsg

SECTION .bss            ; Section containing uninitialized data

SECTION .text            ; Section containing code

global     _start            ; Linker needs this to find the entry point!

_start:
    nop            ; This no-op keeps gdb happy...
    mov eax,4        ; Specify sys_write call
    mov ebx,1        ; Specify File Descriptor 1: Standard Output
    mov ecx,EatMsg        ; Pass offset of the message
    mov edx,EatLen        ; Pass the length of the message
    int 80H            ; Make kernel call
    MOV eax,1        ; Code for Exit Syscall
    mov ebx,0        ; Return a code of zero
    int 80H            ; Make kernel call


I would greatly appreciate any help; I sure it's something simple, but it
might as well be rocket science to me at this point.
Have a nice day.

-- 
The Great Secret?
"It is, and It isn't".
LVX
5107319089


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

* Re: Following Assembly Language Step-by-Step using emacs
       [not found] <mailman.465.1373160835.12400.help-gnu-emacs@gnu.org>
@ 2013-07-07  3:48 ` Rustom Mody
  2013-07-08 13:40   ` Rustom Mody
  0 siblings, 1 reply; 3+ messages in thread
From: Rustom Mody @ 2013-07-07  3:48 UTC (permalink / raw)
  To: help-gnu-emacs

Not really an expert in this...
1. Can you try without the '-F stabs' ?
2. Can you try without emacs ? ie at the shell (yeah you will need to know a couple of commands to try) -- look at help running breakpoints for starters


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

* Re: Following Assembly Language Step-by-Step using emacs
  2013-07-07  3:48 ` Rustom Mody
@ 2013-07-08 13:40   ` Rustom Mody
  0 siblings, 0 replies; 3+ messages in thread
From: Rustom Mody @ 2013-07-08 13:40 UTC (permalink / raw)
  To: help-gnu-emacs

On Sunday, July 7, 2013 9:18:40 AM UTC+5:30, Rustom Mody wrote:
> Not really an expert in this...
> 1. Can you try without the '-F stabs' ?
> 2. Can you try without emacs ? ie at the shell (yeah you will need to know a 
> couple of commands to try) -- look at help running breakpoints for starters

Got a mail from OP saying that changing in the nasm command-line
'-F stabs' to '-F dwarf'
solved the problem

[For anyone else who finds this]


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

end of thread, other threads:[~2013-07-08 13:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-06 23:08 Following Assembly Language Step-by-Step using emacs Robert Webb Jr
     [not found] <mailman.465.1373160835.12400.help-gnu-emacs@gnu.org>
2013-07-07  3:48 ` Rustom Mody
2013-07-08 13:40   ` Rustom Mody

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).