How to erase/program flash if it's not supported by OpenOCD now

Would OpenOCD be a must to program a specific flash?

Can I use GDB to erase and program flash by writing peripheral registers?

Any ideas?

Thanks.