public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Don't update registers with no valid frame
@ 2003-02-12  0:39 Keith Seitz
  2003-02-13 16:46 ` Andrew Cagney
  0 siblings, 1 reply; 2+ messages in thread
From: Keith Seitz @ 2003-02-12  0:39 UTC (permalink / raw)
  To: insight

[-- Attachment #1: Type: text/plain, Size: 398 bytes --]

Hi,

This patch should fix a recent internal_error problem that has crept up
in recent days. Try opening the Register Window with no process. Oops.

Keith

ChangeLog
2003-02-11  Keith R Seitz  <keiths@redhat.com>

        * generic/gdbtk-register.c (register_changed_p): If the selected
        frame is NULL, do not call frame_register_read, since that will
        now cause an internal error.



[-- Attachment #2: p --]
[-- Type: text/x-patch, Size: 758 bytes --]

Index: gdbtk/generic/gdbtk-register.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-register.c,v
retrieving revision 1.14
diff -u -p -r1.14 gdbtk-register.c
--- gdbtk/generic/gdbtk-register.c	11 Feb 2003 16:08:38 -0000	1.14
+++ gdbtk/generic/gdbtk-register.c	12 Feb 2003 00:36:34 -0000
@@ -437,7 +437,8 @@ register_changed_p (int regnum, void *ar
 {
   char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
 
-  if (!frame_register_read (deprecated_selected_frame, regnum, raw_buffer))
+  if (deprecated_selected_frame == NULL
+      || !frame_register_read (deprecated_selected_frame, regnum, raw_buffer))
     return;
 
   if (memcmp (&old_regs[regnum * MAX_REGISTER_RAW_SIZE], raw_buffer,

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Don't update registers with no valid frame
  2003-02-12  0:39 [PATCH] Don't update registers with no valid frame Keith Seitz
@ 2003-02-13 16:46 ` Andrew Cagney
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Cagney @ 2003-02-13 16:46 UTC (permalink / raw)
  To: Keith Seitz; +Cc: insight

> Hi,
> 
> This patch should fix a recent internal_error problem that has crept up
> in recent days. Try opening the Register Window with no process. Oops.
> 
> Keith
> 
> ChangeLog
> 2003-02-11  Keith R Seitz  <keiths@redhat.com>
> 
>         * generic/gdbtk-register.c (register_changed_p): If the selected
>         frame is NULL, do not call frame_register_read, since that will
>         now cause an internal error.

The code should be changed to either:

- call get_selected_frame()
- (prefered) pass the selected frame in

GDB now goes out of its way to create at least an innermost frame.

Andrew


> Index: gdbtk/generic/gdbtk-register.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-register.c,v
> retrieving revision 1.14
> diff -u -p -r1.14 gdbtk-register.c
> --- gdbtk/generic/gdbtk-register.c	11 Feb 2003 16:08:38 -0000	1.14
> +++ gdbtk/generic/gdbtk-register.c	12 Feb 2003 00:36:34 -0000
> @@ -437,7 +437,8 @@ register_changed_p (int regnum, void *ar
>  {
>    char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
>  
> -  if (!frame_register_read (deprecated_selected_frame, regnum, raw_buffer))
> +  if (deprecated_selected_frame == NULL
> +      || !frame_register_read (deprecated_selected_frame, regnum, raw_buffer))
>      return;
>  
>    if (memcmp (&old_regs[regnum * MAX_REGISTER_RAW_SIZE], raw_buffer,


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-02-13 16:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-12  0:39 [PATCH] Don't update registers with no valid frame Keith Seitz
2003-02-13 16:46 ` Andrew Cagney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).