{"record":{"id":"02e52ee06027896e","repo":"mono/mono","slug":"missing-method-name-in-break-command-line-option","errorCode":null,"errorMessage":"Missing method name in --break command line option\n","messagePattern":"Missing method name in --break command line option\n","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"mono/mini/driver.c","lineNumber":1854,"sourceCode":"\t\t\ttrace_options = (char*)\"\";\n\t\t} else if (strncmp (argv [i], \"--trace=\", 8) == 0) {\n\t\t\ttrace_options = &argv [i][8];\n\t\t} else if (strcmp (argv [i], \"--verbose\") == 0 || strcmp (argv [i], \"-v\") == 0) {\n\t\t\tmini_verbose_level++;\n\t\t} else if (strcmp (argv [i], \"--breakonex\") == 0) {\n\t\t\tMonoDebugOptions *opt = mini_get_debug_options ();\n\n\t\t\topt->break_on_exc = TRUE;\n\t\t} else if (strcmp (argv [i], \"--stats\") == 0) {\n\t\t\tenable_runtime_stats ();\n\t\t} else if (strncmp (argv [i], \"--stats=\", 8) == 0) {\n\t\t\tenable_runtime_stats ();\n\t\t\tif (mono_stats_method_desc)\n\t\t\t\tg_free (mono_stats_method_desc);\n\t\t\tmono_stats_method_desc = parse_qualified_method_name (argv [i] + 8);\n\t\t} else if (strcmp (argv [i], \"--break\") == 0) {\n\t\t\tif (i+1 >= argc){\n\t\t\t\tfprintf (stderr, \"Missing method name in --break command line option\\n\");\n\t\t\t\texit (1);\n\t\t\t}\n\t\t\t\n\t\t\tif (!mono_debugger_insert_breakpoint (argv [++i], FALSE))\n\t\t\t\tfprintf (stderr, \"Error: invalid method name '%s'\\n\", argv [i]);\n\t\t} else if (strncmp (argv[i], \"--gc-params=\", 12) == 0) {\n\t\t\tmono_gc_params_set (argv[i] + 12);\n\t\t} else if (strncmp (argv[i], \"--gc-debug=\", 11) == 0) {\n\t\t\tmono_gc_debug_set (argv[i] + 11);\n\t\t} else if (strcmp (argv [i], \"--llvm\") == 0) {\n#ifndef MONO_ARCH_LLVM_SUPPORTED\n\t\t\tfprintf (stderr, \"Mono Warning: --llvm not supported on this platform.\\n\");\n#elif !defined(ENABLE_LLVM)\n\t\t\tfprintf (stderr, \"Mono Warning: --llvm not enabled in this runtime.\\n\");\n#else\n\t\t\tmono_use_llvm = TRUE;\n#endif\n\t\t} else if (strcmp (argv [i], \"--profile\") == 0) {","sourceCodeStart":1836,"sourceCodeEnd":1872,"githubUrl":"https://github.com/mono/mono/blob/0f53e9e151d92944cacab3e24ac359410c606df6/mono/mini/driver.c#L1836-L1872","documentation":"When the --break flag is parsed, the driver checks that another argument follows (i+1 < argc). If --break is the last argument on the command line, there is no method-name token and it prints this message and exits(1). --break expects a qualified method name to insert a debugger breakpoint.","triggerScenarios":"Passing 'mono --break' with no following method argument, or a quoting/argv-splitting mistake that leaves --break as the final token.","commonSituations":"Shell variable for the method name expanding to nothing or being dropped; an argv parser reordering flags so --break ends up last; script concatenation error.","solutions":["Provide a method name token immediately after --break, e.g. --break MyApp.MyClass:Method.","Quote the whole argument so the shell does not drop empty values.","Validate your argument list programmatically before invoking mono."],"exampleFix":"# before\nmono --break app.exe          // --break is last -> exit(1)\n# after\nmono --break MyApp.Foo:Bar app.exe","handlingStrategy":"validation","validationCode":"# Ensure --break is never the final argument\nargs=( \"$@\" )\nfor i in \"${!args[@]}\"; do\n  if [ \"${args[$i]}\" = \"--break\" ] && [ $((i+1)) -ge ${#args[@]} ]; then\n    echo \"--break requires a following method name\"; exit 1\n  fi\ndone","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always supply a method token right after --break.","Validate assembled argv lists so flags expecting a value are never last.","Quote method-name variables to prevent empty-token drop."],"tags":["mono","cli","debugger","argument-parsing","startup"],"backgroundTag":null,"analyzedSha":"0f53e9e151d92944cacab3e24ac359410c606df6","analyzedAt":"2026-08-13T18:54:37.190Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}