Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Why do you think so? I haven't tried to build it on OSX but according to GIT the last use of this function was removed by Re-landing IPv6 support for LLDB Host.
lldb/tools/debugserver/source/RNBSocket.cpp | ||
---|---|---|
37 | `in |
The file is part of debugserver which is Darwin exclusive and is also only compiled/used when you're on Darwin. It's also kind of its own thing: it isn't using LLVM libraries such as ADT and we usually leave it out of larger refactorings because it's kind of in "maintenance-only" mode IIRC.
Anyway, this patch is probably fine but I added Jason as a reviewer because he knows the debugserver best.
I still do not understand what code can use this function on OSX and on OSX I build with -DLLDB_USE_SYSTEM_DEBUGSERVER=ON which probably won't build the new lldb-server then.
Besides that IMO @serge-sans-paille may not need to patch it when it is OSX-only function.
lldb/tools/debugserver/source/RNBSocket.cpp | ||
---|---|---|
37 | Here the prototype does not permit IPv6. | |
40 | This is redundant with getaddrinfo. | |
48 | This is redundant with getaddrinfo. | |
56 | Here it should use ((sockaddr_in *)addr->ai_addr)->sin_addr after verifying it is an IPv4 address - instead of the inet_ntoa+inet_pton calls. |
We build both lldb-server and debugserver on Darwin but we're only using debugserver by default there. And LLDB_USE_SYSTEM_DEBUGSERVER just makes us copy the (codesigned) system debugserver into our build directory instead of building our own (but we still build lldb-server with that option IIRC).
lldb/tools/debugserver/source/RNBSocket.cpp | ||
---|---|---|
44 | Here it should use AI_PASSIVE instead. |
On OSX with -DLLDB_USE_SYSTEM_DEBUGSERVER=OFF I have built:
-rwxr-xr-x 1 macbook staff 689200 Jun 24 19:10 bin/debugserver
It uses lldb/tools/debugserver/source/RNBSocket.cpp (if I mess up the source file it does not build). The build does not need this ResolveIPV4HostName function.
So unless there is some more OSX magic the function can be removed.
Sorry, I thought you meant with "this function" gethostbyname not ResolveIPV4HostName. You're right, this is indeed unused and it's also used in our downstream repo I think, so let's get rid of it. Good catch!
`in