Commit Graph

20 Commits

Author SHA1 Message Date
Andrew Tridgell a6cd7ffd20 HAL_SITL: fixed warning 2022-05-06 06:55:16 +10:00
Andrew Tridgell 9a29f2558c HAL_SITL: fixed cygwin build
cygwin does not handle panic being weak, it gets a link error
2021-10-03 14:00:34 +11:00
Josh Henderson 328cf01436 AP_HAL_SITL: make panic() WEAK 2021-09-28 09:11:48 +10:00
Peter Barker 7a9dd8127a AP_HAL_SITL: generate a core file for a given PID
Similarly to dumpstack.sh, uses gdb to dump a core file
2021-07-08 15:46:07 +10:00
Siddharth Purohit f0e6a8c535 HAL_SITL: add methods to fetch native system clock info 2020-08-19 17:31:09 +10:00
Peter Barker 7a3e2d11db AP_HAL_SITL: make it clear the panic message is a panic message 2020-07-25 22:09:01 +10:00
Peter Barker 59c02816b8 AP_HAL_SITL: find dumpstack when run from vehicle subdirectory 2020-04-20 14:25:08 +10:00
Pierre Kancir 95ee01082f AP_HAL_SITL: update search for dumpstack.sh 2020-02-20 20:41:26 +11:00
Peter Barker 51a1ee83a6 AP_HAL_SITL: correct name on stacktrace files
We write these files out for many more things than just segfaults
2020-02-06 13:48:11 +11:00
Andy Piper a469a31528 AP_HAL_SITL: prevent dump_stack_trace() blowing up on macOS 2020-01-06 14:57:46 +11:00
Peter Barker fe8d631964 AP_HAL_SITL: ensure termination of readlink-derived progname 2019-07-08 13:18:22 +10:00
Peter Barker c59dde78c6 AP_HAL_SITL: dump stack trace as part of panic() 2019-06-13 09:25:42 +10:00
Peter Barker dd68b14f46 AP_HAL_SITL: move dump_strack_trace into HAL 2019-06-13 09:25:42 +10:00
Andrew Tridgell 02403d9b93 HAL_SITL: added support for exit on panic()
used by autotest server
2019-06-07 20:33:13 +10:00
Andrew Tridgell 4c74d32ef3 HAL_SITL: fixed cygwin build of sitl
this is needed for windows SITL build
2018-12-11 09:44:05 +11:00
Andrew Tridgell 7ba957b946 HAL_SITL: flush stdout on panic 2016-12-02 09:49:38 +11:00
murata c808ee2f49 Global: To nullptr from NULL.
RC_Channel: To nullptr from NULL.

AC_Fence: To nullptr from NULL.

AC_Avoidance: To nullptr from NULL.

AC_PrecLand: To nullptr from NULL.

DataFlash: To nullptr from NULL.

SITL: To nullptr from NULL.

GCS_MAVLink: To nullptr from NULL.

DataFlash: To nullptr from NULL.

AP_Compass: To nullptr from NULL.

Global: To nullptr from NULL.

Global: To nullptr from NULL.
2016-11-02 16:04:47 -02:00
Andrew Tridgell 655f57ad01 HAL_SITL: cleanup class names
remove SITL prefix
2016-01-10 17:43:01 +11:00
Caio Marcelo de Oliveira Filho 3ef77617fd AP_HAL_SITL: implement new AP_HAL functions
Implement the new AP_HAL functions and use them in the Scheduler when
possible.

The '_sketch_start_time' was renamed and moved as a detail of
implementation of the functions code. It allows the code to return time
starting from zero.

The 'stopped_clock_usec' was renamed to follow convention in the file
and add a getter so that AP_HAL functions can reach it. It's not a
problem this getter is public because in practice, regular code
shouldn't even access the SITLScheduler directly -- only code that
should is from SITL itself.
2015-11-20 12:25:38 +09:00
Caio Marcelo de Oliveira Filho efbc7648b1 AP_HAL: create AP_HAL namespace and use for some HAL functionality
For certain basic functionality, there aren't much benefit to be able to
vary the implementation easily at runtime. So instead of using virtual
functions, use regular functions that are "resolved" at link time. The
implementation of such functions is provided per board/platform.

Examples of functions that fit this include: getting the current
time (since boot), panic'ing, getting system information, rebooting.

These functions are less likely to benefit from the indirection provided
by virtual interfaces. For more complex hardware access APIs the
indirection makes more sense and ease the testing (when we have it!).

The idea is that instead of calling

    hal.scheduler->panic("on the streets of london");

now use

    AP_HAL::panic("on the streets of london");

A less important side-effect is that call-site code gets
smaller. Currently the compiler needs to get the hal, get the scheduler
pointer, get the right function pointer in the vtable for that
scheduler. And the call must include an extra parameter ("this"). Now it
will be just a function call, with the address resolved at link time.

This patch introduces the first functions that will be in the namespace,
further patches will implementations for each board and then switch the
call-sites. The extra init() function allow any initial setup needed for
the functions to work.
2015-11-20 12:25:24 +09:00