Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak MAKEFLAGS and -X interaction #138

Open
wants to merge 1 commit into
base: remake-4-3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions libdebugger/command/continue.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Boston, MA 02111-1307, USA. */

#include "../../src/trace.h"
#include "../../src/expand.h"
#include "../../src/globals.h"
#include "../break.h"
#include "../fns.h"
#include "../stack.h"
Expand Down Expand Up @@ -75,8 +76,8 @@ dbg_cmd_continue (char *psz_args)

i_debugger_stepping = 0;
i_debugger_nexting = 0;
define_variable_in_set("MAKEFLAGS", sizeof("MAKEFLAGS")-1,
"", o_debugger, 0, NULL, NULL);
debugger_flag = 0;
define_makeflags (1, 0);
return continue_execution;
};

Expand Down
5 changes: 3 additions & 2 deletions libdebugger/command/finish.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Boston, MA 02111-1307, USA. */

#include "../../src/trace.h"
#include "../../src/variable.h"
#include "../../src/globals.h"
#include "../stack.h"
#include "../cmd.h"
#include "../fns.h"
Expand Down Expand Up @@ -56,8 +57,8 @@ dbg_cmd_finish(char *psz_amount)
i_debugger_nexting = 0;
i_debugger_stepping = 0;
p->p_shared_target->tracing |= (BRK_AFTER_CMD);
define_variable_in_set("MAKEFLAGS", sizeof("MAKEFLAGS")-1,
"", o_debugger, 0, NULL, NULL);
debugger_flag = 0;
define_makeflags (1, 0);
return continue_execution;
} else {
if (i > i_amount)
Expand Down
5 changes: 3 additions & 2 deletions libdebugger/command/next.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Boston, MA 02111-1307, USA. */
#include "../../src/trace.h"
#include "../../src/debug.h"
#include "../../src/variable.h"
#include "../../src/globals.h"
#include "../fns.h"

extern debug_return_t
Expand All @@ -37,8 +38,8 @@ dbg_cmd_next(char *psz_arg)
if (!psz_arg || !*psz_arg) {
i_debugger_nexting = 1;
i_debugger_stepping = 0;
define_variable_in_set("MAKEFLAGS", sizeof("MAKEFLAGS")-1,
"", o_debugger, 0, NULL, NULL);
debugger_flag = 0;
define_makeflags (1, 0);
return continue_execution;
}
if (get_uint(psz_arg, &i_debugger_nexting, true))
Expand Down
9 changes: 5 additions & 4 deletions libdebugger/command/step.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Boston, MA 02111-1307, USA. */
#include "../../src/trace.h"
#include "../../src/debug.h"
#include "../../src/variable.h"
#include "../../src/globals.h"
#include "../fns.h"

extern debug_return_t
Expand All @@ -37,13 +38,13 @@ dbg_cmd_step (char *psz_arg)
if (!psz_arg || !*psz_arg) {
i_debugger_stepping = 1;
i_debugger_nexting = 0;
define_variable_in_set("MAKEFLAGS", sizeof("MAKEFLAGS")-1,
"X", o_debugger, 0, NULL, NULL);
debugger_flag = 1;
define_makeflags (1, 0);
return continue_execution;
}
if (get_uint(psz_arg, &i_debugger_stepping, true)) {
define_variable_in_set("MAKEFLAGS", sizeof("MAKEFLAGS")-1,
"X", o_debugger, 0, NULL, NULL);
debugger_flag = 1;
define_makeflags (1, 0);
i_debugger_nexting = 0;
return continue_execution;
} else
Expand Down
11 changes: 4 additions & 7 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ void print_rule_data_base (bool b_verbose);
static void print_version (void);
static void decode_switches (int argc, const char **argv, int env);
static void decode_env_switches (const char *envar, size_t len);
static struct variable *define_makeflags (int all, int makefile);
static char *quote_for_env (char *out, const char *in);
static void initialize_global_hash_tables (void);

Expand Down Expand Up @@ -2932,7 +2931,7 @@ quote_for_env (char *out, const char *in)
command switches. Include options with args if ALL is nonzero.
Don't include options with the 'no_makefile' flag set if MAKEFILE. */

static struct variable *
struct variable *
define_makeflags (int all, int makefile)
{
const char ref[] = "MAKEOVERRIDES";
Expand Down Expand Up @@ -2990,7 +2989,7 @@ define_makeflags (int all, int makefile)
if ((!*(int *) cs->value_ptr) == (cs->type == flag_off)
&& (cs->default_value == 0
|| *(int *) cs->value_ptr != *(int *) cs->default_value))
if (cs->c != 'X') ADD_FLAG (0, 0);
ADD_FLAG (0, 0);
break;

case positive_int:
Expand Down Expand Up @@ -3077,10 +3076,8 @@ define_makeflags (int all, int makefile)
/* Add simple options as a group. */
while (flags != 0 && !flags->arg && short_option (flags->cs->c))
{
if (flags->cs->c != 'X') {
*p++ = (char) flags->cs->c;
flags = flags->next;
}
*p++ = (char) flags->cs->c;
flags = flags->next;
}

/* Now add more complex flags: ones with options and/or long names. */
Expand Down
3 changes: 3 additions & 0 deletions src/variable.h
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,9 @@ struct pattern_var *create_pattern_var (const char *target,

extern int export_all_variables;

struct variable *
define_makeflags (int all, int makefile);

#define MAKELEVEL_NAME "MAKELEVEL"
#define MAKELEVEL_LENGTH (CSTRLEN (MAKELEVEL_NAME))

Expand Down