Skip to content

Commit

Permalink
Add #emit line numbers to debug info
Browse files Browse the repository at this point in the history
If you consider the following code:

1 #include <a_samp>
2
3 main() {
4 	new x;
5 	#emit halt 1
6 	#emit halt 2
7 	#emit halt 3
8 	return 1;
9 }

This is what pawndisasm would output before:

00000008  proc
1.pwn:3
0000000c  break
1.pwn:4
00000010  break
00000014  stack fffffffc
0000001c  zero.pri
00000020  stor.s.pri fffffffc
00000028  halt 00000001
00000030  halt 00000002
00000038  halt 00000003
1.pwn:8
00000040  break
00000044  const.pri 00000001
0000004c  stack 00000004
00000054  retn

Now it outputs this:

00000008  proc
1.pwn:3
0000000c  break
1.pwn:4
00000010  break
00000014  stack fffffffc
0000001c  zero.pri
00000020  stor.s.pri fffffffc
1.pwn:5
00000028  halt 00000001
1.pwn:6
00000030  halt 00000002
1.pwn:7
00000038  halt 00000003
1.pwn:8
00000040  break
00000044  const.pri 00000001
0000004c  stack 00000004
00000054  retn
  • Loading branch information
Zeex committed Sep 1, 2014
1 parent b1fb273 commit e2bbe8e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions source/compiler/sc2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1232,6 +1232,7 @@ static int command(void)
/* write opcode to output file */
char name[40];
int i;
insert_dbgline(fline);
while (*lptr<=' ' && *lptr!='\0')
lptr++;
for (i=0; i<40 && (isalpha(*lptr) || *lptr=='.'); i++,lptr++)
Expand Down

0 comments on commit e2bbe8e

Please sign in to comment.