Skip to content

Commit

Permalink
Merge commit '1f7602b54d707d971245a2aea08e86715911dbf1^' into debian
Browse files Browse the repository at this point in the history
* commit '1f7602b54d707d971245a2aea08e86715911dbf1^':
  Reinstate manpage. Document --target option
  Add install from source instructions and...
  Try using travis container architecture
  One more target comment
  Save and show breakoint mask
  Remove remnant of future REMAKEFLAGS
  Remove stray debug print
  Proof of concept for issue #25. It does this by setting MAKEFILE rather than REMAKEFILE though.
  Set long name in options string for -X or --debugger
  Can't support -X=... form. So split out into -X (--debugger) and --debugger-stop.
  In parsing options to set MAKEFLAGS, don't treat -X as short option. Github issue #22
  debugger quit command was not leaving recursive make. Issue #24
  Initialize global_argv; github issue #23
  Fix expand option of debugger "target" command Github issue #21
  GNU Make bug in enumeration values?
  • Loading branch information
yarikoptic committed Oct 15, 2017
2 parents 2e8d8ff + 31d2736 commit a3e727d
Show file tree
Hide file tree
Showing 14 changed files with 280 additions and 97 deletions.
12 changes: 9 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
language: C

install:
# Prerequisites
- "sudo apt-get install autopoint libreadline-dev wget texinfo"
sudo: false

addons:
apt:
packages:
- autopoint
- libreadline-dev
- wget
- texinfo

# run the tests
#script: autoreconf -i && ./configure --enable-maintainer-mode && make update && (cd doc && make stamp-vti) && make && TRAVIS=1 make check
Expand Down
57 changes: 57 additions & 0 deletions INSTALL-from-source.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Prerequisites:

Build from sources you need:

* a previous version of GNU make
* gcc
* gettext
* GNU Readline
* guile version 2.0


Additionally if installing from git you need:

* git (duh)
* autoconf
* automake
* autopoint

Here is a `apt-get` command you can use to install on Debian-ish systems:

```console
$ sudo apt-get install git gcc pkg-config autoconf automake autopoint libreadline-dev make guile-2.0
```

Here is a `yum` command Redhat/CentOS:

```console
$ sudo yum install git gcc pkgconfig autoconf automake readline-devel make guile
```

To build documentation you need:

* texinfo

Add that to the `apt-get` or `yum` command above.

# Updating translation links

After running `configure` run:

make po-update

to pull in the latest translation strings.


# Building

After the above is done:

```console

$ cd remake*
$ [ ! -f ./configure ] && autoreconf -f -i
$ ./configure
$ make
$ make check
```
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ MOSTLYCLEANFILES = callgrind.out.* *.orig *.rej @MAKE_NAME@
html-local:
cd doc && $(MAKE) $(AM_MAKEFLAGS) $@

#: Make (re)make
make$(EXEEXT): $(make_OBJECTS) $(make_DEPENDENCIES)
@rm -f make$(EXEEXT) @MAKE_NAME@$(EXEEXT)
$(LINK) $(make_OBJECTS) $(make_LDADD) $(LIBS)
Expand Down
3 changes: 2 additions & 1 deletion commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -810,15 +810,16 @@ print_commands (file_t *p_target, commands_t *p_cmds, bool b_expand)

if (b_expand && p_target) {
variable_set_list_t *p_file_vars = NULL;
variable_set_t *p_set = NULL;
initialize_file_variables (p_target, 0);
set_file_variables (p_target);
p_file_vars = p_target->variables;
p_set = p_file_vars->set;
s = variable_expand_set(p_cmds->commands, p_file_vars);
} else {
s = p_cmds->commands;
}

s = p_cmds->commands;
while (*s != '\0')
{
const char *end;
Expand Down
47 changes: 25 additions & 22 deletions debugger/break.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2005, 2007, 2008 R. Bernstein <rocky@gnu.org>
/*
Copyright (C) 2005, 2007-2008, 2015 R. Bernstein <rocky@gnu.org>
This file is part of GNU Make (remake variant).
GNU Make is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -30,6 +30,7 @@ struct breakpoint_node
{
file_t *p_target;
unsigned int i_num;
brkpt_mask_t brkpt_mask;
breakpoint_node_t *p_next;
};

Expand All @@ -39,11 +40,11 @@ breakpoint_node_t *p_breakpoint_bottom = NULL;

brkpt_mask_t i_breakpoints = BRK_NONE;

/*! Add "p_target" to the list of breakpoints. Return true if
/*! Add "p_target" to the list of breakpoints. Return true if
there were no errors
*/
bool
add_breakpoint (file_t *p_target, const brkpt_mask_t brkpt_mask)
bool
add_breakpoint (file_t *p_target, const brkpt_mask_t brkpt_mask)
{
breakpoint_node_t *p_new = CALLOC (breakpoint_node_t, 1);

Expand All @@ -59,23 +60,25 @@ add_breakpoint (file_t *p_target, const brkpt_mask_t brkpt_mask)
p_breakpoint_bottom = p_new;
p_new->p_target = p_target;
p_new->i_num = ++i_breakpoints;
p_new->brkpt_mask = brkpt_mask;


/* Finally, note that we are tracing this target. */
if (p_target->tracing & (BRK_BEFORE_PREREQ & brkpt_mask)) {
dbg_msg(_("Note: prerequisite breakpoint already set at target %s."),
dbg_msg(_("Note: prerequisite breakpoint already set at target %s."),
p_target->name);
}
}
if (p_target->tracing & (BRK_AFTER_PREREQ & brkpt_mask)) {
dbg_msg(_("Note: command breakpoint already set at target %s."),
dbg_msg(_("Note: command breakpoint already set at target %s."),
p_target->name);
}
}
if (p_target->tracing & (BRK_AFTER_CMD & brkpt_mask)) {
dbg_msg(_("Note: target end breakpont set at target %s."),
dbg_msg(_("Note: target end breakpont set at target %s."),
p_target->name);
}
p_target->tracing = brkpt_mask;
printf(_("Breakpoint %d on target %s"), i_breakpoints, p_target->name);
printf(_("Breakpoint %d on target %s, mask 0x%02x"), i_breakpoints,
p_target->name, brkpt_mask);
if (p_target->floc.filenm)
dbg_msg(": file %s, line %lu.", p_target->floc.filenm,
p_target->floc.lineno);
Expand All @@ -88,21 +91,21 @@ add_breakpoint (file_t *p_target, const brkpt_mask_t brkpt_mask)
dbg_msg("so it might not get stopped at again.");
}
return true;

}

/*! Remove breakpoint i from the list of breakpoints. Return true if
/*! Remove breakpoint i from the list of breakpoints. Return true if
there were no errors
*/
bool
remove_breakpoint (unsigned int i)
bool
remove_breakpoint (unsigned int i)
{
if (!i) {
dbg_msg(_("Invalid Breakpoint number 0."));
return false;
}
if (i > i_breakpoints) {
dbg_msg(_("Breakpoint number %d is too high. "
dbg_msg(_("Breakpoint number %d is too high. "
"%d is the highest breakpoint number."), i, i_breakpoints);
return false;
} else {
Expand Down Expand Up @@ -141,7 +144,7 @@ remove_breakpoint (unsigned int i)

/*! List breakpoints.*/
void
list_breakpoints (void)
list_breakpoints (void)
{
breakpoint_node_t *p;

Expand All @@ -150,22 +153,22 @@ list_breakpoints (void)
return;
}

dbg_msg( "Num Type Disp Enb Target Location");
dbg_msg( "Num Type Disp Enb Mask Target Location");
for (p = p_breakpoint_top; p; p = p->p_next) {
printf("%3d breakpoint keep y %s",
printf("%3d breakpoint keep y 0x%02x %s",
p->i_num,
p->p_target->name);
p->brkpt_mask,
p->p_target->name);
if (p->p_target->floc.filenm) {
printf(" at ");
print_floc_prefix(&(p->p_target->floc));
}
printf("\n");
}
}
/*
/*
* Local variables:
* eval: (c-set-style "gnu")
* indent-tabs-mode: nil
* End:
*/

16 changes: 9 additions & 7 deletions debugger/command/continue.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2011 R. Bernstein <rocky@gnu.org>
/*
Copyright (C) 2011, 2015 R. Bernstein <rocky@gnu.org>
This file is part of GNU Make (remake variant).
GNU Make is free software; you can redistribute it and/or modify
Expand All @@ -17,7 +17,7 @@ along with GNU Make; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* Continue running program. */
static debug_return_t
static debug_return_t
dbg_cmd_continue (char *psz_args)
{
if (psz_args && *psz_args) {
Expand All @@ -27,7 +27,7 @@ dbg_cmd_continue (char *psz_args)

/** FIXME: DRY with code in break.h **/
if (p_stack && p_stack->p_target) {
char *psz_expanded_target =
char *psz_expanded_target =
variable_expand_set(psz_target, p_stack->p_target->variables);
if (*psz_expanded_target) {
p_target = lookup_file(psz_expanded_target);
Expand Down Expand Up @@ -61,15 +61,17 @@ 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);
return continue_execution;
};

static void
dbg_cmd_continue_init(unsigned int c)
dbg_cmd_continue_init(unsigned int c)
{
short_command[c].func = &dbg_cmd_continue;
short_command[c].use = _("continue [TARGET [all|run|prereq|end]*]");
short_command[c].doc =
short_command[c].doc =
_("Continue executing debugged Makefile until another breakpoint or\n"
"stopping point. If a target is given and valid we set a temporary\n"
"breakpoint at that target before continuing.\n"
Expand All @@ -81,7 +83,7 @@ dbg_cmd_continue_init(unsigned int c)
);
}

/*
/*
* Local variables:
* eval: (c-set-style "gnu")
* indent-tabs-mode: nil
Expand Down
26 changes: 14 additions & 12 deletions debugger/command/finish.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* Terminate execution. */
/*
Copyright (C) 2004, 2005, 2007, 2008, 2009, 2011 R. Bernstein
/*
Copyright (C) 2004, 2005, 2007, 2008, 2009, 2011, 2015 R. Bernstein
<rocky@gnu.org>
This file is part of GNU Make (remake variant).
Expand All @@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License
along with GNU Make; see the file COPYING. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
static debug_return_t
static debug_return_t
dbg_cmd_finish(char *psz_amount)
{
target_stack_node_t *p=p_stack;
Expand All @@ -27,45 +27,47 @@ dbg_cmd_finish(char *psz_amount)
if ('\0' != *psz_debugger_args) {
if (!get_uint(psz_amount, &i_amount, true))
return debug_readloop;

if (p_stack_top) {
/* We have a target stack */

for (i=0 ; p ; p = p->p_parent, i++ ) {
if (i_amount == i) break;
}

}
}
if (p) {
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);
return continue_execution;
} else {
if (i > i_amount)
printf("Target level %d not found\n", i_amount);
else
printf("Level %d is too large; maximum value is %d.\n",
printf("Level %d is too large; maximum value is %d.\n",
i_amount, i-1);
}

return debug_readloop;
}

static void
dbg_cmd_finish_init(unsigned int c)
dbg_cmd_finish_init(unsigned int c)
{
short_command[c].func = &dbg_cmd_finish;
short_command[c].use = _("finish [AMOUNT]");
short_command[c].doc =
short_command[c].doc =
_("Run (step out) until finishing AMOUNT target levels up.\n"
"The default value is 0, or after commands have been run.\n"
"The default value is 0, or after commands have been run.\n"
);
}


/*
/*
* Local variables:
* eval: (c-set-style "gnu")
* indent-tabs-mode: nil
Expand Down
Loading

0 comments on commit a3e727d

Please sign in to comment.