I need to add a lot of listing environments to a report, and I want to have the numbering of the listing captions to follow the same structure as the captions of figures or tables (eg Listing 1.1, Listing 1.2, Listing 2.1) rather than the current structure, which just increases the number by one for each added listing.
I'm not sure how necessary a MWE is for a (seemingly) simple question like this, but below there is one:
\documentclass[]{article}
\usepackage{listings}
\begin{document}
\section{Section 1}
\begin{lstlisting}[caption = CAPTION., captionpos = b]
CODE
\end{lstlisting} % I want this to say Listing 1.1, says Listing 1
\begin{lstlisting}[caption = CAPTION., captionpos = b]
CODE
\end{lstlisting} % I want this to say Listing 1.2, says Listing 2
\section{Section 2}
\begin{lstlisting}[caption = CAPTION., captionpos = b]
CODE
\end{lstlisting} % I want this to say Listing 2.1, says Listing 3
\end{document}

