Re: GDB 17.1 / Linux setting limits for the debugged process?

Simon Marchi via Gdb <[email protected]> Mon, 26 Jan 2026 10:49:28 -0500
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>
On 1/26/26 9:08 AM, Basile Starynkevitch wrote:
> Hello all,
> 
> (this is motivated by https://github.com/RefPerSys/RefPerSys/issues/30 - a bug in a GPL licensed inference engine project coded in C++)
> 
> Using GDB 17.1 on an open source software compiled by GCC 16 snapshot (or latest GCC 15) on a Debian/Linux desktop (or laptop), 
> how can I set limits (in the https://man7.org/linux/man-pages/man2/getrlimit.2.html sense, for elapsed CPU time limit)
> on the debugged process, but not on the GDB 17.1 debugging process?

Try to set "prlimit" as the exec-wrapper:

(gdb) set exec-wrapper prlimit --cpu=1234
(gdb) run

Simon