• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Revisionfc47a10d9bdb9d11e226ea6ac6c90d85416ef9cd (tree)
Zeit1991-04-19 10:21:29
AutorJohn Gilmore <gnu@cygn...>
CommiterJohn Gilmore

Log Message

        • target.c (dummy_target): Permit add_syms_addr_command.

Ändern Zusammenfassung

Diff

--- a/gdb/target.c
+++ b/gdb/target.c
@@ -31,6 +31,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
3131
3232 extern int memory_insert_breakpoint(), memory_remove_breakpoint();
3333 extern void host_convert_to_virtual(), host_convert_from_virtual();
34+extern void add_syms_addr_command();
3435
3536 static void cleanup_target ();
3637
@@ -53,7 +54,8 @@ struct target_ops dummy_target = {"None", "None",
5354 0, 0, /* memory */
5455 0, 0, /* bkpts */
5556 0, 0, 0, 0, 0, /* terminal */
56- 0, 0, 0, /* kill, load, add_syms */
57+ 0, 0, /* kill, load */
58+ add_syms_addr_command, /* add_syms */
5759 0, 0, /* call_function, lookup_symbol */
5860 0, 0, /* create_inferior, mourn_inferior */
5961 dummy_stratum, 0, /* stratum, next */
@@ -491,8 +493,9 @@ target_command (args, from_tty)
491493 char *args;
492494 int from_tty;
493495 {
494- int i;
496+ int i, possible;
495497 char *rest;
498+ char *argend;
496499
497500 dont_repeat();
498501
@@ -510,11 +513,11 @@ target_command (args, from_tty)
510513
511514 /* Skip to first space, or end of args */
512515 for (rest = args; *rest && !isspace(*rest); rest++) ;
516+ argend = rest;
513517 if (*rest == '\0')
514518 rest = 0; /* Only one word in args */
515519 else
516520 {
517- *rest = '\0'; /* Terminate first word, scan for next */
518521 for (rest++; isspace (*rest); rest++) ;
519522 if (*rest == '\0') /* Only one word w/trailing blanks */
520523 rest = 0;
@@ -522,15 +525,24 @@ target_command (args, from_tty)
522525
523526 /* Search target list for a match */
524527
528+ possible = -1;
525529 for (i = 0; i < target_struct_size; i++)
526530 {
527- if (!strcmp (args, target_structs[i]->to_shortname))
528- goto gotit;
531+ if (!strncmp (args, target_structs[i]->to_shortname, argend - args)) {
532+ /* If we have an exact match, it's time to quit. */
533+ if (target_structs[i]->to_shortname[args-argend] == '\0') {
534+ possible = i;
535+ break;
536+ }
537+ if (possible > 0)
538+ error ("Ambiguous target. `info targets' will list all targets");
539+ possible = i;
540+ }
529541 }
530- error ("No such target. `info targets' will list all targets");
542+ if (possible < 0)
543+ error ("No such target. `info targets' will list all targets");
531544
532-gotit:
533- (*target_structs[i]->to_open) (rest, from_tty);
545+ (*target_structs[possible]->to_open) (rest, from_tty);
534546 }
535547
536548 static char targ_desc[] =