From: Joel Brobecker <brobecker@adacore.com>
To: Paul Pluzhnikov <ppluzhnikov@google.com>
Cc: tromey@redhat.com, Pedro Alves <pedro@codesourcery.com>,
gdb-patches@sourceware.org
Subject: Re: [patch] Fix a crash when displaying variables from shared library.
Date: Thu, 05 Mar 2009 20:04:00 -0000 [thread overview]
Message-ID: <20090305200415.GC3744@adacore.com> (raw)
In-Reply-To: <8ac60eac0903041124s1aafb562u225f268c4d1511dd@mail.gmail.com>
> 2009-03-04 Paul Pluzhnikov <ppluzhnikov@google.com>
>
> * printcmd.c (do_one_display): Reparse exp_string.
> (display_uses_solib_p): New function.
> (clear_dangling_display_expressions): New function.
> (_initialize_printcmd): Add observer.
> * solib.c (no_shared_libraries): Swap order of calls to
> clear_solib and objfile_purge_solibs.
>
> testsuite/ChangeLog:
>
> 2009-02-04 Paul Pluzhnikov <ppluzhnikov@google.com>
>
> * solib-display.exp: New file.
> * solib-display-main.c: New file.
> * solib-display-lib.c: New file.
All pre-approved after taking the minor comments below into account.
> + if (d->block != NULL &&
> + solib_address (d->block->startaddr) == solib->so_name)
Minor style issue: The "&&" should be at the start of the next line.
> + gdb_assert (elts[i + 3].opcode == OP_VAR_VALUE);
Is this really necessary? I don't believe we have this sort
of assertion anywhere else.
> +/* display_chain items point to blocks and expressions. Some expressions in
One space is missing after the period (I feel really sorry about
perstering anyone about this, but this is the GCS)
> Index: solib.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/solib.c,v
> retrieving revision 1.111
> diff -u -p -u -r1.111 solib.c
> --- solib.c 21 Feb 2009 16:14:49 -0000 1.111
> +++ solib.c 4 Mar 2009 19:17:56 -0000
> @@ -999,8 +999,13 @@ sharedlibrary_command (char *args, int f
> void
> no_shared_libraries (char *ignored, int from_tty)
> {
> - objfile_purge_solibs ();
> + /* The order of the two routines below is important: clear_solib
> + will notify observers, and at least clear_dangling_display_expressions
> + observer needs access to objfiles associated with solibs being
> + cleared. */
I'm relunctant to have comments mention the name of a routine as
an example. I think we can get away from it by staying general:
/* The order of the two routines below is important: clear_solib
notifies the solib_unloaded observers, and some of these observes
might need access to their associated objfiles. Therefore,
we cannot purge the solibs' objfiles before clear_solib has
been called. */
> +if ![runto_main] then {
> + fail "Can't run to main (2)"
> + return 0
> +}
> +
> +gdb_test "stepi" "3: c_global = 43\\r\\n2: b_global = 42\\r\\n1: a_global = 41" "after rerun"
I am guessing that the "stepi" test is really there because
you couldn't get the runto_main output, and therefore couldn't
verify it.
I suggest a different approach:
| # Start the program, we should land in the program main procedure
| if { [gdb_start_cmd] < 0 } {
| fail "Can't run to main"
| return -1
| }
|
| gdb_test "" \
| "first \\(\\) at .*first.adb.*" \
| "start first"
The second gdb_test should allow you to verify that the debugger
displays your variables correctly.
What do you think?
--
Joel
next prev parent reply other threads:[~2009-03-05 20:04 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-05 3:03 Paul Pluzhnikov
2009-02-06 21:38 ` Tom Tromey
2009-02-07 2:37 ` Paul Pluzhnikov
2009-02-11 1:46 ` Tom Tromey
2009-02-19 1:00 ` Paul Pluzhnikov
2009-02-19 7:52 ` Paul Pluzhnikov
2009-02-23 1:47 ` Joel Brobecker
2009-02-23 18:36 ` Paul Pluzhnikov
2009-03-03 2:31 ` Paul Pluzhnikov
2009-03-04 0:51 ` Tom Tromey
2009-03-04 19:26 ` Paul Pluzhnikov
2009-03-05 20:04 ` Joel Brobecker [this message]
2009-03-05 23:46 ` Paul Pluzhnikov
2009-03-06 3:06 ` Paul Pluzhnikov
2009-03-06 3:18 ` Paul Pluzhnikov
2009-03-06 17:48 ` Joel Brobecker
2009-03-06 18:31 ` Paul Pluzhnikov
2009-03-06 18:47 ` Joel Brobecker
2009-03-06 18:52 ` Paul Pluzhnikov
2009-03-06 22:06 ` Paul Pluzhnikov
2009-03-09 18:33 ` Joel Brobecker
2009-03-10 2:05 ` Paul Pluzhnikov
2009-03-10 14:31 ` Daniel Jacobowitz
2009-03-12 2:45 ` Paul Pluzhnikov
2009-03-20 20:32 ` Joel Brobecker
2009-03-20 20:53 ` Paul Pluzhnikov
2009-03-23 17:31 ` Joel Brobecker
2009-03-18 2:50 ` Pedro Alves
2009-03-18 3:24 ` [patch] Fix a crash when displaying variables from shared ?library Joel Brobecker
2009-03-18 4:06 ` Paul Pluzhnikov
2009-03-18 4:19 ` Pedro Alves
2009-03-18 6:54 ` Paul Pluzhnikov
2009-03-18 17:32 ` Pedro Alves
2009-02-06 21:53 ` [patch] Fix a crash when displaying variables from shared library Pedro Alves
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=20090305200415.GC3744@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=pedro@codesourcery.com \
--cc=ppluzhnikov@google.com \
--cc=tromey@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