When you call the `SBTarget::ReadInstructions` with flavor from lldb crashes. This is because the wrong order of the `DisassemblyBytes` constructor this fixes that --------- Signed-off-by: Ebuka Ezike <yerimyah1@gmail.com>
21 lines
462 B
C
21 lines
462 B
C
|
|
// This simple program is to test the lldb Python API SBTarget ReadInstruction
|
|
// function.
|
|
//
|
|
// When the target is create we get all the instructions using the intel
|
|
// flavor and see if it is correct.
|
|
|
|
int test_add(int a, int b);
|
|
|
|
__asm__("test_add:\n"
|
|
" movl %edi, %eax\n"
|
|
" addl %esi, %eax\n"
|
|
" ret \n");
|
|
|
|
int main(int argc, char **argv) {
|
|
int a = 10;
|
|
int b = 20;
|
|
int result = test_add(a, b);
|
|
|
|
return 0;
|
|
} |