CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
109 lines
4.2 KiB
C++
109 lines
4.2 KiB
C++
/* Helper to give local IO capabilities to a target.
|
|
|
|
Copyright (C) 2023-2024 Free Software Foundation, Inc.
|
|
Copyright (C) 2023-2024 Advanced Micro Devices, Inc. All rights reserved.
|
|
|
|
This file is part of GDB.
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
|
|
#ifndef GDB_LOCAL_FILEIO_TARGET_H
|
|
#define GDB_LOCAL_FILEIO_TARGET_H
|
|
|
|
#include "gdbsupport/fileio.h"
|
|
|
|
/* Generic implementation of target_ops::fileio_open using the local
|
|
filesystem. */
|
|
extern int local_fileio_open (struct inferior *inf, const char *filename,
|
|
int flags, int mode, int warn_if_slow,
|
|
fileio_error *target_errno);
|
|
|
|
/* Generic implementation of target_ops::fileio_pwrite using the local
|
|
filesystem. */
|
|
extern int local_fileio_pwrite (int fd, const gdb_byte *write_buf, int len,
|
|
ULONGEST offset, fileio_error *target_errno);
|
|
|
|
/* Generic implementation of target_ops::fileio_pread using the local
|
|
filesystem. */
|
|
extern int local_fileio_pread (int fd, gdb_byte *read_buf, int len,
|
|
ULONGEST offset, fileio_error *target_errno);
|
|
|
|
/* Generic implementation of target_ops::fileio_fstat using the local
|
|
filesystem. */
|
|
extern int local_fileio_fstat (int fd, struct stat *sb, fileio_error
|
|
*target_errno);
|
|
|
|
/* Generic implementation of target_ops::fileio_stat using the local
|
|
filesystem. */
|
|
extern int local_fileio_stat (inferior *inf, const char *filename,
|
|
struct stat *sb, fileio_error *target_errno);
|
|
|
|
/* Generic implementation of target_ops::fileio_close using the local
|
|
filesystem. */
|
|
extern int local_fileio_close (int fd, fileio_error *target_errno);
|
|
|
|
/* Generic implementation of target_ops::fileio_unlink using the local
|
|
filesystem. */
|
|
extern int local_fileio_unlink (struct inferior *inf, const char *filename,
|
|
fileio_error *target_errno);
|
|
|
|
/* Generic implementation of target_ops::fileio_readlink using the local
|
|
filesystem. */
|
|
extern std::optional<std::string> local_fileio_readlink
|
|
(struct inferior *inf, const char *filename, fileio_error *target_errno);
|
|
|
|
/* Helper class implementing the fileio hooks using the local filesystem. */
|
|
|
|
template <typename Target>
|
|
class local_fileio_target : public Target
|
|
{
|
|
int fileio_open (struct inferior *inf, const char *filename,
|
|
int flags, int mode, int warn_if_slow,
|
|
fileio_error *target_errno) override
|
|
{
|
|
return local_fileio_open (inf, filename, flags, mode, warn_if_slow,
|
|
target_errno);
|
|
}
|
|
|
|
int fileio_pwrite (int fd, const gdb_byte *write_buf, int len,
|
|
ULONGEST offset, fileio_error *target_errno) override
|
|
{ return local_fileio_pwrite (fd, write_buf, len, offset, target_errno); }
|
|
|
|
int fileio_pread (int fd, gdb_byte *read_buf, int len,
|
|
ULONGEST offset, fileio_error *target_errno) override
|
|
{ return local_fileio_pread (fd, read_buf, len, offset, target_errno); }
|
|
|
|
int fileio_fstat (int fd, struct stat *sb, fileio_error *target_errno) override
|
|
{ return local_fileio_fstat (fd, sb, target_errno); }
|
|
|
|
int fileio_stat (struct inferior *inf, const char *filename,
|
|
struct stat *sb, fileio_error *target_errno) override
|
|
{ return local_fileio_stat (inf, filename, sb, target_errno); }
|
|
|
|
int fileio_close (int fd, fileio_error *target_errno) override
|
|
{ return local_fileio_close (fd, target_errno); }
|
|
|
|
int fileio_unlink (struct inferior *inf,
|
|
const char *filename,
|
|
fileio_error *target_errno) override
|
|
{ return local_fileio_unlink (inf, filename, target_errno); }
|
|
|
|
std::optional<std::string> fileio_readlink (struct inferior *inf,
|
|
const char *filename,
|
|
fileio_error *target_errno) override
|
|
{ return local_fileio_readlink (inf, filename, target_errno); }
|
|
};
|
|
|
|
#endif /* GDB_LOCAL_FILEIO_TARGET_H */
|