public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
From: James Ingham <jingham@cygnus.com>
To: Thomas A Peterson <tap@htc.honeywell.com>
Cc: James Ingham <jingham@cygnus.com>, insight@sourceware.cygnus.com
Subject: Re: A couple of suggestions/questions
Date: Mon, 04 Oct 1999 17:53:00 -0000	[thread overview]
Message-ID: <14329.19576.592753.484533@leda.cygnus.com> (raw)
In-Reply-To: <199910042259.RAA29151@wocket.htc.honeywell.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 7426 bytes --]

Thomas,

 > I would like the same behavior of the mouse that occurs when in a function
 > of a C or C++ file.  Specifically (from the online manual):
 > 
 >  o With the cursor over a global or local variable, the current value of
 >    that variable displays.
 > 
 >  o With the cursor over a pointer to a structure or class, the type of
 >    structure or class displays and the address of the structure or class
 >    displays.
 > 
 >  o Double clicking an expression selects it. 
 > 
 >  o Right clicking an expression invokes a pop-up menu for expressions (the
 >    selected variable was the ‘lis’ expression).
 > 
 > I don't see this behavior when the debugger is stepping through a function
 > in a header file.  The function is defined as inline but we have instructed
 > the compiler to not inline anything yet.  I am able to step and next the
 > compiler but the data interaction is less than desirable.

Humm...  Sounds like a bug.  Insight will only invoke the popups, et
al, if it thinks it is over the function containing the current frame.
I bet gdb is getting confused somehow, and not telling us the right
thing.  If you do inline, gdb gets totally confused about inlined
functions, so it is not too suprising that it loses here as well.  I
don't have time to look at this right now, but I will add it to the list.

 > 
 > 
 >   JI> You can set the GUI preferences (like break at main) in three ways.
 >   JI> One is by setting up the UI the way you want and then closing the app
 >   JI> down.  This should save the preferences in the .gdbtkinit file (gdbtk.ini
 >   JI> for the Windows folks) in your home directory.  If something doesn't
 >   JI> get saved, that is a bug.
 > 
 > For some reason I'm not getting the file created (gdbtk.ini).  I'll try
 > tracking it down.  I'm running under Windows NT with a cross to
 > powerpc-elf.
 > 

Ah, yes.  I fixed this just a few days ago.  Cygwin & Tcl have
different ideas of how to specify paths, and if you had your HOME
environment set to a cygwin path, Tcl would think you had it on a
networked drive...  This also caused an annoyingly long delay when you
quit Insight.  I appended a patch tp gdbtcl2/prefs.tcl to the end of
this note that should fix the problem.

 > 
 >   >> We are using it as a kernel level debugger and would like to view the
 >   >> supervisor level registers of the PowerPC from the View->Registers window.
 >   >> Is there a magic incantation that would allow me to do this or do I have to
 >   >> modify some insight code?
 > 
 >   JI> This is a gdb internal issue, not an Insight issue.  Insight just
 >   JI> finds out all the registers that gdb knows about, and shows you those.
 >   JI> Look at the function gdb_regnames in gdbtk-cmds.c for the details.
 >   JI> You will have to teach gdb how to view the registers you want, then
 >   JI> Insight will view them automatically...
 > 
 > I did a 'set processor 603' and then an 'info register' from the console
 > which showed all of the registers but when I bought up the registers window
 > it just showed the user level registers.

This is a bug.  gdb_regnames was stopping at the first register that
was undefined in the current register set, whereas "info register"
skipped the undefined ones & kept on going.  There is also a patch
appended to fix this.  Tell me how it works.

Jim

Index: gdbtk-cmds.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/gdbtk-cmds.c,v
retrieving revision 2.59
diff -p -r2.59 gdbtk-cmds.c
*** gdbtk-cmds.c	1999/09/21 00:29:51	2.59
--- gdbtk-cmds.c	1999/10/05 00:47:49
*************** map_arg_registers (objc, objv, func, arg
*** 1762,1768 ****
       void (*func) PARAMS ((int regnum, void *argp));
       void *argp;
  {
!   int regnum;
  
    /* Note that the test for a valid register must include checking the
       REGISTER_NAME because NUM_REGS may be allocated for the union of
--- 1762,1768 ----
       void (*func) PARAMS ((int regnum, void *argp));
       void *argp;
  {
!   int regnum, numregs;
  
    /* Note that the test for a valid register must include checking the
       REGISTER_NAME because NUM_REGS may be allocated for the union of
*************** map_arg_registers (objc, objv, func, arg
*** 1770,1784 ****
       case, some entries of REGISTER_NAME will change depending upon
       the particular processor being debugged.  */
  
    if (objc == 0)		/* No args, just do all the regs */
      {
        for (regnum = 0;
! 	   regnum < NUM_REGS
! 	   && REGISTER_NAME (regnum) != NULL
! 	   && *REGISTER_NAME (regnum) != '\000';
  	   regnum++)
! 	func (regnum, argp);
! 
        return TCL_OK;
      }
  
--- 1770,1790 ----
       case, some entries of REGISTER_NAME will change depending upon
       the particular processor being debugged.  */
  
+   numregs = ARCH_NUM_REGS;
+   
    if (objc == 0)		/* No args, just do all the regs */
      {
        for (regnum = 0;
! 	   regnum < numregs;
  	   regnum++)
! 	{
! 	  if (REGISTER_NAME (regnum) == NULL
! 	      || *(REGISTER_NAME (regnum)) == '\0')
! 	    continue;
! 	  
! 	  func (regnum, argp);
! 	}
!       
        return TCL_OK;
      }
  
*************** map_arg_registers (objc, objv, func, arg
*** 1792,1798 ****
  	}
  
        if (regnum >= 0
! 	  && regnum < NUM_REGS
  	  && REGISTER_NAME (regnum) != NULL
  	  && *REGISTER_NAME (regnum) != '\000')
  	func (regnum, argp);
--- 1798,1804 ----
  	}
  
        if (regnum >= 0
! 	  && regnum < numregs
  	  && REGISTER_NAME (regnum) != NULL
  	  && *REGISTER_NAME (regnum) != '\000')
  	func (regnum, argp);
Index: gdbtcl2/prefs.tcl
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/gdbtcl2/prefs.tcl,v
retrieving revision 1.55
retrieving revision 1.56
diff -p -r1.55 -r1.56
*** prefs.tcl	1999/09/16 22:46:24	1.55
--- prefs.tcl	1999/09/29 23:41:48	1.56
*************** proc pref_read {} {
*** 34,39 ****
--- 34,49 ----
    global prefs_init_filename env gdb_ImageDir GDBTK_LIBRARY GDBStartup
    global tcl_platform
  
+   if {[info exists env(HOME)]} {
+     if {$tcl_platform(platform) == "windows"} {
+       set home [ide_cygwin_path to_win32 $env(HOME)]
+     } else {
+       set home $env(HOME)
+     }
+   } else {
+     set home ""
+   }
+ 
    if {$tcl_platform(platform) == "windows"} {
      set prefs_init_filename "gdbtk.ini"
    } else {
*************** proc pref_read {} {
*** 48,55 ****
  	return
        }
        set file_opened 1
!     } elseif {[info exists env(HOME)]} {
!       set name [file join $env(HOME) $prefs_init_filename]
        if {[file exists $name]} {
  	if {[catch {open $name r} fd]} {
  	  debug "$fd"
--- 58,65 ----
  	return
        }
        set file_opened 1
!     } elseif {$home != ""} {
!       set name [file join $home $prefs_init_filename]
        if {[file exists $name]} {
  	if {[catch {open $name r} fd]} {
  	  debug "$fd"
*************** proc pref_read {} {
*** 107,116 ****
  	}
        }
        close $fd
!     } elseif {[info exists env(HOME)]} {
!       set prefs_init_filename [file join $env(HOME) $prefs_init_filename]
!     } else {
!       set prefs_init_filename $prefs_init_filename
      }
    
      # now set global options
--- 117,124 ----
  	}
        }
        close $fd
!     } elseif {$home != ""} {
!       set prefs_init_filename [file join $home $prefs_init_filename]
      }
    
      # now set global options

      reply	other threads:[~1999-10-04 17:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-10-04 12:29 Thomas A Peterson
1999-10-04 14:13 ` James Ingham
1999-10-04 15:59   ` Thomas A Peterson
1999-10-04 17:53     ` James Ingham [this message]

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=14329.19576.592753.484533@leda.cygnus.com \
    --to=jingham@cygnus.com \
    --cc=insight@sourceware.cygnus.com \
    --cc=tap@htc.honeywell.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).