Commit Graph

43 Commits

Author SHA1 Message Date
Sebastian Huber
002c6067ba bsps: Add fatal source/code to bsp_reset()
Mark bsp_reset() as no-return.  Use default BSP fatal handler in lm32 and m68k
BSPs.  Remove empty bsp_reset() implementation.

Update #5067.
2024-08-23 14:54:37 +00:00
Chris Johns
cc34558448 libdebugger/powerpc: Add PowerPC support
Closes #5098
2024-08-07 05:09:38 +00:00
Chris Johns
53a62631ac libdebugger/target: Add support for backend code writters
The call lets backends support special methods of writing code.

Updates #5098
2024-08-07 05:09:38 +00:00
Chris Johns
6a367f4689 libdebugger/target: Move global stepping variables in to the target data
Updates #5098
2024-08-07 05:09:38 +00:00
Chris Johns
18b1a59184 cpukit/libdebugger: Fix stepping on ARM architectures
Closes #4744
2022-10-31 08:04:00 +11:00
Chris Johns
d574e08663 libdebugger: Add a target break call to suspend all running threads
- Optionally wait if there is no remote debugger connected and break
  when the remote connects

Closes #4740
2022-10-18 07:37:57 +11:00
Chris Johns
a932829b01 libdebugger/aarch64: Set .start section to RW
- Stops the server crashing when setting breakpoints in .start
2022-08-25 14:10:21 +10:00
Kinsey Moore
3317d1e8f0 cpukit/libdebugger: Add MicroBlaze support
Add MicroBlaze support for libdebugger. This uses only software break
type instructions to provide self-hosted GDB debugging support for
applications since internal control of debug hardware is not possible.

Also of note, this implementation for MicroBlaze would typically use the
brki instruction for software break, but instead uses an illegal opcode
to manage software breaks as exceptions. This is due to poor interaction
with the debug hardware where the debug hardware will intercept software
breaks instead of allowing the software break vector to execute.
2022-02-23 08:35:45 -06:00
Kinsey Moore
16d40ce7ff cpukit/libdebugger: Avoid cascade for interrupts
This updates behavior of libdebugger to handle debug exceptions in
interrupt context by temporarily removing a software breakpoint,
stepping, and then resuming afterward.
2022-02-23 08:35:45 -06:00
Kinsey Moore
ea1a4fd29b cpukit/libdebugger: Add pure swbreak capability
Add a capability that allows for implementations that operate purely
using software breaks. Due to this implementation method, software
breaks must not be restored until just before returning control to the
thread itself and will be handled by the implementation through thread
switch and interrupt hooks.
2022-02-23 08:35:45 -06:00
Kinsey Moore
924993a4bc cpukit/libdebugger: Avoid missed swbreak removal
It is possible to remove software breaks without actually restoring the
original instruction to memory. When this happens, the original
instruction is lost. This ensures that the original instruction is
restored when a software break is removed.
2022-02-23 08:35:45 -06:00
Kinsey Moore
a857a225d0 cpukit/aarch64: Add libdebugger support
This adds support for libdebugger under AArch64 using software
breakpoints and the single-step execution mode present in all AArch64
CPUs.
2021-11-01 08:39:00 -05:00
Kinsey Moore
102261043a cpukit/libdebugger: Use uintptr_t for pointers
Use uintptr_t instead of DB_UINT when the variable in question describes
a pointer.
2021-11-01 08:38:59 -05:00
Stephen Clark
9b088157ed rtems-debugger: Fixed pointer types to work on 32 and 64 bit architectures
Using 32bit types like uint32_t for pointers creates issues on 64 bit
architectures like AArch64. Replaced occurrences of these with
uintptr_t, which will work for both 32 and 64 bit architectures. Added
hex_decode_addr function to rtems-debugger.
2021-10-27 13:25:30 -05:00
Harrison Edward Gerber
9429115c8b cpukit/libdebugger: Fix for sockaddr_in not being initialized
See also CID 1468684

Closes #4445
2021-06-02 09:31:30 -06:00
Ryan Long
e200265936 rtems-debugger-threads.c: Fix Unchecked return value error (CID #1468688)
CID 1468688: Unchecked return value in snapshot_thread().

Closes #4262
2021-02-26 16:56:07 -06:00
Ryan Long
f65d3384dd rtems-debugger-threads.c: Fix three Dereference before null check errors
CID 1468681: Dereference before null check in rtems_debugger_thread_continue().
CID 1468690: Dereference before null check in rtems_debugger_thread_system_resume().
CID 1468694: Dereference before null check in rtems_debugger_thread_find_index().

Closes #4241.
2021-02-12 17:13:19 -06:00
Ryan Long
3f4cdd8589 rtems-debugger-target.c: Fix Dereference before null check (CID #1468682)
CID 1468682: swbreaks is assigned a value dereferenced from target before
it has been verified that target is not null.

Closes #4240.
2021-02-12 17:13:16 -06:00
Sebastian Huber
be5eee575b libdebugger: Fix for Armv8-R
This architecture variant has no MMU.

Update #4202.
2020-12-22 13:02:39 +01:00
Chris Johns
32c9b83109 libdebugger/arm: Clean up the building on arm variants. 2019-10-19 15:54:40 +11:00
Chris Johns
df25650502 libdebugger/arm: Support ROM tables.
- Parse the ROM taables if present to find the component base for
  the debug hardware. This lets the RPi2 run dl09.exe.
2019-08-12 08:56:37 +10:00
Chris Johns
cb1e8497df libdebugger: ARM fixes for Cortex-A8 and ARM mode.
- Fix destorying the target and thread parts.
- Fix the ARM backend to support Cortex-A8 and ARM mode code.
- Use the DBGDSCR interrupt mask when single stepping.
- Use the DBGDSCR method of entry to debug mode to filter the
  execptions.
- Add support for BSPs to control the ARM backend.
2019-07-31 08:33:05 +10:00
Sebastian Huber
5803f3738f score: Add and use _Thread_Get_unmapped_priority().
Add and use _Thread_Get_unmapped_real_priority().
2019-06-28 08:30:11 +02:00
Sebastian Huber
54ac945764 libdebugger: Unmap thread priorities 2019-06-26 07:57:50 +02:00
Chris Johns
581cce2626 libdebugger: Fix for ARMv7-M with -O0 optimization 2019-04-09 17:52:39 +10:00
Chris Johns
2c09b71faf libdebugger: Use an offset table to format GDB g packets.
Adding support for a register offset table lets FPU registers
be supported if added to the backend.

Closes #3733.
2019-04-09 15:02:24 +10:00
Sebastian Huber
84aedcae3b Include missing <rtems/score/thread.h>
Update #3598.
2018-11-09 15:06:48 +01:00
Sebastian Huber
bab7a688fd build: Merge libdebugger/Makefile.am 2018-10-09 13:26:48 +02:00
Sebastian Huber
f004b2b8dc Use rtems_task_exit()
Update #3530.
Update #3533.
2018-10-02 10:22:15 +02:00
Sebastian Huber
dd8e4b760b libdebugger: Move to separate library
Always build remote TCP support since it depends only on the POSIX
socket API.  It works with the legacy network stack and libbsd.  Move it
to a separate libdebugger.a library to allow an easy use with libbsd via
"-ldebugger -lbsd" otherwise we would have a cyclic dependency between
libbsd.a and librtemscpu.a.

Update #3419.
2018-05-02 09:56:43 +02:00
Chris Johns
2afb22b7e1 Remove make preinstall
A speciality of the RTEMS build system was the make preinstall step.  It
copied header files from arbitrary locations into the build tree.  The
header files were included via the -Bsome/build/tree/path GCC command
line option.

This has at least seven problems:

* The make preinstall step itself needs time and disk space.

* Errors in header files show up in the build tree copy.  This makes it
  hard for editors to open the right file to fix the error.

* There is no clear relationship between source and build tree header
  files.  This makes an audit of the build process difficult.

* The visibility of all header files in the build tree makes it
  difficult to enforce API barriers.  For example it is discouraged to
  use BSP-specifics in the cpukit.

* An introduction of a new build system is difficult.

* Include paths specified by the -B option are system headers.  This
  may suppress warnings.

* The parallel build had sporadic failures on some hosts.

This patch removes the make preinstall step.   All installed header
files are moved to dedicated include directories in the source tree.
Let @RTEMS_CPU@ be the target architecture, e.g. arm, powerpc, sparc,
etc.  Let @RTEMS_BSP_FAMILIY@ be a BSP family base directory, e.g.
erc32, imx, qoriq, etc.

The new cpukit include directories are:

* cpukit/include

* cpukit/score/cpu/@RTEMS_CPU@/include

* cpukit/libnetworking

The new BSP include directories are:

* bsps/include

* bsps/@RTEMS_CPU@/include

* bsps/@RTEMS_CPU@/@RTEMS_BSP_FAMILIY@/include

There are build tree include directories for generated files.

The include directory order favours the most general header file, e.g.
it is not possible to override general header files via the include path
order.

The "bootstrap -p" option was removed.  The new "bootstrap -H" option
should be used to regenerate the "headers.am" files.

Update #3254.
2018-01-25 08:45:26 +01:00
Sebastian Huber
6ad3f47143 libdebugger: Avoid use of <bsp/linker-symbols.h>
Update #3254.
2017-12-13 09:04:25 +01:00
Chris Johns
8ad4d937df libdebugger/i386 Fix i386 backend after changes.
Closes #3097.
2017-08-16 13:34:16 +10:00
Chris Johns
b2353ed924 libdebugger: Fixes to debugging, ARM support, locking, and gcc-7.1 warnings.
- Add `printk` support to aid multi-core debugging.
- Add lock trace to aid lock debugging.
- Fixes to gcc-7.1 warnings.
- Fixes from ticket #2879.
- Add verbose command controls.
- Change using the RTEMS sys/lock.h API to manage exception threads.
- ARM hardware breakpoint fixes. Support for SMP stepping
  is not implemented, this requires use of the context id
  register.

Closes #2879.
2017-08-15 11:39:22 +10:00
Chris Johns
7f95cc0707 libdebugger: Fix the mode on task create. Clean up warnings.
Closes #2976.
2017-04-19 14:33:29 +10:00
Chris Johns
b53ad4615a libdebugger: Work around assert when using _Thread_Executing.
Using _Thread_Executing with RTEMS_DEBUG results in an `assert` if
the server accesses invalid memory.

Updates #2993.
2017-04-15 08:18:25 +10:00
Sebastian Huber
a3730b38cc Add and use rtems_assoc_thread_states_to_string() 2017-01-12 07:44:37 +01:00
Sebastian Huber
b7f1fc3b36 libdebugger: Fix const qualifier 2017-01-12 07:44:36 +01:00
Sebastian Huber
d063e7b3d8 score: Replace STATES_DELAYING
Replace STATES_DELAYING with STATES_WAITING_FOR_TIME.

There is no need for separate timeout thread states.  The
Thread_Control::Timer::header and Watchdog_Control::cpu members can be
used to figure out the kind of timeout.
2017-01-12 07:44:36 +01:00
Sebastian Huber
9a448aabe6 score: Add STATES_THREAD_QUEUE_WITH_IDENTIFIER
Add thread state bit to identify thread queues that are embedded in an
object with identifier.
2017-01-11 08:16:27 +01:00
Sebastian Huber
c6000d2b54 score: Delete STATES_WAITING_FOR_BUFFER 2017-01-11 08:16:27 +01:00
Chris Johns
e629076003 libdebugger: Build for ARM's without a CP15. 2016-12-02 15:39:56 +11:00
Chris Johns
a0d4e9933c cpukit: Add libdebugger, a remote debugger agent for GDB. 2016-11-29 08:50:40 +11:00