Post AVjDWk0ia2gmE3u892 by crc@toot.forth.works
 (DIR) More posts by crc@toot.forth.works
 (DIR) Post #AViqz9nvyWY7O1VPBQ by crc@toot.forth.works
       2023-05-16T18:18:57.487391Z
       
       0 likes, 2 repeats
       
       #FreeBSD #amd64 #assembly I've spent a couple of hours now and am quite lost on trying to debug an amd64 assembly program under FreeBSD.I ported it from Linux to OpenBSD. Then made the relevant adaptions to the system calls for FreeBSD, and when I try to run it it just exits.But if I run it under truss(1) to verify the system calls it works fine(*1). I've not been able to figure out why it works under truss, but not when run directly.I've reviewed the source, double checked all the system calls, and tried single stepping for about an hour (it's a vm for a tiny virtual cpu; it's not practical to single step indefinitely). I'm a little constrained since I'm not very familiar with lldb, and I can't get gdb to run at present (*2).If anyone has any suggestions on what to try, I'd appreciate them.(*1) there is an issue with the command line processing, but I bypassed that until the rest is working.(*2) I updated my packages yesterday and installed gdb, but running it gives only "ld-elf.so.1: Undefined symbol "rl_eof_found" referenced from COPY relocation in /usr/local/bin/gdb"(*3) a source snapshot w/makefile is at https://forth.works/temp/konilo-freebsd.tar.gz if anyone has time to take a look.
       
 (DIR) Post #AVixSpJBLJTIEQeUnA by zbeeble@nojack.easydns.ca
       2023-05-16T20:47:58Z
       
       0 likes, 0 repeats
       
       @crc I'd be willing to help... but forth.works refuses to connect to me, so I can't.
       
 (DIR) Post #AVixSqUCxnsxsuoocK by crc@toot.forth.works
       2023-05-16T20:51:06.607696Z
       
       0 likes, 0 repeats
       
       @zbeeble I've run into that with a couple of ISPs; not sure why. I uploaded a copy to a different server at http://forthworks.com/temp/konilo-freebsd.tar.gz which might work better.
       
 (DIR) Post #AVixbeV8tP3ZJvSGsS by yrabbit@mastodon.sdf.org
       2023-05-16T20:45:05Z
       
       0 likes, 0 repeats
       
       @crc Most useless answer: there is nothing wrong with your program, it works fine (?) both by itself and in gdb, but under #DragonFlyBSD
       
 (DIR) Post #AVixbgkSXQUsI0dX1s by crc@toot.forth.works
       2023-05-16T20:52:37.178935Z
       
       0 likes, 0 repeats
       
       @yrabbit Thanks! I hadn't had a chance to setup a #DragonFlyBSD system yet. I'm glad to know it's working there.
       
 (DIR) Post #AVjDTHb7lJ3rEiHfXc by crc@toot.forth.works
       2023-05-16T23:50:14.034210Z
       
       0 likes, 0 repeats
       
       An update: it's working now (other than command line processing, which I'll look at tomorrow).I had to add code to save/restore r8, r9, r10, and rdx when performing the syscalls.
       
 (DIR) Post #AVjDWk0ia2gmE3u892 by crc@toot.forth.works
       2023-05-16T23:50:54.598647Z
       
       0 likes, 0 repeats
       
       An update: it's working now (other than command line processing, which I'll look at tomorrow).I had to add code to save/restore r8, r9, r10, and rdx when performing the syscalls.
       
 (DIR) Post #AVjE1ckHdqP0fdwXtg by millihertz@oldbytes.space
       2023-05-16T23:53:01Z
       
       0 likes, 0 repeats
       
       @crc gah! asm-level heisenbugs!segfaulting because of a misprediction...?
       
 (DIR) Post #AVjE1dhU5jl1dFdpAm by crc@toot.forth.works
       2023-05-16T23:56:36.192640Z
       
       0 likes, 0 repeats
       
       @millihertz Maybe. I'll have my son help me write a bunch of things to test this much more completely.