yes, this code has two ugly abort() when it should just report an error or a 
warning.
That's a kind of old coding style that is still present here and there in 
OpenOCD.

In your case, the PC is sampled but it always returns the same value
Is target running in an infinite loop?
Or maybe your M0 does not implements PC sampling and reading register DWT_PCSR 
returns zero.
The code computes min and max PC and if it finds that min and max are the same 
it abort() instead of printing an error or something useful.
You can verify that the PC is always the same value running few times
mdw 0xE000101C
but not from GDB, because GDB let you type the command only with target halted.
You need to telnet in OpenOCD with
telnet 127.0.0.1 4444
then type few times the mdw command above


---

** [tickets:#370] profile : Assertion `address_space >= 2' failed.**

**Status:** new
**Milestone:** 0.11.0
**Created:** Wed Nov 23, 2022 04:10 PM UTC by fenugrec
**Last Updated:** Wed Nov 23, 2022 04:10 PM UTC
**Owner:** nobody


Hi,
trying to profile a cortex-M0 target (stm32F042) with a jlink . If I don't 
specify Start and End :

~~~
(gdb) monitor profile 5 test.out               
[stm32f0x.cpu] Starting Cortex-M profiling. Sampling DWT_PCSR as fast as we 
can...
[stm32f0x.cpu] Profiling completed. 10000 samples.
openocd: src/target/target.c:4258: write_gmon: Assertion `address_space >= 2' 
failed.
[stm32f0x.cpu] halted due to debug-request, current mode: Thread 
xPSR: 0x21000000 pc: 0x08002142 msp: 0x20001760
Remote connection closed                     
~~~

Should probably either 
- offer default values for those args
- abort and complain if the args are mandatory
- not require them at all

Sidenote, a hardcoded limit of 10k samples ??


---

Sent from sourceforge.net because openocd-devel@lists.sourceforge.net is 
subscribed to https://sourceforge.net/p/openocd/tickets/

To unsubscribe from further messages, a project admin can change settings at 
https://sourceforge.net/p/openocd/admin/tickets/options.  Or, if this is a 
mailing list, you can unsubscribe from the mailing list.


Reply via email to