Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Neon.2 does not start GDB 7.12 on macOS

> On 31 Jan 2017, at 19:45, Marc Khouzam <marc.khouzam@xxxxxxxxxxxx> wrote:
> 
> > > > - terminate triggers a windows error dialog box ('arm-none-eabi-gdb.exe has stopped working')
> ...
> > in this case probably it would be useful to test again with GDB Hardware Debug.
> 
> ok, let us know if you still see the problem.

the problem seems to be a bug in GDB, aggravated by the method to terminate the process.

when used by my plug-ins, I get:

```
548,492 50-interpreter-exec --thread-group i1 console kill
548,498 ~"Kill the program being debugged? (y or n) [answered Y; input not from terminal]\n"
548,500 =thread-group-exited,id="i1"
548,504 ~"/tmp/jenkins-GCC-6-buildandreg-54_20161216_1481890185/src/gdb/gdb/target.c:2372: internal-\
error: could not find a target to follow mourn inferior\nA problem internal to GDB has been detected\
,\nfurther debugging may prove unreliable.\nQuit this debugging session? "
548,505 ~"(y or n) [answered Y; input not from terminal]\n"
548,506 &"\nThis is a bug, please report it."
548,506 &"  For instructions, see:\n<http://www.gnu.org/software/gdb/bugs/>."
548,506 &"\n\n"
548,509 ~"/tmp/jenkins-GCC-6-buildandreg-54_20161216_1481890185/src/gdb/gdb/target.c:2372: internal-\
error: could not find a target to follow mourn inferior\nA problem internal to GDB has been detected\
,\nfurther debugging may prove unreliable.\nCreate a core file of GDB? "
548,517 ~"(y or n) [answered Y; input not from terminal]\n"
548,535 51-break-delete --thread-group i1 1
548,541 52-stack-info-depth --thread 1 2
```

while when used by Hardware Debug, it terminates nicely:

```
778,820 46-interpreter-exec --thread-group i1 console kill
778,830 ~"Kill the program being debugged? (y or n) [answered Y; input not from terminal]\n"
778,831 =thread-group-exited,id="i1"
778,832 46^done
778,832 (gdb) 
778,858 47-stack-info-depth --thread 1 2
778,868 47^error,msg="Invalid thread id: 1"
778,868 (gdb) 
778,869 48-stack-list-frames --thread 1 0 1
778,870 48^error,msg="Invalid thread id: 1"
778,870 (gdb) 
778,872 49-list-thread-groups
778,881 49^done,groups=[{id="i1",type="process"}]
778,881 (gdb) 
779,334 50-gdb-exit
779,345 50^exit
```

to me it looks like a broken pipe, or something like this, that upsets windows, and the GDB.exe is not prepared to handle properly.

any suggestion?

> 
> > > > - the new console title is not right, macro substitutions were not performed.
> > > 
> > > This may be a modification in your plugin that does not work with the Debugger
> > > console view change.  Should be easy to fix.  I can have a quick look.
> > 
> > it might be a missing setting in my plug-in, that had a different default in the old implementation.
> 
> Do you modify the title or just use the default?

I use `newProcess = DebugPlugin.newProcess(this, cliProc, label, attributes);` where label is exactly '${cross_prefix}gdb${cross_suffix}', coming from the default setting in the GUI.

> What should it show for example?

before moving the console to the new view, the macros were substituted and the result was 'arm-none-eabi-gdb'.

probably you should identify the code doing the substitution in the old view and replicate it in the new view.

> > I'm not sure, but it looks like stdout is forwarded to one console, and stderr to the other. even if this is a marginal case, 
> > I expected all output to go to the same console. if it is a bug, it might affect output from other processes, we never know.
> 
> Please open a bug for that as well.
> Stderr and stdout should be going to the same "tab" as you call it (it's a "console page" in eclipse, I just say "console").
> Can you figure out what output goes to one and what to the other, or is it random?

as far as I can tell, it did not look random, several runs were identical:

- the 'arm-none-eabi-gdb' console (old one) reads:

```
GNU gdb (GNU Tools for ARM Embedded Processors) 7.10.1.20160923-cvs
Copyright (C) 2015 Free Software Foundation, Inc.

For bug reporting instructions, please see:
138	{

```

- the '${cross_prefix}gdb${cross_suffix} (???)' console (new one) reads:

```
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-apple-darwin10 --target=arm-none-eabi".
Type "show configuration" for configuration details.<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".

Temporary breakpoint 1, main (argc=1, argv=0x20000234 <argv_buf>) at ../src/main.cpp:138

```

the expected output would be:

```
GNU gdb (GNU Tools for ARM Embedded Processors) 7.10.1.20160923-cvs		<---
Copyright (C) 2015 Free Software Foundation, Inc.				<---
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-linux-gnu --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:					<---
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
...
```

it doesn't look like stdout/stderr. can you identify any pattern in this?


regards,

Liviu



Back to the top