Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: gdb-patches@sourceware.org
Subject: [patch 0/2] physname reg.: C++ breakpoints / linespec fixes
Date: Sun, 05 Jun 2011 20:26:00 -0000	[thread overview]
Message-ID: <20110605202615.GA20427@host1.jankratochvil.net> (raw)

Hi,

as discussed in the "The future of dwarf2_physname" thread GDB lost the
ability to fallback to minimal symbols (ELF .symtab & co.) from full symbols
(DWARF .debug_info etc.) in some cases, due to physname:
-         if (paren_pointer == NULL)
-           return decode_compound (argptr, funfirstline, canonical,
change into unconditional - approx.:
+           return decode_compound (argptr, funfirstline, canonical,

[patch 1/2]
One reason if there are some bugs and/or discrepancies between GCC, DWARF and
GDB regarding DWARF which is sometimes even missing DW_AT_linkage_name.
The minimal symbols are at least one way how to `break' at some function.

Another point is that sometimes the DWARF is missing, either for parts of the
app compiled without -g or for system libraries which do not have separate
debug info installed.

[patch 2/2]
Another problem is "Junk at end of arguments." for more complicated function
specifiers.  It is due to the physname patch part:
-  else if (paren_pointer != NULL)
-    {
-      p = paren_pointer + 1;
-    }
The idea here is instead of chasing which every string can still be a part of
the function specification (as being done by current physname code) one can
rather to stop on any string which looks as a linespec stopper.  It would be
a problem if it could be ambiguous but I haven't found any countercase, would
you?  That is:
 * it is worse to parse "operator()" and leave "(int)" there
   causing "Junk at end of arguments." 
instead of the failure case of the proposed code:
 * possibly consider whole "funcname threaf 1" (`threaf' is a `thread' typo)
   as a function name failing to look up symbol "funcname threaf 1".  It just
   leads to a different error type but it would end up by an error anyway.

I have not addressed specific PRs, I was addressing to have no regressions
against pre-physname GDB, that is to the FSF gdb-7.1 state, before:
	commit 42284fdf9d8cdb20c8e833bdbdb2b56977fea525
	Author: Keith Seitz <keiths@redhat.com>
	Date:   Tue Mar 9 18:09:04 2010 +0000
	    dwarf2_physname patchset:

as tested by my gdb-breakpoint*.pl scripts posted at:
	Re: [RFA] 12266 (typedef'd parameters) revisited again
	http://sourceware.org/ml/gdb-patches/2011-06/msg00067.html

that is to be able to at least:
	(gdb) break 'function name as seen in nm -C'

So far I have not tried to test regressions without quotes but (a) hopefully
it also works and (b) adding quotes should be users be used to as
a workaround, it is worse if one cannot figure out how to putsthe breakpoint.

I understand all the various bugs in decode_compound code (such as the one about `operator ()') and in physname
mangling etc. can be fixed but these two
patches try to address it in a generic way.  linespec is IMNSHO a hack anyway
and one day it should be merged with the general expression parser (used for
example for `print'); which should be further merged with GCC/G++ parser.
	Expression Parser Plug-In Available
	http://sourceware.org/ml/archer/2011-q1/msg00122.html

So the goal here is to get no regressions with gdb-breakpoint*.pl scripts,
I did not try to summarize all the regression types to create a GDB testcase
for each of them.  The new testcases are only illustrative for the specific
fixes FAIL->PASS, I was not trying to address each specific problems by this
patchset anyway.


Thanks,
Jan


             reply	other threads:[~2011-06-05 20:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-05 20:26 Jan Kratochvil [this message]
2011-06-05 20:58 ` Jan Kratochvil
2011-06-07 20:24 ` Tom Tromey
2011-06-08 14:43   ` Jan Kratochvil
2011-06-09 13:47     ` Jan Kratochvil

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=20110605202615.GA20427@host1.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb-patches@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