From: Kevin Buettner <kevinb@redhat.com>
To: gdb-patches@sourceware.org
Subject: [RFC] symtab.c: Change skip_prologue_sal comparison to match main() too
Date: Tue, 13 Mar 2012 22:58:00 -0000 [thread overview]
Message-ID: <20120313155817.44b4f280@mesquite.lan> (raw)
I'm seeing failures in gdb.cp/koenig.exp for targets which define a
``skip_main_prologue'' gdbarch method. It turns out, however, that
most other C++ tests which run to main are not running to the correct
location either. (The test results don't show this though.)
Here is the relevant part of the log file for gdb.cp/koenig.exp for
frv-elf showing this behavior:
Breakpoint 1, main () at /ironwood1/sourceware-clean/frv-elf/../src/gdb/testsuite/gdb.cp/koenig.cc:246
246 {
(gdb) p first(c)
No symbol "c" in current context.
Note that the breakpoint did not correctly end up at the first line of
the function body.
When I look at the code in question with gdb, I see that a comparison
is being made between "main()" and "main" and is (obviously) failing.
Does the patch below look reasonable?
Kevin
* symtab.c (skip_prologue_sal): Change test to check for "main()"
in addition to "main".
Index: symtab.c
===================================================================
RCS file: /cvs/src/src/gdb/symtab.c,v
retrieving revision 1.298
diff -u -p -r1.298 symtab.c
--- symtab.c 1 Mar 2012 21:13:59 -0000 1.298
+++ symtab.c 13 Mar 2012 22:32:49 -0000
@@ -2776,7 +2776,7 @@ skip_prologue_sal (struct symtab_and_lin
to `__main' in `main' between the prologue and before user
code. */
if (gdbarch_skip_main_prologue_p (gdbarch)
- && name && strcmp (name, "main") == 0)
+ && name && strcmp_iw (name, "main") == 0)
{
pc = gdbarch_skip_main_prologue (gdbarch, pc);
/* Recalculate the line number (might not be N+1). */
next reply other threads:[~2012-03-13 22:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-13 22:58 Kevin Buettner [this message]
2012-03-13 23:25 ` Pedro Alves
2012-03-14 9:02 ` Jan Kratochvil
2012-03-21 22:08 ` Kevin Buettner
2012-03-21 22:01 ` Kevin Buettner
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=20120313155817.44b4f280@mesquite.lan \
--to=kevinb@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