Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: ams@codesourcery.com
Cc: gdb@sourceware.org
Subject: Re: [commited] Detect bad debug info
Date: Mon, 22 Sep 2008 14:27:00 -0000	[thread overview]
Message-ID: <200809221423.m8MENqKc022084@brahms.sibelius.xs4all.nl> (raw)
In-Reply-To: <48D799CC.4020103@codesourcery.com> (message from Andrew Stubbs 	on Mon, 22 Sep 2008 14:12:44 +0100)

> Date: Mon, 22 Sep 2008 14:12:44 +0100
> From: Andrew Stubbs <ams@codesourcery.com>
> 
> Daniel Jacobowitz wrote:
> > On Mon, Sep 22, 2008 at 10:41:29AM +0100, Andrew Stubbs wrote:
> >> The patch ensures that the debugger never attempts to read beyond the end 
> >> of the register file.
> > 
> > Could you explain this in the code?  I think it's more enlightening
> > than "bad debug info".
> 
> Very well, how about the attached?

Thanks, that defenitely removes some serious question marks for me.

> 2008-09-22  Andrew Stubbs  <ams@codesourcery.com>
> 
> 	* frame.c (get_frame_register_bytes): Comment improvments.
> 
> Index: frame.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/frame.c,v
> retrieving revision 1.252
> diff -u -p -r1.252 frame.c
> --- frame.c	19 Sep 2008 18:12:17 -0000	1.252
> +++ frame.c	22 Sep 2008 13:12:09 -0000
> @@ -806,13 +806,14 @@ get_frame_register_bytes (struct frame_i
>        regnum++;
>      }
>  
> -  /* Detect bad debug info.  */
> +  /* Ensure that we will not read beyond the end of the register file.
> +     This can only ever happen if the debug information is bad.  */
>    maxsize = -offset;
>    for (i = regnum; i < gdbarch_num_regs (gdbarch); i++)
>      {
>        int thissize = register_size (gdbarch, i);
>        if (thissize == 0)
> -	break;
> +	break;	/* This register is not available on this architecture.  */
>        maxsize += thissize;
>      }
>    if (len > maxsize)


  parent reply	other threads:[~2008-09-22 14:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-19 18:16 Andrew Stubbs
2008-09-19 22:27 ` Mark Kettenis
2008-09-22  9:42   ` Andrew Stubbs
2008-09-22 12:50     ` Daniel Jacobowitz
2008-09-22 13:13       ` Andrew Stubbs
2008-09-22 13:33         ` Daniel Jacobowitz
2008-09-22 13:38           ` Andrew Stubbs
2008-09-22 14:27         ` Mark Kettenis [this message]
2008-09-24 12:18 ` Andreas Schwab
2008-09-24 13:00   ` Andreas Schwab

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=200809221423.m8MENqKc022084@brahms.sibelius.xs4all.nl \
    --to=mark.kettenis@xs4all.nl \
    --cc=ams@codesourcery.com \
    --cc=gdb@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