Include gdbsupport/gdb_vecs.h in gdb/s390-linux-nat.c

Message ID 20241207004547.246474-1-mark@klomp.org
State New
Headers
Series Include gdbsupport/gdb_vecs.h in gdb/s390-linux-nat.c |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_gdb_check--master-arm success Test passed
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Test passed

Commit Message

Mark Wielaard Dec. 7, 2024, 12:45 a.m. UTC
  Commit c8889b913175 ("gdb, gdbserver, gdbsupport: remove some unused
gdb_vecs.h includes") removed gdbsupport/gdb_vecs.h from various
header files. This caused an compile issue for gdb/s390-linux-nat.c

../../binutils-gdb/gdb/s390-linux-nat.c: In member function ‘virtual int s390_linux_nat_target::remove_watchpoint(CORE_ADDR, int, target_hw_bp_type, expression*)’:
../../binutils-gdb/gdb/s390-linux-nat.c:875:11: error: ‘unordered_remove’ was not declared in this scope
  875 |           unordered_remove (state->watch_areas, ix);
      |           ^~~~~~~~~~~~~~~~
../../binutils-gdb/gdb/s390-linux-nat.c: In member function ‘virtual int s390_linux_nat_target::remove_hw_breakpoint(gdbarch*, bp_target_info*)’:
../../binutils-gdb/gdb/s390-linux-nat.c:928:11: error: ‘unordered_remove’ was not declared in this scope
  928 |           unordered_remove (state->break_areas, ix);
      |           ^~~~~~~~~~~~~~~~

Fix this by including gdbsupport/gdb_vecs.h in gdb/s390-linux-nat.c.
---
 gdb/s390-linux-nat.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Simon Marchi Dec. 7, 2024, 2:48 a.m. UTC | #1
On 2024-12-06 19:45, Mark Wielaard wrote:
> Commit c8889b913175 ("gdb, gdbserver, gdbsupport: remove some unused
> gdb_vecs.h includes") removed gdbsupport/gdb_vecs.h from various
> header files. This caused an compile issue for gdb/s390-linux-nat.c
> 
> ../../binutils-gdb/gdb/s390-linux-nat.c: In member function ‘virtual int s390_linux_nat_target::remove_watchpoint(CORE_ADDR, int, target_hw_bp_type, expression*)’:
> ../../binutils-gdb/gdb/s390-linux-nat.c:875:11: error: ‘unordered_remove’ was not declared in this scope
>   875 |           unordered_remove (state->watch_areas, ix);
>       |           ^~~~~~~~~~~~~~~~
> ../../binutils-gdb/gdb/s390-linux-nat.c: In member function ‘virtual int s390_linux_nat_target::remove_hw_breakpoint(gdbarch*, bp_target_info*)’:
> ../../binutils-gdb/gdb/s390-linux-nat.c:928:11: error: ‘unordered_remove’ was not declared in this scope
>   928 |           unordered_remove (state->break_areas, ix);
>       |           ^~~~~~~~~~~~~~~~
> 
> Fix this by including gdbsupport/gdb_vecs.h in gdb/s390-linux-nat.c.
> ---
>  gdb/s390-linux-nat.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/gdb/s390-linux-nat.c b/gdb/s390-linux-nat.c
> index 6b2b6f1bf315..0726536dda1a 100644
> --- a/gdb/s390-linux-nat.c
> +++ b/gdb/s390-linux-nat.c
> @@ -19,6 +19,7 @@
>     You should have received a copy of the GNU General Public License
>     along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
>  
> +#include "gdbsupport/gdb_vecs.h"
>  #include "extract-store-integer.h"
>  #include "regcache.h"
>  #include "inferior.h"

Thanks for catching and fixing this.

Approved-By: Simon Marchi <simon.marchi@efficios.com>

Simon
  
Tom de Vries Dec. 9, 2024, 1:58 p.m. UTC | #2
On 12/7/24 01:45, Mark Wielaard wrote:
> Commit c8889b913175 ("gdb, gdbserver, gdbsupport: remove some unused
> gdb_vecs.h includes") removed gdbsupport/gdb_vecs.h from various
> header files. This caused an compile issue for gdb/s390-linux-nat.c
> 
> ../../binutils-gdb/gdb/s390-linux-nat.c: In member function ‘virtual int s390_linux_nat_target::remove_watchpoint(CORE_ADDR, int, target_hw_bp_type, expression*)’:
> ../../binutils-gdb/gdb/s390-linux-nat.c:875:11: error: ‘unordered_remove’ was not declared in this scope
>    875 |           unordered_remove (state->watch_areas, ix);
>        |           ^~~~~~~~~~~~~~~~
> ../../binutils-gdb/gdb/s390-linux-nat.c: In member function ‘virtual int s390_linux_nat_target::remove_hw_breakpoint(gdbarch*, bp_target_info*)’:
> ../../binutils-gdb/gdb/s390-linux-nat.c:928:11: error: ‘unordered_remove’ was not declared in this scope
>    928 |           unordered_remove (state->break_areas, ix);
>        |           ^~~~~~~~~~~~~~~~
> 
> Fix this by including gdbsupport/gdb_vecs.h in gdb/s390-linux-nat.c.

Hi Mark,

I managed to reproduce this, and then tested your fix by doing a 
complete build.

LGTM, please apply.

Thanks for fixing this.

Approved-By: Tom de Vries <tdevries@suse.de>

[ FWIW, the RFC "[gdb/build] Build extra nat targets as unit test" I 
posted is meant to catch this type of thing. ]

Thanks,
- Tom

> ---
>   gdb/s390-linux-nat.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/gdb/s390-linux-nat.c b/gdb/s390-linux-nat.c
> index 6b2b6f1bf315..0726536dda1a 100644
> --- a/gdb/s390-linux-nat.c
> +++ b/gdb/s390-linux-nat.c
> @@ -19,6 +19,7 @@
>      You should have received a copy of the GNU General Public License
>      along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
>   
> +#include "gdbsupport/gdb_vecs.h"
>   #include "extract-store-integer.h"
>   #include "regcache.h"
>   #include "inferior.h"
  
Tom Tromey Dec. 9, 2024, 7:42 p.m. UTC | #3
>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:

>> Fix this by including gdbsupport/gdb_vecs.h in gdb/s390-linux-nat.c.

Tom> LGTM, please apply.

FWIW I think small build fixes like this fall under the obvious rule.
Thanks for doing this.

Tom
  

Patch

diff --git a/gdb/s390-linux-nat.c b/gdb/s390-linux-nat.c
index 6b2b6f1bf315..0726536dda1a 100644
--- a/gdb/s390-linux-nat.c
+++ b/gdb/s390-linux-nat.c
@@ -19,6 +19,7 @@ 
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#include "gdbsupport/gdb_vecs.h"
 #include "extract-store-integer.h"
 #include "regcache.h"
 #include "inferior.h"