[ECOS] gdb disassemble shift about 52 bytes in arm platform

Andrew Lunn andrew@lunn.ch
Mon Apr 28 23:59:00 GMT 2008

On Mon, Apr 28, 2008 at 09:31:51PM +0800, Frank Lin wrote:
> ----- Original Message ----- 
> From: "Andrew Lunn" <andrew@lunn.ch>
> To: "Frank Lin" <franklin373@gmail.com>
> Cc: <ecos-discuss@ecos.sourceware.org>
> Sent: Monday, April 28, 2008 4:49 PM
> Subject: Re: [ECOS] gdb disassemble shift about 52 bytes in arm platform
> > On Mon, Apr 28, 2008 at 03:33:51PM +0800, Frank Lin wrote:
> >> My Global compiler flags is: -mcpu=arm7tdmi -mno-short-load-words -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O0 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority
> >> My Global linker flags is: -mcpu=arm7tdmi -mno-short-load-words -Wl,--gc-sections -Wl,-static -g -nostdlib
> >> 
> >> for example:
> >> 
> >> I disassmble do_mfill function in mfill.c using elf-arm-insight in mixed mode(using elf-arm-gdb is same result, but elf-arm-insight more clearly), it display(please pay attention I mark with '<---------'):
> >> 
> > 
> > I've not had problems before. Are you sure everything is syncronised?
> Yes, everything is syncronised.
> > What is on your hardware is the same as the object file on your host
> > and that the objects are from your current sources?
> I use S3C44B0X CPU, the objects is from current souces.
> > 
> > Try arm-elf-objdump -D myprog.elf | less
> > 
> > and see if there is the same problem. This removes the target from the
> > picture.
> I use arm-elf-objdump -D redboot.elf, the result is correct, for example:

Now try using gdb to disassemble the code, but do not connect to the
target. This will force gdb to disassemble what is in the elf file,
not what is in the targets memory. 

I still think the symbol table you passed to gdb does not match what
is in memory of your target. If gdb correctly disassembles when not
connected to the target, but gets it wrong when connected to the
target, i would really suspect you need to download your image again.


Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

More information about the Ecos-discuss mailing list