我正在使用macOS 10.14的x86_64 Macbook上学习汇编语言。 nasm版本是2.14,而lldb版本是11.38.2。
我的源代码非常简单:
create table #tempStatus (EmpId int, intTime datetime, sStatus int)
insert into #tempStatus
values(1, '2018-05-26 08:44', 1),
(1, '2018-05-26 08:44', 2),
(2, '2018-05-28 08:44', 1),
(2, '2018-05-28 12:44', 2),
(1, '2018-05-21 08:44', 1),
(1, '2018-05-21 10:44', 2),
(2, '2018-05-23 08:44', 1),
(2, '2018-05-23 08:44', 2)
select EmpId, MIN(intTime) as intTime, MIN(intTime) as OutTime into #tempA from (
select EmpId, intTime, intTime as OutTime
from #tempStatus where sStatus = 1
)a
group by EmpId, intTime
select EmpId, MAX(outTime) as outTime into #tempB from(
select EmpId, intTime as outTime
from #tempStatus where sStatus = 2
)b
group by empId,outTime
select * from #tempA order by EmpId
drop table #tempA
drop table #tempB
DROP TABLE #tempStatus
我使用汇编该文件
SECTION .data
EatMsg: db "Hello World", 0x0a
EatLen: equ $-EatMsg
SECTION .bss
SECTION .text
global _start
_start:
nop
mov rax,0x2000004
mov rdi,1
mov rsi,EatMsg
mov rdx,EatLen
syscall
mov rax,0x2000001
mov rdi,0
syscall
但是当我使用lldb时:
nasm -f macho64 -F dwarf helloworld.asm
ld -e _start -no_pie -o helloworld helloworld.o -lSystem
它说:
lldb helloworld
(lldb)b helloworld.asm:16
我见过Unable to set breakpoints lldb和Is it possible to debug x64 assembly on Mac OS?,并尝试了这些答案(例如Breakpoint 1: no locations (pending).
WARNING: Unable to resolve breakpoint to any actual locations.
),但无济于事。