gdb: connect will now fail if flash autoprobe fails

This stops GDB from launching with an empty memory map,
making gdb load w/flashing fail for no obvious reason.

The error message points in the direction of the gdb-attach
event that can be set up to issue a halt or "reset init"
which will put GDB in a well defined stated upon attach
and thus have a robust flash autoprobe.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
This commit is contained in:
Øyvind Harboe
2010-05-04 13:26:52 +02:00
parent 812e21ac39
commit 82ea640830
4 changed files with 44 additions and 24 deletions
+7 -4
View File
@@ -220,22 +220,25 @@ struct flash_bank *get_flash_bank_by_name(const char *name)
return NULL;
}
struct flash_bank *get_flash_bank_by_num(int num)
int get_flash_bank_by_num(int num, struct flash_bank **bank)
{
struct flash_bank *p = get_flash_bank_by_num_noprobe(num);
int retval;
if (p == NULL)
return NULL;
{
return ERROR_FAIL;
}
retval = p->driver->auto_probe(p);
if (retval != ERROR_OK)
{
LOG_ERROR("auto_probe failed %d\n", retval);
return NULL;
return retval;
}
return p;
*bank = p;
return ERROR_OK;
}
/* lookup flash bank by address */