kopia lustrzana https://github.com/stlink-org/stlink
gdb-server: set target configuration after client connects
rodzic
c2e898c922
commit
3173858396
|
@ -242,16 +242,12 @@ int main(int argc, char** argv) {
|
||||||
|
|
||||||
DLOG("Chip ID is %#010x, Core ID is %#08x.\n", sl->chip_id, sl->core_id);
|
DLOG("Chip ID is %#010x, Core ID is %#08x.\n", sl->chip_id, sl->core_id);
|
||||||
|
|
||||||
state.current_memory_map = make_memory_map(sl);
|
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
WSADATA wsadata;
|
WSADATA wsadata;
|
||||||
|
|
||||||
if (WSAStartup(MAKEWORD(2, 2), &wsadata) != 0) { goto winsock_error; }
|
if (WSAStartup(MAKEWORD(2, 2), &wsadata) != 0) { goto winsock_error; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
init_cache(sl);
|
|
||||||
|
|
||||||
do { // don't go beserk if serve() returns with error
|
do { // don't go beserk if serve() returns with error
|
||||||
if (serve(sl, &state)) { usleep (1 * 1000); }
|
if (serve(sl, &state)) { usleep (1 * 1000); }
|
||||||
|
|
||||||
|
@ -1102,12 +1098,22 @@ int serve(stlink_t *sl, st_state_t *st) {
|
||||||
|
|
||||||
close_socket(sock);
|
close_socket(sock);
|
||||||
|
|
||||||
|
uint32_t chip_id = sl->chip_id;
|
||||||
|
|
||||||
stlink_target_connect(sl, st->connect_mode);
|
stlink_target_connect(sl, st->connect_mode);
|
||||||
stlink_force_debug(sl);
|
stlink_force_debug(sl);
|
||||||
|
|
||||||
|
if (sl->chip_id != chip_id) {
|
||||||
|
WLOG("Target has changed!\n");
|
||||||
|
}
|
||||||
|
|
||||||
init_code_breakpoints(sl);
|
init_code_breakpoints(sl);
|
||||||
init_data_watchpoints(sl);
|
init_data_watchpoints(sl);
|
||||||
|
|
||||||
|
init_cache(sl);
|
||||||
|
|
||||||
|
st->current_memory_map = make_memory_map(sl);
|
||||||
|
|
||||||
ILOG("GDB connected.\n");
|
ILOG("GDB connected.\n");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Ładowanie…
Reference in New Issue