Author Topic: Debugger - Memory dump  (Read 4081 times)

Offline Evan

  • Multiple posting newcomer
  • *
  • Posts: 25
Debugger - Memory dump
« 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.


Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2803
Re: Debugger - Memory dump
« Reply #1 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".

Offline Evan

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: Debugger - Memory dump
« Reply #2 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

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2803
Re: Debugger - Memory dump
« Reply #3 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.
« Last Edit: March 14, 2024, 08:52:51 pm by Pecan »

Offline Evan

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: Debugger - Memory dump
« Reply #4 on: March 14, 2024, 08:50:26 pm »
Sorry, but I'm using Linux Mint.

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2803
Re: Debugger - Memory dump
« Reply #5 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.

Offline Evan

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: Debugger - Memory dump
« Reply #6 on: March 15, 2024, 01:43:39 pm »
I got this.

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2803
Re: Debugger - Memory dump
« Reply #7 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.
« Last Edit: March 15, 2024, 06:36:54 pm by Pecan »

Offline Evan

  • Multiple posting newcomer
  • *
  • Posts: 25
Re: Debugger - Memory dump
« Reply #8 on: March 17, 2024, 09:47:49 am »
Thanks, really appreciated.  :)