Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Thomas Neumann <tneumann@users.sourceforge.net>
To: gdb@sourceware.org
Subject: Organization of breakpoint locations
Date: Mon, 19 Feb 2007 11:57:00 -0000	[thread overview]
Message-ID: <45D97E30.2060008@users.sourceforge.net> (raw)

Hi,

I would like some suggestions on the organization of breakpoint
locations in breakpoint.c. Currently, all breakpoint locations are
stored in a linear list. This does not scale if the number of
breakpoints is large, see PR 2230 for an example. Instead the
breakpoints should be stored in a suitable search structure (e.g. a
balanced tree).

I have a patch that converts the list into a splay. Works fine, and the
bottleneck indeed goes away, but I am not satisfied with the approach
itself. Changing the data structure is quite simple due to the access
macros used, so I had to change less than 20 lines. Unfortunately my
patch is still big (about 450 lines), as it contains a complete splay
implementation.

It would be nicer to reuse existing data structures instead of
implementing a new one. I thought about using splay-tree in libiberty,
but the breakpoint locations have some unique characteristics: 1. the
locations have to be organized by address, but the address is not
necessarily unique. So the search structure must handle duplicates. 2.
the test suite (and perhaps other code) expect that a breakpoint is
added "last" in the list, i.e. duplicate handling must keep an order
within the duplicates. 3. it must be possible to iterate over search
structure (directly, without callbacks), as otherwise a lot of code has
to be changed.

The splay implementation from libiberty satisfies none of these
constraints. Is there perhaps something else in the gdb sources that I
can reuse? Or should I submit my (admittedly quite large) patch? But
this would probably no longer count as a "small changes" that according
to CONTRIBUTE do not require a copyright assignment.

Thomas


             reply	other threads:[~2007-02-19 10:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-19 11:57 Thomas Neumann [this message]
2007-02-19 12:54 ` Daniel Jacobowitz
2007-02-19 14:40   ` Thomas Neumann
2007-02-19 14:48     ` Daniel Jacobowitz
2007-02-19 14:54       ` Michael Veksler
2007-02-19 21:24         ` Daniel Jacobowitz
2007-02-20  4:46       ` Thomas Neumann
2007-02-20 10:26         ` Thomas Neumann
2007-02-21 17:05   ` Michael Snyder
2007-02-21  1:53 ` Michael Snyder

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=45D97E30.2060008@users.sourceforge.net \
    --to=tneumann@users.sourceforge.net \
    --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