The patch uses qfThreadID to get the thread IDs if qC packet is not supported by target.
Diff Detail
- Repository
- rL LLVM
Event Timeline
Any other OSs other than Linux have process IDs being the same as thread IDs? The code added should be properly made conditional based on linux and any other OSs where this holds true.
source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp | ||
---|---|---|
1462–1476 | The threads ID is not the same as a process ID on any Apple based OS. We would need make this check conditional based on the OSs that have thread IDs being the same as process IDs. Not sure if that is only linux? |
source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp | ||
---|---|---|
1462–1476 | We are connected to a bare-iron target (IASim in this case). We need to check whether the target OS is Unknown. |
That is fine for unknown or for any known OSs where the pid == tid for the main thread.
That seems good, except take out the use of auto in the first diff. We try not to use "auto" for trivially nameable types like lldb::pid_t. When you are declaring a variable where you would have to scratch your head more than twice to figure out how to write the type of the thing, then auto is a real help. But for simple types it doesn't offer any benefit and makes reading the code a little bit harder...
I don't see how passing the target architecture's OS helps here since you aren't checking it for linux or any of the other OS's where pid == tid. This arch is likely to be unset during many of these calls which makes the test just assume any time the OS is unknown it will just assume pid == tid.
source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp | ||
---|---|---|
1463–1465 | How does checking the "ostype" with unknown help us to determine if this is an OS where pid == tid? What if the user makes their target with: (lldb) target create --arch x86_64-pc-linux ... Then this code doesn't trigger? |
source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp | ||
---|---|---|
1463–1465 | In this case the target we are connected to is a bare-iron which does not support qC packet. Here pid == tid and only way to get this is using qfThreadID. If arch is likely to be unset during many of these calls then we need to find alternate way to implement this. |
Lets just not send the OS then since it is very unreliable when the target if first attaching or launching and just always back up to using qfThreadID if first qProcessInfo and then qC are not implemented. We need some way to get the pid, so lets just do it.
source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp | ||
---|---|---|
1101 | Revert this and don't send the OS, see main comment below. | |
1428 | Revert this and don't send the OS, see main comment below. | |
1464 | remove the ostype check, see main comment below. | |
source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h | ||
112 ↗ | (On Diff #31213) | Revert this and don't send the OS, see main comment below. |
source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | ||
761–762 ↗ | (On Diff #31213) | Revert this and don't send the OS, see main comment below. |
1016–1017 ↗ | (On Diff #31213) | Revert this and don't send the OS, see main comment below. |
2323–2324 ↗ | (On Diff #31213) | Revert this and don't send the OS, see main comment below. |
Revert this and don't send the OS, see main comment below.