dbg_stubs.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // Copyright 2017 Espressif Systems (Shanghai) PTE LTD
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. // http://www.apache.org/licenses/LICENSE-2.0
  7. //
  8. // Unless required by applicable law or agreed to in writing, software
  9. // distributed under the License is distributed on an "AS IS" BASIS,
  10. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. // See the License for the specific language governing permissions and
  12. // limitations under the License.
  13. #ifndef ESP_DBG_STUBS_H_
  14. #define ESP_DBG_STUBS_H_
  15. #include "esp_err.h"
  16. /**
  17. * Debug stubs entries IDs
  18. */
  19. typedef enum {
  20. ESP_DBG_STUB_CONTROL_DATA, ///< stubs descriptor entry
  21. ESP_DBG_STUB_ENTRY_FIRST,
  22. ESP_DBG_STUB_ENTRY_GCOV ///< GCOV entry
  23. = ESP_DBG_STUB_ENTRY_FIRST,
  24. ESP_DBG_STUB_ENTRY_MAX
  25. } esp_dbg_stub_id_t;
  26. /**
  27. * @brief Initializes debug stubs.
  28. *
  29. * @note Must be called after esp_apptrace_init() if app tracing is enabled.
  30. */
  31. void esp_dbg_stubs_init(void);
  32. /**
  33. * @brief Initializes application tracing module.
  34. *
  35. * @note Should be called before any esp_apptrace_xxx call.
  36. *
  37. * @param id Stub ID.
  38. * @param entry Stub entry. Usually it is stub entry function address,
  39. * but can be any value meaningfull for OpenOCD command/code.
  40. *
  41. * @return ESP_OK on success, otherwise see esp_err_t
  42. */
  43. esp_err_t esp_dbg_stub_entry_set(esp_dbg_stub_id_t id, uint32_t entry);
  44. #endif //ESP_DBG_STUBS_H_