Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Thomas Maier" <balagi@justmail.de>
To: "Daniel Jacobowitz" <drow@false.org>
Cc: gdb-patches@sources.redhat.com
Subject: Re: gdb 6.3 C++ breakpoint in constructor/destructor patch
Date: Sun, 01 May 2005 20:54:00 -0000	[thread overview]
Message-ID: <opsp36yr1riudtyh@a3efe.a.pppool.de> (raw)
In-Reply-To: <20050501190532.GB9429@nevyn.them.org>

Hello,

On Sun, 1 May 2005 15:05:32 -0400, Daniel Jacobowitz <drow@false.org>  
wrote:

> On Sun, May 01, 2005 at 08:32:12PM +0200, Thomas Maier wrote:
>> Hello,
>>
>> I want to supply a patch for the released gdb 6.3, that fixes partially
>> the gdb bugs
>>
>> gdb/1091: Constructor breakpoints ignored
>> gdb/1193: g++ 3.3 creates multiple constructors: gdb 5.3 can't set
>> breakpoints
>>
>> I was really confused, why my programs to not stop at the breakpoint in
>> constructor/destructors. Now i know, it is not the fault of my programs  
>> ;)
>> Since this anoying problem seems to be in gdb since the gcc 3.x  
>> release, i
>> guess, no one else a) has this problem (i don't believe so) or b) will  
>> not
>> fix it. So i did it ;)
>>
>> This modification is only made for commands like "break
>> [source]:<lineno>". For C++ constructors and destructors, the patch
>> creates more than one breakpoint at the source at lineno, but each
>> generated breakpoint will have another address!
>>
>> NOTE: this is only a simple "hack". I have spent only one day to get  
>> into
>> gdb source code and do the modification.
>> It would be better, to create only one breakpoint in such  
>> C++ constructors
>> and destructors and assign multiple addresses to it. But this needs a  
>> huge
>> modification of gdb, i guess ;)
>
> This is not a very useful change, because it only handles the case
> where everything at a particular line is in the same symtab.  Often
> this will not be the case.

Ok, hmm, then the code in find_line_symtab() must not return one symtab,
which is used to find one or more references to the lineno, it must return
a list of symtabs with references to this lineno. Means, a similar search
over all symtabs which is already done in find_line_symtab().
Would that be enough to handle the file:lineno case?

(If yes it think a new function like find_multi_line_symtab() is the best
way to do it, then in decode_all_digits() fill in the sals with the found
symtabs + linenos)

> If you take a look at the archives for the list, you will find a lot of
> discussion on this subject - as well as a prototype patch I posted
> earlier this year.  That patch may be good enough for your needs, since
> it handles the file:lineno case.  But it isn't done yet, and I haven't
> had time to go back to it yet.
>

Intresting...


-Thomas Maier



  reply	other threads:[~2005-05-01 20:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-01 18:33 Thomas Maier
2005-05-01 19:05 ` Daniel Jacobowitz
2005-05-01 20:54   ` Thomas Maier [this message]
2005-05-01 21:56     ` Daniel Jacobowitz
2005-05-03 17:46       ` Thomas Maier

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=opsp36yr1riudtyh@a3efe.a.pppool.de \
    --to=balagi@justmail.de \
    --cc=drow@false.org \
    --cc=gdb-patches@sources.redhat.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