* Remove -l flag in rarc2

- Replaced by rarc2 -a
* Fix build
This commit is contained in:
pancake 2010-10-13 00:43:02 +02:00
parent 8f9dbbd0d1
commit 01b56da424
3 changed files with 21 additions and 18 deletions

View File

@ -711,11 +711,11 @@ static int parsechar(char c) {
static void showhelp() {
fprintf (stderr,
"Usage: r2rc [-alh] [files] > file.S\n"
" -A Show current architecture\n"
" -l List all supported architectures\n"
" -s use at&t syntax instead of intel\n"
" -m add 'call main prefix\n"
" -h Display this help\n"
" -h display this help\n"
" -A show default architecture\n"
" -a list all supported architectures\n"
" -ax86 use x86-32\n"
" -ax64 use x86-64\n"
" -aarm use ARM\n");
@ -725,16 +725,22 @@ static void parseflag(const char *arg) {
int i;
switch (*arg) {
case 'a':
emit = NULL;
for (i=0; emits[i]; i++)
if (!strcmp (emits[i]->arch, arg+1)) {
emit = emits[i];
syscallbody = emit->syscall ();
break;
if (arg[1]) {
emit = NULL;
for (i=0; emits[i]; i++)
if (!strcmp (emits[i]->arch, arg+1)) {
emit = emits[i];
syscallbody = emit->syscall ();
break;
}
if (emit == NULL) {
eprintf ("Invalid architecture: '%s'\n", arg+1);
exit (1);
}
if (emit == NULL) {
eprintf ("Invalid architecture: '%s'\n", arg+1);
exit (1);
} else {
for (i=0; emits[i]; i++)
printf ("%s\n", emits[i]->arch);
exit (0);
}
break;
case 'm':
@ -746,10 +752,6 @@ static void parseflag(const char *arg) {
case 'A':
printf ("%s\n", emit->arch);
exit (0);
case 'l':
for (i=0; emits[i]; i++)
printf ("%s\n", emits[i]->arch);
exit (0);
case 'h':
showhelp ();
exit (0);

View File

@ -1,3 +1,4 @@
printf@alias(0x804400);
main@global(,32) {
printf("Hello World\n");
}

View File

@ -756,7 +756,7 @@ static void *gdbwrap_writememory(gdbwrap_t *desc, la32 linaddr,
static void *gdbwrap_writememory2(gdbwrap_t *desc, la32 linaddr,
void *value, unsigned bytes)
{
char *rec *packet;
char *rec, *packet;
u_char *val = value;
u_short i;
u_int len;
@ -764,7 +764,7 @@ static void *gdbwrap_writememory2(gdbwrap_t *desc, la32 linaddr,
packet = malloc (2*bytes+MSG_BUF);
if (packet == NULL) {
eprintf ("Cannot allocate %d bytes\n", 2*bytes+MSG_BUF);
return;
return NULL;
}
snprintf(packet, MSG_BUF, "%s%x%s%x%s", GDBWRAP_MEMWRITE2,