Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Change variable value causes crash in debugger


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 3 - Last Post: Jul 11, 2016 10:40 AM Last Post By: Remy Lebeau (Te...
Adrian Frugtniet

Posts: 6
Registered: 4/9/16
Change variable value causes crash in debugger  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 10, 2016 9:10 PM
Hi, I am using Delphi 2007 on Windows 7. When trying to change the value of a string in the debugger, I stop the program at a break point, change the string, then the program crashes as soon as I save the changed value, before even releasing it from the breakpoint. The string I am changing is an a .DLL, does that make a difference.
Has anybody else seen this behaviour?

Edited by: Adrian Frugtniet on Jul 10, 2016 9:19 PM
Andrew Baylis

Posts: 27
Registered: 7/19/00
Re: Change variable value causes crash in debugger [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 10, 2016 11:41 PM   in response to: Adrian Frugtniet in response to: Adrian Frugtniet
On 11/07/2016 2:19 PM, Adrian Frugtniet wrote:
Hi, I am using Delphi 2007 on Windows 7. When trying to change the value of a string in the debugger, I stop the program at a break point, change the string, then the program crashes as soon as I save the changed value, before even releasing it from the breakpoint. The string I am changing is an a .DLL, does that make a difference.
Has anybody else seen this behaviour?

Edited by: Adrian Frugtniet on Jul 10, 2016 9:19 PM
Suggest this will be a memory manager issue - strings are managed as
copy-on-write, so you have created a new block of memory which may not
be associated with the memory pool the DLL is managing....

Cheers,
Andrew
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Change variable value causes crash in debugger [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 11, 2016 10:39 AM   in response to: Andrew Baylis in response to: Andrew Baylis
Andrew wrote:

Suggest this will be a memory manager issue - strings are managed
as copy-on-write

Assuming a Delphi COW-style (Ansi|Wide|Unicode)String is involved in the
first place...

--
Remy Lebeau (TeamB)
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Change variable value causes crash in debugger [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 11, 2016 10:40 AM   in response to: Adrian Frugtniet in response to: Adrian Frugtniet
Adrian wrote:

The string I am changing is an a .DLL, does that make a difference.

It can make a HUGE difference, depending on what kind of string it is, and
how it is allocated. Why are you modifying a string in a DLL? What are
you trying to accomplish?

--
Remy Lebeau (TeamB)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02