#18174 - regularkid - Mon Mar 22, 2004 9:25 am
Hi!
ok, so I have got GDB to work and am trying to fix a crash bug. Somehow my RAM is getting corrupted, but I'm not sure by what. I know that some debuggers have the ability to put "watchpoints" in where it will break execution when a certain address is written to. Then, once in the break, you can examine the callstack and find out what exactly is changing that memory address. So, I want to do the same type of thing here: put a watchpoint on an address in RAM and just run the game and wait for the break to happen whenever this memory address is written to. Is this possible in GDB? If not, anyone know of a good way to debug something like this? Thanks!
_________________
- RegularKid
#18179 - bomberman - Mon Mar 22, 2004 10:15 am
I do not think this is possible with Visual Boy Advance... I also think this feature is very useful in debug sessions, unfortunately I never succeeded in having this work :O(
#18186 - yaustar - Mon Mar 22, 2004 2:51 pm
It is possible with insight GDB, that is an icon that looks like a pair of glasses.
_________________
[Blog] [Portfolio]
#18188 - bomberman - Mon Mar 22, 2004 2:59 pm
Insight GDB proposes this as it is a front end to gdb. But I am not sure that Visual Boy Advance provides this feature.
Eclipse also proposes that but it won't work...
Did you actually manage to have this feature work ?
#18193 - yaustar - Mon Mar 22, 2004 4:05 pm
#18201 - regularkid - Mon Mar 22, 2004 4:43 pm
But you can't actually make the program break when the value for a variable you are watching (glasses icon) changes (gets written to). Correct?
By the way, yaustar: thanks for the help on getting GDB working for me (i didn't thank you in the other post).
_________________
- RegularKid
#18202 - yaustar - Mon Mar 22, 2004 4:47 pm
Not really, the best thing you can get is to put a breakpoint when it changes and after rereading your initial post I actually understand the question (d'oh).
whoops.....
Quote: |
By the way, yaustar: thanks for the help on getting GDB working for me (i didn't thank you in the other post). |
no problem :)
_________________
[Blog] [Portfolio]
#18206 - bomberman - Mon Mar 22, 2004 5:02 pm
So we can not... This feature is invaluable when you come to debug nasty things !
#18209 - yaustar - Mon Mar 22, 2004 5:44 pm
Quote: |
Console Output
--------------
There are two forms of console output in this version:
- Mappy style dprint: use the following code (from Mappy's documentation) to get
output:
- VBA style: use the following code to get output:
// THUMB code
void print(char *s)
{
asm volatile("mov r0, %0;"
"swi 0xff;"
: // no ouput
: "r" (s)
: "r0");
}
// ARM code
void print(char *s)
{
asm volatile("mov r0, %0;"
"swi 0xff0000;"
: // no ouput
: "r" (s)
: "r0");
}
When using GDB, the output will show up in GDB's console. When using the built-in
debugger, output will go to standard out.
Built-in debugger enhancements
------------------------------
The built-in debugger has the following enhancements (need debug enabled ELF
file):
- ELF file support: both multiple and regular. Please report any messages or
problems reading ELF files. C++ classes and some miscellaneous features are
not supported yet. Also, method names may be mangled in C++ code.
- break command: add a breakpoint on a function, line number of file:line
number
- locals command: print the local variables on the current function
- print command: prints the value of a given expression. Valid expression
include *this, ptr->member, var.member, array[0], sizeof(expression), etc...
- symbols command: list information known about a symbol (or symbols that start
with the given name)
- radix command: sets the output radix to eithe decimal, octal or hex.
- file and line number when stopped: the debugger will show the file and line
number (if available) for the current address
- fixes to some breakpoint handling problems
- fixes to break on write function |
from the readme, it looks like it can be possible...not sure how myself...:/
_________________
[Blog] [Portfolio]
#18211 - bomberman - Mon Mar 22, 2004 6:05 pm
hmmm.... it mentions breakpoints, not watchpoints !
Ignore the post... it says breakpoint on write function you're right !
But I never succeeded to make it work :O(
Last edited by bomberman on Mon Mar 22, 2004 6:22 pm; edited 1 time in total
#18212 - yaustar - Mon Mar 22, 2004 6:20 pm
hmmm...true
The only thing i can think off is using ASSERT but it depends on the level of corruption.
eg a > 160 then ASSERT
_________________
[Blog] [Portfolio]
#18214 - regularkid - Mon Mar 22, 2004 6:37 pm
Yeah! It does say that it can break on the write function. Sweet! Now if we can only figure out how to make it work...I'll keep trying and let you guys know if I find anything out.
_________________
- RegularKid
#18216 - Miked0801 - Mon Mar 22, 2004 6:45 pm
The only emulator that I know that supports breaks on writes to memory (and watches) is No$GBA.
#18221 - bomberman - Mon Mar 22, 2004 6:58 pm
Yes I know this emulator supports every feature I dream about except its price :O(
#18224 - regularkid - Mon Mar 22, 2004 7:09 pm
Yeah, the price sucks.....$5000!! Too much for us small time developers.
_________________
- RegularKid
#18226 - yaustar - Mon Mar 22, 2004 7:57 pm
The freeware one is still laying around some where, but I dont think it supports C/C++ source code :(
_________________
[Blog] [Portfolio]
#18250 - dagamer34 - Tue Mar 23, 2004 3:48 am
Even if you had that kind of money, Martin only sells his emulator to those who have a licsence from Nintendo, like Miked0801 over here.
But for now, VBA tries its best, all for a nice price of $0. I'm not complaining.
_________________
Little kids and Playstation 2's don't mix. :(
#18251 - Miked0801 - Tue Mar 23, 2004 5:05 am
Truth is, Martin has been MIA for quite some time. We can't get any questions or bugs fixed for awhile now which is very annoying. I think that he buried himself in his new pet project, a C64 emulator. I kinda wish he'd finish his current one...
#18257 - tepples - Tue Mar 23, 2004 5:43 am
VBA is free software. If you can afford a Nintendo license and a No$gba license, then you most likely can afford to hire programmers to add one or more of the necessary features and submit the patch to Forgotten.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.