Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Evan on March 14, 2024, 10:29:31 am

Title: Debugger - Memory dump
Post by: Evan on March 14, 2024, 10:29:31 am
Happy Code::Blocks user here running Linux Mint LMDE programming in C99:

When I use Memory dump, I have to type the memory address I want look at in the Memory dump window.

How can I copy/paste the memory address, from the Watch window to the Memory dump window?

Thanks in advance.

Title: Re: Debugger - Memory dump
Post by: Pecan on March 14, 2024, 03:59:30 pm
See if this works.
Try running CodeBlocks with the -d option to show the debuggers log. You can copy from the log by marking the address, right clicking, and selecting "copy selection".
Title: Re: Debugger - Memory dump
Post by: Evan on March 14, 2024, 07:40:22 pm
I assume you mean the -d option can be set as an argument in debugger default settings. If so, I can't see any address.

My debugger log:

Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: /home/evan/Desktop/C/DB/
Adding source dir: /home/evan/Desktop/C/DB/
Adding file: /home/evan/Desktop/C/DB/bin/Debug/DB
Changing directory to: /home/evan/Desktop/C/DB/.
Set variable: LD_LIBRARY_PATH=.:
Starting debugger: /usr/bin/gdb -nx -fullname -quiet -d -args /home/evan/Desktop/C/DB/bin/Debug/DB
Setting SHELL to '/bin/sh'
done
Setting breakpoints
Debugger name and version: GNU gdb (Debian 13.1-3) 13.1
Child process PID: 103102
Title: Re: Debugger - Memory dump
Post by: Pecan on March 14, 2024, 08:43:15 pm
@evan

No, I mean the "CodeBlocks.exe -d "  option flag.
Or /d for windows. Run "codeblocks /?" for into.

My error. The debuggers log is there wether the -d options is used or not.
Title: Re: Debugger - Memory dump
Post by: Evan on March 14, 2024, 08:50:26 pm
Sorry, but I'm using Linux Mint.
Title: Re: Debugger - Memory dump
Post by: Pecan on March 14, 2024, 09:30:40 pm
Sorry, but I'm using Linux Mint.

My error. You do not need the -d startup option.
You can still copy any item in the debuggers log.

See below using Linux Mint.
Title: Re: Debugger - Memory dump
Post by: Evan on March 15, 2024, 01:43:39 pm
I got this.
Title: Re: Debugger - Memory dump
Post by: Pecan on March 15, 2024, 06:34:20 pm
Good.
After a breakpoint has occurred, hover over the variable for which you want an address. If you've set the option that requires the ctrl key to be tapped, do so.
The elements of the variable should then appear in the debuggers log to copy/paste.

Depending on the GDB version being used, for the first attempt to display the expression (variable or whatever), the GDB may be quite slow. After the first display, the subsequent evaluations/displays will be much faster.
Title: Re: Debugger - Memory dump
Post by: Evan on March 17, 2024, 09:47:49 am
Thanks, really appreciated.  :)