This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Reset breakpoint after load?


> On 01/22/2010 05:19 AM, Daniel Jacobowitz wrote:
> > On Thu, Jan 21, 2010 at 10:29:06AM -0800, Michael Snyder wrote:
> >>> On 19/01/2010 07:36, Jie Zhang wrote:
> >>>
> >>>> gdb-comm.exp sets breakpoints on exit and abort before load. The
> problem
> >>>> is that GDB tries to skip prologue according to what it reads
from
> >>>> memory, which might contain random data since the executable has
> not
> >>>> been loaded into memory. In my case, sometimes skip_prologue
might
> skip
> >>>> one or two more instructions, which happens to be an exception
> >>>> instruction and will trap the processor into an exception event
> loop
> >>>> after running the executable before hit the breakpoints.
> >
> > I've had this problem on a MIPS target, too.
> >
> I didn't notice this issue until recently a bug in toolchain linked in
> simulator libc for bare metal executable, which made this issue easily
> happen.
> 
> >> I don't believe that gdb can tell when the (remote) inferior
> >> is started.  All gdb knows is that target remote is started.
> >> Thus, if we connect to target remote and then load the image,
> >> there is an interval during which gdb will attempt to read
> >> the prologue bytes from un-initialized target memory.
> >>...

Yes, but... doesn't GDB take read-only data from the executable file
rather than from the target?  If so then it should not matter.  That's
what "set trust-readonly-sections" does.  Or is it off by default?  Turn
it on, that's good for performance anyway.

	paul


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]