public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* A couple of suggestions/questions
@ 1999-10-04 12:29 Thomas A Peterson
  1999-10-04 14:13 ` James Ingham
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas A Peterson @ 1999-10-04 12:29 UTC (permalink / raw)
  To: insight

It would be nice if the pop-up view of a variables was available when
viewing inline C++ functions that are in header files.  I end up doing a
View->Local Variables to get around this missing feature.

For some reason the source file list does not contain the assembly language
files that went into the executable.  Only the headers, C, and C++ files
are in the list.  Is this a limitation of gdb?

I would like to have a gdb.ini file that would allow me to attach to my
remote target without any gui interaction but I can't seem to figure it
out.  Is there a way to set the baudrate from the init file?  Is there a
way to specify that breakpoints should NOT be set at main() and exit()?

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?

Thanks, Tom

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

* Re: A couple of suggestions/questions
  1999-10-04 12:29 A couple of suggestions/questions Thomas A Peterson
@ 1999-10-04 14:13 ` James Ingham
  1999-10-04 15:59   ` Thomas A Peterson
  0 siblings, 1 reply; 4+ messages in thread
From: James Ingham @ 1999-10-04 14:13 UTC (permalink / raw)
  To: Thomas A Peterson; +Cc: insight

Tom,

 > It would be nice if the pop-up view of a variables was available when
 > viewing inline C++ functions that are in header files.  I end up doing a
 > View->Local Variables to get around this missing feature.

I don't understand what you want here?  Do you want a popup on the
main source window, along with the File & Function box, or what?

 > 
 > For some reason the source file list does not contain the assembly language
 > files that went into the executable.  Only the headers, C, and C++ files
 > are in the list.  Is this a limitation of gdb?

This is a limitation of the assembler you are using.  It has to put
the correct file symbol into the debug information, or gdb will never
read it.  Gas on the Sun, for instance, does not include this
information even if you do -g.  There is not much gdb can do if the
symbol information is not there.

 > 
 > I would like to have a gdb.ini file that would allow me to attach to my
 > remote target without any gui interaction but I can't seem to figure it
 > out.  Is there a way to set the baudrate from the init file?  Is there a
 > way to specify that breakpoints should NOT be set at main() and exit()?

You can set the GUI preferences (like break at main) in three ways.
One is by setting up the UI the way you want and then closing the app
down.  This should save the preferences in the .gdbtkinit file (gdbtk.ini
for the Windows folks) in your home directory.  If something doesn't
get saved, that is a bug.

You can also edit the .gdbtkinit file by hand.  You can figure out
what the entries mean by looking in the sources, in particular, grep
for "pref define" in the gdb/gdbtcl2 directory of the sources, this
will show you what is there, and there are some comments to help you
out a bit.

Finally, you can run tcl code in the gdb.ini file (or from the console
for that matter), using the "tk" command.  Just put in: 

tk pref set gdb/load/main 0

for instance to turn off breaking at main.  This is probably not the
best way to handle startup code, however, as it will cause errors when
you run gdb -nw, since the tk command only exists in GUI mode.  To
avoid this difficulty, you can instead pass gdb a command file through
the command line using:

gdb --tclcommand file.tcl

which will start up Insight, and then source in the file "file.tcl".
This code will be passed straight to the tcl interpreter, however, so
you must leave off the "tk".

You can also use this to do stuff like connect automatically when you
start up.  You will have to hunt around in the Tcl code to find out
which Tcl procedure does what you want.  The best way to do this is to
find the menu item that does what you want, and seeing what its
-command option is.

 > 
 > 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?

This is a gdb internal issue, not an Insight issue.  Insight just
finds out all the registers that gdb knows about, and shows you those.
Look at the function gdb_regnames in gdbtk-cmds.c for the details.
You will have to teach gdb how to view the registers you want, then
Insight will view them automatically...

Hope this helps,

Jim

-- 
++==++==++==++==++==++==++==++==++==++==++==++==++==++==++==++==++==++==++
Jim Ingham                                              jingham@cygnus.com
Cygnus Solutions Inc.

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

* Re: A couple of suggestions/questions
  1999-10-04 14:13 ` James Ingham
@ 1999-10-04 15:59   ` Thomas A Peterson
  1999-10-04 17:53     ` James Ingham
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas A Peterson @ 1999-10-04 15:59 UTC (permalink / raw)
  To: James Ingham; +Cc: insight

>>>>> "JI" =3D=3D James Ingham <jingham@cygnus.com> writes:

  JI> Tom,

  >> It would be nice if the pop-up view of a variables was available w=
hen
  >> viewing inline C++ functions that are in header files.  I end up d=
oing a
  >> View-> Local Variables to get around this missing feature.

  JI> I don't understand what you want here?  Do you want a popup on th=
e
  JI> main source window, along with the File & Function box, or what?

I would like the same behavior of the mouse that occurs when in a funct=
ion
of a C or C++ file.  Specifically (from the online manual):

 o With the cursor over a global or local variable, the current value o=
f
   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 clas=
s
   displays.

 o Double clicking an expression selects it.=20

 o Right clicking an expression invokes a pop-up menu for expressions (=
the
   selected variable was the =91lis=92 expression).

I don't see this behavior when the debugger is stepping through a funct=
ion
in a header file.  The function is defined as inline but we have instru=
cted
the compiler to not inline anything yet.  I am able to step and next th=
e
compiler but the data interaction is less than desirable.


  JI> You can set the GUI preferences (like break at main) in three way=
s.
  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 (g=
dbtk.ini
  JI> for the Windows folks) in your home directory.  If something does=
n'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.


  >> 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 t=
hose.
  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, th=
en
  JI> Insight will view them automatically...

I did a 'set processor 603' and then an 'info registers' from the conso=
le
which showed all of the registers but when I bought up the registers wi=
ndow
it just showed the user level registers.

Thanks, Tom

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

* Re: A couple of suggestions/questions
  1999-10-04 15:59   ` Thomas A Peterson
@ 1999-10-04 17:53     ` James Ingham
  0 siblings, 0 replies; 4+ messages in thread
From: James Ingham @ 1999-10-04 17:53 UTC (permalink / raw)
  To: Thomas A Peterson; +Cc: James Ingham, insight

[-- 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

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

end of thread, other threads:[~1999-10-04 17:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-10-04 12:29 A couple of suggestions/questions 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 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).