News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Debugger - Memory dump

Started by Evan, March 14, 2024, 10:29:31 AM

Previous topic - Next topic

Evan

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.


Pecan

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".

Evan

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

Pecan

#3
@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.

Evan

Sorry, but I'm using Linux Mint.

Pecan

Quote from: Evan on March 14, 2024, 08:50:26 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.

Evan


Pecan

#7
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.

Evan

Thanks, really appreciated.  :)