I must be missing something. It's a pretty normal function. Just call it, then walk through the struct and get the value out. It's like 3 lines of code. Why is the debugger involved?
I suppose the one complication is you have to cast sockaddr to sockaddr_in but that's all documented
Seemed like a lot of work to not read the manual.
This short post documents tracking down the IP address location and value resolved by the getaddrinfo function call with the help of x64dbg.