Bug 86

Summary: Remote debug fails
Product: [Yocto Project Subprojects] Anjuta Plugin Reporter: Gary Thomas <gary>
Component: anjuta-pluginAssignee: liping Ke <liping.ke>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: High CC: gary, jessica.zhang, josh, liping.ke, yp.ap.watcher, yp.watcher
Version: 0.9   
Target Milestone: 0.9 M1   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Program Management Documentation change: ---

Description Gary Thomas 2010-04-01 12:35:10 UTC
Host=x86, Target=PowerPC

When I "Tools->Debug Remote", gdbserver is launched on the target, but the IDE
just sits there.  It's unclear if a local GDB process is launched.
Comment 1 Joshua Lock - Disabled 2010-04-07 10:32:12 UTC
Turns out this is when there is not GDB server installed on the target, so we should make loud noises about it.
Comment 2 Gary Thomas 2010-04-07 12:27:19 UTC
Actually, the observed problem is when there is no <target-triplet>-gdb available on the host.  This path is implicitly used, but not defined/controllable by the user and if it's missing, there is no reporting.

In the function do_local_gdb() in src/plugin.c, line #758:
  ianjuta_terminal_execute_command (terminal, cur_dir, cmd, NULL, &error);

Somehow when the 'cmd' fails, 'error' is not set as expected and thus there is no report of the problem.
Comment 3 Gary Thomas 2010-04-07 22:29:28 UTC
Looking more at the plugin code - the function that it calls totally ignores the 'error' parameter, so it hs no way to pass back any error information.

It does pass back the pid_t of the created process, so a check for (pid_t)-1
would be a way to at least detect that the exec failed.
Comment 4 liping Ke 2010-05-19 08:47:58 UTC
After checking anjuta IDE & vte terminal code, I think this makes sense. I will try to reproduce and fix it in this way to see whether it works.

Thanks!
criping

(In reply to comment #3)
> Looking more at the plugin code - the function that it calls totally ignores
> the 'error' parameter, so it hs no way to pass back any error information.
> 
> It does pass back the pid_t of the created process, so a check for (pid_t)-1
> would be a way to at least detect that the exec failed.
> 
Comment 5 liping Ke 2010-05-21 03:59:42 UTC
*** Bug 2062 has been marked as a duplicate of this bug. ***
Comment 6 liping Ke 2010-05-21 04:06:35 UTC
(In reply to comment #4)
> After checking anjuta IDE & vte terminal code, I think this makes sense. I will
> try to reproduce and fix it in this way to see whether it works.
> 
> Thanks!
> criping
> 
> (In reply to comment #3)
> > Looking more at the plugin code - the function that it calls totally ignores
> > the 'error' parameter, so it hs no way to pass back any error information.
> > 
> > It does pass back the pid_t of the created process, so a check for (pid_t)-1
> > would be a way to at least detect that the exec failed.
> > 
> 

Hi, all
To totally solve this bug we need
1) as the above mentions, use pid to judge whether ianjuta_terminal_execute_command succeeds or not. If fails, we need print error information.
2) But even we doing this, the terminal still hang there, with no user keyboard response at all, please refer to http://bugzilla.o-hand.com/show_bug.cgi?id=2000
I have already fired a bug to anjuta terminal plugin for this.
For bring the terminal back, the workaround is : do another valid ianjuta_terminal_execute_command if fails, such as "pwd", it will bring the terminal back. But just as I said, the terminal did not work well even if the cmd is valid, eg: for pwd, it did not list the current path information at all.
I don't know whether the latest vte/anjuta version still have this problem.
please trace bug https://bugzilla.gnome.org/show_bug.cgi?id=619253.

I will submit the fix 1) (this is a must) and workaround 2 (for makes this terminal a little stabler), and update the bug status a little later.

Thanks& Regards,
criping
Comment 7 Joshua Lock - Disabled 2010-07-13 04:02:00 UTC
Fixed in 0.7.1
Comment 8 liping Ke 2010-09-01 01:10:29 UTC
Hi, Saul

Just as Josh, the fix was already checked in.

Thanks& Regards,
criping