Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 240033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:38:00+00:00 2026-05-11T20:38:00+00:00

I am trying to create a code coverage tool using Delphi 2007. My general

  • 0

I am trying to create a code coverage tool using Delphi 2007.

My general approach is to use the Win32 Debug API to insert breakpoints for each source line and then remove the breakpoints as I pass them – thus I would be able to track each executed source line.

Outline of my approach:

  • parse the detailed MAP file (as generated by Delphi 2007) to find all the addresses for each source line (only for .text segments)
  • open the application in debug mode using the OpenProcess API call
  • iterate over each source line and insert an Int3 instruction (one $cc byte using WriteProcessMemory + FlushInstructionCache) at the address of each line
  • continue executing and as each breakpoint is triggered, remove the corresponding breakpoint and mark the line as covered
  • After either each breakpoint is passed or program exists I generate a report on what lines were covered and which lines were not for each source module

Now on to my question:

Is each source line address in a detailed MAP file a valid address to insert an Int3 breakpoint?

While the approach was successful for some simple units, I run in to access violations for some larger applications where the violated address includes a $cc – which would lead me to think that my approach needs some modification to work.

Hints on better approaches also very welcome!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T20:38:00+00:00Added an answer on May 11, 2026 at 8:38 pm

    Well, in theory: yes. And practical, I think yes too. If Delphi can place a breakpoint on every line, so can you :-).

    Probably you need some specific handling for some case (for example: first line of a procedure is initialization of local vars, setting EBP etc).
    So can you find out in which case it fails?

    Btw: nice project! Is it open source?

    P.S. if you need some assembly code handling: look at koldetours.pas (use google search).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 111k
  • Answers 111k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Have you tried resetting the firmware? Theres an option in… May 11, 2026 at 9:41 pm
  • Editorial Team
    Editorial Team added an answer Just set the quiet period on the build, under configure… May 11, 2026 at 9:41 pm
  • Editorial Team
    Editorial Team added an answer Use an attribute filter, in particular the attributeEquals filter: $("node[name='x']");… May 11, 2026 at 9:41 pm

Related Questions

I am new to Python. I am writing an application using wxPython and I
Does anyone know of a good open source plugin for database querying and exploring
I am trying to structure my code in such a way to reduce/avoid code
I am brand new in the world of Wpf, and am thinking it's time
I am trying to create a countdown using javascript. I got some code from

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.