Bastian
Bastian

Reputation: 63

next in .lldb init enters to assembly

I often have to reenter the same steps when debugging a program with lldb so I decided to put them into an .lldbinit file:

file main
b ft_printf
run
next

I should automatically load the file, set a breakpoint, run the program and go to the next line. Instead I get his output:

Current executable set to '/Users/baschnit/repos/42printf_new/easytest/main' (x86_64). Breakpoint 1: where = main`ft_printf + 312 at ft_printf_bonus.c:74:8, address = 0x0000000100002578 Process 33829 launched: '/Users/baschnit/repos/42printf_new/easytest/main' (x86_64) Process 33829 stopped

  • thread #1, queue = 'com.apple.main-thread', stop reason = instruction step over frame #0: 0x0000000100011025 dyld_dyld_start + 37 dyld_dyld_start: -> 0x100011025 <+37>: movq -0x8(%rbp), %rdi 0x100011029 <+41>: cmpq $0x0, %rdi 0x10001102d <+45>: jne 0x10001103f ; <+63> 0x10001102f <+47>: movq %rbp, %rsp Target 0: (main) stopped. Process 33829 stopped
  • thread #1, queue = 'com.apple.main-thread', stop reason = instruction step over frame #0: 0x0000000100011025 dyld_dyld_start + 37 dyld_dyld_start: -> 0x100011025 <+37>: movq -0x8(%rbp), %rdi 0x100011029 <+41>: cmpq $0x0, %rdi 0x10001102d <+45>: jne 0x10001103f ; <+63> 0x10001102f <+47>: movq %rbp, %rsp Target 0: (main) stopped.

Why does it show me the assembly code and not the line info?

When I set the config file to the following

file main
b ft_printf
run

and start lldb with lldb and enter next by hand, the output is the following:

Current executable set to '/Users/baschnit/repos/42printf_new/easytest/main' (x86_64). Breakpoint 1: where = main`ft_printf + 312 at ft_printf_bonus.c:74:8, address = 0x0000000100002578 Process 34414 launched: '/Users/baschnit/repos/42printf_new/easytest/main' (x86_64)

===== my ======= Process 34414 stopped

  • thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1 frame #0: 0x0000000100002578 main`ft_printf(format="%%") at ft_printf_bonus.c:74:8 71 int written_bytes; 72
    73 // printf("\nstart with format: %s\n", format); -> 74 if (!*format) 75 return (0); 76 specs = NULL; 77 get_specs_str_from_format_str(format, &specs); Target 0: (main) stopped.

How can I use the next command in the config file without seeing assembly code but the line info?

Upvotes: 1

Views: 15

Answers (0)

Related Questions