This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: code size problem cause system crash
- To: jpeng at c-cube dot com
- Subject: Re: code size problem cause system crash
- From: Nick Clifton <nickc at cambridge dot redhat dot com>
- Date: 19 Apr 2001 09:22:47 +0100
- Cc: binutils at sources dot redhat dot com
- References: <3ADE32B9.2E9A3588@c-cube.com>
Hi Jian,
> There is a strange bug in my system. if I compile a single file with a
> library, download and test it, it works fine. If I compile hundreds file
> swith the same library, download it and found out it will generate some
> exception in run time. Those exception is generated inside a ISR. Please
> give me some hint how to debug and solve this kind of bug.
It would help if you could provide some more information. For
example, what system are you compiling (and linking) these files on ?
What is the target system that you are downloading to ? How big is
the hundred-file program once it is compiled and linked ?
As for tracking down the bug, there are several approaches that you
could try:
* Locate which ISR is failing. This might give you a clue as to what
is going wrong ?
* Run the program on a different target. It may be that there is a
real bug in the program, not the tools that are used to create
it. If the same kind of problem happens with a different target
this would point to that.
* Run the program on a simulator. You might then be able to
backtrace through the ISR and find out where things start going
wrong.
* Try creating a cut down program. eg Can you create a executable
with only 50 files, not 100. If so, does this fail ? What if you
change the 50 files that make up the program ?
* Try creating a circular debug message buffer in the memory of your
target system. Create a function call that places a message into
this buffer, placed after the last message that was inserted.
Then library sprinkle calls to this debug function throughout your
code. When the system crashes, use your monitor to examine the
circular buffer and work out where things went wrong.
Cheers
Nick