Skip to content

Add a -gdb option that dumps relevant sections in a gdb-friendly way#12

Open
sam-itt wants to merge 1 commit into
XboxDev:masterfrom
sam-itt:gdb-friendly-sections
Open

Add a -gdb option that dumps relevant sections in a gdb-friendly way#12
sam-itt wants to merge 1 commit into
XboxDev:masterfrom
sam-itt:gdb-friendly-sections

Conversation

@sam-itt

@sam-itt sam-itt commented Feb 4, 2020

Copy link
Copy Markdown

$ xbe bin/default.xbe -gdb
XBE Dumper 0.5-BETA Release
0x00011000 -s .rdata 0x00071000 -s .data 0x0007B000

$ xbe bin/default.xbe -gdb
XBE Dumper 0.5-BETA Release
0x00011000 -s .rdata 0x00071000 -s .data 0x0007B000
@GXTX

GXTX commented Apr 7, 2020

Copy link
Copy Markdown

Doesn't seem to break anything and works as expected.

Comment thread xbedump.c
char *name = ((char *)xbe)+(int)sechdr->SectionName-(int)header->BaseAddress;
if (!strcmp(name,".text")) {
printf("0x%08X ", sechdr->VirtualAddress);
}else if (!strcmp(name,".bss") || !strcmp(name,".data") || !strcmp(name,".rdata")) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: space before else

Comment thread xbedump.c
char *name = ((char *)xbe)+(int)sechdr->SectionName-(int)header->BaseAddress;
if (!strcmp(name,".text")) {
printf("0x%08X ", sechdr->VirtualAddress);
}else if (!strcmp(name,".bss") || !strcmp(name,".data") || !strcmp(name,".rdata")) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would there ever be any reason why someone wouldn't want to map the rest of the sections?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants