Skip to content

Commit

Permalink
update.
Browse files Browse the repository at this point in the history
  • Loading branch information
ohtorii committed Aug 5, 2011
1 parent 3b1f419 commit e04666e
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 24 deletions.
76 changes: 53 additions & 23 deletions macro/demangle.mac
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,15 @@ $old_searchbuffer = searchbuffer;
//�܂肽���݂��ێ�,�����ҏW���ێ�,�͈͑I��,�Ō�Ɉړ�
//�}�N���I�����Ɍ��ɖ߂�B
setcompatiblemode 0x0003|0x000c|0x0200|0x2000;
call ClearOutput;
call LoadDengaku;
if(result){
call Main;
if(#g_load_dengaku){
freedll;
}
freedll;
setsearch $old_searchbuffer, #old_searchoption;
//runex��񓯊��ŌĂԂƃ}�N�����I�����邽�ߍŌ�ɏ�������B
call DoDemangle;
}
setsearch $old_searchbuffer, #old_searchoption;
endmacro;


Expand All @@ -69,16 +70,29 @@ Main:
call DoNoSelecting;
}
}
call DoDemangle;
movetolineno 1+##old_column,##old_lineno;
return ;

DoRecselecting:
##old_x=x;
##old_y=y;
##old_seltopcolumn=seltopcolumn;
##old_seltoplineno=seltoplineno;
##old_selendlineno=selendlineno;
escape;
while(##old_seltoplineno <= ##old_selendlineno){
movetolineno 1+##old_seltopcolumn,##old_seltoplineno;

/*
�ȉ��̎��ɂ��܂��J�[�\���ړ����邽�߂ɂQ��ɕ����Ĉړ�����B
\t\t|name_1
name|_1

�E| �͋�`�I�����̃J�[�\���ʒu
�E\t==8space
*/
movetolineno 1,##old_seltoplineno;
moveto ##old_x,y;

call DoNoSelecting;
##old_seltoplineno=##old_seltoplineno+1;
}
Expand All @@ -104,35 +118,44 @@ DoSelectingSingle:
return ;

DoNoSelecting:
call DoNoSelecting_Move;
##old_lineno = lineno;
searchdown2 "[\\c@?$]+", regular,nocasesense,nohilight;
if(result && selecting && (##old_lineno==lineno)){
$$str = gettext2(seltopcolumn,seltoplineno,selendcolumn,selendlineno);
$$str = dllfuncstr("RTRIM",$$str);
$g_mangle_names=$g_mangle_names + " " + $$str;
if(linelen2){
call DoNoSelecting_Move;
##old_lineno = lineno;
searchdown2 "[\\c@?$_]+", regular,nocasesense,nohilight;
if(result && selecting && (##old_lineno==lineno)){
$$str = gettext2(seltopcolumn,seltoplineno,selendcolumn,selendlineno);
$$str = dllfuncstr("RTRIM",$$str);
$g_mangle_names=$g_mangle_names + " " + $$str;
}
}
return ;

/*�J�[�\�����}���O�������ꂽ�i�Ǝv����j���O�̐擪�ֈړ�����B*/
DoNoSelecting_Move:
##old_lineno = lineno;
##old_column = column;
##u = unicode;
while((0x20<##u) && (##u<0x7f)){
if((0x0d==##u)||(0x0a==##u)||(0==##u)||(-1==##u)){
//�J�[�\���͍s���Ȃ̂ō��ւP��ړ�
left;
##old_column = column;
##u = unicode;
}
if(##old_lineno != lineno){
movetolineno ##old_column+1, ##old_lineno;
return ;
}

while((0x20<##u) && (##u<0x7f) && (##old_lineno == lineno)){
left;
if(! result){
break;
}
##u = unicode;
}
/*�J�[�\���ʒu����
�i�O�j
| name
�i��j
|name
*/
if(column < ##old_column){
right;
if(##old_lineno != lineno){
movetolineno 1, ##old_lineno;
return ;
}
return ;

Expand All @@ -154,12 +177,19 @@ DoDemangle:
}
return ;

ClearOutput:
loaddll "HmOutputPane.dll";
//�A�E�g�v�b�g�g���J��
#ret=dllfunc("Output",hidemaruhandle(0),"");
//�A�E�g�v�b�g�g���N���A
#h=dllfunc("GetWindowHandle",hidemaruhandle(0));
#ret=sendmessage(#h,0x111/*WM_COMMAND*/,1009,0);
return ;

LoadDengaku:
loaddll $g_dll_dengaku_abs_path;
if (!result) {
message "�c�yDLL�̃��[�h�Ɏ��s���܂���\n" + "DengakuDLL.dll���G�ۂ̃f�B���N�g���ɑ��݂��邩�m�F���Ă�������";
return false;
}
#g_load_dengaku = true;
return true;
26 changes: 25 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,26 @@
C/C++のシンボル名デマングルする秀丸マクロ
C/C++のシンボル名をデマングルする秀丸マクロ
========

###デマングル(demangle)できる形式
- GCC v3
- VisualStudio


###動作環境
- 秀丸エディタ ver8以降
- 田楽(でんがく)DLL [http://www.ceres.dti.ne.jp/~sugiura/](http://www.ceres.dti.ne.jp/~sugiura/)

###導入方法
下記ファイルを秀丸エディタのマクロディレクトリへコピーしてください、あとは適当にキーアサインしてお使い下さい。

- demangle.exe
- demangle.mac

###スクリーンショット(その1)
- ![demangle hidemaru](http://cdn-ak.f.st-hatena.com/images/fotolife/o/ohtorii/20110730/20110730155951.gif "デマングル 秀丸エディター")

###スクリーンショット(その2)
- ![demangle hidemaru](http://cdn-ak.f.st-hatena.com/images/fotolife/o/ohtorii/20110730/20110730155938.gif "デマングル 秀丸エディター")

###スクリーンショット(その3)
- ![demangle hidemaru](http://cdn-ak.f.st-hatena.com/images/fotolife/o/ohtorii/20110730/20110730155928.gif "demangle hidemaru")

0 comments on commit e04666e

Please sign in to comment.