From: Daniel Berlin <dan@www.cgsoftware.com>
To: Kevin Buettner <kevinb@cygnus.com>
Cc: Andrew Cagney <ac131313@cygnus.com>,
<gdb-patches@sources.redhat.com>,
Daniel Berlin <dberlin@redhat.com>
Subject: Re: [PATCH] Add support for tracking/evaluating dwarf2 locationexpressions
Date: Fri, 06 Apr 2001 23:18:00 -0000 [thread overview]
Message-ID: <Pine.LNX.4.33.0104070210050.31132-100000@www.cgsoftware.com> (raw)
In-Reply-To: <1010406193532.ZM32133@ocotillo.lan>
On Fri, 6 Apr 2001, Kevin Buettner wrote:
> On Apr 6, 3:10pm, Daniel Berlin wrote:
>
> > On Fri, 6 Apr 2001, Andrew Cagney wrote:
> >
> > > > > value_ptr stack[64];
> > > > > Is there a constant for this? A quick glance at decode_locdesc() and it
> > > > > has the same hardwired constant.
> > > > Nobody has ever produced location expressions that need more.
> > >
> > > The problem typically isn't with what people are doing intentionally but
> > > rather unintentionally. The code opens the way for an input file to
> > > cause gdb to overflow a buffer and trash its stack.
> >
> > Well, as I said, it will trash GCC as well, since they do no range
> > checking, and have the exact same limit.
> > But i'll range check it, just the same.
>
> Maybe GCC has been designed so that it'll never need a bigger stack.
No, it hasn't.
It's a FIXME that's never been fixed :)
> But keep in mind that GDB needs to accept as input the output of
> compilers other than GCC.
Of course.
I think you aren't getting what i say by "break GCC". I mean that all of
the STL classes, and anything that *can* throw exceptions, would miserably
fail, and segfault, at runtime, if something ever went above that limit.
That's a much greater risk than we are facing, by having gdb maybe dump
core, no?
Perhaps some other compiler, through either
> a bug or a feature, will produce more complicated location expressions
> than GCC.
Yeah, but a single location expression requiring 64 things on the stack,
just to evaluate? Remember, adds/removes/etc reduce the number of things
on the stack, or keep it constant, they don't add.
And also, location expressions are for a single web (unioned live ranges
of a variable), location lists are used to describe where it is over a
given range of PC's, which consist of multiple location expressions.
I can't even fathom a way to use more than 64 stack entries. You could
split a variable into almost an infinite number of places (IE say the
first byte is in a register, the next byte is at this given memory
address, etc), at once, and *still* not hit the limit.
But anyway, i added the range check, so this is all moot. ust rambling. :)
> Anyway, I'm glad you've added the range check. >
> Kevin
>
next prev parent reply other threads:[~2001-04-06 23:18 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-03-30 11:11 [PATCH] Add support for tracking/evaluating dwarf2 location expressions Daniel Berlin
2001-03-30 15:36 ` Andrew Cagney
2001-03-30 18:53 ` Daniel Berlin
2001-04-06 11:53 ` Andrew Cagney
2001-04-06 12:10 ` Daniel Berlin
2001-04-06 12:36 ` Kevin Buettner
2001-04-06 23:18 ` Daniel Berlin [this message]
2001-05-21 14:46 ` Jim Blandy
2001-05-21 18:49 ` Daniel Berlin
2001-05-22 12:46 ` Jim Blandy
2001-05-22 13:51 ` Daniel Berlin
2001-05-22 23:14 ` Jim Blandy
2001-05-23 8:51 ` Daniel Berlin
2001-05-23 11:53 ` Daniel Berlin
2001-05-23 21:53 ` Jim Blandy
2001-05-23 22:56 ` Daniel Berlin
2001-06-06 9:07 ` Andrew Cagney
2001-06-06 9:46 ` Daniel Berlin
2001-06-07 7:29 ` Andrew Cagney
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=Pine.LNX.4.33.0104070210050.31132-100000@www.cgsoftware.com \
--to=dan@www.cgsoftware.com \
--cc=ac131313@cygnus.com \
--cc=dberlin@redhat.com \
--cc=gdb-patches@sources.redhat.com \
--cc=kevinb@cygnus.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