This is the mail archive of the insight@sources.redhat.com mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problem with "file" command from CVS_HEAD


OK,

Take 2.

The following patch provides "entry_point" as the PC if Insight has not connected to the target. This seems a much better solution than my previous attempt, as it doesnt trigger an error, and so the TCL Code doesnt need to catch it any more than it did before my change.

Behaviour I now experience, which I feel are different problems:

1. If i execute "file" from a gdb script, sourced by --command:
1.a) The source window comes up with the entry point highlighted. OK.
1.b) I do not have the 3 Drop downs present under the button bar for file, function and mode. BAD
1.c) I get a pop up (a lot) with the message: (Internal error: pc 0x0 in read in psymtab, but not in symtab.). BAD
Note, my entry point is the address 0x00000000. The pop up occurs so much, it makes the interface unusable.
Sometimes the address it complains about is 0x00000100. This is a problem from GDB, and whatever it is will
need to be suppressed, either by the code that puts the pop up up, (probably preferable, as I know from past
experience that the GDB maintainers arent that interested that this message when it occurs usually means (at least
in my experience)
a) Nothing is wrong that is going to cause GDB too many problems, and b) it occurs so often to impede the functional
use of GDB. I am preparing a patch to allow this warning to be disabled, for those who really arent interested if
psymtab matches symtab or not, because it is outside of their control (like the normal end user). But I think i should
also put a filter in Insight for it, so the popup doesnt happen, either way.
2. If i execute "file" from inside insight, by the menu, or by typing it in the Console window (effects are the same):
2.a)Before i execute it, after insight starts, the 3 Drop downs present under the button bar for file, function and mode are present.
2.b)When i execute it i get an error "This file can not be found or does not contain debugging information."
Also, while the error box is shown, the first drop down (file list) shows "xxx,"
2.c) if i press ok, then the error closes, xxx, disappears from the file list, but no file is displayed, including the entry point.
2.d) if i then select a file in the first drop down, i see that file listed, but i get my error from 1.c) above.
2.e) if i then select a function, i get the error from 2.b) again, including xxx, shown in the first drop down.
2.f) when i select ok, i get "Error: expected integer but got "read," i then have an option for a stacktrace:
2.g) the stack trace if selected is:


expected integer but got "read,"
while executing
"gdb_CA_to_TAS $addr"
(object "::.srcwin0.srcwin" method "::SrcWin::location" body line 46)
invoked from within
"location BROWSE_TAG $result"
(object "::.srcwin0.srcwin" method "::SrcWin::goto_func" body line 19)
invoked from within
"::.srcwin0.srcwin goto_func .srcwin0.srcwin.container.pane1.childsite.con.func CountDisplayableJackpots"
(in namespace inscope "::SrcWin" script line 1)
invoked from within
"namespace inscope ::SrcWin {::.srcwin0.srcwin goto_func} .srcwin0.srcwin.container.pane1.childsite.con.func CountDisplayableJackpots"
("uplevel" body line 1)
invoked from within
"uplevel \#0 $options(-command) $args"
(procedure "CallCommand" line 9)
invoked from within
"CallCommand $w $newValue"
(procedure "::combobox::SetValue" line 33)
invoked from within
"::combobox::SetValue $widgets(this) $data"
(procedure "::combobox::Select" line 8)
invoked from within
"::combobox::Select .srcwin0.srcwin.container.pane1.childsite.con.func [.srcwin0.srcwin.container.pane1.childsite.con.func.top.list nearest 13]"
(command bound to event)errorCode is NONE


I think these only now occur, because I am getting past the segfault, the only behaviour which differs in the above from my previous fix is 1.a) which in the previous fix didnt show the entry point, it showed no source at all, but otherwise everything else still occured, so I dont think this fix is responsible for these problems.

I will continue to investigate these issues. Once ive tracked them down, and i can see for sure they are unrelated or at least not cause and effect, i will resubmit this patch with appropriate changelog entries, if no one has any negative comments.

Steven Johnson

diff -Naur gdb-6.3/gdb/gdbtk/generic/gdbtk-cmds.c gdb-6.3-modified/gdb/gdbtk/generic/gdbtk-cmds.c
--- gdb-6.3/gdb/gdbtk/generic/gdbtk-cmds.c	2005-05-15 21:49:09.000000000 -1100
+++ gdb-6.3-modified/gdb/gdbtk/generic/gdbtk-cmds.c	2005-05-17 16:46:58.164964427 -1100
@@ -2114,8 +2114,18 @@
 
   if (objc == 1)
     {
-      if (deprecated_selected_frame
-	  && (get_frame_pc (deprecated_selected_frame) != read_pc ()))
+      /* This function can be called, before the target is properly
+         set-up, the following prevents an error, by trying to
+	 read_pc when there is no pc to read. It defaults pc, 
+         before the target is connected to the entry point of the
+         program */
+      if (!target_has_registers)
+        {
+	  pc = entry_point_address ();
+	  sal = find_pc_line (pc, 0);
+	}  
+      else if (deprecated_selected_frame
+	       && (get_frame_pc (deprecated_selected_frame) != read_pc ()))
         {
           /* Note - this next line is not correct on all architectures.
 	     For a graphical debugger we really want to highlight the 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]