Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@redhat.com>
To: Jafa <jafa@silicondust.com>
Cc: gdb@sources.redhat.com
Subject: Re: self decompressing code
Date: Sat, 12 Apr 2003 19:54:00 -0000	[thread overview]
Message-ID: <3E986F0E.883BE2F@redhat.com> (raw)
In-Reply-To: <043701c3004a$49ca4b00$f601a8c0@scenix.com>

Jafa wrote:
> 
> Hi all,
> 
> This isn't a problem with GDB but I would appreciate your advice on a usage
> model....
> 
> The ip2k is an embedded processor and we compile a single elf file to be
> used to program and debug the ip2k which executes out of internal flash.
> 
> External flash can also be used and I have just added code to remote-ip2k.c
> to program external flash.
> 
> The image that is uploaded to external flash is a compressed upgrade image.
> When the chip boots up it will decompress code/data to internal flash and
> external flash.
> 
> This scheme works well except for two problems:
> 1) GDB downloads the .text section even though it is not needed and is
> overwritten. If I change the section flags such that the .text section is
> not loadable then GDB complains that it can't debug the file.

What's in the text section that isn't needed?
Can you just create a dummy text section that is small, 
so that it won't take long to DL and can be ignored?


> 2) Any breakpoints that are inserted are overwritten - I need to add a break
> on the reset vector.

I don't understand -- why would any breakpoints be inserted at the
time when you're doing a download?  GDB only inserts breakpoints
when the program being debugged is running.


> Ideas so far:
> 1) Modify the upgrade/decompression code so that it doesn't write the
> internal flash. This would solve the breakpoint problem but is noticably
> slower (it is faster to upload the compressed image) and the scheme will be
> difficult to modify.
> 2) Modify gdb so it ignores the fact that the .text section isn't loadable.
> Add an auto-inserted breakpoint on the reset vector.
> 
> If you have any thoughts or ideas I would appreciate the advice.

Why can't you just set a normal gdb breakpoint on the reset vector?


      reply	other threads:[~2003-04-12 19:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-11 16:51 Jafa
2003-04-12 19:54 ` Michael Snyder [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3E986F0E.883BE2F@redhat.com \
    --to=msnyder@redhat.com \
    --cc=gdb@sources.redhat.com \
    --cc=jafa@silicondust.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox