flat assembler
Message board for the users of flat assembler.

Index > Main > label table suggestion question

Author
Thread Post new topic Reply to topic
lazer1



Joined: 24 Jan 2006
Posts: 185
lazer1 03 Apr 2011, 00:44
Hi,

I have a question or suggestion, Very Happy

I noticed fasm has an -s option to output symbolic info but I dont know how to utilize that. Confused

my question is whether fasm can output a table of labels for debug.

for example if you divide by zero, then the interrupt handler tells you the instruction pointer, say its 124af3, but how do you find that in the
source code?

lets say the source code is:

Code:

use64
         org 124000h

a:
start:
         mov rax, rbx
         add rax, rcx
.x:   
.y:
        add rbx, rdx
        add rcx, rbx
        add rax, rbx
.z:    and rcx, rax
.t:     ret
abc:   db 5
         db 256 dup( 0 )
         dq 10
         dw 5
z:
    


then I would like fasm to output a table something like:

Code:
a:
start:
124000h:
124004h:
start.x:
start.y:
124008h:
12400ch:
124010h:
start.z:
124014h:
start.t:
124018h:
abc:
124019h
12401ah
12411ah
124122h
z:
124124h
    


here the output is that each time a label is reached,

the full version of the label is output, and

each time an instruction is output, the address of that is

output. For data, the labels are also output

and the points demarkated by db dq etc

and dup etc, the syntactic demarkation points.

ie not every byte, but the constructs. However

it would be ok just to have the labels and their addresses

for data. But I need the address of each instruction.

at the end of the output one last address is also output.




Then if I find that there is an error at 12400ch, I can

search the table for 12400ch, and then see that

its the second instruction after start.y and then locate

this in the source code.


can this be done, either now or in the future? Cool


because at the moment I have to insert extra labels,
echo the addresses, and gradually locate where the
problem is in the source code. The problem also is
that the echo code can change the addresses also! Sad

I'm running the code directly on x86 hardware without
intervening OS, thus I need a low level debug feature
such as the above.
Post 03 Apr 2011, 00:44
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20424
Location: In your JS exploiting you and your system
revolution 03 Apr 2011, 00:55
Post 03 Apr 2011, 00:55
View user's profile Send private message Visit poster's website Reply with quote
lazer1



Joined: 24 Jan 2006
Posts: 185
lazer1 03 Apr 2011, 16:05
revolution wrote:
See the sticky topic in this forum:

http://board.flatassembler.net/topic.php?t=9792

And specifically this post:

http://board.flatassembler.net/topic.php?p=89374#89374



ok, I'll have a study of this and return later with any further questions Smile


it is a central problem to locate in the source code where a particular address is, and it does need to be relative to the fasm syntax.

but its best if the format can be utilized directly, say manually,
Post 03 Apr 2011, 16:05
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.