וַ֠יָּבֹא אֶל־גִּדְר֨וֹת הַצֹּ֤אן עַל־הַדֶּ֙רֶךְ֙ וְשָׁ֣ם מְעָרָ֔ה וַיָּבֹ֥א שָׁא֖וּל לְהָסֵ֣ךְ אֶת־רַגְלָ֑יו וְדָוִד֙ וַאֲנָשָׁ֔יו בְּיַרְכְּתֵ֥י הַמְּעָרָ֖ה יֹשְׁבִֽים׃
I przybył do zagród owczych przy drodze. A była tam jaskinia, do której wszedł, aby załatwić potrzebę, podczas gdy Dawid wraz z ludźmi swymi w głębi jaskini przebywał.
Rashi
according to my righteousness that I did not slay him when I sliced off the skirt of his coat. [Obviously, Rashi explains verses 8-17 as referring to Israel’s departure from Egypt. Only in verse 17 does he suggest the explanation that David refers to his own experiences.]
Metzudat Zion
It is a euphemism for reliving himself as an Samuel 1:24:3 "And Saul came to relive himself." Its named this based on the way that he is sitting down and facing. To shut in and to cover his legs because of modesty.