Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "Breazeal, Don" <Don_Breazeal@mentor.com>
To: Alexandru-Adrian Oltean <adrian.oltean@nxp.com>,
	"gdb@sourceware.org"	<gdb@sourceware.org>
Subject: RE: hbreak reads memory
Date: Wed, 27 Jul 2016 21:41:00 -0000	[thread overview]
Message-ID: <DA279C53C4A5884A907135DFCD7A059A37EF9758@NA-MBX-02.mgc.mentorg.com> (raw)
In-Reply-To: <VI1PR0401MB2671E54864682705BFABFC6BF10F0@VI1PR0401MB2671.eurprd04.prod.outlook.com>

Adrian,
I think this is due to some function prologue analysis.  You might try setting the breakpoint on an address, e.g. instead of 'hbreak foo' use 'hbreak *foo'.  The breakpoint should then be on the address of the entry point to the function and the memory accesses may be reduced or eliminated.

You might also try 'set trust-readonly-sections' and/or set mem inaccessible-by-default.  Those may or may not help.
--Don

> -----Original Message-----
> From: gdb-owner@sourceware.org [mailto:gdb-owner@sourceware.org] On
> Behalf Of Alexandru-Adrian Oltean
> Sent: Tuesday, July 26, 2016 11:29 PM
> To: gdb@sourceware.org
> Subject: hbreak reads memory
> 
> Hi everyone,
> 
> I noticed that setting a hardware break using hbreak will trigger a
> memory access at the address where the breakpoint is supposed to be
> installed. Can someone explain why is that memory access needed? I'm
> thinking that we might be in a situation where that memory area is not
> yet initialized/accessible (maybe MMU not configured yet) and the
> access corrupts the debugged target.
> 
> Thanks,
> Adrian


  reply	other threads:[~2016-07-27 21:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-27  6:29 Alexandru-Adrian Oltean
2016-07-27 21:41 ` Breazeal, Don [this message]
2016-07-28  6:28   ` Alexandru-Adrian Oltean
     [not found]     ` <0CEE46EB9C50E44486A861D738D3E2067ED804CC@RS-MBS02.realsil.com.cn>
2016-08-02  6:53       ` Alexandru-Adrian Oltean
     [not found]     ` <CAH=s-PO2rUWbiFwMgtbsqDMNQnPB0fdmsmxe2HU9y4z7F7=pFQ@mail.gmail.com>
2016-08-02  9:15       ` Alexandru-Adrian Oltean

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=DA279C53C4A5884A907135DFCD7A059A37EF9758@NA-MBX-02.mgc.mentorg.com \
    --to=don_breazeal@mentor.com \
    --cc=adrian.oltean@nxp.com \
    --cc=gdb@sourceware.org \
    /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