Difference between revisions of "Gdbgui"

[quality revision] [quality revision]
m
 
 

1 Article purpose[edit]

This article provides the basic information needed to start using the gdbgui[1] host PC tool.

2 Introduction[edit]

The following table provides a brief description of the tool, as well as its availability depending on the software packages:

Yes: this tool is either present (ready to use or to be activated), or can be integrated and activated on the software package.

No: this tool is not present and cannot be integrated, or it is present but cannot be activated on the software package.

Under construction.png Coming soon
Tool STM32MPU Embedded Software distribution STM32MPU Embedded Software distribution for Android™
Name Category Purpose Starter Package Developer Package Distribution Package Starter Package Developer Package Distribution Package
gdbgui Debugging tools gdbgui[1] runs GDB in the background to build an easy-to-use graphical user interface. It is a browser-based debugger that operates through a web browser page. Since it is based on GDB, it can be used through a JTAG or an ethernet link with gdbserver.
No Yes No* No No No
*: The Developer Package is required to run a GDB debug session that includes all dependencies.

3 Installing the trace and debug tool on your host PC (Ubuntu Linux distribution)[edit]

Warning.png To avoid variable conflicts, the following steps must not be executed from a console where the SDK environment is set.

If it is not present on your Ubuntu Linux® machine, install gdbgui via the Python package installer (pip):

PC $> pip install --trusted-host pypi.python.org --cert /etc/ssl/certs/ --proxy $https_proxy --upgrade gdbgui

Note1: If pip is not already installed, install it as follows:

PC $> sudo apt-get install python-pip

Note2: Depending on your environment, the --proxy option is not mandatory; if required, please check that $https_proxy is well defined, or replace it by your environment variable in the command line.

The gdbgui binary is then installed under $HOME/.local/bin/gdbgui. You can check it by using ths following command:

PC $> which gdbgui

4 Getting started with gdbgui[edit]

4.1 Running gdbgui using gdbserver[edit]

This environment is mainly used to debug applications. The Developer Package context (SDK) is used for setup.

  • Start gdbserver on your target board for the userland program you want to debug:
Board $> gdbserver host:1234 hello_world_example
  • Go to the source directory path:
PC $> cd <source_file_folder_path>

  • Set the SDK environment and start gdbgui:
PC $> source <Your_SDK_path>/environment-setup-cortexa7hf-neon-vfpv4-openstlinux_weston-linux-gnueabi
PC $> gdbgui -g $OECORE_NATIVE_SYSROOT/usr/bin/arm-openstlinux_weston-linux-gnueabi/arm-openstlinux_weston-linux-gnueabi-gdb

Note: In case of issue when starting gdbgui, please refer to the Error cases chapter.

  • Then:
  • Select the "Connect to gdbserver" option from the top left menu.
  • Fill in the ip address of the remote target including the port.

Screenshot gdbgui.png

4.2 Running gdbgui using ST-LINK[edit]

In that case, GDB with openOCD environment is used in a Developer Package context (SDK). Please refer to Running OpenOCD and GDB.

Only GDB console command will be changed:

  • OpenOCD console
No change for OpenOCD. Please refer to the command described in the above link.
  • GDB console
gdbgui must be started with an argument providing the path to the GDB version available on your target board, as well as the config setup file:
PC $> source <Your_SDK_path>/environment-setup-cortexa7hf-neon-vfpv4-openstlinux_weston-linux-gnueabi
PC $> gdbgui -g $OECORE_NATIVE_SYSROOT/usr/bin/arm-openstlinux_weston-linux-gnueabi/arm-openstlinux_weston-linux-gnueabi-gdb --gdb-args="-x <Your_full_path_to>/setupSetup.gdb"

Note: Please refer to GDB page for information on setupSetup.gdb file and how to configure it: Attach on running target or Attach on boot.

5 To go further[edit]

5.1 Execution and debug[edit]

A button to program the execution (continue, step, next), and a panel showing all debug information (signals, thread, variables, memory) can be found on the top right of the gdbgui web page.

Please refer to the gdbgui[1] web page for details.

5.2 Error cases[edit]

  • socket.error: [Errno 98] Address already in use: ('127.0.0.1', 5000)
This error occurs when an instance of gdbgui is already running in background.
In that case, the connection to the gdbserver fails in gdbgui, and the message "remote 'g' packet reply is too long" is displayed.
Just kill the gdbgui instance running in background to solve the issue.

6 References[edit]



<noinclude>

{{ArticleBasedOnModel | [[Trace and debug tools article model]]}}
{{ArticleMainWriter | Jean-PhilippeR}}

{{ ArticleApprovedVersion | Jean-PhilippeR | Jean-ChristopheT, BernardP | No previous approved version  | AnneJ - 07Jan'19 - 10163 | 07Jan'19 }}

[[Category:Debugging tools]]</noinclude>

== Article purpose ==
This article provides the basic information needed to start using the '''gdbgui'''<ref name=gdbguidotcom/> host PC tool.

== Introduction ==
{{:Trace_and_debug_tools_assignment_table_template}}<onlyinclude>

 | rowspan="2" | [[Gdbgui|gdbgui]]
 | rowspan="2" | [[:Category:Debugging tools|Debugging tools]]
 | rowspan="2" style="text-align:left;" | '''gdbgui'''<ref name=gdbguidotcom>https://gdbgui.com/</ref> runs [[GDB]] in the background to build an easy-to-use graphical user interface. It is a browser-based debugger that operates through a web browser page. Since it is based on [[GDB]], it can be used through a JTAG or an ethernet link with gdbserver.<br>

 | {{N}} || {{Y}} || {{N}}&#42;
 | colspan="3" | {{UnderConstruction}}
 |-
 | colspan="6style="height:240px;" | {{N}}
 | style="height:240px;" | {{Y}}
 | style="height:240px;" | {{N}}&#42;
 | rowspan="2"  | {{N}}
 | rowspan="2"  | {{N}}
 | rowspan="2"  | {{N}}
 |-
 | colspan="3" style="text-align:left;font-size:70%;" | &#42;: ''The Developer Package is required to run a GDB debug session that includes all dependencies.''
 |-</onlyinclude>

|}

== Installing the trace and debug tool on your host PC (Ubuntu Linux distribution) ==
{{Warning|To avoid variable conflicts, the following steps must not be executed from a console where the SDK environment is set.}}
If it is not present on your Ubuntu Linux<sup>&reg;</sup> machine, install gdbgui via the Python package installer (pip):
 {{PC$}} pip install --trusted-host pypi.python.org --cert /etc/ssl/certs/ --proxy $https_proxy --upgrade gdbgui

''Note1: If pip is not already installed, install it as follows:''
 {{PC$}} sudo apt-get install python-pip

''Note2: Depending on your environment, the --proxy option is not mandatory; if required, please check that $https_proxy is well defined, or replace it by your environment variable in the command line.''

The gdbgui binary is then installed under ''$HOME/.local/bin/gdbgui''. You can check it by using ths following command:
 {{PC$}} which gdbgui

== Getting started with gdbgui ==

=== Running gdbgui using gdbserver ===
This environment is mainly used to debug applications. The Developer Package context (SDK) is used for setup.
* Start gdbserver on your target board for the userland program you want to debug:
 {{Board$}} gdbserver host:1234 hello_world_example
* Go to the source directory path:
 {{PC$}} cd {{orange|<''source_file_folder_path''>}}

* Set the SDK environment and start '''gdbgui''':
 {{PC$}} source {{orange|<''Your_SDK_path''>}}/environment-setup-cortexa7hf-neon-vfpv4-openstlinux_weston-linux-gnueabi
 {{PC$}} gdbgui -g $OECORE_NATIVE_SYSROOT/usr/bin/arm-openstlinux_weston-linux-gnueabi/arm-openstlinux_weston-linux-gnueabi-gdb
''Note: In case of issue when starting gdbgui, please refer to the [[#Error cases|Error cases]] chapter.''

* Then:
:* Select the "Connect to gdbserver" option from the top left menu.
:* Fill in the ip address of the remote target including the port.
[[File:Screenshot gdbgui.png|1000px|link=]]

=== Running gdbgui using ST-LINK ===
In that case, GDB with openOCD environment is used in a Developer Package context (SDK).
Please refer to [[GDB#Running_OpenOCD_and_GDB|Running OpenOCD and GDB]].

{{highlight|Only GDB console command will be changed:}}
* OpenOCD console
:No change for OpenOCD. Please refer to the command described in the above link.

* GDB console
:'''gdbgui''' must be started with an argument providing the path to the GDB version available on your target board, as well as the config setup file:
 {{PC$}} source {{orange|<''Your_SDK_path''>}}/environment-setup-cortexa7hf-neon-vfpv4-openstlinux_weston-linux-gnueabi
 {{PC$}} gdbgui -g $OECORE_NATIVE_SYSROOT/usr/bin/arm-openstlinux_weston-linux-gnueabi/arm-openstlinux_weston-linux-gnueabi-gdb --gdb-args="-x {{orange|<''Your_full_path_to''>}}/setupSetup.gdb"
''Note: Please refer to [[GDB]] page for information on setupSetup.gdb file and how to configure it: [[GDB#Configuring GDB and OpenOCD for attachment on a running target|Attach on running target]] or [[GDB#Configuring GDB and OpenOCD for attachment on boot|Attach on boot]]''.

== To go further ==
=== Execution and debug ===
A button to program the execution (continue, step, next), and a panel showing all debug information (signals, thread, variables, memory) can be found on the top right of the gdbgui web page. 

Please refer to the '''gdbgui'''<ref name=gdbguidotcom/> web page for details.

=== Error cases ===
* ''socket.error: [Errno 98] Address already in use: ('127.0.0.1', 5000)''
: This error occurs when an instance of gdbgui is already running in background.<br/>

: In that case, the connection to the gdbserver fails in gdbgui, and the message "remote 'g' packet reply is too long" is displayed.
: Just kill the gdbgui instance running in background to solve the issue.

== References ==<references />


{{ArticleBasedOnModel | Trace and debug tools article model}}
{{PublicationRequestId | 10163 | 07Jan'19}}
[[Category:Debugging tools]]
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<noinclude>
 
{{ArticleBasedOnModel | [[Trace and debug tools article model]]}}
 
{{ArticleMainWriter | Jean-PhilippeR}}
 
 
{{ ArticleApprovedVersion | Jean-PhilippeR | Jean-ChristopheT, BernardP | No previous approved version  | AnneJ - 07Jan'19 - 10163 | 07Jan'19 }}
 
 
[[Category:Debugging tools]]
 
</noinclude>
 
 
 
== Article purpose ==
 
== Article purpose ==
 
This article provides the basic information needed to start using the '''gdbgui'''<ref name=gdbguidotcom/> host PC tool.
 
This article provides the basic information needed to start using the '''gdbgui'''<ref name=gdbguidotcom/> host PC tool.
Line 17: Line 8:
 
  | rowspan="2" | [[:Category:Debugging tools|Debugging tools]]
 
  | rowspan="2" | [[:Category:Debugging tools|Debugging tools]]
 
  | rowspan="2" style="text-align:left;" | '''gdbgui'''<ref name=gdbguidotcom>https://gdbgui.com/</ref> runs [[GDB]] in the background to build an easy-to-use graphical user interface. It is a browser-based debugger that operates through a web browser page. Since it is based on [[GDB]], it can be used through a JTAG or an ethernet link with gdbserver.<br>
 
  | rowspan="2" style="text-align:left;" | '''gdbgui'''<ref name=gdbguidotcom>https://gdbgui.com/</ref> runs [[GDB]] in the background to build an easy-to-use graphical user interface. It is a browser-based debugger that operates through a web browser page. Since it is based on [[GDB]], it can be used through a JTAG or an ethernet link with gdbserver.<br>
  | {{N}} || {{Y}} || {{N}}&#42;
+
  | style="height:240px;" | {{N}}
  | colspan="3" | {{UnderConstruction}}
+
| style="height:240px;" | {{Y}}
  +
| style="height:240px;" | {{N}}&#42;
  +
  | rowspan="2" | {{N}}
  +
| rowspan="2"  | {{N}}
  +
| rowspan="2"  | {{N}}
 
  |-
 
  |-
  | colspan="6" style="text-align:left;font-size:70%;" | &#42;: ''The Developer Package is required to run a GDB debug session that includes all dependencies.''
+
  | colspan="3" style="text-align:left;font-size:70%;" | &#42;: ''The Developer Package is required to run a GDB debug session that includes all dependencies.''
 
  |-
 
  |-
 
</onlyinclude>
 
</onlyinclude>
Line 68: Line 63:
 
:'''gdbgui''' must be started with an argument providing the path to the GDB version available on your target board, as well as the config setup file:
 
:'''gdbgui''' must be started with an argument providing the path to the GDB version available on your target board, as well as the config setup file:
 
  {{PC$}} source {{orange|<''Your_SDK_path''>}}/environment-setup-cortexa7hf-neon-vfpv4-openstlinux_weston-linux-gnueabi
 
  {{PC$}} source {{orange|<''Your_SDK_path''>}}/environment-setup-cortexa7hf-neon-vfpv4-openstlinux_weston-linux-gnueabi
  {{PC$}} gdbgui -g $OECORE_NATIVE_SYSROOT/usr/bin/arm-openstlinux_weston-linux-gnueabi/arm-openstlinux_weston-linux-gnueabi-gdb --gdb-args="-x {{orange|<''Your_full_path_to''>}}/setup.gdb"
+
  {{PC$}} gdbgui -g $OECORE_NATIVE_SYSROOT/usr/bin/arm-openstlinux_weston-linux-gnueabi/arm-openstlinux_weston-linux-gnueabi-gdb --gdb-args="-x {{orange|<''Your_full_path_to''>}}/Setup.gdb"
''Note: Please refer to [[GDB]] page for information on setup.gdb file and how to configure it: [[GDB#Configuring GDB and OpenOCD for attachment on a running target|Attach on running target]] or [[GDB#Configuring GDB and OpenOCD for attachment on boot|Attach on boot]]''.
+
''Note: Please refer to [[GDB]] page for information on Setup.gdb file and how to configure it: [[GDB#Configuring GDB and OpenOCD for attachment on a running target|Attach on running target]] or [[GDB#Configuring GDB and OpenOCD for attachment on boot|Attach on boot]]''.
   
 
== To go further ==
 
== To go further ==
Line 85: Line 80:
 
== References ==
 
== References ==
 
<references />
 
<references />
  +
  +
{{ArticleBasedOnModel | Trace and debug tools article model}}
  +
{{PublicationRequestId | 10163 | 07Jan'19}}
  +
[[Category:Debugging tools]]

Attachments

Discussions