| View previous topic :: View next topic |
| Author |
Message |
Zanko Cheater
Reputation: 0
Joined: 28 May 2014 Posts: 40
|
Posted: Fri Jun 24, 2016 1:33 am Post subject: Debug break point question |
|
|
Hello I have found an address that corresponds to count of event occurring. I attached the "what write to this address" and got a clean result that increment once every time the event occur.
I then go into the disassembler to put breakpoint there, I don't know why it breaks so often like 12 times before the whole event finished. Each time the value of registers are different. This is really confusing as the count from out side shows that it only write once for every event. So what is going on? Thank you!
|
|
| Back to top |
|
 |
zm0d Master Cheater
Reputation: 7
Joined: 06 Nov 2013 Posts: 423
|
Posted: Fri Jun 24, 2016 1:53 am Post subject: |
|
|
| zanko2610 wrote: | | as the count from out side shows that it only write once for every event |
That's because your adress matched in the event. The "what writes to this address function" checks if the selected address occurs in one register. If so, it gets count as valid and also gets incremented +1 in the list.
Your breakpoint gets hit multiple times because the function might be something generic and gets called a couple of times. E.g. ->
You have 3 resources, gold, wood and stone. These 3 resources are handle over one update function. The function accepts parameters to set the resources ->
| Code: | | void updateResource(Resource r, int value) |
So when you build a house in your game, this function gets called a couple of times, because you need wood, stone and gold to build the house.
| Code: |
void buildHouse() {
updateResource(m_goldResource, 750);
updateResource(m_woodResource, 500);
updateResource(m_stoneResource, 450);
}
|
If your breakpoint lies in the updateResource function, then of course, it gets hit a couple of times. This is just one example how it could be, that your breakpoint gets hit a couple of times.
|
|
| Back to top |
|
 |
Zanko Cheater
Reputation: 0
Joined: 28 May 2014 Posts: 40
|
Posted: Fri Jun 24, 2016 2:08 am Post subject: |
|
|
| I see! Thank you so much. So you mean when it says mov[edx], ax get written once, it basically saying when edx == certain address? When I set my break point it occurs for every kind of edx. So if I want to acheive same effect I have to put condition on my breakpoint to have the same address right?
|
|
| Back to top |
|
 |
zm0d Master Cheater
Reputation: 7
Joined: 06 Nov 2013 Posts: 423
|
Posted: Fri Jun 24, 2016 2:55 am Post subject: |
|
|
You got it, yeah.
|
|
| Back to top |
|
 |
|