Debugging DLL's from within Codegear 2007 RAD Studio


My application is written in Delphi, apart from a few DLL's that are written in assembler and C++. I recomplied the DLL's under the RAD Studio C++ compiler, copied theses DLL's into my main program directory along with the corrosponding ...
Posted On: Tuesday 27th of November 2012 12:57:42 AM Total Views:  275
View Complete with Replies

RELATED TOPICS OF Delphi Programming PROGRAMMING LANGUAGE




Events within Events

Trying to track down some subtle bugs in my app that may be related to reentry, Is it possible for a on timer event to trigger before a on shortcut event is finished or even the opposite... a on shortcut event before a on timer event is finished. A pointer to a document on these issues would be helpfull. many
VIEWS ON THIS POST

226

Posted on:

Wednesday 19th September 2012
View Replies!

copy bytes within an allocated memory block?

I'm grabbing a chunk of memory like this: VAR siz: longint; chunk: LPVOID; BEGIN ... siz := 1000; chunk := Heapoc(GetProcessHeap, HEAP_ZERO_MEMORY, siz); How do I copy 20 bytes from one place in "chunk" to another, let's say, from the 100th byte of "chunk" to the 200th byte of "chunk". Move(\t\t, \t\t, 20); (I know that if "chunk" were just an array of bytes, I could just use an array index. But it's not.)
VIEWS ON THIS POST

201

Posted on:

Saturday 22nd September 2012
View Replies!

D2007 debugging too much code

I debug a D2007 program and find it annoying that stepping though my code with F7 from a breakpoint leads me into the code of standard delphi units as well. I only need to see what goes on in my own code. This is probably a matter of using proper settings in Tools/Options, but I have not been able to find the correct settings. - Any suggestions Claus
VIEWS ON THIS POST

271

Posted on:

Saturday 22nd September 2012
View Replies!

BDS 2006 .NET - Another debugging question

Hi all, In debugging an EXE, I am setting my first breakpoint on "Application.Run(TWinForm.Create)". I am trying to find out how a particular global variable is being set. So far, I have done a "Find in files" but the only thing that comes up is one line, the place where the global variable (named "gWFile" in my case) is passed to a function. At the breakpoint, mentioned above, the Watch window displays the global variable's value so it must be being set earlier than this point. As far as I am aware, this breakpoint (Applicarion.Run) should be he start of the program so my question is: How is this global being set I have noticed that as I close the resulting window, the debugger stops and I get back to Edit mode and a *.INI file for the EXE filename being created in the same folder as the EXE file. Since the creation of the INI file occurs after the main window is closed, I looked for whether an INI file is created in the code but could not find anything in the code that references the reading or creation of an INI file. Is there something I am missing in the operation of the BDS 2006 .NET ide for global variables Is there an earlier breakpoint location than "Application.Run
VIEWS ON THIS POST

309

Posted on:

Saturday 22nd September 2012
View Replies!

Passing parameters within ""

Hi I've got a problem... I'm passing a url as a parameter (its a rdp:// protocol for use with a custom RDP client I'm making) I've got the RDP side of things working but I'm having trouble with the rdp:// link. Basically I'm passing it URL encoded in the following format: rdp:///v: /u:"Firstname Lastname" /p: URL encoded it is: %2Fv%3A%3Cserver%3Aport%3E+%2Fu%3A%22Firstname+Lastname%22+%2Fp%3A%3Cpassword%3E I can pass the normal parameters (/v: /u:"Firstname Lastname" /p:) in the command line and there are no problems. However when I process them myself from the decrypted URL encryption, I am parsing each parameter by the space between them. This causes me a problem with "Firstname Lastname" as it doesn't recognise the double quotes! It simply takes the Firstname and Lastname as 2 seperate parameters. This is the code I've used for parsing the URL encrypted information: If Pos('rdp://', ParamStr(I)) 0 then begin NMURL := TNMURL.Create(nil); //Create NMURL component from FastNet library for decoding url encrypted strings Temp := ParamStr(I); Temp := Utils.ParseRemove(':', Temp, 1); Delete(Temp, 1, 2); NMURL.InputString := Temp; Temp := NMURL.Decode; repeat Params.Add(Utils.Parse(' ', Temp, 1)); //This is where First and Last names are not passed as a whole string Utils.ParseRemove(' ', Temp, 1); until Temp = ''; I can see why it obviously doesn't pass the username as a whole string because it is parsing via the space. What I'm having trouble with is working out how to check for double quotes and use the string within them as one parameter and add it to the StringList. Can anyone show me a quick and easy way of checking for double quotes and parsing by them without me spending hours head scratching
VIEWS ON THIS POST

167

Posted on:

Monday 24th September 2012
View Replies!

Is the code within Thread Safe ?

Ladies / Gentlemen Could someone or several someones please take a look at the following code and tell me if this is thread safe and if not why not and how to correct it.
VIEWS ON THIS POST

218

Posted on:

Friday 5th October 2012
View Replies!

D7 doesn't break on errors, no debugging?

Somehow, my D7 fails to properly break on errors. I have "integrated debugging" and "Stop on Delphi exceptions" turned ON, but it simply doesn't do anything. :-/ Anyone got a clue -- Martijn Tonies Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle & MS SQL Server Upscene Productions http://www.upscene.com My thoughts: http://blog.upscene.com/martijn/ Database development questions Check the forum! http://www.databasedevelopmentforum.com
VIEWS ON THIS POST

238

Posted on:

Friday 5th October 2012
View Replies!

How to show debugging values with mouseover?

What setting to I change to show variable values when I mouse over the code during debugging I had this working before, but changed something in the settings and can't remember what.
VIEWS ON THIS POST

153

Posted on:

Saturday 6th October 2012
View Replies!

Avoid stepping into certain units when debugging...

CodeGear 2007 Professional IDE How can I avoid stepping into the source of my components and memory managers when debugging with F7 and F8 Can I specify a folder name somewhere for 'my' units and have the debugger ignore any .pas files from other folders regards Geir
VIEWS ON THIS POST

128

Posted on:

Sunday 7th October 2012
View Replies!

Is the code within Thread Safe ?

Ladies / Gentlemen Could someone or several someones please take a look at the following code and tell me if this is thread safe and if not why not and how to correct it.
VIEWS ON THIS POST

200

Posted on:

Tuesday 16th October 2012
View Replies!

Execution of finalization code when program is reset during a debugging session

Enquiring Mind wrote: > When during a debugging session the developer Resets the program by > clicking "Run>Reset program" , for example after an exception has > been thrown, does the debugger still call all the termination code of > the application, e.g. the OnDestroy event handlers for all created > forms, the finalization code of all program units, etc. No. Reset rudely and immediately kills the app, occasionally leaving a mess behind. > On a related note, what happens to dynamically created custom objects > (that do not have an Owner property) created by the main form in its > OnCreate handler, and destroyed in its OnDestroy event handler, if > the program is aborted prematurely in a debugging session Windows will clean up allocated memory that "leaks" when a process is killed (whether under the debugger or not). But the destructor on the "custom object" won't be called. -- Craig Stuntz [TeamB] Vertex Systems Corp. Columbus, OH Delphi/InterBase Weblog : http://blogs.teamb.com/craigstuntz Everything You Need to Know About InterBase Character Sets: http://blogs.teamb.com/craigstuntz/articles/403.aspx
VIEWS ON THIS POST

138

Posted on:

Tuesday 16th October 2012
View Replies!

THreads, dlls, and UDP

Hej, I have a service appication that starts three threads. These threads all call a DLL to send a message using UDP. The dll uses the UDPClient component (I think its called that). Somewhere in all this I find that the call to send the message via UDP causes an exception. This dll has been used many times over a long period of time, but never from a thread, and never more than once per machine. So I wonder if my dll needs to be "thread safe" and what does this mean Or could it be that the calls to the UDPClient are occuring symultaneously and therefore causing the problem Any advice would be welcome. /Richard
VIEWS ON THIS POST

419

Posted on:

Tuesday 16th October 2012
View Replies!

Events within Events

Trying to track down some subtle bugs in my app that may be related to reentry, Is it possible for a on timer event to trigger before a on shortcut event is finished or even the opposite... a on shortcut event before a on timer event is finished. A pointer to a document on these issues would be helpfull. many
VIEWS ON THIS POST

126

Posted on:

Tuesday 16th October 2012
View Replies!

BDS 2006 .NET - Another debugging question

Hi all, In debugging an EXE, I am setting my first breakpoint on "Application.Run(TWinForm.Create)". I am trying to find out how a particular global variable is being set. So far, I have done a "Find in files" but the only thing that comes up is one line, the place where the global variable (named "gWFile" in my case) is passed to a function. At the breakpoint, mentioned above, the Watch window displays the global variable's value so it must be being set earlier than this point. As far as I am aware, this breakpoint (Applicarion.Run) should be he start of the program so my question is: How is this global being set I have noticed that as I close the resulting window, the debugger stops and I get back to Edit mode and a *.INI file for the EXE filename being created in the same folder as the EXE file. Since the creation of the INI file occurs after the main window is closed, I looked for whether an INI file is created in the code but could not find anything in the code that references the reading or creation of an INI file. Is there something I am missing in the operation of the BDS 2006 .NET ide for global variables Is there an earlier breakpoint location than "Application.Run
VIEWS ON THIS POST

123

Posted on:

Tuesday 16th October 2012
View Replies!

Test rigs, dev machines and psychic debugging

I got a cool new dev machine from my Boss as a sort of late Xmas present a few months ago. After all the fun of installing Delphi on it, and getting all of my custom components to work to the point where I could rebuild a project successfully, I ran into a bit of a lazy block where I couldn't be bothered installing some of the additional software that it provided by other parties, and that our software relies on. In the past, my dev machine has been capable of doing anything that a client machine would be able to do, but this new machine is much cleaner, can't do a bunch of stuff, and I am pretty happy about it. In the worst-case scenario, I can fire up a VM that is fully specced and try to figure out problems that way. This happens rarely. More often, I'll write a driver that emulates what the 3rd party stuff is supposed to do, and leave it up to the testing dept to do end-to-end checks. I decided a while ago that my dev machine should not also be a test- rig, so that leaves me with only psychic debugging as a way of tracking down most bugs. The thing that I have found most beneficial about this approach is that it is way more productive/effective than anything I did earlier. I've found that debugging most issues ends up being an exercise in solving problems by thinking about them, in much the same way that you might try to solve a Sudoku puzzle without looking at it. Maybe there's also an element of being able to "hold a program in your head". Gone are the days of swearing at the IDE debugger and the way it throws focus around indiscriminatley (using BDS2006 here). Instead, I can just go to bed and sleep on the problem, secure in the knowledge that in finding the bug, I might also find a good re-factoring opportunity or algorithm improvement. The systems that I work on are large and complex. There's nothing really psychic about trying to understand every part of what the system is doing simultaneously, but I do find that the restriction of not being able to single step through what it is up to has helped me enormously. It can, however, be a bit mind-bending. The testers and customers think that I am psychic. Do you work this way Would/could you work this way Scout
VIEWS ON THIS POST

103

Posted on:

Tuesday 16th October 2012
View Replies!

searching within a TMenu

Hi! I'm implementing access levels to my system, I already did it with the Main Menu of the app. I store in the tag property of each menuitem the access level, and then enable the item only if it's tag is less or equal then the access level of the user. So far, everything fine. But I have some quick buttons to enter to the most used forms in the app. So I need to enable/disable those buttons. They have the OnClick event pointing to a procedure that is conected to the MainMenu also. So, I think, I need to make a function like this: function ButtonTag(Button: TToolButton, Menu: Tenu): integer begin if Button.OnClick = { the OnClick of a item in the Menu } then result := {The Item I've found}.Tag end; So far I can figure out how to scan all the menu. I guess I need a recursive function, do I
VIEWS ON THIS POST

82

Posted on:

Tuesday 16th October 2012
View Replies!

Wrong file in the IDE while step by step debugging

, It happens to often that Delphi shows a wrong file will doing step by step after a breakpoint. This happens if delphi finds a unit on the search path with the same name, it executes the right code but ...
VIEWS ON THIS POST

78

Posted on:

Saturday 10th November 2012
View Replies!

Funky debugging delimna

I have a service that loads a DLL named SYScheduler in a thread. Now, this DLL is a "scheduler" and does tasks at specified intervals. One task that this DLL runs is called RunPOSDll.exe. That executable loads the DLL that ...
VIEWS ON THIS POST

79

Posted on:

Thursday 22nd November 2012
View Replies!

Re: IDE hints while debugging not showing

Paul Coshott wrote: > Hi , > > I reformatted my machine recently, and after I had re-installed > Delphi 7, the hints that display values while debugging are not > showing. The machine setup is identical to before the ...
VIEWS ON THIS POST

75

Posted on:

Thursday 22nd November 2012
View Replies!

Problem with executing a component method within a secondary thread

I have a form containing a TOleContainer control. When I call the method OleContainer1.CreateObjectFromFile(const Filename: string; Iconic: Boolean) from within a method of the main form, the image of some of the form's controls is lost and there's an ...
VIEWS ON THIS POST

152

Posted on:

Thursday 22nd November 2012
View Replies!