Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch] XFAIL gdb.cp/mb-inline.exp conditionaly
Date: Thu, 23 Jun 2011 13:40:00 -0000	[thread overview]
Message-ID: <4E034237.2040404@codesourcery.com> (raw)
In-Reply-To: <201106231128.14335.pedro@codesourcery.com>

On 06/23/2011 06:28 PM, Pedro Alves wrote:
> Okay, that happens when the locations have ambiguous names, at the
> end of update_breakpoint_locations.
> 
> You're just re-running the same binary, and the breakpoints are even
> all set in the same objfile.  Nothing changed from the user's
> perpective.  It's reasonable to expect gdb manages to not lose track
> of the disable state.  I think we can and should improve the heuristic
> to handle this scenario.  
> 

Yes, this heuristics can be improved.  I have had a local hack similar
to what you suggest below, and this hack works for me.

> Instead of comparing
> absolute addresses, normalize them before comparing.  E.g.,
> 
> Before             After
> 0x400010           0x800010
> 0x401000           0x801000
> 0x410000           0x810000
> 0x400100           0x800100
> 
> For each list, find some common base and subtract it from
> each entry, and _then_ compare the locations:
> 
> Before             After
> 0x000010           0x000010
> 0x001000           0x001000
> 0x010000           0x010000
> 0x000100           0x000100
> 
> The common base might be the lowest address in each list,
> or something else, like the objfile's lowest address, or
> some such.  If we had some sort of unique symbol hash id,
> we could use that instead, and it'd be more reliable, me
> thinks.
> 

The key point of this approach is about identifying common base.

My hack is similar to yours.  In my hack, the offset of objfile
relocation O1 is cached.  When new inferior is created again and new
object of objfile relocation offset O2 is got, we can compute the offset
A between offset of previous inferior's relocation offset (O1) and
current inferior's (O2), and then we can "relocate" breakpoint locations
with offset A.  Again, it is still a hack, and some more work may be
needed here.

Anyway, I'll think of this problem.

-- 
Yao (齐尧)


  reply	other threads:[~2011-06-23 13:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-16  6:17 Yao Qi
2011-06-22 15:38 ` Pedro Alves
2011-06-23  9:21   ` Yao Qi
2011-06-23 10:28     ` Pedro Alves
2011-06-23 13:40       ` Yao Qi [this message]
2011-06-23 14:00         ` Pedro Alves
2011-06-23 10:37     ` Pedro Alves
2011-06-23 14:41       ` Yao Qi

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=4E034237.2040404@codesourcery.com \
    --to=yao@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.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