(CommandList children: [ (FuncDef name: usage body: (BraceGroup children: [ (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op_id: Redir_DLess fd: 16777215 body: { (DQ ('Usage: gdb_mbuild.sh [ <options> ... ] <srcdir> <builddir>\n') (' Options:\n') (' -j <makejobs> Run <makejobs> in parallel. Passed to make.\n') ('\t On a single cpu machine, 2 is recommended.\n') (' -k Keep going. Do not stop after the first build fails.\n') ( ' --keep Keep builds. Do not remove each build when finished.\n' ) (' -e <regexp> Regular expression for selecting the targets to build.\n') ( ' -f Force rebuild. Even rebuild previously built directories.\n' ) (' -v Be more (and more, and more) verbose.\n') (' Arguments:\n') (' <srcdir> Source code directory.\n') (' <builddir> Build directory.\n') (' Environment variables examined (with default if not defined):\n') (' MAKE (make)') (Right_DoubleQuote '"') ('\n') ) } do_expansion: True here_end: EOF was_filled: T spids: [64] ) ] ) (Sentence child: (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) terminator: <Op_Semi ';'> ) (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op_id: Redir_DLess fd: 16777215 body: { (DQ (' -b <maxbuilds> Run <maxbuild> builds in parallel.\n') ('\t\t On a single cpu machine, 1 is recommended.\n') ) } do_expansion: True here_end: NOTYET was_filled: T spids: [92] ) ] ) ] spids: [59] ) spids: [55 58] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:makejobs) op:Equal rhs:{(EmptyPart)} spids:[105])] spids: [105] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:maxbuilds) op:Equal rhs:{(1)} spids:[107])] spids: [107] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:keepgoing) op:Equal rhs:{(EmptyPart)} spids:[110])] spids: [110] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:force) op:Equal rhs:{(false)} spids:[112])] spids: [112] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:targexp) op:Equal rhs:{(DQ )} spids:[115])] spids: [115] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:verbose) op:Equal rhs:{(0)} spids:[119])] spids: [119] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:keep) op:Equal rhs:{(false)} spids:[122])] spids: [122] ) (While cond: [(C {(test)} {($ VSub_Pound '$#')} {(-gt)} {(0)})] body: (DoGroup children: [ (Case to_match: {(DQ ($ VSub_Number '$1'))} arms: [ (case_arm pat_list: [{(-j)}] action: [ (C {(shift)}) (AndOr ops: [Op_DPipe] children: [(C {(test)} {($ VSub_Pound '$#')} {(-ge)} {(1)}) (C {(usage)})] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:makejobs) op: Equal rhs: {(DQ ('-j ') ($ VSub_Number '$1'))} spids: [172] ) ] spids: [172] ) ] spids: [147 149 179 16777215] ) (case_arm pat_list: [{(-b)} {(-c)}] action: [ (C {(shift)}) (AndOr ops: [Op_DPipe] children: [(C {(test)} {($ VSub_Pound '$#')} {(-ge)} {(1)}) (C {(usage)})] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:maxbuilds) op: Equal rhs: {($ VSub_Number '$1')} spids: [211] ) ] spids: [211] ) ] spids: [182 188 215 16777215] ) (case_arm pat_list: [{(-k)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:keepgoing) op: Equal rhs: {(-k)} spids: [227] ) ] spids: [227] ) ] spids: [218 220 231 16777215] ) (case_arm pat_list: [{(--keep)}] action: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:keep) op:Equal rhs:{(true)} spids:[239])] spids: [239] ) ] spids: [234 236 243 16777215] ) (case_arm pat_list: [{(-e)}] action: [ (C {(shift)}) (AndOr ops: [Op_DPipe] children: [(C {(test)} {($ VSub_Pound '$#')} {(-ge)} {(1)}) (C {(usage)})] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:targexp) op: Equal rhs: {(DQ (${ VSub_Name targexp) (' -e ') (${ VSub_Number 1))} spids: [271] ) ] spids: [271] ) ] spids: [246 248 283 16777215] ) (case_arm pat_list: [{(-f)}] action: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:force) op: Equal rhs: {(true)} spids: [295] ) ] spids: [295] ) terminator: <Op_Semi ';'> ) ] spids: [286 288 301 16777215] ) (case_arm pat_list: [{(-v)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:verbose) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(expr)} {(${ VSub_Name verbose)} {(Lit_Other '+')} {(1)}) ] ) left_token: <Left_Backtick '`'> spids: [314 324] ) } spids: [313] ) ] spids: [313] ) ] spids: [304 306 327 16777215] ) (case_arm pat_list: [{(-) (Lit_Other '*')}] action: [(C {(usage)})] spids: [330 333 337 16777215] ) (case_arm pat_list: [{(Lit_Other '*')}] action: [(ControlFlow token:<ControlFlow_Break break>)] spids: [340 341 345 16777215] ) ] spids: [138 144 348] ) (C {(shift)}) ] spids: [135 353] ) ) (If arms: [ (if_arm cond: [(C {(test)} {($ VSub_Pound '$#')} {(-ne)} {(2)})] action: [(C {(usage)})] spids: [16777215 371] ) ] spids: [16777215 376] ) (AndOr ops: [Op_DPipe] children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:srcdir) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (AndOr ops: [Op_DAmp] children: [(C {(cd)} {($ VSub_Number '$1')}) (C {(/bin/pwd)})] ) ] ) left_token: <Left_Backtick '`'> spids: [387 395] ) } spids: [386] ) ] spids: [386] ) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] ) (AndOr ops: [Op_DPipe] children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:builddir) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (AndOr ops: [Op_DAmp] children: [(C {(cd)} {($ VSub_Number '$2')}) (C {(/bin/pwd)})] ) ] ) left_token: <Left_Backtick '`'> spids: [408 416] ) } spids: [407] ) ] spids: [407] ) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:make) op: Equal rhs: { (BracedVarSub token: <VSub_Name MAKE> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(make)}) spids: [433 437] ) } spids: [432] ) ] spids: [432] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:MAKE) op:Equal rhs:{(${ VSub_Name make)} spids:[439])] spids: [439] ) (C {(export)} {(MAKE)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:maintainers) op: Equal rhs: {(${ VSub_Name srcdir) (/gdb/MAINTAINERS)} spids: [453] ) ] spids: [453] ) (If arms: [ (if_arm cond: [ (C {(Lit_Other '[')} {(KW_Bang '!')} {(-r)} {(${ VSub_Name maintainers)} {(Lit_Other ']')}) ] action: [ (C {(echo)} {(Maintainers)} {(file)} {(${ VSub_Name maintainers)} {(not)} {(found)}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [16777215 473] ) ] spids: [16777215 495] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:alltarg) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(cat)} {(${ VSub_Name maintainers)}) (C {(tr)} {(-s)} {(SQ <'[\\t]'>)} {(SQ <'[ ]'>)}) (C {(sed)} {(-n)} { (SQ <'\n'> <'/^[ ]*[-a-z0-9\\.]*[ ]*[(]*--target=.*/ !d\n'> <'s/^.*--target=//\n'> <'s/).*$//\n'> <'h\n'> <':loop\n'> <' g\n'> <' /^[^ ]*,/ !b end\n'> <' s/,[^ ]*//\n'> <' p\n'> <' g\n'> <' s/^[^,]*,//\n'> <' h\n'> <'b loop\n'> <':end\n'> <'p\n'> ) } ) (If arms: [ (if_arm cond: [(C {(test)} {(DQ (${ VSub_Name targexp))} {(Lit_Other '=')} {(DQ )})] action: [(C {(grep)} {(-v)} {(-e)} {(broken)} {(-e)} {(OBSOLETE)})] spids: [16777215 565] ) ] else_action: [(C {(grep)} {(${ VSub_Name targexp)})] spids: [580 589] ) ] negated: F ) ] ) left_token: <Left_Backtick '`'> spids: [502 590] ) } spids: [501] ) ] spids: [501] ) (FuncDef name: fail body: (BraceGroup children: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:msg) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} spids: [612] ) ] spids: [612] ) terminator: <Op_Semi ';'> ) (C {(shift)}) (If arms: [ (if_arm cond: [(C {(test)} {(DQ ($ VSub_At '$@'))})] action: [ (C {(echo)} {(DQ (${ VSub_Name target) (': ') (${ VSub_Name msg))}) (If arms: [ (if_arm cond: [ (C {(test)} {(DQ (${ VSub_Name keepgoing))} {(KW_Bang '!') (Lit_Other '=')} {(DQ )}) ] action: [(ControlFlow token:<ControlFlow_Continue continue>)] spids: [16777215 664] ) ] else_action: [ (C {(kill)} {($ VSub_Dollar '$$')}) (ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) ] spids: [674 687] ) ] spids: [16777215 631] ) ] spids: [16777215 690] ) ] spids: [609] ) spids: [604 608] ) (FuncDef name: log body: (BraceGroup children: [ (If arms: [ (if_arm cond: [(C {(test)} {(${ VSub_Name verbose)} {(-ge)} {($ VSub_Number '$1')})] action: [(C {(tee)} {($ VSub_Number '$2')})] spids: [16777215 724] ) ] else_action: [ (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {($ VSub_Number '$2')} spids: [737] ) ] ) ] spids: [732 742] ) ] spids: [708] ) spids: [703 707] ) (C {(echo)} {(DQ ($ VSub_Name '$alltarg'))}) (C {(echo)} {(DQ )}) (Pipeline children: [ (C {(echo)} {(DQ ($ VSub_Name '$alltarg'))}) (While cond: [(C {(read)} {(target)} {(gdbopts)} {(simopts)})] body: (DoGroup children: [ (C {(trap)} {(DQ ('exit 1'))} {(1)} {(2)} {(15)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:dir) op: Equal rhs: {(${ VSub_Name builddir) (/) (${ VSub_Name target)} spids: [805] ) ] spids: [805] ) (If arms: [ (if_arm cond: [(C {(${ VSub_Name force)})] action: [ (C {(echo)} {(forcing)} {(${ VSub_Name target)} {(...)}) (C {(rm)} {(-rf)} {(${ VSub_Name dir)}) ] spids: [16777215 832] ) (if_arm cond: [(C {(test)} {(-f)} {(${ VSub_Name dir)})] action: [ (C {(echo)} {(DQ (${ VSub_Name target))}) (ControlFlow token:<ControlFlow_Continue continue>) ] spids: [855 866] ) ] else_action: [(C {(echo)} {(${ VSub_Name target)} {(...)})] spids: [881 893] ) (If arms: [ (if_arm cond: [ (C {(test)} {(-d)} {(${ VSub_Name dir)} {(-a)} {(KW_Bang '!')} {(-r)} {(${ VSub_Name dir) (/Makefile)} ) ] action: [ (C {(echo)} {(...)} {(removing)} {(partially)} {(configured)} {(${ VSub_Name target)} ) (C {(rm)} {(-rf)} {(${ VSub_Name dir)}) (If arms: [ (if_arm cond: [(C {(test)} {(-d)} {(${ VSub_Name dir)})] action: [ (C {(echo)} { (DQ (${ VSub_Name target) (': unable to remove directory ') (${ VSub_Name dir) ) } ) (ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) ] spids: [16777215 966] ) ] spids: [16777215 987] ) ] spids: [16777215 928] ) ] spids: [16777215 990] ) (C {(mkdir)} {(-p)} {(${ VSub_Name dir)}) (AndOr ops: [Op_DPipe] children: [ (C {(cd)} {(${ VSub_Name dir)}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] ) (If arms: [ (if_arm cond: [(C {(test)} {(KW_Bang '!')} {(-r)} {(Makefile)})] action: [ (AndOr ops: [Op_DAmp] children: [ (C {(test)} {(-z)} {(DQ (${ VSub_Name simopts))}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:simopts) op: Equal rhs: {(DQ (${ VSub_Name gdbopts))} spids: [1061] ) ] spids: [1061] ) ] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:__target) op: Equal rhs: {(DQ ('--target=') (${ VSub_Name target))} spids: [1073] ) ] spids: [1073] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:__enable_gdb_build_warnings) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (AndOr ops: [Op_DPipe] children: [ (C {(test)} {(-z)} {(DQ (${ VSub_Name gdbopts))}) (C {(echo)} { (DQ ('--enable-gdb-build-warnings=') (${ VSub_Name gdbopts) ) } ) ] ) ] ) left_token: <Left_Backtick '`'> spids: [1083 1106] ) } spids: [1082] ) ] spids: [1082] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:__enable_sim_build_warnings) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (AndOr ops: [Op_DPipe] children: [ (C {(test)} {(-z)} {(DQ (${ VSub_Name simopts))}) (C {(echo)} { (DQ ('--enable-sim-build-warnings=') (${ VSub_Name simopts) ) } ) ] ) ] ) left_token: <Left_Backtick '`'> spids: [1110 1133] ) } spids: [1109] ) ] spids: [1109] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:__configure) op: Equal rhs: { (DQ (${ VSub_Name srcdir) ('/configure ') ('\t ') (${ VSub_Name __target) (' ') ('\t ') (${ VSub_Name __enable_gdb_build_warnings) (' ') ('\t ') (${ VSub_Name __enable_sim_build_warnings) ) } spids: [1136] ) ] spids: [1136] ) (C {(echo)} {(...)} {(${ VSub_Name __configure)}) (C {(trap)} { (DQ ('echo Removing partially configured ') (${ VSub_Name dir) (' directory ...; rm -rf ') (${ VSub_Name dir) ('; exit 1') ) } {(1)} {(2)} {(15)} ) (Pipeline children: [ (SimpleCommand words: [{(${ VSub_Name __configure)}] redirects: [ (Redir op_id: Redir_GreatAnd fd: 2 arg_word: {(1)} spids: [1196] ) ] ) (C {(log)} {(2)} {(Config.log)}) ] negated: F ) (C {(trap)} {(DQ ('exit 1'))} {(1)} {(2)} {(15)}) ] spids: [16777215 1042] ) ] spids: [16777215 1221] ) (C {(fail)} {(DQ ('configure failed'))} {(KW_Bang '!')} {(-r)} {(Makefile)}) (If arms: [ (if_arm cond: [ (C {(test)} {(KW_Bang '!')} {(-x)} {(gdb/gdb)} {(-a)} {(KW_Bang '!')} {(-x)} {(gdb/gdb.exe)} ) ] action: [ (C {(echo)} {(...)} {(${ VSub_Name make)} {(${ VSub_Name keepgoing)} {(${ VSub_Name makejobs)} {(${ VSub_Name target)} ) (Pipeline children: [ (Subshell child: (AndOr ops: [Op_DPipe] children: [ (C {(${ VSub_Name make)} {(${ VSub_Name keepgoing)} {(${ VSub_Name makejobs)} {(all-gdb)} ) (C {(rm)} {(-f)} {(gdb/gdb)} {(gdb/gdb.exe)}) ] ) redirects: [ (Redir op_id: Redir_GreatAnd fd: 2 arg_word: {(1)} spids: [1332] ) ] spids: [1303 1330] ) (C {(log)} {(1)} {(Build.log)}) ] negated: F ) ] spids: [16777215 1263] ) ] spids: [16777215 1344] ) (C {(fail)} {(DQ ('compile failed'))} {(KW_Bang '!')} {(-x)} {(gdb/gdb)} {(-a)} {(KW_Bang '!')} {(-x)} {(gdb/gdb.exe)} ) (C {(echo)} {(...)} {(run)} {(${ VSub_Name target)}) (C {(rm)} {(-f)} {(core)} {(gdb.core)} {(${ VSub_Name dir) (/gdb/x)}) (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op_id: Redir_DLess fd: 16777215 body: {(DQ ('maint print architecture\n') ('quit\n'))} do_expansion: True here_end: EOF was_filled: T spids: [1402] ) (Redir op_id: Redir_Great fd: 16777215 arg_word: {(x)} spids: [1405] ) ] ) (Pipeline children: [ (SimpleCommand words: [{(./gdb/gdb)} {(-batch)} {(-nx)} {(-x)} {(x)}] redirects: [(Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[1423])] ) (C {(log)} {(1)} {(Gdb.log)}) ] negated: F ) (C {(fail)} {(DQ ('gdb dumped core'))} {(-r)} {(core)} {(-o)} {(-r)} {(gdb.core)}) (C {(fail)} {(DQ ('gdb printed no output'))} {(KW_Bang '!')} {(-s)} {(Gdb.log)}) (AndOr ops: [Op_DAmp] children: [ (C {(grep)} {(-e)} {(internal-error)} {(Gdb.log)}) (C {(fail)} {(DQ ('gdb panic'))} {(1)}) ] ) (C {(echo)} {(...)} {(cleanup)} {(${ VSub_Name target)}) (C {(rm)} {(-f)} {(mbuild.sed)}) (AndOr ops: [Op_DPipe] children: [ (C {(touch)} {(mbuild.sed)}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] ) (Pipeline children: [ (C {(sed)} {(-n)} {(-e)} {(SQ <'/<0x0*>/d'>)} {(-e)} {(SQ <'s/^.*<0x\\([0-9a-f]*\\)>.*$/0x\\1/p'>)} {(Gdb.log)} ) (C {(sort)} {(-u)}) (While cond: [(C {(read)} {(addr)})] body: (DoGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:func) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(addr2line)} {(-f)} {(-e)} {(./gdb/gdb)} {(-s)} {(${ VSub_Name addr)} ) (C {(sed)} {(-n)} {(-e)} {(1p)}) ] negated: F ) ] ) left_token: <Left_Backtick '`'> spids: [1569 1593] ) ) } spids: [1567] ) ] spids: [1567] ) (AndOr ops: [Op_DAmp] children: [ (C {(test)} {(${ VSub_Name verbose)} {(-gt)} {(0)}) (SimpleCommand words: [{(echo)} {(DQ (${ VSub_Name addr) (' ') (${ VSub_Name func))}] redirects: [ (Redir op_id: Redir_GreatAnd fd: 1 arg_word: {(2)} spids: [1621] ) ] ) ] ) (C {(echo)} {(DQ ('s/<') (${ VSub_Name addr) ('>/<') (${ VSub_Name func) ('>/g'))} ) ] spids: [1564 1640] ) redirects: [ (Redir op_id: Redir_DGreat fd: 16777215 arg_word: {(mbuild.sed)} spids: [1642] ) ] ) ] negated: F ) (SimpleCommand words: [{(echo)} {(SQ <'s/"\\/.*\\/gdb\\//"gdb\\//g'>)}] redirects: [ (Redir op_id: Redir_DGreat fd: 16777215 arg_word: {(mbuild.sed)} spids: [1657] ) ] ) (SimpleCommand words: [{(sed)} {(-f)} {(mbuild.sed)} {(Gdb.log)}] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(Mbuild.log)} spids: [1674] ) ] ) (C {(cd)} {(${ VSub_Name builddir)}) (If arms: [ (if_arm cond: [(C {(${ VSub_Name keep)})] action: [(C {(Lit_Other ':')})] spids: [16777215 1704] ) ] else_action: [ (C {(rm)} {(-f)} {(${ VSub_Name target) (.tmp)}) (C {(mv)} {(${ VSub_Name target) (/Mbuild.log)} {(${ VSub_Name target) (.tmp)}) (C {(rm)} {(-rf)} {(${ VSub_Name target)}) (C {(mv)} {(${ VSub_Name target) (.tmp)} {(${ VSub_Name target)}) ] spids: [1710 1757] ) (C {(echo)} {(...)} {(${ VSub_Name target)} {(built)}) ] spids: [788 1776] ) ) ] negated: F ) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)}) ] )