{"record":{"id":"31a1feffada854bb","repo":"mono/mono","slug":"method-name-is-in-a-bad-format-in-break-at-bb-co","errorCode":null,"errorMessage":"Method name is in a bad format in --break-at-bb command line option.","messagePattern":"Method name is in a bad format in --break-at-bb command line option\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"mono/mini/driver.c","lineNumber":2273,"sourceCode":"\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], \"--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\treturn 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 (strcmp (argv [i], \"--break-at-bb\") == 0) {\n\t\t\tif (i + 2 >= argc) {\n\t\t\t\tfprintf (stderr, \"Missing method name or bb num in --break-at-bb command line option.\");\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tmono_break_at_bb_method = mono_method_desc_new (argv [++i], TRUE);\n\t\t\tif (mono_break_at_bb_method == NULL) {\n\t\t\t\tfprintf (stderr, \"Method name is in a bad format in --break-at-bb command line option.\");\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tmono_break_at_bb_bb_num = atoi (argv [++i]);\n\t\t} else if (strcmp (argv [i], \"--inject-async-exc\") == 0) {\n\t\t\tif (i + 2 >= argc) {\n\t\t\t\tfprintf (stderr, \"Missing method name or position in --inject-async-exc command line option\\n\");\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tmono_inject_async_exc_method = mono_method_desc_new (argv [++i], TRUE);\n\t\t\tif (mono_inject_async_exc_method == NULL) {\n\t\t\t\tfprintf (stderr, \"Method name is in a bad format in --inject-async-exc command line option\\n\");\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tmono_inject_async_exc_pos = atoi (argv [++i]);\n\t\t} else if (strcmp (argv [i], \"--verify-all\") == 0) {\n\t\t\tmono_verifier_enable_verify_all ();\n\t\t} else if (strcmp (argv [i], \"--full-aot\") == 0) {\n\t\t\tmono_jit_set_aot_mode (MONO_AOT_MODE_FULL);","sourceCodeStart":2255,"sourceCodeEnd":2291,"githubUrl":"https://github.com/mono/mono/blob/0f53e9e151d92944cacab3e24ac359410c606df6/mono/mini/driver.c#L2255-L2291","documentation":"For `--break-at-bb`, after the two tokens are present the driver parses the method token with `mono_method_desc_new(argv[i], TRUE)` (include_namespace=TRUE). If that returns NULL the descriptor string is malformed (unparseable method-spec syntax) and the driver exits 1. This is distinct from error 105: that checks whether a method MATCHES; this checks whether the STRING even parses into a MonoMethodDesc.","triggerScenarios":"A method-spec string that violates the descriptor grammar (e.g. missing the `:`, stray characters, empty class name). mono_method_desc_new expects a form like `Namespace.Class:Method` (with optional generic/arity syntax).","commonSituations":"Typing `Namespace.Class.Method` (dot instead of colon), omitting the method portion, or pasting a reflection-style name that the desc parser rejects.","solutions":["Use the `Namespace.Class:Method` form with a colon separator: `mono --break-at-bb MyApp.Foo:Bar 3 prog.exe`.","For generic methods, use the supported arity/generic syntax in the descriptor; consult mono_method_desc_new docs.","Test the descriptor against a small tool that calls mono_method_desc_new before launching."],"exampleFix":"# before (dot instead of colon)\nmono --break-at-bb MyApp.Foo.Bar 3 prog.exe\n# after\nmono --break-at-bb MyApp.Foo:Bar 3 prog.exe","handlingStrategy":"type-guard","validationCode":"#!/usr/bin/env bash\nm=\"$1\"\n# mono_method_desc_new expects Namespace.Class:Method\n[[ \"$m\" =~ ^[A-Za-z_][A-Za-z0-9_.]*(\\[[^]]*\\])?:[A-Za-z_][A-Za-z0-9_]* ]] \\\n  || { echo \"bad method descriptor: $m\" >&2; exit 1; }","typeGuard":"// Method descriptor must parse via mono_method_desc_new(name, TRUE).\n// Minimal shape guard: Namespace.Class:Method  (colon separator required)\nfunction looksLikeMethodDesc(s) {\n  return /^[A-Za-z_][\\w.]*(\\[[^\\]]*\\])?:[A-Za-z_][\\w]*$/.test(s);\n}","tryCatchPattern":null,"preventionTips":["Always use the colon: Namespace.Class:Method — never a dot before the method.","Test the descriptor string with a tiny C harness calling mono_method_desc_new before the real run.","Generic methods need the descriptor grammar's arity syntax."],"tags":["cli","mono","argument-validation","debugging","breakpoint"],"backgroundTag":null,"analyzedSha":"0f53e9e151d92944cacab3e24ac359410c606df6","analyzedAt":"2026-08-13T18:54:37.190Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}