1 | |
---|---|
2 | // This simple program is to test the lldb Python API SBTarget ReadInstruction |
3 | // function. |
4 | // |
5 | // When the target is create we get all the instructions using the intel |
6 | // flavor and see if it is correct. |
7 | |
8 | int test_add(int a, int b); |
9 | |
10 | __asm__("test_add:\n" |
11 | " movl %edi, %eax\n" |
12 | " addl %esi, %eax\n" |
13 | " ret \n"); |
14 | |
15 | int main(int argc, char **argv) { |
16 | int a = 10; |
17 | int b = 20; |
18 | int result = test_add(a, b); |
19 | |
20 | return 0; |
21 | } |