Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Josef Zlomek <zlomj9am@artax.karlin.mff.cuni.cz>
To: Daniel Jacobowitz <drow@mvista.com>
Cc: gdb@sources.redhat.com
Subject: Re: Problem with location lists and variables on stack
Date: Wed, 01 Oct 2003 15:21:00 -0000	[thread overview]
Message-ID: <20031001152137.GA14527@artax.karlin.mff.cuni.cz> (raw)
In-Reply-To: <20031001144937.GA4613@nevyn.them.org>

> > I writing a better pass (variable tracking) for GCC which finally emits
> > location lists for variables. (If you are insterested it is at
> > http://artax.karlin.mff.cuni.cz/~zlomj9am/download/vt-main.patch
> > It still contains many debugging checks and (disabled) prints.)
> > 
> > Let the local variables and (some) arguments be addressed using stack pointer,
> > for example x86-64 architecture with variables addressed using %rsp.
> > The address emitted for variables located on stack by my new patch is always
> > DW_OP_fbreg + constant.
> > 
> > When I was testing the emitted debug info with mainline GDB I found that
> > GDB probably does not adjust addresses of variables when stack pointer changes
> > (like because of "pushq" instruction) if using location lists.
> > I think GDB should adjust the address of %rsp addressed variables according to
> > change of %rsp (probably DWARF2 sais so for DW_OP_fbreg). I think it is a
> > better solution than emitting new locations to location list for all variables
> > located on stack after each "push" and "pop" which would cause too large debug
> > info.
> > 
> > When I looked to gdb/dwarf2loc.c I see there:
> >  /* FIXME: cagney/2003-03-26: This code should be using
> >      get_frame_base_address(), and then implement a dwarf2 specific
> >      this_base method.  */
> > Probably this is related to my problem.
> 
> The FIXME is a cleanliness problem.  We do evaluate DW_AT_frame_base,
> so it _ought_ to work.
> 
> > I tested it on attached C file, assembler with debug info and x86-64 binary
> > is attached too.
> 
> Do you suppose you could produce an x86 (ia32) testcase?  I don't have
> x86-64 hardware available yet.  The debug info looks right so I'd like
> to get my fingers into the problem.

I think it will be the same on i386 with -fomit-frame-pointer.
I'll test it and send you files if needed.

Josef


  reply	other threads:[~2003-10-01 15:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-01 14:43 Josef Zlomek
2003-10-01 14:49 ` Daniel Jacobowitz
2003-10-01 15:21   ` Josef Zlomek [this message]
2003-10-01 15:44   ` Josef Zlomek
2003-10-01 15:54     ` Daniel Jacobowitz
2003-10-01 16:03       ` Josef Zlomek
2003-10-01 16:22         ` Daniel Jacobowitz
2003-10-01 17:41           ` Josef Zlomek
2003-10-01 17:44             ` Daniel Jacobowitz
2003-10-01 17:48               ` Josef Zlomek
2003-10-06  6:22               ` Richard Henderson
2003-10-06  6:40                 ` Josef Zlomek
2003-10-06 13:46                   ` Daniel Jacobowitz
2003-10-06 14:49                     ` Daniel Berlin
2003-10-07 21:48                       ` Daniel Jacobowitz
2003-10-08  5:09                         ` Josef Zlomek

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=20031001152137.GA14527@artax.karlin.mff.cuni.cz \
    --to=zlomj9am@artax.karlin.mff.cuni.cz \
    --cc=drow@mvista.com \
    --cc=gdb@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