- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我让 DevKitPro 在 Game Boy Advance 上工作,但我遇到了一些问题。我看到的最大的一个是我的代码是在 0x00000000
而不是 ROM 盒带的正常 0x08000000
处组装的。我的理解是 C 编译器不使用 .org
指令在指定的内存位置创建代码;相反,链接器应该为我处理所有这些。但它似乎将代码放在“错误”的地址。游戏将正确运行,但我想这是因为它在模拟器上运行,而模拟器不关心它位于不应该位于的位置。如何在 0x08000000
处“组装”代码?
我对 makefile、编译器、链接器等的概念还很陌生,所以我可能没有把所有东西都设置好。我将展示我的 makefile、运行 makefile 的批处理脚本以及正在编译的 C 代码。我还包含了 objdump 以防相关。
C 代码:
// LIBGBA HEADERS
#include <gba_console.h>
#include <gba_video.h>
#include <gba_interrupt.h>
#include <gba_systemcalls.h>
#include <gba_input.h>
#include <stdio.h>
#include <stdlib.h>
// GAME-SPECIFIC INCLUDES
#include "M:\SrcGBA\PaintBoyAdvance\include\bitmap.h"
#include "M:\SrcGBA\PaintBoyAdvance\include\bitmap.c" //BITMAP SCREEN FUNCTIONS
//---------------------------------------------------------------------------------
// Program entry point
//---------------------------------------------------------------------------------
int main(void) {
//---------------------------------------------------------------------------------
// the vblank interrupt must be enabled for VBlankIntrWait() to work
// since the default dispatcher handles the bios flags no vblank handler
// is required
irqInit();
irqEnable(IRQ_VBLANK);
// consoleDemoInit();
REG_DISPCNT = 0x1403;
while (1) {
VBlankIntrWait();
}
}
批处理脚本:
@echo off
set path=C:\devkitPro\;%path%
cd M:\SrcGBA\PaintBoyAdvance
make
if not "%errorlevel%"=="0" goto Abandon
C:\devkitPro\devkitARM\bin\arm-none-eabi-objdump -h M:\SrcGBA\PaintBoyAdvance\build\paintboyadvance.o
C:\Users\puppy\Documents\VisualBoyAdvance\visualboyadvance-m.exe M:\SrcGBA\PaintBoyAdvance\PaintBoyAdvance.gba
:Abandon
exit
生成文件:
#---------------------------------------------------------------------------------
.SUFFIXES:
#---------------------------------------------------------------------------------
ifeq ($(strip $(DEVKITARM)),)
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
endif
include $(DEVKITARM)/gba_rules
#---------------------------------------------------------------------------------
# TARGET is the name of the output
# BUILD is the directory where object files & intermediate files will be placed
# SOURCES is a list of directories containing source code
# INCLUDES is a list of directories containing extra header files
# DATA is a list of directories containing binary data
# GRAPHICS is a list of directories containing files to be processed by grit
#
# All directories are specified relative to the project directory where
# the makefile is found
#
#---------------------------------------------------------------------------------
TARGET := $(notdir $(CURDIR))
BUILD := build
SOURCES := source
INCLUDES := include
DATA := data
MUSIC :=
#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------
ARCH := -mthumb -mthumb-interwork
SPECS := -specs=gba.specs
CFLAGS := -g -Wall -O2\
-mcpu=arm7tdmi -mtune=arm7tdmi\
-ffreestanding \
$(ARCH)
CFLAGS := $(INCLUDE)
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions
ASFLAGS := -g $(ARCH)
LDFLAGS = -g $(ARCH) $(INCLUDE) -Wl,-Map,$(notdir $@.map)
#---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project
#---------------------------------------------------------------------------------
LIBS := -lmm -lgba
#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib
#---------------------------------------------------------------------------------
LIBDIRS := $(LIBGBA)
#---------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
# rules for different file extensions
#---------------------------------------------------------------------------------
ifneq ($(BUILD),$(notdir $(CURDIR)))
#---------------------------------------------------------------------------------
export OUTPUT := $(CURDIR)/$(TARGET)
export VPATH := $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
$(foreach dir,$(DATA),$(CURDIR)/$(dir)) \
$(foreach dir,$(GRAPHICS),$(CURDIR)/$(dir))
export DEPSDIR := $(CURDIR)/$(BUILD)
CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
ifneq ($(strip $(MUSIC)),)
export AUDIOFILES := $(foreach dir,$(notdir $(wildcard $(MUSIC)/*.*)),$(CURDIR)/$(MUSIC)/$(dir))
BINFILES += soundbank.bin
endif
#---------------------------------------------------------------------------------
# use CXX for linking C++ projects, CC for standard C
#---------------------------------------------------------------------------------
ifeq ($(strip $(CPPFILES)),)
#---------------------------------------------------------------------------------
export LD := $(CC)
#---------------------------------------------------------------------------------
else
#---------------------------------------------------------------------------------
export LD := $(CXX)
#---------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------
export OFILES_BIN := $(addsuffix .o,$(BINFILES))
export OFILES_SOURCES := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
export OFILES := $(OFILES_BIN) $(OFILES_SOURCES)
export HFILES := $(addsuffix .h,$(subst .,_,$(BINFILES)))
export INCLUDE := $(foreach dir,$(INCLUDES),-iquote $(CURDIR)/$(dir)) \
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
-I$(CURDIR)/$(BUILD)
export LIBPATHS := $(foreach dir,$(LIBDIRS),-L$(dir)/lib)
.PHONY: $(BUILD) clean
#---------------------------------------------------------------------------------
$(BUILD):
@[ -d $@ ] || mkdir -p $@
@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
#---------------------------------------------------------------------------------
clean:
@echo clean ...
@rm -fr $(BUILD) $(TARGET).elf $(TARGET).gba
#---------------------------------------------------------------------------------
else
#---------------------------------------------------------------------------------
# main targets
#---------------------------------------------------------------------------------
$(OUTPUT).gba : $(OUTPUT).elf
$(OUTPUT).elf : $(OFILES)
$(OFILES_SOURCES) : $(HFILES)
#---------------------------------------------------------------------------------
# The bin2o rule should be copied and modified
# for each extension used in the data directories
#---------------------------------------------------------------------------------
#---------------------------------------------------------------------------------
# rule to build soundbank from music files
#---------------------------------------------------------------------------------
soundbank.bin soundbank.h : $(AUDIOFILES)
#---------------------------------------------------------------------------------
@mmutil $^ -osoundbank.bin -hsoundbank.h
#---------------------------------------------------------------------------------
# This rule links in binary data with the .bin extension
#---------------------------------------------------------------------------------
%.bin.o %_bin.h : %.bin
#---------------------------------------------------------------------------------
@echo $(notdir $<)
@$(bin2o)
-include $(DEPSDIR)/*.d
#---------------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------------
对象转储的输出:
M:\SrcGBA\PaintBoyAdvance\build\paintboyadvance.o: file format elf32-littlearm
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 00000268 00000000 00000000 00000034 2**2
CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
1 .data 00000000 00000000 00000000 0000029c 2**0
CONTENTS, ALLOC, LOAD, DATA
2 .bss 00000000 00000000 00000000 0000029c 2**0
ALLOC
3 .comment 00000024 00000000 00000000 0000029c 2**0
CONTENTS, READONLY
4 .ARM.attributes 0000002a 00000000 00000000 000002c0 2**0
CONTENTS, READONLY
编辑:这里要求的是批处理文件的输出:
\SrcGBA\PaintBoyAdvance\compile.bat paintboyadvance.c M:\SrcGBA\PaintBoyAdvance\source nopause
Process started >>>
paintboyadvance.c
linking cartridge
built ... PaintBoyAdvance.gba
ROM fixed!
M:\SrcGBA\PaintBoyAdvance\build\paintboyadvance.o: file format elf32-littlearm
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 00000280 00000000 00000000 00000034 2**2
CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
1 .data 00000000 00000000 00000000 000002b4 2**0
CONTENTS, ALLOC, LOAD, DATA
2 .bss 00000000 00000000 00000000 000002b4 2**0
ALLOC
3 .comment 00000024 00000000 00000000 000002b4 2**0
CONTENTS, READONLY
4 .ARM.attributes 0000002a 00000000 00000000 000002d8 2**0
CONTENTS, READONLY
最佳答案
关键是使用链接描述文件。我将只发布一个完整的工作示例。
启动.s
.cpu arm7tdmi
.code 32
rom_start:
b ram_start
.space 0xA0-0x04,0
.space 0xC0-0xA0,0
ram_start:
b _start
.space 0xE0-0xC4,0
_start:
ldr sp,=0x03008000
bl notmain
hang:
b hang
.globl PUT16
PUT16:
strh r1,[r0]
bx lr
.globl GET16
GET16:
ldrh r0,[r0]
bx lr
.globl PUT32
PUT32:
str r1,[r0]
bx lr
.globl GET32
GET32:
ldr r0,[r0]
bx lr
notmain.c
extern void PUT32 ( unsigned int, unsigned int );
extern unsigned int GET32 ( unsigned int );
extern void PUT16 ( unsigned int, unsigned int );
extern unsigned int GET16 ( unsigned int );
#define DISPCNT 0x04000000
#define BG0CNT 0x04000008
#define PMEM 0x05000000
#define TMEM 0x06000000
#define VMEM 0x06008000
//#define TWIDE 32
//#define THIGH 20
//#define TVISIBLE 30
void notmain ( void )
{
unsigned int ra;
unsigned int rb;
unsigned int rc;
//display control,
//mode 0
//enable BG0
PUT16(DISPCNT,0x0100);
//BG0 control
//256 color palette
//tiles defined at 0x60000000
//screen at 0x60008000
PUT16( BG0CNT,0x1080);
//setup the first 8 colors
PUT16(PMEM+0x0,0x0000); //BLACK
PUT16(PMEM+0x2,0x001F); //RED
PUT16(PMEM+0x4,0x03E0); //GREEN
PUT16(PMEM+0x6,0x03FF); //GREEN+RED
PUT16(PMEM+0x8,0x7C00); //BLUE
PUT16(PMEM+0xA,0x7C1F); //BLUE+RED
PUT16(PMEM+0xC,0x7FE0); //BLUE+GREEN
PUT16(PMEM+0xE,0x7FFF); //BLUE+GREEN+RED (WHITE)
// Let's make a few tiles 64 bytes per tile.
ra=TMEM;
PUT32(ra,0x00000000); ra+=4; PUT32(ra,0x00000000); ra+=4;
PUT32(ra,0x00000000); ra+=4; PUT32(ra,0x00000000); ra+=4;
PUT32(ra,0x00000000); ra+=4; PUT32(ra,0x00000000); ra+=4;
PUT32(ra,0x00000000); ra+=4; PUT32(ra,0x00000000); ra+=4;
PUT32(ra,0x00000000); ra+=4; PUT32(ra,0x00000000); ra+=4;
PUT32(ra,0x00000000); ra+=4; PUT32(ra,0x00000000); ra+=4;
PUT32(ra,0x00000000); ra+=4; PUT32(ra,0x00000000); ra+=4;
PUT32(ra,0x00000000); ra+=4; PUT32(ra,0x00000000); ra+=4;
PUT32(ra,0x01010000); ra+=4; PUT32(ra,0x01010000); ra+=4;
PUT32(ra,0x01010000); ra+=4; PUT32(ra,0x01010000); ra+=4;
PUT32(ra,0x01010000); ra+=4; PUT32(ra,0x01010000); ra+=4;
PUT32(ra,0x01010000); ra+=4; PUT32(ra,0x01010000); ra+=4;
PUT32(ra,0x00010001); ra+=4; PUT32(ra,0x00010001); ra+=4;
PUT32(ra,0x01000100); ra+=4; PUT32(ra,0x01000100); ra+=4;
PUT32(ra,0x00010001); ra+=4; PUT32(ra,0x00010001); ra+=4;
PUT32(ra,0x01000100); ra+=4; PUT32(ra,0x01000100); ra+=4;
PUT32(ra,0x02020000); ra+=4; PUT32(ra,0x02020000); ra+=4;
PUT32(ra,0x02020000); ra+=4; PUT32(ra,0x02020000); ra+=4;
PUT32(ra,0x02020000); ra+=4; PUT32(ra,0x02020000); ra+=4;
PUT32(ra,0x02020000); ra+=4; PUT32(ra,0x02020000); ra+=4;
PUT32(ra,0x00020002); ra+=4; PUT32(ra,0x00020002); ra+=4;
PUT32(ra,0x02000200); ra+=4; PUT32(ra,0x02000200); ra+=4;
PUT32(ra,0x00020002); ra+=4; PUT32(ra,0x00020002); ra+=4;
PUT32(ra,0x02000200); ra+=4; PUT32(ra,0x02000200); ra+=4;
PUT32(ra,0x03030000); ra+=4; PUT32(ra,0x03030000); ra+=4;
PUT32(ra,0x03030000); ra+=4; PUT32(ra,0x03030000); ra+=4;
PUT32(ra,0x03030000); ra+=4; PUT32(ra,0x03030000); ra+=4;
PUT32(ra,0x03030000); ra+=4; PUT32(ra,0x03030000); ra+=4;
PUT32(ra,0x00030003); ra+=4; PUT32(ra,0x00030003); ra+=4;
PUT32(ra,0x03000300); ra+=4; PUT32(ra,0x03000300); ra+=4;
PUT32(ra,0x00030003); ra+=4; PUT32(ra,0x00030003); ra+=4;
PUT32(ra,0x03000300); ra+=4; PUT32(ra,0x03000300); ra+=4;
PUT32(ra,0x04040000); ra+=4; PUT32(ra,0x04040000); ra+=4;
PUT32(ra,0x04040000); ra+=4; PUT32(ra,0x04040000); ra+=4;
PUT32(ra,0x04040000); ra+=4; PUT32(ra,0x04040000); ra+=4;
PUT32(ra,0x04040000); ra+=4; PUT32(ra,0x04040000); ra+=4;
PUT32(ra,0x00040004); ra+=4; PUT32(ra,0x00040004); ra+=4;
PUT32(ra,0x04000400); ra+=4; PUT32(ra,0x04000400); ra+=4;
PUT32(ra,0x00040004); ra+=4; PUT32(ra,0x00040004); ra+=4;
PUT32(ra,0x04000400); ra+=4; PUT32(ra,0x04000400); ra+=4;
PUT32(ra,0x05050000); ra+=4; PUT32(ra,0x05050000); ra+=4;
PUT32(ra,0x05050000); ra+=4; PUT32(ra,0x05050000); ra+=4;
PUT32(ra,0x05050000); ra+=4; PUT32(ra,0x05050000); ra+=4;
PUT32(ra,0x05050000); ra+=4; PUT32(ra,0x05050000); ra+=4;
PUT32(ra,0x00050005); ra+=4; PUT32(ra,0x00050005); ra+=4;
PUT32(ra,0x05000500); ra+=4; PUT32(ra,0x05000500); ra+=4;
PUT32(ra,0x00050005); ra+=4; PUT32(ra,0x00050005); ra+=4;
PUT32(ra,0x05000500); ra+=4; PUT32(ra,0x05000500); ra+=4;
PUT32(ra,0x06060000); ra+=4; PUT32(ra,0x06060000); ra+=4;
PUT32(ra,0x06060000); ra+=4; PUT32(ra,0x06060000); ra+=4;
PUT32(ra,0x06060000); ra+=4; PUT32(ra,0x06060000); ra+=4;
PUT32(ra,0x06060000); ra+=4; PUT32(ra,0x06060000); ra+=4;
PUT32(ra,0x00060006); ra+=4; PUT32(ra,0x00060006); ra+=4;
PUT32(ra,0x06000600); ra+=4; PUT32(ra,0x06000600); ra+=4;
PUT32(ra,0x00060006); ra+=4; PUT32(ra,0x00060006); ra+=4;
PUT32(ra,0x06000600); ra+=4; PUT32(ra,0x06000600); ra+=4;
PUT32(ra,0x07070000); ra+=4; PUT32(ra,0x07070000); ra+=4;
PUT32(ra,0x07070000); ra+=4; PUT32(ra,0x07070000); ra+=4;
PUT32(ra,0x07070000); ra+=4; PUT32(ra,0x07070000); ra+=4;
PUT32(ra,0x07070000); ra+=4; PUT32(ra,0x07070000); ra+=4;
PUT32(ra,0x00070007); ra+=4; PUT32(ra,0x00070007); ra+=4;
PUT32(ra,0x07000700); ra+=4; PUT32(ra,0x07000700); ra+=4;
PUT32(ra,0x00070007); ra+=4; PUT32(ra,0x00070007); ra+=4;
PUT32(ra,0x07000700); ra+=4; PUT32(ra,0x07000700); ra+=4;
//make screen black/clear screen
ra=VMEM;
for(rb=0;rb<(32*20);rb++)
{
PUT16(ra,0x0000);
ra+=2;
}
//put some tiles on the screen
ra=VMEM;
for(rc=0,rb=0;rb<(32*10);rb++,rc++)
{
rc&=7;
if(rc==0) rc=1;
PUT16(ra,rc);
ra+=2;
}
}
内存映射
MEMORY
{
ewram : ORIGIN = 0x02000000, LENGTH = 256K
}
SECTIONS
{
.text : { *(.text*) } > ewram
}
罗马 map
MEMORY
{
rom : ORIGIN = 0x08000000, LENGTH = 32K
}
SECTIONS
{
.text : { *(.text*) } > rom
}
构建
arm-none-eabi-as --warn --fatal-warnings startup.s -o startup.o
arm-none-eabi-gcc -c -mcpu=arm7tdmi -Wall -Werror -O2 -ffreestanding notmain.c -o notmain.o
arm-none-eabi-ld -T rommap startup.o notmain.o -o gbarom.elf
arm-none-eabi-objdump -D gbarom.elf > gbarom.list
arm-none-eabi-objcopy gbarom.elf -O binary notmain.gba
arm-none-eabi-ld -T memmap startup.o notmain.o -o notmain.elf
arm-none-eabi-objdump -D notmain.elf > notmain.list
arm-none-eabi-objcopy notmain.elf -O binary notmain.mb
现在 vba 允许你运行 multiboot 文件和 gba 文件
vba notmain.mb
vba motmain.gba
一个使用 EWRAM,另一个使用 GAME ROM。
您不必在链接描述文件中同时使用 MEMORY 和 SECTIONS,可以在节中硬编码地址,但我建议内存也在那里。我建议不要使用 (rwx) 东西,YMMV。
MEMORY
{
rom : ORIGIN = 0x08000000, LENGTH = 32K
}
SECTIONS
{
.text : { *(.text*) } > rom
}
名字 rom 并不重要——你可以叫它 pickle 就可以了。它只是一个名称,用于将内存范围定义连接到一个或多个部分。 .text* 里面是对象中所有以 .text 开头的东西(.text 是指令)。外面的 *() 表示通过链接器提供的所有对象,您可以为每个条目指定特定对象以进行更好的控制(请注意链接器脚本语言并不像您期望的那样好和完美,有时调出对象不起作用你会怎么想)。
那么前面的 .text 就是输出二进制文件使用的名称,你可以调用它 .baseball 它会工作得很好只是你输入该文件的工具不知道该怎么做所以只使用 .text 是一个好主意。
你添加更多这样的东西
MEMORY
{
ewram : ORIGIN = 0x02000000, LENGTH = 256K
}
SECTIONS
{
.text : { *(.text*) } > ewram
.rodata : { *(.rodata*) } > ewram
.bss : { *(.bss*) } > ewram
.data : { *(.data*) } > ewram
}
它将按顺序处理这些内容,因为 .text 内容首先进入输出,然后是 .rodata,然后是 .bss,最后是 .data。另请注意,由于此处没有调用任何文件或对象,因此命令行也会驱动事物的顺序。
arm-none-eabi-ld -T memmap startup.o notmain.o -o notmain.elf
我们需要将入口点代码放在首位,这样文件才能在命令行中排在首位(比使用编造的节名称等使其复杂化更容易)。
在构建时和尝试将内容提交到 Flash 之前请注意
看反汇编:
Disassembly of section .text:
02000000 <rom_start>:
2000000: ea00002e b 20000c0 <ram_start>
...
020000c0 <ram_start>:
20000c0: ea000006 b 20000e0 <_start>
...
020000e0 <_start>:
20000e0: e59fd024 ldr sp, [pc, #36] ; 200010c <GET32+0x8>
20000e4: eb000009 bl 2000110 <notmain>
020000e8 <hang>:
20000e8: eafffffe b 20000e8 <hang>
如果你在命令行交换文件
Disassembly of section .text:
02000000 <notmain>:
2000000: e92d4070 push {r4, r5, r6, lr}
2000004: e3a01c01 mov r1, #256 ; 0x100
2000008: e3a00301 mov r0, #67108864 ; 0x4000000
200000c: eb00028f bl 2000a50 <PUT16>
2000010: e3a01d42 mov r1, #4224 ; 0x1080
2000014: e59f06bc ldr r0, [pc, #1724] ; 20006d8 <notmai
游戏结束了,那将会崩溃。肯定不会像您希望/期望的那样运行(有时您可能会很幸运,但总的来说这是失败的)。
我在 Bootstrap 中为 Logo 数据留出了空间,这样可以让它作为 mgba 的真正 rom 或带有正确墨盒的真正 gba 工作(有些有菜单,你不需要正确的墨盒头) .在多重引导级别,您不需要拥有所有空间,只需从 Bootstrap 开始即可。
你可以通过 -Ttext=0x08000000
作为一个快速而肮脏的 hack,但是 gnu ld 仍然使用你正在使用的工具链中内置的默认链接器脚本,你是只需调整该部分类型。如果你用更复杂的东西来插入它,你就会开始陷入奇怪的境地。所以你可以看到使用链接描述文件是多么简单,它们不必很复杂。许多人倾向于过度复杂化,老实说,gnu 链接器脚本语言可能会很痛苦,因为它并不总是以一种理智和一致的方式工作。我更喜欢在其他地方而不是在链接描述文件中完成大部分工作。
关于c - (Game Boy Advance) 程序从 0x00000000 而不是 0x08000000 开始。如何告诉 gcc 编译到特定地址?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69875381/
为了遵循务实的编程原则,我试图根据“告诉,不要询问”原则来决定如何处理用户密码更改。 我有一个用户对象,其密码每 30 天过期一次。如果密码过期,我需要能够显示密码过期/更改密码 View 。询问对象
我试图在接收文件时绕过任何本地存储。根据documentation ,如果“合理”,Flask 会将文件保存在内存中,否则会将它们存储在临时位置。 我只找到了一种通常使用 MAX_CONTENT_LE
SAS 在 proc 中返回 sci-notation 意味着总和输出,我不能将其用于进一步的速率计算过程。如何抑制 SAS 产生 sci-notation,有什么想法吗?提前致谢。 “解决了一个类似
当使用 nohup 时,脚本的输出会被缓冲,只有在脚本执行完毕后才会转储到日志文件 (nohup.out) 中。以接近实时的方式查看脚本输出以了解其进展情况将非常有用。有没有办法让 nohup 在脚本
假设我们定义了以下路由: const routes: Routes = [ { path: '', component: WelcomeComponent }, {
我正在尝试以下操作: a a > 1 1 > 2 2 > 3 3 我想要的是: a b > 1 1 > 2 2 > 3 3 有没有办法告诉 R 使用存储在对象( "b" )中的字符串( a
我想在安装二进制文件之前使用 automake 处理/修改它们。例如,我想将二进制文件中的符号提取到单独的文件和位置(如 this )。另一个示例是收集关键 Assets 的 md5sum 以发布报告
我的应用程序有一个主要的 pro 文件,我想告诉 qmake 在与应用程序同时编译一个单独的库。该库的目录中还有一个 pro 文件。这可能吗? 最佳答案 将 lib 和应用程序放在单独的子目录中,并使
我的 vimrc 中有以下内容: nnoremap :!screen -S foo -p run -X stuff '!!^M' 但是,当单击 F1 时,出现错误:没有上一个命令。 我想要的
我正在使用 Swagger 和 Scala 来记录我的 REST API。我想为 POST、PUT 和 DELETE 启用批量操作,并希望相同的路由接受单个对象或对象集合作为正文内容。 有没有办法告诉
我有一个 SAS 代码,它为我的计算创建了很多中间表。事情是,我在工作完成后并不真正关心这张 table ,我只关心决赛的结果。 但是,每次我运行这段代码时,SAS 都会添加所有生成的表来做我的流程,
有没有办法告诉 UglifyJS 跳过特定的代码部分,也许使用这样的注释: // uglifyjs:skipStart filter = function(item){ /* some crazy f
在 macOS 上通过 homebrew 安装包时,如果我的网络不稳定并且一次下载失败,homebrew 将下载源并从源开始构建。这将需要很长时间和高 CPU 使用率,这是不需要的。如何在下载失败时告
有没有办法告诉 GORM 不要保留属性?我计划在我的 User 类上定义一个确认密码属性,用于验证,但不应保留。 最佳答案 使用 transient 关键字 GORM 可以指示不持久化特定属性。 以下
我正在为 jQuery 编写一个幻灯片放映应用程序(单击按钮,然后滑动浏览图像列表),但我遇到了一个小错误,它将响应 即使在动画发生时也会发出 click() 请求。我已经在使用 animate()
我可以告诉 Xcode 4 我不在项目中使用自动布局吗? 目前,每个新创建的 xib 都会启用自动布局,这意味着我必须在创建 xib 后手动将其关闭,而我不希望这样。 最佳答案 这是自动布局的问题。您
因此,我正在使用目前手动运行的 AzCopy,但我要通过我们的一台服务器上的任务计划程序来运行它。如果我手动执行批处理文件,这会将文件从一个容器复制到另一个容器,并且可以完美运行。然而,它问我: Ov
我正在 OSX 中编写一个基于文档的应用程序。我发现当我更改文档的内容时,应用程序不知道文档已更改。我可以在没有警告的情况下关闭文档,这会导致我未保存的内容丢失。 如何告诉 NSDocument 文档
根据NSWindow Class Reference ,您应该“很少需要调用”NSWindow 方法“display”或“setViewsNeedDisplay”。那么重新显示窗口内容的常用方法是什么
为了重写开源 iMedia 框架项目(目前有数十名开发人员正在使用),我们正在切换到 IKImageBrowserView,并且在缓存方面遇到了麻烦。 看来 IKImageBrowserView 喜欢
我是一名优秀的程序员,十分优秀!