Yes, `set print elements unlimited` is the correct command to display the full string in GDB without truncation.
However, if you want this setting to persist across all your GDB sessions (make it "stick"), you need to add it to your GDB configuration file.
**Steps to make it permanent:**
1. Create or edit the `.gdbinit` file in your home directory:
nano ~/.gdbinit
2. Add these lines:
set print elements unlimited
set print repeats unlimited
3. Save and exit
Now every time you start GDB, these settings will be automatically applied.
**Additional useful tips:**
- `set print elements 0` is equivalent to unlimited
- To verify current setting: `show print elements`
- For project-specific settings, create a `.gdbinit` file in your project directory
**Security Note:** By default, GDB may not load local `.gdbinit` files for security reasons. To enable it, add this to your `~/.gdbinit`:
set auto-load safe-path /
Or for specific directories:
add-auto-load-safe-path /path/to/your/project
undefined