-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xtensa: initial support for debugpoint api #15907
base: master
Are you sure you want to change the base?
Conversation
Implement up_debugpoint_add/up_debugpoint_remove for xtensa. Signed-off-by: chenxiaoyi <[email protected]>
[Experimental Bot, please feedback here] Yes, this PR appears to meet the basic NuttX requirements, but it's incomplete. Here's a breakdown: Strengths:
Weaknesses:
Conclusion: While the PR presents a good starting point, it needs further work to fully meet the NuttX requirements. Specifically, it needs to include actual testing logs, complete information about the testing environment, and address the missing details in the Impact section. Adding the missing link to the planned interrupt handler PR would also be beneficial. |
#if defined(XCHAL_NUM_DBREAK) && XCHAL_NUM_DBREAK > 0 | ||
g_trigger_count += XCHAL_NUM_DBREAK; | ||
#endif | ||
#if defined(XCHAL_NUM_IBREAK) && XCHAL_NUM_IBREAK > 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's change to fix array and remove allocation at line 232
for (; i < XCHAL_NUM_DBREAK; i++) | ||
{ | ||
g_trigger_map[i].trigger_type = TRIGGER_TYPE_DATA; | ||
g_trigger_map[i].index = index++; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why need save index, which is same as i
****************************************************************************/ | ||
|
||
static int g_trigger_count = 0; | ||
static struct xtensa_debug_trigger *g_trigger_map; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's use the separated array for code and data to simplify the initializition
: "r"(address), "r"(ibreakenable) | ||
); | ||
} | ||
else if (index == 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about other index
: "r"(address), "r"(dbreakc) | ||
); | ||
} | ||
else if (index == 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
} | ||
|
||
static struct xtensa_debug_trigger * | ||
xtensa_debug_find_slot(int trigger_type, int type, void *address, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's use different find function for code and data?
* Private Functions | ||
****************************************************************************/ | ||
|
||
static void xtensa_enable_ibreak(int index, uintptr_t address) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please include function Description
} | ||
} | ||
|
||
static void xtensa_disable_ibreak(int index) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
); | ||
} | ||
|
||
static void xtensa_enable_dbreak(int index, int type, uintptr_t address, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
} | ||
} | ||
|
||
static void xtensa_disable_dbreak(int index) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
} | ||
|
||
static struct xtensa_debug_trigger * | ||
xtensa_debug_find_slot(int trigger_type, int type, void *address, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
return NULL; | ||
} | ||
|
||
static int xtensa_debug_init(void) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
* Name: up_debugpoint_add | ||
****************************************************************************/ | ||
|
||
int up_debugpoint_add(int type, void *addr, size_t size, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
* Name: up_debugpoint_remove | ||
****************************************************************************/ | ||
|
||
int up_debugpoint_remove(int type, void *addr, size_t size) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @chirping78 , nice job!
Can you please improve the testing section on how to run the gdbstub
and how to test it using a real HW? Also, being a new feature, can you please provide the related documentation?
Summary
Implement up_debugpoint_add/up_debugpoint_remove for xtensa.
Impact
Can use
debugpoint
program to test code and data debugpoint.Currently the int handler here will call panic when the debugpoint hit, will improve the int handler with following PR.
Testing
enable
CONFIG_LIB_GDBSTUB
CONFIG_SYSTEM_DEBUGPOINT
and disableCONFIG_NSH_DISABLE_MW
to test.