Re: Anyone have a piggy program for memory debugging?

2002-10-09 Thread kcorey

On Thu, 2002-10-10 at 04:35, JB Parrett wrote:
> Are you using the Emulator with debug ROMs? Use the latest POSE (3.5) and
> the OS 4.1 debug ROMs with all the debug checks turned on and run Gremlins.
> POSE does a pretty thorough job of looking for memory accesses in forbidden
> places, and the debug ROMs do a good job of checking your use of the Palm OS
> APIs through assertions.

Yep, I was using the emulator and debug roms.

The problem was in one of my assembly line drawing routines.  I was
getting the base address of a window, and adding the offset for the line
something like this:

move.l #base, a0| base address for bitmap
move.w #rowbytes, d0| bytes per row for this bitmap
move.w #row,d1  | row number to start at
mulu d1,d0  | multiply them
add.w d0,a0 | worked "some" of the time.

Assume a0 is 0x11000, and the multiplied offset was 0x3000, no problem,
a0 would be 0x14000.

Now assume a0 is 0x1E000, and the multiplied offset was 0x3000.  now, a0
is actually 0x12000.

Because of the way I'd allocated memory, (two big buffers), this would
be pointing in the previous buffer, causing a smear effect, but *not*
causing a memory violation, even with debug roms.

Obviously, that last instruction should have been 'add.l d0,a0'.

I just found the right combination of emulator, rom, and pre-loaded
programs that helped me tickle this bug to the surface so it could be
squashed.

It's truly a joy having the emulator so that I *can* debug on so many
different devices virtually.

> In CodeWarrior, the Palm menu has a Debug Console menu (or something similar
> depending on your platform) where you can scramble the heap, compact it,
> fill up most free memory, etc. This can also be done in code. Take a look at
> the Development Tools Guide chapter on the Console (the guide is in the 5.0
> SDK docs).

I'm afraid that Codewarrior is a bit steep for me SRP of $500!?!?.  

I'm using Falch and PRC Tools.

> Finally, take a look at the Expert Case Studies online course, which is free
> until the end of the year. Click on the Developers link at
> www.palmsource.com and follow the Training links to the course enrollment
> form.

I've enrolled for this.  Thanks!

-Ken



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/



Re: Anyone have a piggy program for memory debugging?

2002-10-09 Thread JB Parrett

Are you using the Emulator with debug ROMs? Use the latest POSE (3.5) and
the OS 4.1 debug ROMs with all the debug checks turned on and run Gremlins.
POSE does a pretty thorough job of looking for memory accesses in forbidden
places, and the debug ROMs do a good job of checking your use of the Palm OS
APIs through assertions.

In CodeWarrior, the Palm menu has a Debug Console menu (or something similar
depending on your platform) where you can scramble the heap, compact it,
fill up most free memory, etc. This can also be done in code. Take a look at
the Development Tools Guide chapter on the Console (the guide is in the 5.0
SDK docs).

Finally, take a look at the Expert Case Studies online course, which is free
until the end of the year. Click on the Developers link at
www.palmsource.com and follow the Training links to the course enrollment
form.

Good luck,
JB @ PalmSource


on 10/8/02 6:11 AM, kcorey at [EMAIL PROTECTED] wrote:

> Hi All,
> 
> I've recently found a bug that didn't surface during initial testing,
> because it only appears when my program loads above a certain spot in
> memory.
> 
> This means that I need to find (or write) a program that can force my
> program to load at a higher place in memory and to test for low-memory
> situations.  I'm thinking a DA, a hack, or some such terminate and stay
> resident program.
> 
> On unix or PC's I've seen these referred to as 'Piggy programs'.
> 
> Does anyone know of such a thing for the Palm?
> 
> Also, anyone know of a program to purposely scramble the stack, slowly
> eat up available memory over time, etc?
> 
> -Ken
> 
> 
> 
> 


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/



Re: RE: Anyone have a piggy program for memory debugging?

2002-10-08 Thread kcorey

On Tue, 2002-10-08 at 19:52, Hal Mueller wrote:
> I'm still trying to figure out what Piggies and 'Roids have in common :)

Aside from the fact that 'roids lived up to its name for a day or two
because of memory issues, not much... *smile*

-Ken






-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/



RE: Anyone have a piggy program for memory debugging?

2002-10-08 Thread Hal Mueller

I'm still trying to figure out what Piggies and 'Roids have in common :)

H

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/



RE: Anyone have a piggy program for memory debugging?

2002-10-08 Thread Scott Johnson

> From: kcorey [mailto:[EMAIL PROTECTED]]
> On unix or PC's I've seen these referred to as 'Piggy programs'.
> Does anyone know of such a thing for the Palm?

http://www.palmoswerks.com/stories/storyReader$28

-slj-


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/



Re: Anyone have a piggy program for memory debugging?

2002-10-08 Thread tilo . christ

Hi!
> 
> This means that I need to find (or write) a program that can force my
> program to load at a higher place in memory and to test for low-memory
> situations.  I'm thinking a DA, a hack, or some such terminate and stay
> resident program.
> 
Try out Memory Hog
(http://www.quantumclockwork.net/memoryhog/index.html).
There is also a debug setting in the Palm OS Memory manager (I think the
API call is MemSetDebug), that enables some behavior that will break
badly written apps earlier on.

Cheers,
Tilo

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/